mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 09:46:53 -04:00
Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.7.10
This commit is contained in:
commit
debc62a941
@ -1,9 +1,18 @@
|
||||
local version = "OpenLoader 0.2EE"
|
||||
|
||||
local eeprom = [[
|
||||
_G._OSVERSION = "OpenLoader 0.1EE"
|
||||
_G._OSVERSION = "]] .. version .. [["
|
||||
local component = component or require('component')
|
||||
local computer = computer or require('computer')
|
||||
local unicode = unicode or require('unicode')
|
||||
|
||||
local eeprom = component.list("eeprom")()
|
||||
computer.getBootAddress = function()
|
||||
return component.invoke(eeprom, "getData")
|
||||
end
|
||||
computer.setBootAddress = function(address)
|
||||
return component.invoke(eeprom, "setData", address)
|
||||
end
|
||||
|
||||
local gpu = component.list("gpu")()
|
||||
local w, h
|
||||
@ -147,7 +156,7 @@ say ("Do you really want to flash openloader to EEPROM("..tostring(#eeprom).." b
|
||||
if options.q or options.quiet or io.read():lower() == "y" then
|
||||
say("Flashing... Do not reboot now!")
|
||||
component.eeprom.set(eeprom)
|
||||
component.eeprom.setLabel((type(options.label) == "string" and options.label) or "OpenLoader")
|
||||
component.eeprom.setLabel((type(options.label) == "string" and options.label) or version)
|
||||
if options.r or options.reboot then
|
||||
computer.shutdown(true)
|
||||
else
|
||||
|
@ -1,8 +1,15 @@
|
||||
_G._OSVERSION = "OpenLoader 0.1"
|
||||
_G._OSVERSION = "OpenLoader 0.2"
|
||||
local component = component or require('component')
|
||||
local computer = computer or require('computer')
|
||||
local unicode = unicode or require('unicode')
|
||||
|
||||
local eeprom = component.list("eeprom")()
|
||||
computer.getBootAddress = function()
|
||||
return component.invoke(eeprom, "getData")
|
||||
end
|
||||
computer.setBootAddress = function(address)
|
||||
return component.invoke(eeprom, "setData", address)
|
||||
end
|
||||
|
||||
local gpu = component.list("gpu")()
|
||||
local w, h
|
||||
|
@ -0,0 +1,33 @@
|
||||
local event = require "event"
|
||||
local component = require "component"
|
||||
local keyboard = require "keyboard"
|
||||
|
||||
local interactive = io.output() == io.stdout
|
||||
local color, isPal, evt
|
||||
if interactive then
|
||||
color, isPal = component.gpu.getForeground()
|
||||
end
|
||||
io.write("Press 'q' to exit\n")
|
||||
pcall(function()
|
||||
repeat
|
||||
evt = table.pack(event.pull())
|
||||
if interactive then component.gpu.setForeground(0xCC2200) end
|
||||
io.write("[" .. os.date("%T") .. "] ")
|
||||
if interactive then component.gpu.setForeground(0x44CC00) end
|
||||
io.write(tostring(evt[1]) .. string.rep(" ", math.max(10 - #tostring(evt[1]), 0) + 1))
|
||||
if interactive then component.gpu.setForeground(0xB0B00F) end
|
||||
io.write(tostring(evt[2]) .. string.rep(" ", 37 - #tostring(evt[2])))
|
||||
if interactive then component.gpu.setForeground(0xFFFFFF) end
|
||||
if evt.n > 2 then
|
||||
for i = 3, evt.n do
|
||||
io.write(" " .. tostring(evt[i]))
|
||||
end
|
||||
end
|
||||
|
||||
io.write("\n")
|
||||
until evt[1] == "key_down" and evt[4] == keyboard.keys.q
|
||||
end)
|
||||
if interactive then
|
||||
component.gpu.setForeground(color, isPal)
|
||||
end
|
||||
|
@ -0,0 +1,6 @@
|
||||
NAME
|
||||
dmesg - display messages(events)
|
||||
|
||||
SYNOPIS
|
||||
dmesg
|
||||
|
Loading…
x
Reference in New Issue
Block a user