Advertisement
EliteAnax17

program to run

Nov 4th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. local primaryGPUAddr = "b4e"
  2. local primaryScreenAddr = "d48"
  3. local fs = require("filesystem")
  4. local component = require("component")
  5.  
  6. -- 1) MOUNT HARD DRIVE & VERIFY SUCCESS
  7. local address = ...
  8. local hdCheck, hdError = fs.mount(address, "/main")
  9. if hdCheck then
  10. db("1) Mounted hard drive under '/main'")
  11. else
  12. db("1) Hard Drive did NOT mount: " .. tostring(hdError))
  13. end
  14.  
  15. -- 2) SET PRIMARY GPU
  16. -- (a) Checks address of randomly-chosen primary GPU:
  17. if component.isAvailable("gpu") then
  18. db("2(a) Primary GPU exists at Boot: " .. tostring(component.gpu.address))
  19. end
  20.  
  21. -- (b) Change primary GPU:
  22. primaryGPUAddr = component.get(primaryGPUAddr) -- resolve full GPU address
  23. db("2(b) Setting Primary GPU to: " .. tostring(primaryGPUAddr))
  24. component.setPrimary("gpu",primaryGPUAddr)
  25.  
  26. -- (c) Check again whether primary GPU exists:
  27. if component.isAvailable("gpu") then
  28. db("2(c) Primary GPU successfully changed: " .. tostring(component.gpu.address))
  29. else
  30. db("2(c) No Primary GPU!")
  31. db("... GPU Address = (" .. tostring(component.gpu.address) .. ")")
  32. end
  33.  
  34. -- 3) BIND PRIMARY GPU TO "TERMINAL" SCREEN:
  35. primaryScreenAddr = component.get(primaryScreenAddr) -- resolve full screen address
  36. local gpu = component.gpu
  37. db("3) Attempting Screen Bind: " .. tostring(gpu.bind(primaryScreenAddr)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement