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