Working beeper (it can send morse)

Former-commit-id: 02553a52405ef4bba0d3f8f781f710b6c5b3ae16
Former-commit-id: 6cee7d2b44563a664756651d73a4b1ddfa70cf2f
This commit is contained in:
Song Minjae
2016-09-26 23:28:15 +09:00
parent 49fc723e66
commit bd4c95b321
12 changed files with 242 additions and 101 deletions

View File

@@ -950,7 +950,7 @@ sandbox._G = sandbox
package.path = "/net/torvald/terrarum/virtualcomputer/assets/lua/?.lua;" .. package.path
-- global variables
_G._VERSION = "Luaj-jse 5.2.3"
_G._VERSION = "Luaj-jse 3.0.1 (Lua 5.2.3)"
_G.EMDASH = string.char(0xC4)
_G.UNCHECKED = string.char(0x9C) -- box unchecked
_G.CHECKED = string.char(0x9D) -- box checked
@@ -962,6 +962,8 @@ _G.DC3 = string.char(19) -- dim grey
_G.DC4 = string.char(20) -- light grey
_G.DLE = string.char(16) -- default error colour
_G.runscript = function(s, src, ...)
if s:byte(1) == 27 then error("Bytecode execution is prohibited.") end
local code, reason = load(s, src)
if code then
@@ -971,6 +973,8 @@ _G.runscript = function(s, src, ...)
end
end
_G.__scanMode__ = "UNINIT" -- part of inputstream implementation
_G.bell = function(patn) term.bell(patn or ".") end
_G.beep = _G.bell
local screenbufferdim = term.width() * term.height()
local screencolours = 4
@@ -995,6 +999,9 @@ computer.freeMemory = function() return totalMemory() - getMemory() end
-- load libraries that coded in Lua
require("ROMLIB")
-- POST passed, initialise beeper
beep "."
-- load bios, if any
if fs.exists(computer.bootloader) then shell.run(computer.bootloader) end
-- halt/run luaprompt upon the termination of bios.