boot.lua: polyfill computer.{get,set}BootAddress

main
cinder 7 months ago
parent e67f77c36d
commit 387daea7f2

@ -34,6 +34,16 @@ else
bootfs = data bootfs = data
end end
--polyfill {get,set}BootAddress like normal bios does
--they should exist! <https://github.com/MightyPirates/OpenComputers/blob/871e3c83d36c428c8652e0527eb19c217bb072d2/src/main/resources/assets/opencomputers/lua/machine.lua#L1381-L1384>
--normal lua bios says it provides {get,set}BootAddress for "backwards compatibility", but there's no replacement
function computer.getBootAddress()
return ci(eeprom, 'getData')
end
function computer.setBootAddress(addr)
return ci(eeprom, 'setData', addr)
end
local fd, err = ci(bootfs, 'open', '/init.lua') local fd, err = ci(bootfs, 'open', '/init.lua')
if not fd then bail('open %s/init.lua failed: %s', bootfs:sub(1, 8), err) end if not fd then bail('open %s/init.lua failed: %s', bootfs:sub(1, 8), err) end
local code = '' local code = ''

Loading…
Cancel
Save