From 30bb2637592efb611005fd38499c678214d14b76 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sun, 16 Oct 2016 20:02:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D0=B8=D0=B7=D0=B6=D0=B5=20?= =?UTF-8?q?=D0=B1=D0=B8=D0=BE=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MineOS/EFI.lua | 99 +++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/MineOS/EFI.lua b/MineOS/EFI.lua index 39be0a74..89672afa 100755 --- a/MineOS/EFI.lua +++ b/MineOS/EFI.lua @@ -1,48 +1,48 @@ -local ee, gpu, screen, background, foreground, re -local pr,cm,ls,ps = component.proxy,computer,component.list,computer.pullSignal +local ee,gpu,screen,background,foreground,re +local pr,cm,ls,ps=component.proxy,computer,component.list,computer.pullSignal local function init() - local g = ls("gpu")() - local s = ls("screen")() - local e = ls("eeprom")() + local g=ls("gpu")() + local s=ls("screen")() + local e=ls("eeprom")() if g and s and e then - gpu, screen, ee = pr(g), pr(s), pr(e) + gpu,screen,ee=pr(g),pr(s),pr(e) - computer.getBootAddress = function() return ee.getData() end - computer.setBootAddress = function(address) return ee.setData(address) end + computer.getBootAddress=function() return ee.getData() end + computer.setBootAddress=function(address) return ee.setData(address) end gpu.bind(screen.address) - re = {}; re.width, re.height = gpu.maxResolution() - gpu.setResolution(re.width, re.height) + re={};re.width,re.height=gpu.maxResolution() + gpu.setResolution(re.width,re.height) 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 pu(t) while true do local e={ps()};if e[1]==t then return e end end end local function sleep(timeout) - local deadline = cm.uptime() + (timeout or 0) - while cm.uptime() < deadline do ps(deadline - cm.uptime()) end + local deadline=cm.uptime() + (timeout or 0) + while cm.uptime()1 and sv-1 or 1 + sv=sv>1 and sv-1 or 1 elseif e[4]==208 then - sv = sv<#v and sv+1 or #v + sv=sv<#v and sv+1 or #v elseif e[4]==28 then return v[sv] end end end -local function waitForAlt(t, dr) - local dl = cm.uptime() + (t or 0) - while cm.uptime() < dl do - local e = {ps(dl - cm.uptime())} +local function waitForAlt(t,dr) + local dl=cm.uptime()+(t or 0) + while cm.uptime()
0 then cT(re.height - 1, colors.t2, "Hold Alt to enter boot options menu");waitForAlt(1.2, dr) else cT(y+1, colors.t2, "Bootable drives not found"); pu("key_down"); fade(colors.b, 0x0, -0x202020); cm.shutdown() end +fade(0x0,colors.b,0x202020) +local y=math.floor(re.height / 2 - 1) +cT(y,colors.t1,"MineOS EFI") +cT(y+1,colors.t2,"Initialising system...") +local dr=getBootableDrives() +if #dr>0 then cT(re.height - 1,colors.t2,"Hold Alt to enter boot options menu");waitForAlt(1.2,dr) else cT(y+1,colors.t2,"Bootable drives not found");pu("key_down");fade(colors.b,0x0,-0x202020);cm.shutdown() end