updated SEBIOS to have a nicer UI
This commit is contained in:
parent
4c068cbf81
commit
67ecaec76e
24
sebios.lua
24
sebios.lua
@ -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
|
||||||
|
local cba = computer.getBootAddress()
|
||||||
|
local S = " "
|
||||||
|
local function rdraw()
|
||||||
|
gP.fill(1,1,sx,sy," ")
|
||||||
|
cy=1
|
||||||
wl("SKS Enhanced BIOS v1")
|
wl("SKS Enhanced BIOS v1")
|
||||||
wl("Memory: "..tostring(computer.totalMemory()/1024).."K")
|
wl("Memory: "..tostring(computer.totalMemory()/1024).."K")
|
||||||
wl(" ")
|
wl(" ")
|
||||||
for k,v in ipairs(bootdevs) do
|
for k,v in ipairs(bootdevs) do
|
||||||
wl(tostring(k).." "..v.." "..component.type(v).." "..(component.invoke(v,"getLabel") or ""))
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user