Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local primaryGPUAddr = "b4e"
- local primaryScreenAddr = "d48"
- local fs = require("filesystem")
- local component = require("component")
- -- 1) MOUNT HARD DRIVE & VERIFY SUCCESS
- local address = ...
- local hdCheck, hdError = fs.mount(address, "/main")
- if hdCheck then
- db("1) Mounted hard drive under '/main'")
- else
- db("1) Hard Drive did NOT mount: " .. tostring(hdError))
- end
- -- 2) SET PRIMARY GPU
- -- (a) Checks address of randomly-chosen primary GPU:
- if component.isAvailable("gpu") then
- db("2(a) Primary GPU exists at Boot: " .. tostring(component.gpu.address))
- end
- -- (b) Change primary GPU:
- primaryGPUAddr = component.get(primaryGPUAddr) -- resolve full GPU address
- db("2(b) Setting Primary GPU to: " .. tostring(primaryGPUAddr))
- component.setPrimary("gpu",primaryGPUAddr)
- -- (c) Check again whether primary GPU exists:
- if component.isAvailable("gpu") then
- db("2(c) Primary GPU successfully changed: " .. tostring(component.gpu.address))
- else
- db("2(c) No Primary GPU!")
- db("... GPU Address = (" .. tostring(component.gpu.address) .. ")")
- end
- -- 3) BIND PRIMARY GPU TO "TERMINAL" SCREEN:
- primaryScreenAddr = component.get(primaryScreenAddr) -- resolve full screen address
- local gpu = component.gpu
- db("3) Attempting Screen Bind: " .. tostring(gpu.bind(primaryScreenAddr)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement