local c,cm=component,computer local pr,ls,ps,ut,sd, ee,gpu,bg,fg,re,sce=c.proxy,c.list,cm.pullSignal,cm.uptime,cm.shutdown local function init() local g=ls("gpu")() local s=ls("screen")() local e=ls("eeprom")() if g and s and e then gpu,ee=pr(g),pr(e) cm.getBootAddress=function() return ee.getData() end cm.setBootAddress=function(address) return ee.setData(address) end gpu.bind(s) re={};re.width,re.height=gpu.maxResolution() gpu.setResolution(re.width,re.height) sce=math.floor(re.height/2) else error("") end end local function pu(t) while true do local e={ps()};if e[1]==t then return e end end end local function sleep(timeout) local deadline=ut()+(timeout or 0) while ut()1 and sv-1 or 1 elseif e[4]==208 then sv=sv<#v and sv+1 or #v elseif e[4]==28 then return sv end end end local function waitForAlt(t,dr) local dl=ut()+t while ut()
524288 and "HDD" or "FDD").." ("..dr[i].address..")" end; table.insert(v, "Back") local d=menu("Choose drive",v); if d==#v then break end v={"Set as bootable"};if not dr[d].isReadOnly() then v[2]="Format" end; table.insert(v, "Back") local a=menu("Drive \""..dr[d].address.."\"",v) if a==1 then l();bt(dr[d]);return elseif a==2 and #v==3 then for _,file in pairs(dr[d].list("/")) do dr[d].remove("/"..file) end;sd(true) end end end end local fs=pr(ee.getData() or "") l();bt((fs and cbf(fs)) and fs or dr[1]) end init() fade(0x0,colors.b,0x202020) l() cT(sce,colors.t2,"Initialising system") local dr=gB() if #dr>0 then cT(re.height-1,colors.t2,"Hold Alt to enter boot options menu");waitForAlt(1.2,dr) else cT(sce,colors.t2,"Bootable drives not found");pu("key_down");fade(colors.b,0x0,-0x202020);sd() end