updated SEBIOS to have a nicer UI

This commit is contained in:
Izaya 2017-08-04 08:25:23 +10:00
parent 4c068cbf81
commit 67ecaec76e

View File

@ -65,27 +65,41 @@ do
local gP,cy = component.proxy(gA),1 local gP,cy = component.proxy(gA),1
gP.bind(sA) gP.bind(sA)
local sx, sy = gP.getResolution() local sx, sy = gP.getResolution()
gP.fill(1,1,sx,sy," ")
local function wl(s) local function wl(s)
gP.set(1,cy,s) gP.set(1,cy,s)
cy=cy+1 cy=cy+1
end end
wl("SKS Enhanced BIOS v1") local cba = computer.getBootAddress()
wl("Memory: "..tostring(computer.totalMemory()/1024).."K") local S = " "
wl(" ") local function rdraw()
for k,v in ipairs(bootdevs) do gP.fill(1,1,sx,sy," ")
wl(tostring(k).." "..v.." "..component.type(v).." "..(component.invoke(v,"getLabel") or "")) cy=1
wl("SKS Enhanced BIOS v1")
wl("Memory: "..tostring(computer.totalMemory()/1024).."K")
wl(" ")
for k,v in ipairs(bootdevs) do
if v == cba then S = " * " else S = " " end
wl(S..tostring(k).." "..v.." "..component.type(v).." "..(component.invoke(v,"getLabel") or ""))
end
end end
rdraw()
local timer = 5 local timer = 5
local bhc = false
while computer.uptime() < timer do while computer.uptime() < timer do
t,_,c = computer.pullSignal(0.5) t,_,c,C = computer.pullSignal(0.5)
if t == "key_down" and c > 48 and c < 58 then if t == "key_down" and c > 48 and c < 58 then
computer.setBootAddress(bootdevs[c-48]) cba = bootdevs[c-48]
wl("Boot device set to "..bootdevs[c-48]) bhc = true
rdraw()
elseif t == "key_down" and c == 32 then elseif t == "key_down" and c == 32 then
timer = timer + 10 timer = timer + 10
elseif t == "key_down" and c == 13 and C == 28 then
timer = 0
end end
end end
if bhc then
computer.setBootAddress(cba)
end
end end
end end