Lua Computer: collection of minor updates, none notable (read romapidoc)

Former-commit-id: 3ad3a1432f67148aa1a412ca1cdfb628423f6ad7
Former-commit-id: f223a870c431f2dd906a127a4c3d6b787114bb1c
This commit is contained in:
Song Minjae
2016-09-26 12:15:45 +09:00
parent 29db14d184
commit d44c11f0f0
76 changed files with 2325 additions and 781 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -15,13 +15,10 @@ class StateFontTester : BasicGameState() {
val textToPrint = "Font printer 서체 인쇄기"
lateinit var canvas: Graphics
lateinit var gameFont: Font
override fun init(gc: GameContainer, game: StateBasedGame) {
canvas = Graphics(1024, 1024)
gameFont = GameFontWhite()
Terrarum.gameLocale = "fiFI"
}
@@ -30,7 +27,7 @@ class StateFontTester : BasicGameState() {
}
override fun render(gc: GameContainer, game: StateBasedGame, g: Graphics) {
g.font = gameFont
g.font = Terrarum.fontGame
val text = arrayOf(
Lang["APP_WARNING_HEALTH_AND_SAFETY"],
@@ -46,6 +43,11 @@ class StateFontTester : BasicGameState() {
for (i in 0..text.size - 1) {
g.drawString(text[i], 10f, 10f + (g.font.lineHeight * i))
}
g.font = Terrarum.fontSmallNumbers
g.drawString("The true master needs but one channel", 0f, 64f)
g.drawString("Press a key to start", 0f, 64f + 16f)
}
override fun getID(): Int = Terrarum.STATE_ID_TEST_FONT

View File

@@ -19,8 +19,8 @@ import org.newdawn.slick.state.StateBasedGame
*/
class StateVTTest : BasicGameState() {
// HiRes: 100x62, LoRes: 80x25
val vt = SimpleTextTerminal(SimpleTextTerminal.ELECTRIC_BLUE, 80, 25, colour = false, hires = false)
// HiRes: 100x64, LoRes: 80x25
val vt = SimpleTextTerminal(SimpleTextTerminal.GREEN, 80, 25, colour = false, hires = false)
val computerInside = BaseTerrarumComputer(vt)
val vtUI = Image(vt.displayW, vt.displayH)

View File

@@ -13,6 +13,9 @@ object Key {
val SPACE = 57
val CAPS_LOCK = 58
val L_CONTROL = 29
// same position keys
val L_ALT = 56
val L_COMMAND = 219 // Mac
val DELETE = 211

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@
if term.isTeletype() then error("This is a teletype; cannot use CCAPI layer") end
table.insert(_COMPUTER.loadedCLayer, "CCAPI")
table.insert(computer.loadedCLayer, "CCAPI")
local function intLog2(i)
@@ -34,7 +34,7 @@ _G.bit = {} -- CC's weird BIT API
bit.blshift = function(n, bits) bit32.lshift(n, bits) end
bit.brshift = function(n, bits) bit32.arshift(n, bits) end
bit.blogic_rshift = function(n, bits) bit32.brshift(n, bits) end
bit.blogic_rshift = function(n, bits) bit32.rshift(n, bits) end
bit.bxor = function(m, n) bit32.bxor(m, n) end
bit.bor = function(m, n) bit32.bor(m, n) end
bit.band = function(m, n) bit32.band(m, n) end
@@ -162,4 +162,4 @@ fs.run = function(p) fs.dofile(p) end
-- DOWN AND OUT --
------------------
if _COMPUTER.verbose then print("ComputerCraft compatibility layer successfully loaded.") end
if computer.verbose then print("ComputerCraft compatibility layer successfully loaded.") end

View File

@@ -6,6 +6,8 @@
-- ALIASES --
-------------
_G.io = {}
fs.dofile = function(p, ...)
local f = fs.open(p, "r")
local s = f.readAll()
@@ -14,12 +16,8 @@ end
_G.loadstring = _G.load
_G.print = term.print
--_G.dofile = function(f) fs.dofile(f) end
_G.boot = function() fs.dofile("/boot/efi") end
fs.fetchText = function(p)
local file = fs.open(p, "r")
@@ -60,7 +58,7 @@ _G.__scanforline__ = function(echo) -- pass '1' to not echo; pass nothing to ech
end
-- use Keys API to identify the keycode
_G.__scanforkey__ = function(echo) -- pass '1' to not echo; pass nothing to echo
--[[_G.__scanforkey__ = function(echo) -- pass '1' to not echo; pass nothing to echo
native.closeInputString()
native.openInput(echo or 0)
_G.__scanMode__ = "a_key"
@@ -70,11 +68,12 @@ _G.__scanforkey__ = function(echo) -- pass '1' to not echo; pass nothing to echo
until key
-- input is closed when any key is hit. See above comments.
return key
end
end]] -- DELETED: use _G.input.isKeyDown(keycode)
input.readLine = _G.__scanforline__
io.read = _G.__scanforline__
-----------------
-- PRINTSTREAM --
-----------------
@@ -82,7 +81,12 @@ io.read = _G.__scanforline__
io.write = function(...)
local args = {...}
for _, v in ipairs(args) do
local s = tostring(v)
local s
if v == nil then
s = "nil"
else
s = tostring(v)
end
term.write(s)
end
end
@@ -111,7 +115,22 @@ end
_G.shell = {}
shell.status = shell.ok
shell.run = function(p) fs.dofile(p) end
shell.run = function(path)
-- check for interpreter key "#!"
local f = fs.open(path, "r")
local s = ""
repeat
s = f.readLine()
if (s == nil) then return end -- empty file
until #s > 0
if s:sub(1,2) == "#!" then
local interpreter = s:sub(3)
fs.dofile(interpreter..".lua", path)
else
fs.dofile(path)
end
end
shell.ok = 0
@@ -167,123 +186,193 @@ end
-- KEYS API --
--------------
-- ComputerCraft compliant
local keycodeDic = {
["30"] = "a",
["48"] = "b",
["46"] = "c",
["32"] = "d",
["18"] = "e",
["33"] = "f",
["34"] = "g",
["35"] = "h",
["23"] = "i",
["36"] = "j",
["37"] = "k",
["38"] = "l",
["50"] = "m",
["49"] = "n",
["24"] = "o",
["25"] = "p",
["16"] = "q",
["19"] = "r",
["31"] = "s",
["20"] = "t",
["22"] = "u",
["47"] = "v",
["17"] = "w",
["45"] = "x",
["21"] = "y",
["44"] = "z",
["2"] = "one",
["3"] = "two",
["4"] = "three",
["5"] = "four",
["6"] = "five",
["7"] = "six",
["8"] = "seven",
["9"] = "eight",
["10"] = "nine",
["11"] = "zero",
["12"] = "minus",
["13"] = "equals",
["14"] = "backspace",
["15"] = "tab",
["26"] = "leftBracket",
["27"] = "rightBracket",
["28"] = "enter",
["29"] = "leftCtrl",
["39"] = "semiColon",
["40"] = "apostrophe",
["41"] = "grave",
["42"] = "leftShift",
["43"] = "backslash",
["51"] = "comma",
["52"] = "period",
["53"] = "slash",
["54"] = "rightShift",
["55"] = "multiply",
["56"] = "leftAlt",
["57"] = "space",
["58"] = "capsLock",
["59"] = "f1",
["60"] = "f2",
["61"] = "f3",
["62"] = "f4",
["63"] = "f5",
["64"] = "f6",
["65"] = "f7",
["66"] = "f8",
["67"] = "f9",
["68"] = "f10",
["69"] = "numLock",
["70"] = "scollLock",
["71"] = "numPad7",
["72"] = "numPad8",
["73"] = "numPad9",
["74"] = "numPadSubtract",
["75"] = "numPad4",
["76"] = "numPad5",
["77"] = "numPad6",
["78"] = "numPadAdd",
["79"] = "numPad1",
["80"] = "numPad2",
["81"] = "numPad3",
["82"] = "numPad0",
["83"] = "numPadDecimal",
["87"] = "f11",
["88"] = "f12",
["89"] = "f13",
["90"] = "f14",
["91"] = "f15",
["-1"] = "kana",
["-1"] = "convert",
["-1"] = "noconvert",
["-1"] = "yen",
["-1"] = "numPadEquals",
["144"] = "cimcumflex",
["145"] = "at",
["146"] = "colon",
["147"] = "underscore",
["-1"] = "kanji",
["-1"] = "stop",
["-1"] = "ax",
["156"] = "numPadEnter",
["157"] = "rightCtrl",
["-1"] = "numPadComma",
["181"] = "numPadDivide",
["184"] = "rightAlt",
["197"] = "pause",
["199"] = "home",
["200"] = "up",
["201"] = "pageUp",
["203"] = "left",
["208"] = "right",
["207"] = "end",
["205"] = "down",
["209"] = "pageDown",
["210"] = "insert",
["211"] = "delete",
local keycodeNumToName = {
["30"] = "a",
["48"] = "b",
["46"] = "c",
["32"] = "d",
["18"] = "e",
["33"] = "f",
["34"] = "g",
["35"] = "h",
["23"] = "i",
["36"] = "j",
["37"] = "k",
["38"] = "l",
["50"] = "m",
["49"] = "n",
["24"] = "o",
["25"] = "p",
["16"] = "q",
["19"] = "r",
["31"] = "s",
["20"] = "t",
["22"] = "u",
["47"] = "v",
["17"] = "w",
["45"] = "x",
["21"] = "y",
["44"] = "z",
["2"] = "one",
["3"] = "two",
["4"] = "three",
["5"] = "four",
["6"] = "five",
["7"] = "six",
["8"] = "seven",
["9"] = "eight",
["10"] = "nine",
["11"] = "zero",
["12"] = "minus",
["13"] = "equals",
["14"] = "backspace",
["15"] = "tab",
["26"] = "leftBracket",
["27"] = "rightBracket",
["28"] = "enter",
["29"] = "leftCtrl",
["39"] = "semiColon",
["40"] = "apostrophe",
["41"] = "grave",
["42"] = "leftShift",
["43"] = "backslash",
["51"] = "comma",
["52"] = "period",
["53"] = "slash",
["54"] = "rightShift",
["55"] = "multiply",
["56"] = "leftAlt",
["57"] = "space",
["58"] = "capsLock",
["59"] = "f1",
["60"] = "f2",
["61"] = "f3",
["62"] = "f4",
["63"] = "f5",
["64"] = "f6",
["65"] = "f7",
["66"] = "f8",
["67"] = "f9",
["68"] = "f10",
["69"] = "numLock",
["70"] = "scollLock",
["87"] = "f11",
["88"] = "f12",
["89"] = "f13",
["90"] = "f14",
["91"] = "f15",
["144"] = "cimcumflex",
["145"] = "at",
["146"] = "colon",
["147"] = "underscore",
["157"] = "rightCtrl",
["184"] = "rightAlt",
["197"] = "pause",
["199"] = "home",
["200"] = "up",
["201"] = "pageUp",
["203"] = "left",
["208"] = "right",
["207"] = "end",
["205"] = "down",
["209"] = "pageDown",
["210"] = "insert",
["211"] = "delete",
["219"] = "leftCommand"
}
_G.keys = {}
_G.keys.getName = function(code) return keycodeDic[tostring(code)] end
_G.keys = {
["a"] = 30,
["b"] = 48,
["c"] = 46,
["d"] = 32,
["e"] = 18,
["f"] = 33,
["g"] = 34,
["h"] = 35,
["i"] = 23,
["j"] = 36,
["k"] = 37,
["l"] = 38,
["m"] = 50,
["n"] = 49,
["o"] = 24,
["p"] = 25,
["q"] = 16,
["r"] = 19,
["s"] = 31,
["t"] = 20,
["u"] = 22,
["v"] = 47,
["w"] = 17,
["x"] = 45,
["y"] = 21,
["z"] = 44,
["one"] = 2,
["two"] = 3,
["three"] = 4,
["four"] = 5,
["five"] = 6,
["six"] = 7,
["seven"] = 8,
["eight"] = 9,
["nine"] = 10,
["zero"] = 11,
["minus"] = 12,
["equals"] = 13,
["backspace"] = 14,
["tab"] = 15,
["leftBracket"] = 26,
["rightBracket"] = 27,
["enter"] = 28,
["leftCtrl"] = 29,
["semiColon"] = 39,
["apostrophe"] = 40,
["grave"] = 41,
["leftShift"] = 42,
["backslash"] = 43,
["comma"] = 51,
["period"] = 52,
["slash"] = 53,
["rightShift"] = 54,
["multiply"] = 55,
["leftAlt"] = 56,
["space"] = 57,
["capsLock"] = 58,
["f1"] = 59,
["f2"] = 60,
["f3"] = 61,
["f4"] = 62,
["f5"] = 63,
["f6"] = 64,
["f7"] = 65,
["f8"] = 66,
["f9"] = 67,
["f10"] = 68,
["numLock"] = 69,
["scollLock"] = 70,
["f11"] = 87,
["f12"] = 88,
["f13"] = 89,
["f14"] = 90,
["f15"] = 91,
["cimcumflex"] = 144,
["at"] = 145,
["colon"] = 146,
["underscore"] = 147,
["rightCtrl"] = 157,
["rightAlt"] = 184,
["pause"] = 197,
["home"] = 199,
["up"] = 200,
["pageUp"] = 201,
["left"] = 203,
["right"] = 208,
["end"] = 207,
["down"] = 205,
["pageDown"] = 209,
["insert"] = 210,
["delete"] = 211,
["leftCommand"] = 219
}
_G.keys.getName = function(code) return keycodeNumToName[tostring(code)] end

View File

@@ -2,19 +2,18 @@ package net.torvald.terrarum.virtualcomputer.computer
import li.cil.repack.org.luaj.vm2.Globals
import li.cil.repack.org.luaj.vm2.LuaError
import li.cil.repack.org.luaj.vm2.LuaTable
import li.cil.repack.org.luaj.vm2.LuaValue
import li.cil.repack.org.luaj.vm2.lib.ZeroArgFunction
import li.cil.repack.org.luaj.vm2.lib.jse.JsePlatform
import net.torvald.terrarum.KVHashMap
import net.torvald.terrarum.gameactors.ActorValue
import net.torvald.terrarum.virtualcomputer.luaapi.Filesystem
import net.torvald.terrarum.virtualcomputer.luaapi.HostAccessProvider
import net.torvald.terrarum.virtualcomputer.luaapi.Security
import net.torvald.terrarum.virtualcomputer.luaapi.Term
import net.torvald.terrarum.virtualcomputer.luaapi.*
import net.torvald.terrarum.virtualcomputer.terminal.*
import net.torvald.terrarum.virtualcomputer.worldobject.ComputerPartsCodex
import net.torvald.terrarum.virtualcomputer.worldobject.FixtureComputerBase
import org.newdawn.slick.GameContainer
import org.newdawn.slick.Input
import java.io.*
/**
@@ -40,15 +39,14 @@ class BaseTerrarumComputer(val term: Teletype? = null) {
val processorCycle: Int // number of Lua statement to process per tick (1/100 s)
get() = ComputerPartsCodex.getProcessorCycles(computerValue.getAsInt("processor") ?: 0)
val memSize: Int // max: 8 GB
val memSize: Int // in bytes; max: 8 GB
get() {
if (DEBUG_UNLIMITED_MEM) return 1.shl(30)// 1 GB
if (DEBUG_UNLIMITED_MEM) return 16.shl(20)// 16 MB
var size = 0
for (i in 0..3)
size += ComputerPartsCodex.getRamSize(computerValue.getAsInt("memSlot$i") ?: 0)
size += ComputerPartsCodex.getRamSize(computerValue.getAsInt("memSlot$i")!!)
return 16.shl(20)
return size
}
@@ -58,6 +56,9 @@ class BaseTerrarumComputer(val term: Teletype? = null) {
var isHalted = false
lateinit var input: Input
private set
init {
computerValue["memslot0"] = 4864 // -1 indicates mem slot is empty
computerValue["memslot1"] = -1 // put index of item here
@@ -83,34 +84,46 @@ class BaseTerrarumComputer(val term: Teletype? = null) {
computerValue["boot"] = computerValue.getAsString("hda")!!
if (term != null) {
termOut = TerminalPrintStream(term)
termErr = TerminalPrintStream(term)
termIn = TerminalInputStream(term)
if (term != null) initSandbox(term)
}
luaJ_globals.STDOUT = termOut
luaJ_globals.STDERR = termErr
luaJ_globals.STDIN = termIn
fun initSandbox(term: Teletype) {
termOut = TerminalPrintStream(term)
termErr = TerminalPrintStream(term)
termIn = TerminalInputStream(term)
// load libraries
Term(luaJ_globals, term)
Security(luaJ_globals)
Filesystem(luaJ_globals, this)
HostAccessProvider(luaJ_globals, this)
}
luaJ_globals.STDOUT = termOut
luaJ_globals.STDERR = termErr
luaJ_globals.STDIN = termIn
// load libraries
Term(luaJ_globals, term)
Security(luaJ_globals)
Filesystem(luaJ_globals, this)
HostAccessProvider(luaJ_globals, this)
Input(luaJ_globals, this)
Http(luaJ_globals, this)
// secure the sandbox
luaJ_globals["io"] = LuaValue.NIL
val sethook = luaJ_globals["debug"]["sethook"]
luaJ_globals["debug"] = LuaValue.NIL
// ROM BASIC
val inputStream = javaClass.getResourceAsStream("/net/torvald/terrarum/virtualcomputer/assets/lua/BOOT.lua")
runCommand(InputStreamReader(inputStream), "=boot")
// computer-related global functions
luaJ_globals["getTotalMem"] = LuaFunGetTotalMem(this)
luaJ_globals["totalMemory"] = LuaFunGetTotalMem(this)
}
var threadTimer = 0
val threadMaxTime = 2000
fun update(gc: GameContainer, delta: Int) {
input = gc.input
if (currentExecutionThread.state == Thread.State.TERMINATED)
unsetThreadRun()

View File

@@ -456,6 +456,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
}
}
/** returns NO line separator! */
private class FileClassReadLine(val fr: FileReader) : ZeroArgFunction() {
val scanner = Scanner(fr.readText()) // no closing; keep the scanner status persistent

View File

@@ -37,7 +37,10 @@ internal class HostAccessProvider(globals: Globals, computer: BaseTerrarumComput
class PrintLn(): OneArgFunction() {
override fun call(p0: LuaValue): LuaValue {
println(p0.checkIBM437())
if (p0.isnumber())
println(p0.checkdouble())
else
println(p0.checkIBM437())
return LuaValue.NONE
}
}
@@ -91,7 +94,7 @@ internal class HostAccessProvider(globals: Globals, computer: BaseTerrarumComput
class HaltComputer(val computer: BaseTerrarumComputer) : ZeroArgFunction() {
override fun call() : LuaValue {
computer.isHalted = true
computer.luaJ_globals.load("""print("system halted")""").call()
computer.luaJ_globals.load("""print(DC4.."system halted")""").call()
return LuaValue.NONE
}
}

View File

@@ -0,0 +1,12 @@
package net.torvald.terrarum.virtualcomputer.luaapi
import li.cil.repack.org.luaj.vm2.Globals
import net.torvald.terrarum.virtualcomputer.computer.BaseTerrarumComputer
/**
* Provides internet access, if @param computer has internet card(s).
*
* Created by minjaesong on 16-09-24.
*/
internal class Http(globals: Globals, computer: BaseTerrarumComputer) {
}

View File

@@ -0,0 +1,48 @@
package net.torvald.terrarum.virtualcomputer.luaapi
import li.cil.repack.org.luaj.vm2.Globals
import li.cil.repack.org.luaj.vm2.LuaTable
import li.cil.repack.org.luaj.vm2.LuaValue
import li.cil.repack.org.luaj.vm2.lib.OneArgFunction
import net.torvald.terrarum.gamecontroller.Key
import net.torvald.terrarum.virtualcomputer.computer.BaseTerrarumComputer
/**
* Created by minjaesong on 16-09-25.
*/
class Input(globals: Globals, computer: BaseTerrarumComputer) {
init {
globals["input"] = LuaTable()
globals["input"]["isKeyDown"] = IsKeyDown(computer)
}
companion object {
val keys_alt = intArrayOf(Key.L_ALT, Key.L_COMMAND)
val keys_caps = intArrayOf(Key.CAPS_LOCK, Key.BACKSPACE, Key.L_CONTROL)
}
class IsKeyDown(val computer: BaseTerrarumComputer) : OneArgFunction() {
override fun call(keyCode: LuaValue): LuaValue {
val key = keyCode.checkint()
// L_Alt and L_COMMAND are homogeneous
if (keys_alt.contains(key)) {
for (k in keys_alt) {
val down = computer.input.isKeyDown(k)
if (down) return LuaValue.valueOf(true)
}
}
// Caps, Backspace, L_Control, for Colemak and HHKB
if (keys_caps.contains(key)) {
for (k in keys_caps) {
val down = computer.input.isKeyDown(k)
if (down) return LuaValue.valueOf(true)
}
}
return LuaValue.valueOf(computer.input.isKeyDown(keyCode.checkint()))
}
}
}

View File

@@ -9,6 +9,8 @@ import org.apache.commons.codec.digest.DigestUtils
import java.security.SecureRandom
/**
* Hashes, CSPRNG, Base64
*
* Created by minjaesong on 16-09-15.
*/
internal class Security(globals: Globals) {

View File

@@ -7,7 +7,8 @@ import net.torvald.terrarum.virtualcomputer.terminal.Terminal
import java.nio.charset.Charset
/**
* APIs must have some extent of compatibility with ComputerCraft by dan200
* Controls terminal as if it was a monitor
* (not sending control sequences but just drives it, as if it was not a terminal @ 9600 baud)
*
* Created by minjaesong on 16-09-12.
*/

View File

@@ -91,8 +91,8 @@ open class SimpleTextTerminal(
private val cursorBlinkLen = 250
private var cursorBlinkOn = true
val phosphor = if (colour) WHITE else phosphorColour
open protected val colourScreen = if (colour) Color(4, 4, 4) else Color(19, 19, 19)
val phosphor = if (colour) WHITE7500 else phosphorColour
open protected val colourScreen = if (colour) Color(8, 8, 8) else Color(19, 19, 19)
@@ -447,10 +447,11 @@ open class SimpleTextTerminal(
companion object {
val AMBER = Color(255, 183, 0) // P3, 602 nm
val IBM_GREEN = Color(74, 255, 0) // P39, 525 nm
val WHITE = Color(228, 234, 255) // P4, 7 500 K
val GREEN = Color(74, 255, 0) // P39, 525 nm
val WHITE = Color(204, 223, 255) // approximation of white CRT I own
val WHITE7500 = Color(0xe4eaff)
val ELECTRIC_BLUE = Color(0, 226, 255) // imaginary, 483 nm
val RED = Color(250, 0, 0) // <= 645 nm
val RED = Color(250, 51, 0) // 632 nm
val ASCII_NUL = 0.toChar()
val ASCII_BEL = 7.toChar() // *BEEP!*

View File

@@ -14,14 +14,14 @@ object ComputerPartsCodex {
init {
// in kilobytes
rams.put(4864, 16.MiB())
rams.put(4865, 24.MiB())
rams.put(4866, 32.MiB())
rams.put(4867, 64.MiB())
rams.put(4868, 96.MiB())
rams.put(4869, 128.MiB())
rams.put(4870, 160.MiB())
rams.put(4871, 256.MiB())
rams.put(4864, 128.KiB())
rams.put(4865, 192.KiB())
rams.put(4866, 256.KiB())
rams.put(4867, 384.KiB())
rams.put(4868, 512.KiB())
rams.put(4869, 768.KiB())
rams.put(4870, 1024.KiB())
rams.put(4871, 2048.KiB())
processors.put(4872, 1000)
processors.put(4873, 2000)
@@ -51,6 +51,6 @@ object ComputerPartsCodex {
private fun Int.MB() = this * 1000000 // 1 MB == 1 000 000 bytes, bitches!
private fun Int.kB() = this * 1000
private fun Int.KiB() = this.shr(10)
private fun Int.MiB() = this.shr(20)
private fun Int.KiB() = this.shl(10)
private fun Int.MiB() = this.shl(20)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

69
work_files/monotone.ans Normal file
View File

@@ -0,0 +1,69 @@
ÛOrderÛ °00°C-4 úúú°C-5 úúú°C-5 úúú°C-4 F20°Octave F1 F2 F3 F4 F5 F6 F7 F8 F9
  °01°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
 00 02  °02°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°01°00° °03°úúú úúú°úúú úúú°úúú úúú°úúú úúú°  SPACE Stop/Rec. mode SHIFT Assign patn to order
°02°01° °04°úúú úúú°D-5 úúú°F#5 úúú°úúú F08° Move cursorSHIFT Prev/Next pattern
°03°03° °05°úúú úúú°F#5 úúú°úúú úúú°úúú úúú°\ Note offTAB Next channel
°04°04° °06°úúú úúú°A-5 úúú°úúú úúú°úúú úúú°
°05°05° °07°úúú úúú°G-5 úúú°G-5 úúú°úúú úúú°
°06°06° °08°úúú úúú°C-6 úúú°úúú úúú°úúú úúú° ALT Select blockPAGE Move by 16 rows
°07°07°  09 úúú úúú E-6 úúú úúú úúú úúú úúú  ALT C Copy selectionHM/ED Move to top/bottom
°08°08° °0A°úúú úúú°C-5 úúú°=== úúú°úúú úúú° ALT V Paste selection
°09°09° °0B°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°0A°0A° °0C°úúú úúú°úúú úúú°úúú úúú°úúú F20° ENTER Play from beggining
°0B°0B° °0D°úúú úúú°úúú úúú°úúú úúú°úúú úúú° INS Insert a patn  ENTER Play this pattern
°0C°0C° °0E°úúú úúú°úúú úúú°úúú úúú°úúú úúú° DEL Del. sel. patn
°0D°0D° °0F°úúú úúú°úúú úúú°úúú úúú°úúú úúú° INS Insert order
°0E°0E° °10°úúú úúú°C-6 úúú°G#5 úúú°úúú F04° DEL Delete orderCTRL S Save
°0F°0F° °11°úúú úúú°D#6 úúú°C-6 úúú°úúú úúú°CTRL O Load (discard this)
°10°10° °12°úúú úúú°G#6 úúú°D#6 úúú°úúú úúú°CTRL N New (discard this)
°11°11° °13°úúú úúú°F#6 úúú°D-6 úúú°úúú úúú°
°12°12° °14°úúú úúú°A-6 úúú°F#6 úúú°úúú úúú°
°13°13° °15°úúú úúú°D-7 úúú°A-6 úúú°úúú úúú°
°14°14° °16°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°15°15° °17°úúú úúú°C-5 úúú°=== úúú°úúú úúú°
°16°16° °18°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°17°17° °19°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°18°18° °1A°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°19°19° °1B°úúú úúú°úúú úúú°úúú úúú°úúú F20°
°1A°1A° °1C°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°1B°1B° °1D°úúú úúú°úúú úúú°úúú úúú°úúú úúú°
°1C°1C° °1E°úúú úúú°úúú úúú°G-3 úúú°úúú F03° Effects
°1D°1D° °1F°úúú úúú°úúú úúú°A-3 úúú°úúú úúú°
°1E°1E° °20°úúú úúú°úúú úúú°B-3 úúú°úúú úúú°0xy Arpeggio
°1F°1E° °21°úúú úúú°úúú úúú°C-4 úúú°úúú úúú°
°20°1E° °22°úúú úúú°úúú úúú°D-4 úúú°úúú úúú°1xx Portamento up
°21°1F° °23°úúú úúú°úúú úúú°E-4 úúú°úúú úúú°
°úú°úú° °24°úúú úúú°úúú úúú°F-4 úúú°úúú úúú°2xx Portamento down
°úú°úú° °25°úúú úúú°úúú úúú°G-4 úúú°úúú úúú°
°úú°úú° °26°úúú úúú°úúú úúú°A-4 úúú°úúú úúú°3xx Portamento to note
°úú°úú° °27°úúú úúú°úúú úúú°B-4 úúú°úúú úúú°
°úú°úú° °28°úúú úúú°úúú úúú°C-5 úúú°úúú úúú°4xy Vibrato
°úú°úú° °29°úúú úúú°úúú úúú°D-5 úúú°úúú úúú°
°úú°úú° °2A°úúú úúú°úúú úúú°E-5 úúú°úúú úúú°Bxx Jump to order
°úú°úú° °2B°úúú úúú°úúú úúú°F-5 úúú°úúú úúú°
°úú°úú° °2C°úúú úúú°úúú úúú°G-5 úúú°úúú úúú°Dxx Pattern break
°úú°úú° °2D°úúú úúú°úúú úúú°A-5 úúú°úúú úúú°
°úú°úú° °2E°úúú úúú°úúú úúú°B-5 úúú°úúú úúú°Fxx Set tick speed
°úú°úú° °2F°úúú úúú°úúú úúú°C-6 úúú°úúú úúú°
°úú°úú° °30°úúú úúú°úúú úúú°D-6 úúú°úúú úúú°
°úú°úú° °31°úúú úúú°úúú úúú°E-6 úúú°úúú úúú° ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
°úú°úú° °32°úúú úúú°úúú úúú°F-6 úúú°úúú úúú° ±±Ý ÞÝ Þ±±±Ý ÞÝ ÞÝ Þ±±±Ý ÞÝ Þ±±±Ý Þ±±±
°úú°úú° °33°úúú úúú°úúú úúú°G-6 úúú°úúú úúú° ±±Ý2ÞÝ3Þ±±±Ý5ÞÝ6ÞÝ7Þ±±±Ý9ÞÝ0Þ±±±Ý=Þ±±±
°úú°úú° °34°úúú úúú°úúú úúú°A-6 úúú°úúú úúú° ±±Ý ÞÝ Þ±±±Ý ÞÝ ÞÝ Þ±±±Ý ÞÝ Þ±±±Ý Þ±±±
°úú°úú° °35°úúú úúú°úúú úúú°B-6 D00°úúú úúú° ±Ý ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ Þ±
°úú°úú° °36°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±ÝQÞÝWÞÝEÞÝRÞÝTÞÝYÞÝUÞÝIÞÝOÞÝPÞÝ{ÞÝ}Þ±
°úú°úú° °37°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±Ý ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ Þ±
°úú°úú° °38°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
°úú°úú° °39°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±±Ý ÞÝ Þ±±±Ý ÞÝ ÞÝ Þ±±±Ý ÞÝ Þ±±±±±±±±
°úú°úú° °3A°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±±ÝSÞÝDÞ±±±ÝGÞÝHÞÝJÞ±±±ÝLÞÝ;Þ±±±±±±±±
  °3B°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±±Ý ÞÝ Þ±±±Ý ÞÝ ÞÝ Þ±±±Ý ÞÝ Þ±±±±±±±±
°3C°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±Ý ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ Þ±±±±±±
RecPlay °3D°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±ÝZÞÝXÞÝCÞÝVÞÝBÞÝNÞÝMÞÝ,ÞÝ.ÞÝ/Þ±Oct±±
Trcks 4 °3E°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±Ý ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ ÞÝ Þ± -1±±
Tick 08 °3F°úúú úúú°úúú úúú°úúú úúú°úúú úúú° ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
RecPlay RecPlay
Trcks 4 Trcks 4  Editable
Tick 08 Tick 08  Fxx eff
SAUCE00 20160924—~dEIBM VGA50

BIN
work_files/monotone.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,77 @@
The Filesystem API provides functions for manipulating files and the filesystem.
The path for the argument of functions blocks `\,.\,.\,' to be entered, preventing users from access outside of the computer and eliminating the potential of harming the real computer of the innocent players.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
fs.list(\textbf{path}: string) & table & Returns list of files in \textbf{path}, in lua table.
\\ \\
fs.exists(\textbf{path}: string) & bool & Checks if \textbf{path} exists on the filesystem.
\\ \\
fs.isDir(\textbf{path}: string) & bool & Checks if \textbf{path} is a directory.
\\ \\
fs.isFile(\textbf{path}: string) & bool & Checks if \textbf{path} is a file.
\\ \\
fs.isReadOnly(\textbf{path}: string) & bool & Checks if \textbf{path} is read only.
\\ \\
fs.getSize(\textbf{path}: string) & int & Returns a size of the file/directory, in bytes.
\\ \\
fs.mkdir(\textbf{path}: string) & bool & Create a directory to \textbf{path}. Returns \textbf{true} upon success.
\\ \\
fs.mv(\textbf{from}: string, \textbf{dest}: string) & bool & Moves the directory to the destination. Subdirectories / files will also be moved. Returns \textbf{true} upon success.
\\ \\
fs.cp(\textbf{from}: string, \textbf{dest}: string) & bool & Copies the directory to the destination. Subdirectories / files will also be copied. Returns \textbf{true} upon success.
\\ \\
fs.rm(\textbf{path}: string) & bool & Deletes the \textbf{path}. If \textbf{path} is a directory, all its members will also be deleted. Returns \textbf{true} upon success.
\\ \\
fs.concat(\textbf{p1}: string, \textbf{p2}: string) & string & Concatenates two paths and return new path as string.
\\ \\
fs.open(\textbf{path}: string, \textbf{mode}: string) & file & Opens file and returns its handle. See section \emph{File Handler} for details.
\\ \\
fs.parent(\textbf{path}: string) & string & Returs parent directory to the \textbf{path}.
\\ \\
fs.dofile(\textbf{path}: string) & nil & Loads the script on \textbf{path} and executes it.
\\ \\
fs.fetchText(\textbf{path}: string) & string & Opens the file on \textbf{path} and returns its contents as a plain text.
\end{tabularx}
\subsection{File Handler}
When it comes to opening a file, there are six modes available---r, w, a, rb, wb, ab, each represents \textbf{r}ead, \textbf{w}rite, \textbf{a}ppend and \textbf{b}yte.
\begin{tabularx}{\textwidth}{l X}
\textbf{\large Function} & \textbf{\large Description}
\\ \\
\endhead
file.close() & Closes the file. Any data wrote will be actually wrote to disk when this function is called.
\\ \\
file.flush() & (in write/append mode) Flushes the data to the file, keeps the handle available afterwards
\\ \\
\multicolumn{2}{c}{\textbf{Read mode}}
\\ \\
file.readLine() & Reads text from the file line by line. Returns string of line, or \emph{nil} if there is no next line.
\\ \\
file.readAll() & Reads and returns whole text in the file as string.
\\ \\
\multicolumn{2}{c}{\textbf{Read binary mode}}
\\ \\
file.read() & Reads single byte in the file as int, or \emph{-1} if end-of-file is reached.
\\ \\
file.readAll() & Reads and returns whole byte in the file as string.
\\ \\
\multicolumn{2}{c}{\textbf{Write/append mode}}
\\ \\
file.write(string) & Writes \textbf{string} to the file.
\\ \\
file.writeLine(string) & Writes \textbf{string} to the file and append line feed.
\\ \\
\multicolumn{2}{c}{\textbf{Write/append binary mode}}
\\ \\
file.write(int) & Writes \textbf{int} to the file.
\\ \\
file.writeBytes(string) & Writes \textbf{string} to the file and append line feed.
\end{tabularx}

View File

@@ -0,0 +1,10 @@
The Hexutils library provides utility to convert byte value to hexadecimal string.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
hexutils.toHexString(\textbf{bytes}: string) & string & Converts byte array to the string of its hexadecimal representations.
\end{tabularx}

View File

@@ -0,0 +1,18 @@
The Input API provides access to game's Input API to get input-related informations.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
input.isKeyDown(keycode: int) & bool & Checks whether the key is down. By combining with `and' or `or' statement, you can inquire for multiple keys being down simultaneously.
\\ \\
input.readLine() & string & Reads a line of string and returns it.
\end{tabularx}
You can use \emph{Keys} Library with this API. Examples:
\begin{itemize}
\item input.isKeyDown(keys.q)
\end{itemize}

View File

@@ -0,0 +1,72 @@
The Keys library helps you with Input API to get key code by key's names, or identify a key code.
Notes on compatibility with ComputerCraft: although this library is ComputerCraft-compliant, but Numpads are \emph{not} supported whatsoever. \textit{Come on, it's not like everyone has or likes numpad on their keyboard.}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
keys.<key name: String> & int & Returns key code corresponds to the key name.
\\ \\
keys.getName(keycode: int) & string & Returns key name corresponds to the keycode.
\end{tabularx}
\subsection{Accepted Key Names}
\emph{NOTE: following sets are considered as the same keys.}
\begin{itemize}
\item leftAlt --- leftCommand
(leftAlt is often recognised as leftCommand on macOS)
\item leftControl --- capsLock --- backspace
(colemak key layout puts secondary backspace on capsLock, Happy Hacking Keyboard puts Control on the location of Caps Lock)
\end{itemize}
\begin{tasks}[counter-format=\-](5)
\task (\emph{a} to \emph{z})
\task (\emph{zero} to \emph{nine})
\task minus
\task equals
\task backspace
\task tab
\task leftBracket
\task rightBracket
\task enter
\task leftCtrl
\task semiColon
\task apostrophe
\task grave
\task leftShift
\task backslash
\task comma
\task period
\task slash
\task rightShift
\task multiply
\task leftAlt
\task space
\task capsLock
\task scollLock
\task (\emph{f1} to \emph{f15})
\task cimcumflex
\task at
\task colon
\task underscore
\task rightCtrl
\task rightAlt
\task pause
\task home
\task up
\task pageUp
\task left
\task right
\task end
\task down
\task pageDown
\task insert
\task delete
\task leftCommand
\end{tasks}

View File

@@ -0,0 +1,20 @@
The Serurity API provides functions for security purposes, such as hashing and CSPRNG\footnote{Cryptographically secure psuedo-random number generator}.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
security.toSHA1(string) & string & Returns SHA-256 hash of input string in array of bytes (as a string)
\\ \\
security.toSHA256(string) & string & Returns SHA-1 hash of input string in array of bytes
\\ \\
security.toMD5(string) & string & Returns MD-5 hash of input string in array of bytes
\\ \\
security.randomBytes(\textbf{len}: int) & string & Returns byte array of random values in desired \textbf{len}gth.
\\ \\
security.decodeBase64(string) & string & Decodes Base64 string and returns the result as string.
\\ \\
security.encodeBase64(string) & string & Encodes input string as Base64 format and returns the result as array of bytes.
\end{tabularx}

View File

@@ -0,0 +1,6 @@
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
shell.run(\textbf{path}: string) & nil & Loads the script on \textbf{path} and executes it.
\end{tabularx}

View File

@@ -0,0 +1,109 @@
The Terminal API provides functions for sending text to the terminals, and drawing text-mode graphics. The API expects connected terminal to use Codepage 437. See section \emph{Codepage} for details.
\subsection{Functions}
Note: cursor coordinates starts from one, not zero.
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
term.write(string) & nil & Writes string to the current cursor position. Line feed is not appended.
\\ \\
term.print(string) & nil & Writes string to the current cursor position and make a new line.
\\ \\
term.newLine() & nil & Make a new line.
\\ \\
term.moveCursor(\textbf{x}: int) & nil & Moves cursor horizontally, starting from 1.
\\ \\
term.width() & int & Returns the width of the terminal. Graphic terminals also can use this.
\\ \\
term.scroll(\textbf{n}: int) & nil & Make a new line \textbf{n} times.
\\ \\
term.isTeletype() & bool & Returns \textbf{true} if the terminal is teletype.
\\ \\
\multicolumn{3}{c}{\textbf{Graphic terminals only}}
\\ \\
term.emit(\textbf{c}: int, \textbf{x}: int, \textbf{y}: int) & nil & Emits \textbf{c} into (\textbf{x}, \textbf{y}), control sequence will not be processed and printed as symbols instead. Cursor will not be moved.
\\ \\
term.emitRaw(\textbf{bufferChar}: int) & nil & Emits \textbf{bufferChar} into into (\textbf{x}, \textbf{y}). Buffer char means a single character actually stored into the screen buffer, has four bits for back- and foreground colours respectively, and eight bits for a letter.
\\ \\
term.emitString(\textbf{s}, \textbf{x}: int, \textbf{y}: int) & nil & Emits \textbf{s} (a string) into (\textbf{x}, \textbf{y}), printing control sequences as symbols. Cursor will not be moved.
\\ \\
\begin{tabular}[t]{@{}l@{}}term.resetColour()\\term.resetColor()\end{tabular} & nil & Resets any colour changes to the defaults.
\\ \\
term.clear() & nil & Clears whole screen buffer and move cursor to (1, 1)
\\ \\
term.clearLine() & nil & Clears current line on the screen buffer, does not moves cursor.
\\ \\
term.setCursor(\textbf{x}: int, \textbf{y}: int) & nil & Moves cursor to (\textbf{x}, \textbf{y})
\\ \\
term.getCursor() & int, int & Returns current coordinates of the cursor.
\\ \\
term.getX() & int & Returns X coordinate of the cursor.
\\ \\
term.getY() & int & Returns Y coordinate of the cursor.
\\ \\
term.setX(int) & nil & Sets X coordinate of the cursor.
\\ \\
term.setY(int) & nil & Sets Y coordinate of the cursor.
\\ \\
term.setCursorBlink(bool) & nil & Sets cursor blinking. \textbf{true} makes the cursor blink.
\\ \\
term.size() & int, int & Returns width and height of the terminal.
\\ \\
term.height() & int & Returns height of the terminal.
\\ \\
term.isCol() & bool & Returns if the terminal supports colour.
\\ \\
term.setForeCol(\textbf{col}: int) & nil & Sets foreground colour to \textbf{col}
\\ \\
term.setBackCol(\textbf{col}: int) & nil & Sets background colour to \textbf{col}.
\\ \\
term.foreCol() & int & Returns current foreground colour.
\\ \\
term.backCol() & int & Returns current background colour.
\end{tabularx}
\subsection{Standard Colours}
\begin{tabularx}{\textwidth}{c l c l c l c l}
0 & \textcolor{black}{Black} & 1 & White & 2 & \textcolor{dimgrey}{Dim grey} & 3 & \textcolor{brightgrey}{Bright grey}
\\ \\
4 & \textcolor{yellow}{Yellow} & 5 & \textcolor{orange}{Orange} & 6 & \textcolor{red}{Red} & 7 & \textcolor{magenta}{Magenta}
\\ \\
8 & \textcolor{purple}{Purple} & 9 & \textcolor{blue}{Blue} & 10 & \textcolor{cyan}{Cyan} & 11 & \textcolor{lime}{Lime}
\\ \\
12 & \textcolor{green}{Green} & 13 & \textcolor{darkgreen}{Dark green} & 14 & \textcolor{brown}{Brown} & 15 & \textcolor{tan}{Tan}
\end{tabularx}
Non-colour terminals support colour index of 0--3.
\subsection{Codepage}
\newlength{\cpimagew}
\setlength{\cpimagew}{\linewidth}
\addtolength{\cpimagew}{-4em}
\begin{center}\includegraphics[width=\cpimagew]{mda.png}\end{center}
Character 0x9E (currency symbol) and 0xFA (middle dot) can be accessed with following Lua constants: \emph{MONEYSYM} and \emph{MIDDOT}. See \emph{Lua Globals} > \emph{Constants} section.
\subsection{Accepted Control Sequences}
\begin{tabularx}{\textwidth}{c X c X}
\textbf{\large No.} & \textbf{\large Description} & \textbf{\large No.} & \textbf{\large Description}
\\ \\
\endhead
7 & BEL. Emits short beep. & 8 & BS. Moves cursor to left 1 character.
\\ \\
9 & TAB. Inserts appropriate horizontal space. Tab size is variable. & 10 & LF. Prints a new line.
\\ \\
12 & FF. Clears everything in screen buffer and moves cursor to (1, 1) & 13 & CR. Moves x coordinate of cursor to 1.
\\ \\
16 & DLE. Sets foreground colour to the default STDERR colour. & 127 & DEL. Backspace and deletes one character.
\\ \\
17 & DC1. Sets foreground colour to 0. (black) & 18 & DC2. Sets foreground colour to 1. (white)
\\ \\
19 & DC3. Sets foreground colour to 2. (dim grey) & 20 & DC4. Sets foreground colour to 3. (bright grey)
\end{tabularx}

View File

@@ -0,0 +1,22 @@
The Bit API is for manipulating numbers using bitwise binary operations. The ROMBASIC already comes with Lua's bit32 library so make sure to use that for your casual usage.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l X}
\textbf{\large Function} & \textbf{\large Notes}
\\ \\
\endhead
bit.blshift(n, bits) & Alias of bit32.lshift(n, bits)
\\ \\
bit.brshift(n, bits) & Alias of bit32.arshift(n, bits)
\\ \\
bit.blogic\_rshift(n, bits) & Alias of bit32.brshift(n, bits)
\\ \\
bit.bxor(m, n) & Alias of bit32.bxor(m, n)
\\ \\
bit.bor(m, n) & Alias of bit32.bor(m, n)
\\ \\
bit.band(m, n) & Alias of bit32.band(m, n)
\\ \\
bit.bnot(n) & Alias of bit32.bnot(n)
\end{tabularx}

View File

@@ -0,0 +1,21 @@
The Colors API allows you to manipulate sets of colors. This is useful in colors on Advanced Computers and Advanced Monitors. British spellings are also supported.
\subsection{Constants}
When the colours are used in ComputerCraft's Term API, nearest console colours will be used. Below is the table of colours coded with their substitutions.
\begin{tabularx}{\textwidth}{l l l l}
colors.white & colors.\textcolor{orange}{orange} & colors.\textcolor{magenta}{magenta} & colors.\textcolor{cyan}{lightBlue}
\\ \\
colors.\textcolor{yellow}{yellow} & colors.\textcolor{lime}{lime} & colors.\textcolor{tan}{pink} & colors.\textcolor{dimgrey}{gray}
\\ \\
colors.\textcolor{brightgrey}{lightGray} & colors.\textcolor{cyan}{cyan} & colors.\textcolor{purple}{purple} & colors.\textcolor{blue}{blue}
\\ \\
colors.\textcolor{brown}{brown} & colors.\textcolor{green}{green} & colors.\textcolor{red}{red} & colors.\textcolor{black}{black}
\end{tabularx}
Note that pink is understood as \textcolor{tan}{tan} when it is used, lightBlue and cyan are merged to \textcolor{cyan}{cyan}.
\subsection{Functions}
All three functions are not supported, as there is no bundled cable thus there is no use of them.

View File

@@ -0,0 +1,3 @@
\begin{itemize}
\item io library is limited to io.read (read a line from keyboard) and io.write (print without new line)
\end{itemize}

View File

@@ -0,0 +1,51 @@
ROMBASIC adds global functions and constants for operability.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
\unemph{\_G.}runScript(\textbf{fun}: str, \textbf{env}: str) & nil & Runs Lua script \textbf{fun} with the environment tag \textbf{env}.
\\ \\
computer.totalMemory() & int & Returns the total size of the memory installed in the computer, in bytes.
\\ \\
computer.freeMemory() & int & Returns the amount of free memory on the computer.
\end{tabularx}
\subsection{Constants}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Name} & \textbf{\large Type} & \textbf{\large Description}
\\ \\
\endhead
\unemph{\_G.}EMDASH & string & EM dash represented by box-drawing character. Code 0xC4
\\ \\
\unemph{\_G.}UNCHECKED & string & Unchecked checkbox. Code 0x9C
\\ \\
\unemph{\_G.}CHECKED & string & Checked checkbox. Code 0x9D
\\ \\
\unemph{\_G.}MONEYSYM & string & Currency symbol used in the world. Code 0x9E
\\ \\
\unemph{\_G.}MIDDOT & string & Middle dot used in typography. Code 0xFA (note: 0xF9 is a Dot Product used in Mathematics)
\\ \\
\unemph{\_G.}DC1 & string & Ascii control sequence DC1. Used to change foreground colour to black.
\\ \\
\unemph{\_G.}DC2 & string & Ascii control sequence DC2. Used to change foreground colour to white.
\\ \\
\unemph{\_G.}DC3 & string & Ascii control sequence DC3. Used to change foreground colour to dim grey.
\\ \\
\unemph{\_G.}DC4 & string & Ascii control sequence DC4. Used to change foreground colour to bright grey.
\\ \\
\unemph{\_G.}DLE & string & Ascii control sequence DLE. Used to change foreground colour to terminal's default error text colour.
\\ \\
computer.prompt & string & Default text for prompt input indicator.
\\ \\
computer.verbose & bool & Sets whether print debug information to the console.
\\ \\
computer.loadedCLayer & table & List of names of compatibility layers has been loaded.
\\ \\
computer.bootloader & string & Path to the boot file. Should point to the EFI (/boot/efi).
\\ \\
computer.OEM & string & Manufacturer of the computer. If you \emph{are} a manufacturer, you may want to fill in this variable with your own company's name.
\end{tabularx}

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,18 @@
The line printer is a printer that operates on line basis. It only prints text in line-by-line, hence the name, on almost endlessly long roll of papers; it has no notion of page, it just prints. If you want some pages to keep, you must tear them out yourself.
Line printers do not work indefinitely; ignoring the obvious depletion of ink, belt for loading paper will be out of service on about 50 000 lines of printing, give or take a few, or paper will jam if the printer had struck with the unluckiness.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
lp.print(string) & nil & Prints a line of string.
\\ \\
lp.scroll(\textbf{n}: int) & nil & Scrolls the paper by \textbf{n} lines.
\\ \\
lp.status() & int & Returns a status of the line printer.
\\ \\
lp.reset() & nil & Resets the line printer.
\end{tabularx}

View File

@@ -37,23 +37,35 @@
\@writefile{toc}{\contentsline {section}{\numberline {1.2}Hexutils}{9}{section.1.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.1}Functions}{9}{subsection.1.2.1}}
\gdef \LT@iv {\LT@entry
{2}{138.81004pt}\LT@entry
{1}{45.25516pt}\LT@entry
{1}{150.9348pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.3}Input}{10}{section.1.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.1}Functions}{10}{subsection.1.3.1}}
\gdef \LT@v {\LT@entry
{2}{126.83005pt}\LT@entry
{1}{45.25516pt}\LT@entry
{1}{162.9148pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.4}Keys}{11}{section.1.4}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.4.1}Accepted Key Names}{11}{subsection.1.4.1}}
\gdef \LT@vi {\LT@entry
{2}{136.82pt}\LT@entry
{1}{45.25516pt}\LT@entry
{1}{152.92484pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.3}Security}{10}{section.1.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.3.1}Functions}{10}{subsection.1.3.1}}
\gdef \LT@v {\LT@entry
\@writefile{toc}{\contentsline {section}{\numberline {1.5}Security}{12}{section.1.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.5.1}Functions}{12}{subsection.1.5.1}}
\gdef \LT@vii {\LT@entry
{2}{102.18004pt}\LT@entry
{1}{45.25516pt}\LT@entry
{2}{180.42001pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.4}Shell}{11}{section.1.4}}
\gdef \LT@vi {\LT@entry
\@writefile{toc}{\contentsline {section}{\numberline {1.6}Shell}{13}{section.1.6}}
\gdef \LT@viii {\LT@entry
{2}{139.76003pt}\LT@entry
{1}{45.25516pt}\LT@entry
{1}{149.98482pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.5}Terminal}{12}{section.1.5}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.5.1}Functions}{12}{subsection.1.5.1}}
\gdef \LT@vii {\LT@entry
\@writefile{toc}{\contentsline {section}{\numberline {1.7}Terminal}{14}{section.1.7}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.7.1}Functions}{14}{subsection.1.7.1}}
\gdef \LT@ix {\LT@entry
{1}{22.26001pt}\LT@entry
{1}{39.16003pt}\LT@entry
{1}{22.26001pt}\LT@entry
@@ -62,57 +74,58 @@
{1}{49.88002pt}\LT@entry
{1}{22.26001pt}\LT@entry
{1}{58.02002pt}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.5.2}Standard Colours}{14}{subsection.1.5.2}}
\gdef \LT@viii {\LT@entry
\@writefile{toc}{\contentsline {subsection}{\numberline {1.7.2}Standard Colours}{16}{subsection.1.7.2}}
\gdef \LT@x {\LT@entry
{1}{28.3155pt}\LT@entry
{1}{139.1845pt}\LT@entry
{1}{28.3155pt}\LT@entry
{1}{139.1845pt}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.5.3}Codepage}{15}{subsection.1.5.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.5.4}Accepted Control Sequences}{15}{subsection.1.5.4}}
\gdef \LT@ix {\LT@entry
\@writefile{toc}{\contentsline {subsection}{\numberline {1.7.3}Codepage}{17}{subsection.1.7.3}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.7.4}Accepted Control Sequences}{17}{subsection.1.7.4}}
\gdef \LT@xi {\LT@entry
{2}{134.13005pt}\LT@entry
{1}{45.25516pt}\LT@entry
{1}{155.61479pt}}
\gdef \LT@x {\LT@entry
{2}{123.76009pt}\LT@entry
\gdef \LT@xii {\LT@entry
{2}{111.63007pt}\LT@entry
{2}{36.06001pt}\LT@entry
{1}{175.1799pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.6}Lua Globals}{17}{section.1.6}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.6.1}Functions}{17}{subsection.1.6.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.6.2}Constants}{17}{subsection.1.6.2}}
{1}{187.30992pt}}
\@writefile{toc}{\contentsline {section}{\numberline {1.8}Lua Globals}{18}{section.1.8}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.8.1}Functions}{18}{subsection.1.8.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {1.8.2}Constants}{18}{subsection.1.8.2}}
\@writefile{toc}{\contentsline {section}{\numberline {1.9}Changes from Generic Lua Environment}{20}{section.1.9}}
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {2}Compatibility Layers---ComputerCraft}{19}{chapter.2}}
\gdef \LT@xi {\LT@entry
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {2}Compatibility Layers---ComputerCraft}{21}{chapter.2}}
\gdef \LT@xiii {\LT@entry
{2}{108.45001pt}\LT@entry
{2}{125.76003pt}}
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Bit}{20}{section.2.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.1}Functions}{20}{subsection.2.1.1}}
\gdef \LT@xii {\LT@entry
\@writefile{toc}{\contentsline {section}{\numberline {2.1}Bit}{22}{section.2.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.1.1}Functions}{22}{subsection.2.1.1}}
\gdef \LT@xiv {\LT@entry
{1}{77.19011pt}\LT@entry
{1}{68.63008pt}\LT@entry
{1}{76.35007pt}\LT@entry
{1}{76.36005pt}}
\@writefile{toc}{\contentsline {section}{\numberline {2.2}Colors}{21}{section.2.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.1}Constants}{21}{subsection.2.2.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.2}Functions}{21}{subsection.2.2.2}}
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Term}{22}{section.2.3}}
\@writefile{toc}{\contentsline {section}{\numberline {2.4}Filesystem}{23}{section.2.4}}
\@writefile{toc}{\contentsline {section}{\numberline {2.2}Colors}{23}{section.2.2}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.1}Constants}{23}{subsection.2.2.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.2}Functions}{23}{subsection.2.2.2}}
\@writefile{toc}{\contentsline {section}{\numberline {2.3}Term}{24}{section.2.3}}
\@writefile{toc}{\contentsline {section}{\numberline {2.4}Filesystem}{25}{section.2.4}}
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {3}Compatibility Layers---OpenComputers}{25}{chapter.3}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {3}Compatibility Layers---OpenComputers}{27}{chapter.3}}
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {4}Peripherals}{27}{chapter.4}}
\gdef \LT@xiii {\LT@entry
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {4}Peripherals}{29}{chapter.4}}
\gdef \LT@xv {\LT@entry
{2}{71.78003pt}\LT@entry
{1}{45.25516pt}\LT@entry
{2}{153.90001pt}}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Line Printer}{28}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.1}Functions}{28}{subsection.4.1.1}}
\@writefile{toc}{\contentsline {section}{\numberline {4.1}Line Printer}{30}{section.4.1}}
\@writefile{toc}{\contentsline {subsection}{\numberline {4.1.1}Functions}{30}{subsection.4.1.1}}
\@writefile{lof}{\addvspace {10pt}}
\@writefile{lot}{\addvspace {10pt}}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {5}References}{29}{chapter.5}}
\memsetcounter{lastsheet}{31}
\memsetcounter{lastpage}{31}
\@writefile{toc}{\contentsline {chapter}{\chapternumberline {5}References}{31}{chapter.5}}
\memsetcounter{lastsheet}{33}
\memsetcounter{lastpage}{33}

View File

@@ -1,4 +1,4 @@
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) (format=lualatex 2015.10.5) 22 SEP 2016 18:24
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) (format=lualatex 2015.10.5) 26 SEP 2016 12:12
restricted \write18 enabled.
file:line:error style messages enabled.
**romapidoc.tex
@@ -552,7 +552,7 @@ luatexbase-attr: luatexbase.attributes["luaotfload@cursbase"] = 6
luatexbase-attr: luatexbase.attributes["luaotfload@curscurs"] = 7
luatexbase-attr: luatexbase.attributes["luaotfload@cursdone"] = 8
luatexbase-attr: luatexbase.attributes["luaotfload@state"] = 9
luaotfload | main : fontloader loaded in 0.033 seconds
luaotfload | main : fontloader loaded in 0.031 seconds
luatexbase-mcb: inserting 'luaotfload.node_processor'
at position 1 in 'pre_linebreak_filter'
luatexbase-mcb: inserting 'luaotfload.node_processor'
@@ -1084,7 +1084,147 @@ Package: longtable 2014/10/28 v4.11 Multi-page Table package (DPC)
\c@LT@chunks=\count306
\LT@p@ftn=\toks27
))
Package hyperref Info: Option `unicode' set `true' on input line 80.
(/usr/local/texlive/2015/texmf-dist/tex/latex/tasks/tasks.sty
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
Package: l3keys2e 2014/11/25 v5471 LaTeX2e option processing using LaTeX3 keys
)
Package: tasks 2014/07/29 v0.10a Horizontal columned lists.
(/usr/local/texlive/2015/texmf-dist/tex/latex/eepic/epic.sty
Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986
\@@multicnt=\count307
\d@lta=\count308
\@delta=\dimen267
\@@delta=\dimen268
\@gridcnt=\count309
\@joinkind=\count310
\@dotgap=\dimen269
\@ddotgap=\dimen270
\@x@diff=\count311
\@y@diff=\count312
\x@diff=\dimen271
\y@diff=\dimen272
\@dotbox=\box262
\num@segments=\count313
\num@segmentsi=\count314
\@datafile=\read3
) (/usr/local/texlive/2015/texmf-dist/tex/latex/cntformats/cntformats.sty
Package: cntformats 2014/07/20 v0.7 A different way to read counters. (CN)
(/usr/local/texlive/2015/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2015/05/04 v2.2 e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count315
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/cnltx/cnltx-base.sty
Package: cnltx-base 2015/01/11 v0.12 LaTeX tools and documenting facilities (CN)
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgfopts/pgfopts.sty
Package: pgfopts 2014/07/10 v2.1a LaTeX package options with pgfkeys
(/usr/local/texlive/2015/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
\pgfkeys@pathtoks=\toks28
\pgfkeys@temptoks=\toks29
(/usr/local/texlive/2015/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c
ode.tex
\pgfkeys@tmptoks=\toks30
)))
\pgfopts@list@add@a@toks=\toks31
\pgfopts@list@add@b@toks=\toks32
)
\c@cnltx@tmpa=\count316
\c@cnltx@tmpb=\count317
\c@cnltx@tmpc=\count318
\cnltx@tmpa@length=\skip271
\cnltx@tmpb@length=\skip272
\cnltx@tmpc@length=\skip273
(/usr/local/texlive/2015/texmf-dist/tex/latex/trimspaces/trimspaces.sty
Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st
y
Package: xtemplate 2014/11/25 v5471 L3 Experimental prototype document functions
\l__xtemplate_tmp_dim=\dimen273
\l__xtemplate_tmp_int=\count319
\l__xtemplate_tmp_muskip=\muskip17
\l__xtemplate_tmp_skip=\skip274
Variant \prop_get:NoNTF already defined; not changing it on line 106
Variant \prop_get:NoNT already defined; not changing it on line 107
Variant \prop_get:NoNF already defined; not changing it on line 108
) (/usr/local/texlive/2015/texmf-dist/tex/latex/environ/environ.sty
Package: environ 2014/05/04 v0.3 A new way to define environments
\@envbody=\toks33
)
\l__tasks_depth_int=\count320
\g__tasks_int=\count321
\g__tasks_total_items_int=\count322
\l__tasks_columns_int=\count323
\l__tasks_rows_int=\count324
\g__tasks_current_col_num_int=\count325
\g__tasks_current_row_num_int=\count326
\l__tasks_item_columns_int=\count327
\l__tasks_item_indent_dim=\dimen274
\l__tasks_item_default_indent_dim=\dimen275
\l__tasks_item_width_dim=\dimen276
\l__tasks_label_width_dim=\dimen277
\l__tasks_label_default_width_dim=\dimen278
\l__tasks_label_offset_dim=\dimen279
\l__tasks_label_default_offset_dim=\dimen280
\l__tasks_column_sep_dim=\dimen281
\l__tasks_after_item_skip=\skip275
\l__tasks_custom_after_item_skip=\skip276
\l__tasks_before_list_skip=\skip277
\l__tasks_after_list_skip=\skip278
\l__tasks_item_coffin=\box263
\l__tasks_label_coffin=\box264
\c@task=\count328
\l__tasks_tmpa_int=\count329
\l__tasks_tmpb_int=\count330
\l__tasks_tmpa_coffin=\box265
.................................................
. xtemplate info: "declare-object-type"
.
. Declaring object type 'tasks' taking 3 argument(s) on line 377.
.................................................
\l__tasks_choice_width_dim=\dimen282
\l__tasks_choice_linewidth_dim=\dimen283
\l__tasks_choice_checkwidth_dim=\dimen284
\l__tasks_choice_raise_dim=\dimen285
.................................................
. LaTeX info: "xparse/define-command"
.
. Defining command \startnewitemline with sig. '' on line 670.
.................................................
.................................................
. LaTeX info: "xparse/define-command"
.
. Defining command \NewTasks with sig. 'O{}mO{\task }D(){1}' on line 679.
.................................................
.................................................
. LaTeX info: "xparse/define-command"
.
. Defining command \RenewTasks with sig. 'O{}mO{\task }D(){1}' on line 686.
.................................................
.................................................
. LaTeX info: "xparse/define-environment"
.
. Defining environment 'tasks' with sig. 'O{}D(){1}' on line 694.
.................................................
(/usr/local/texlive/2015/texmf-dist/tex/latex/tasks/tasks.cfg
File: tasks.cfg 2014/07/29 v0.10a tasks instances
)
.................................................
. LaTeX info: "xparse/define-command"
.
. Defining command \settasks with sig. 'm' on line 710.
.................................................
)
Package hyperref Info: Option `unicode' set `true' on input line 83.
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/puenc.def
File: puenc.def 2012/11/06 v6.83m Hyperref: PDF Unicode definition (HO)
@@ -1092,44 +1232,44 @@ File: puenc.def 2012/11/06 v6.83m Hyperref: PDF Unicode definition (HO)
(./romapidoc.aux)
\openout1 = romapidoc.aux
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for EU2/lmr/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for T3/cmr/m/n on input line 84.
LaTeX Font Info: Try loading font information for T3+cmr on input line 84.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for EU2/lmr/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for T3/cmr/m/n on input line 87.
LaTeX Font Info: Try loading font information for T3+cmr on input line 87.
(/usr/local/texlive/2015/texmf-dist/tex/latex/tipa/t3cmr.fd
File: t3cmr.fd 2001/12/31 TIPA font definitions
)
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 84.
LaTeX Font Info: ... okay on input line 84.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
LaTeX Font Info: Checking defaults for PU/pdf/m/n on input line 87.
LaTeX Font Info: ... okay on input line 87.
(/usr/local/texlive/2015/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count307
\scratchdimen=\dimen267
\scratchbox=\box262
\nofMPsegments=\count308
\nofMParguments=\count309
\everyMPshowfont=\toks28
\MPscratchCnt=\count310
\MPscratchDim=\dimen268
\MPnumerator=\count311
\makeMPintoPDFobject=\count312
\everyMPtoPDFconversion=\toks29
\scratchcounter=\count331
\scratchdimen=\dimen286
\scratchbox=\box266
\nofMPsegments=\count332
\nofMParguments=\count333
\everyMPshowfont=\toks34
\MPscratchCnt=\count334
\MPscratchDim=\dimen287
\MPnumerator=\count335
\makeMPintoPDFobject=\count336
\everyMPtoPDFconversion=\toks35
) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf
@@ -1151,64 +1291,64 @@ File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
.................................................
\symlegacymaths=\mathgroup4
LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold'
(Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 84.
LaTeX Font Info: Redeclaring math accent \acute on input line 84.
LaTeX Font Info: Redeclaring math accent \grave on input line 84.
LaTeX Font Info: Redeclaring math accent \ddot on input line 84.
LaTeX Font Info: Redeclaring math accent \tilde on input line 84.
LaTeX Font Info: Redeclaring math accent \bar on input line 84.
LaTeX Font Info: Redeclaring math accent \breve on input line 84.
LaTeX Font Info: Redeclaring math accent \check on input line 84.
LaTeX Font Info: Redeclaring math accent \hat on input line 84.
LaTeX Font Info: Redeclaring math accent \dot on input line 84.
LaTeX Font Info: Redeclaring math accent \mathring on input line 84.
LaTeX Font Info: Redeclaring math symbol \colon on input line 84.
LaTeX Font Info: Redeclaring math symbol \Gamma on input line 84.
LaTeX Font Info: Redeclaring math symbol \Delta on input line 84.
LaTeX Font Info: Redeclaring math symbol \Theta on input line 84.
LaTeX Font Info: Redeclaring math symbol \Lambda on input line 84.
LaTeX Font Info: Redeclaring math symbol \Xi on input line 84.
LaTeX Font Info: Redeclaring math symbol \Pi on input line 84.
LaTeX Font Info: Redeclaring math symbol \Sigma on input line 84.
LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 84.
LaTeX Font Info: Redeclaring math symbol \Phi on input line 84.
LaTeX Font Info: Redeclaring math symbol \Psi on input line 84.
LaTeX Font Info: Redeclaring math symbol \Omega on input line 84.
LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 84.
LaTeX Font Info: Redeclaring symbol font `operators' on input line 84.
(Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 87.
LaTeX Font Info: Redeclaring math accent \acute on input line 87.
LaTeX Font Info: Redeclaring math accent \grave on input line 87.
LaTeX Font Info: Redeclaring math accent \ddot on input line 87.
LaTeX Font Info: Redeclaring math accent \tilde on input line 87.
LaTeX Font Info: Redeclaring math accent \bar on input line 87.
LaTeX Font Info: Redeclaring math accent \breve on input line 87.
LaTeX Font Info: Redeclaring math accent \check on input line 87.
LaTeX Font Info: Redeclaring math accent \hat on input line 87.
LaTeX Font Info: Redeclaring math accent \dot on input line 87.
LaTeX Font Info: Redeclaring math accent \mathring on input line 87.
LaTeX Font Info: Redeclaring math symbol \colon on input line 87.
LaTeX Font Info: Redeclaring math symbol \Gamma on input line 87.
LaTeX Font Info: Redeclaring math symbol \Delta on input line 87.
LaTeX Font Info: Redeclaring math symbol \Theta on input line 87.
LaTeX Font Info: Redeclaring math symbol \Lambda on input line 87.
LaTeX Font Info: Redeclaring math symbol \Xi on input line 87.
LaTeX Font Info: Redeclaring math symbol \Pi on input line 87.
LaTeX Font Info: Redeclaring math symbol \Sigma on input line 87.
LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 87.
LaTeX Font Info: Redeclaring math symbol \Phi on input line 87.
LaTeX Font Info: Redeclaring math symbol \Psi on input line 87.
LaTeX Font Info: Redeclaring math symbol \Omega on input line 87.
LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 87.
LaTeX Font Info: Redeclaring symbol font `operators' on input line 87.
LaTeX Font Info: Encoding `OT1' has changed to `EU2' for symbol font
(Font) `operators' in the math version `normal' on input line 84.
(Font) `operators' in the math version `normal' on input line 87.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> EU2/MyriadPro(0)/m/n on input line 84.
(Font) OT1/cmr/m/n --> EU2/MyriadPro(0)/m/n on input line 87.
LaTeX Font Info: Encoding `OT1' has changed to `EU2' for symbol font
(Font) `operators' in the math version `bold' on input line 84.
(Font) `operators' in the math version `bold' on input line 87.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> EU2/MyriadPro(0)/m/n on input line 84.
(Font) OT1/cmr/bx/n --> EU2/MyriadPro(0)/m/n on input line 87.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) EU2/MyriadPro(0)/m/n --> EU2/MyriadPro(0)/m/n on input l
ine 84.
ine 87.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> EU2/MyriadPro(0)/m/it on input line 84.
(Font) OT1/cmr/m/it --> EU2/MyriadPro(0)/m/it on input line 87.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> EU2/MyriadPro(0)/bx/n on input line 84.
(Font) OT1/cmr/bx/n --> EU2/MyriadPro(0)/bx/n on input line 87.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> EU2/lmss/m/n on input line 84.
(Font) OT1/cmss/m/n --> EU2/lmss/m/n on input line 87.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> EU2/lmtt/m/n on input line 84.
(Font) OT1/cmtt/m/n --> EU2/lmtt/m/n on input line 87.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) EU2/MyriadPro(0)/m/n --> EU2/MyriadPro(0)/bx/n on input
line 84.
line 87.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> EU2/MyriadPro(0)/bx/it on input line 8
4.
7.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> EU2/lmss/bx/n on input line 84.
(Font) OT1/cmss/bx/n --> EU2/lmss/bx/n on input line 87.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> EU2/lmtt/bx/n on input line 84.
\AtBeginShipoutBox=\box263
Package hyperref Info: Link coloring OFF on input line 84.
(Font) OT1/cmtt/m/n --> EU2/lmtt/bx/n on input line 87.
\AtBeginShipoutBox=\box267
Package hyperref Info: Link coloring OFF on input line 87.
(/usr/local/texlive/2015/texmf-dist/tex/latex/hyperref/nameref.sty
Package: nameref 2012/10/27 v2.43 Cross-referencing by name of section
@@ -1216,14 +1356,14 @@ Package: nameref 2012/10/27 v2.43 Cross-referencing by name of section
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
Package: gettitlestring 2010/12/03 v1.4 Cleanup title references (HO)
)
\c@section@level=\count313
\c@section@level=\count337
)
Redoing nameref's sectioning
Redoing nameref's label
LaTeX Info: Redefining \nameref on input line 84.
LaTeX Info: Redefining \ref on input line 84.
LaTeX Info: Redefining \pageref on input line 84.
LaTeX Info: Redefining \nameref on input line 84.
LaTeX Info: Redefining \nameref on input line 87.
LaTeX Info: Redefining \ref on input line 87.
LaTeX Info: Redefining \pageref on input line 87.
LaTeX Info: Redefining \nameref on input line 87.
(./romapidoc.out) (./romapidoc.out)
\@outlinefile=\write4
@@ -1235,11 +1375,11 @@ luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Regular.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Regular.otf"
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <10.95> on input line 86.
(Font) <10.95> on input line 89.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 86.
(Font) <8> on input line 89.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 86.
(Font) <6> on input line 89.
[1
{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] [2
@@ -1262,218 +1402,295 @@ luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Regular.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf" [5]
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Regular.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf"
(./api_filesystem.tex
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf"
Underfull \hbox (badness 2735) in paragraph at lines 138--138
Underfull \hbox (badness 2735) in paragraph at lines 40--40
[][]|\EU2/MyriadPro(0)/m/n/10 Moves the di-rec-tory to the
[]
Underfull \hbox (badness 1655) in paragraph at lines 138--138
Underfull \hbox (badness 1655) in paragraph at lines 40--40
\EU2/MyriadPro(0)/m/n/10 des-ti-na-tion. Sub-di-rec-to-ries /
[]
Underfull \hbox (badness 2150) in paragraph at lines 138--138
Underfull \hbox (badness 2150) in paragraph at lines 40--40
[][]|\EU2/MyriadPro(0)/m/n/10 Copies the di-rec-tory to the
[]
Underfull \hbox (badness 1655) in paragraph at lines 138--138
Underfull \hbox (badness 1655) in paragraph at lines 40--40
\EU2/MyriadPro(0)/m/n/10 des-ti-na-tion. Sub-di-rec-to-ries /
[]
LaTeX Font Info: Font shape `EU2/MyriadPro(0)/m/sl' in size <10> not availabl
e
(Font) Font shape `EU2/MyriadPro(0)/m/it' tried instead on input li
ne 138.
ne 40.
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf" [6
] [7] [8]
Underfull \hbox (badness 4792) in paragraph at lines 188--188
] [7]) [8] (./api_hexutils.tex
Underfull \hbox (badness 4792) in paragraph at lines 10--10
[][]|\EU2/MyriadPro(0)/m/n/10 Con-verts byte ar-ray to the
[]
[9
) [9
]
Underfull \hbox (badness 3354) in paragraph at lines 212--212
] (./api_input.tex
Underfull \hbox (badness 1515) in paragraph at lines 12--12
\EU2/MyriadPro(0)/m/n/10 By com-bin-ing with and or or
[]
Underfull \hbox (badness 3884) in paragraph at lines 12--12
\EU2/MyriadPro(0)/m/n/10 state-ment, you can in-quire for
[]
) [10
] (./api_keys.tex
Overfull \hbox (3.01012pt too wide) in paragraph at lines 3--4
[][]\EU2/MyriadPro(0)/m/n/10 Notes on com-pat-i-bil-ity with Com-put-er-Craft:
al-though this li-brary is ComputerCraft-
[]
Underfull \hbox (badness 2150) in paragraph at lines 12--12
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns key name cor-re-sponds to
[]
Overfull \hbox (9.77664pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 (\EU2/MyriadPro(0)/m/it/10 zero \EU2/MyriadPro(0)/m
/n/10 to \EU2/MyriadPro(0)/m/it/10 nine\EU2/MyriadPro(0)/m/n/10 )|
[]
Overfull \hbox (1.58002pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 backspace|
[]
Overfull \hbox (2.65999pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 leftBracket|
[]
Overfull \hbox (9.01001pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 rightBracket|
[]
Overfull \hbox (2.23003pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 semiColon|
[]
Overfull \hbox (6.18004pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 apostrophe|
[]
Overfull \hbox (6.32997pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 cimcumflex|
[]
Overfull \hbox (5.03001pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 underscore|
[]
Overfull \hbox (4.14001pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 pageDown|
[]
Overfull \hbox (15.58pt too wide) in paragraph at lines 72--72
[]|\EU2/MyriadPro(0)/m/n/10 leftCommand|
[]
) [11
] (./api_security.tex
Underfull \hbox (badness 3354) in paragraph at lines 20--20
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns SHA-256 hash of in-put
[]
Underfull \hbox (badness 4805) in paragraph at lines 212--212
Underfull \hbox (badness 4805) in paragraph at lines 20--20
[][]|\EU2/MyriadPro(0)/m/n/10 De-codes Base64 string and re-
[]
Underfull \hbox (badness 2707) in paragraph at lines 212--212
Underfull \hbox (badness 2707) in paragraph at lines 20--20
[][]|\EU2/MyriadPro(0)/m/n/10 En-codes in-put string as Base64
[]
[10
) [12
] [11
] (./api_shell.tex) [13
]
Underfull \hbox (badness 2165) in paragraph at lines 292--292
] (./api_terminal.tex
Underfull \hbox (badness 2165) in paragraph at lines 66--66
\EU2/MyriadPro(0)/m/n/10 nal. Graphic ter-mi-nals also can
[]
Underfull \hbox (badness 2932) in paragraph at lines 292--292
Underfull \hbox (badness 2932) in paragraph at lines 66--66
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns \EU2/MyriadPro(0)/bx/n/10 true \EU2/Myri
adPro(0)/m/n/10 if the ter-mi-nal is
[]
Underfull \hbox (badness 2772) in paragraph at lines 292--292
Underfull \hbox (badness 2772) in paragraph at lines 66--66
[][]|\EU2/MyriadPro(0)/m/n/10 Emits \EU2/MyriadPro(0)/bx/n/10 c \EU2/MyriadPro(
0)/m/n/10 into (\EU2/MyriadPro(0)/bx/n/10 x\EU2/MyriadPro(0)/m/n/10 , \EU2/Myri
adPro(0)/bx/n/10 y\EU2/MyriadPro(0)/m/n/10 ), con-trol se-
[]
Underfull \hbox (badness 3118) in paragraph at lines 292--292
Underfull \hbox (badness 3118) in paragraph at lines 66--66
\EU2/MyriadPro(0)/m/n/10 ing con-trol se-quences as sym-
[]
Underfull \hbox (badness 1365) in paragraph at lines 292--292
Underfull \hbox (badness 1365) in paragraph at lines 66--66
[][]|\EU2/MyriadPro(0)/m/n/10 Clears whole screen buffer and
[]
Underfull \hbox (badness 5022) in paragraph at lines 292--292
Underfull \hbox (badness 5022) in paragraph at lines 66--66
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent co-or-di-nates of
[]
Underfull \hbox (badness 10000) in paragraph at lines 292--292
Underfull \hbox (badness 10000) in paragraph at lines 66--66
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent fore-ground
[]
Underfull \hbox (badness 10000) in paragraph at lines 292--292
Underfull \hbox (badness 10000) in paragraph at lines 66--66
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent back-ground
[]
[12
[14
] [13] <mda.pdf, id=157, 597.51233pt x 845.0471pt>
File: mda.pdf Graphic file (type pdf)
<use mda.pdf>
Package pdftex.def Info: mda.pdf used on input line 310.
(pdftex.def) Requested size: 148.4842pt x 210.0pt.
] [15]
\cpimagew=\skip279
<mda.png, id=184, 4625.28pt x 1798.72pt>
File: mda.png Graphic file (type png)
<use mda.png>
Package pdftex.def Info: mda.png used on input line 88.
(pdftex.def) Requested size: 295.0pt x 114.69775pt.
Underfull \vbox (badness 10000) has occurred while \output is active []
[14]
Underfull \hbox (badness 6658) in paragraph at lines 331--331
[16]
Underfull \hbox (badness 6658) in paragraph at lines 109--109
[][]|\EU2/MyriadPro(0)/m/n/10 DEL. Backspace and deletes
[]
[15<./mda.pdf>] [16]
Underfull \hbox (badness 1092) in paragraph at lines 352--352
) [17<./mda.png>] (./luaglobals.tex
Underfull \hbox (badness 1092) in paragraph at lines 14--14
\EU2/MyriadPro(0)/m/n/10 ory in-stalled in the com-puter, in
[]
Underfull \hbox (badness 3019) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Cur-rency sym-bol used in the world.
[]
Underfull \hbox (badness 1888) in paragraph at lines 383--383
Underfull \hbox (badness 10000) in paragraph at lines 51--51
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC1. Used to
[]
Underfull \hbox (badness 1888) in paragraph at lines 383--383
Underfull \hbox (badness 10000) in paragraph at lines 51--51
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC2. Used to
[]
Underfull \hbox (badness 1888) in paragraph at lines 383--383
Underfull \hbox (badness 10000) in paragraph at lines 51--51
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC3. Used to
[]
Underfull \hbox (badness 1888) in paragraph at lines 383--383
Underfull \hbox (badness 10000) in paragraph at lines 51--51
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC4. Used to
[]
Underfull \hbox (badness 4713) in paragraph at lines 383--383
\EU2/MyriadPro(0)/m/n/10 change fore-ground colour to bright
[]
Underfull \hbox (badness 2478) in paragraph at lines 383--383
Underfull \hbox (badness 10000) in paragraph at lines 51--51
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DLE. Used to
[]
[17
] [18]
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf" [19
Underfull \hbox (badness 2781) in paragraph at lines 51--51
\EU2/MyriadPro(0)/m/n/10 change fore-ground colour to ter-mi-nals
[]
] [20
[18
]) [19] (./luadifferences.tex) [20
]
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf" [21
] (./cc_bit.tex) [22
] [21
] [22
] [23
]
(./cc_colors.tex) [23
] [24
] [25] [26
] [25
] [26
] [27] [28
] [29
] [29] (./peri_lp.tex) [30
] [30
] [31
]
[31
] [32
] [33
]
\tf@toc=\write5
\openout5 = romapidoc.toc
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 480.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 480.
(./romapidoc.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 480.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 480.
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 165.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 165.
(./romapidoc.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 165.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 165.
Package rerunfilecheck Info: File `romapidoc.out' has not changed.
(rerunfilecheck) Checksum: 03D8004877E474961620BACB7D2C8DE2;1800.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 480.
(rerunfilecheck) Checksum: A4B98F6CE220B3C970CC4D5ECA7A4CF8;2202.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 165.
)
Here is how much of LuaTeX's memory you used:
25439 strings out of 494693
125006,552014 words of node,token memory allocated
724 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 1 kern, 5 attribute, 140 glue_spec, 5 attri
27266 strings out of 494693
125070,662416 words of node,token memory allocated
778 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 1 kern, 5 attribute, 141 glue_spec, 5 attri
bute_list, 2 write nodes
avail lists: 2:14425,3:272,4:3580,5:1297,6:6112,7:343,8:18,9:884,10:384
28550 multiletter control sequences out of 65536+600000
avail lists: 2:14493,3:271,4:3580,5:1301,6:6145,7:343,8:21,9:884,10:390
30200 multiletter control sequences out of 65536+600000
62 fonts using 5300671 bytes
55i,12n,59p,1189b,492s stack positions out of 5000i,500n,10000p,200000b,100000s
67i,12n,59p,1189b,492s stack positions out of 5000i,500n,10000p,200000b,100000s
</Library/Fonts/MyriadPro-It.otf></Library/Fonts/MyriadPro-Regular.otf></Library
/Fonts/MyriadPro-Bold.otf>
Output written on romapidoc.pdf (31 pages, 201848 bytes).
Output written on romapidoc.pdf (33 pages, 95180 bytes).
PDF statistics: 281 PDF objects out of 1000 (max. 8388607)
235 compressed objects within 3 object streams
76 named destinations out of 1000 (max. 131072)
129 words of extra memory for PDF output out of 10000 (max. 10000000)
PDF statistics: 304 PDF objects out of 1000 (max. 8388607)
255 compressed objects within 3 object streams
85 named destinations out of 1000 (max. 131072)
153 words of extra memory for PDF output out of 10000 (max. 10000000)

View File

@@ -1,16 +1,19 @@
\BOOKMARK [0][-]{chapter.1}{\376\377\000A\000P\000I\000s\000\040\000a\000n\000d\000\040\000L\000i\000b\000r\000a\000r\000i\000e\000s}{}% 1
\BOOKMARK [1][-]{section.1.1}{\376\377\000F\000i\000l\000e\000s\000y\000s\000t\000e\000m}{chapter.1}% 2
\BOOKMARK [1][-]{section.1.2}{\376\377\000H\000e\000x\000u\000t\000i\000l\000s}{chapter.1}% 3
\BOOKMARK [1][-]{section.1.3}{\376\377\000S\000e\000c\000u\000r\000i\000t\000y}{chapter.1}% 4
\BOOKMARK [1][-]{section.1.4}{\376\377\000S\000h\000e\000l\000l}{chapter.1}% 5
\BOOKMARK [1][-]{section.1.5}{\376\377\000T\000e\000r\000m\000i\000n\000a\000l}{chapter.1}% 6
\BOOKMARK [1][-]{section.1.6}{\376\377\000L\000u\000a\000\040\000G\000l\000o\000b\000a\000l\000s}{chapter.1}% 7
\BOOKMARK [0][-]{chapter.2}{\376\377\000C\000o\000m\000p\000a\000t\000i\000b\000i\000l\000i\000t\000y\000\040\000L\000a\000y\000e\000r\000s\040\024\000C\000o\000m\000p\000u\000t\000e\000r\000C\000r\000a\000f\000t}{}% 8
\BOOKMARK [1][-]{section.2.1}{\376\377\000B\000i\000t}{chapter.2}% 9
\BOOKMARK [1][-]{section.2.2}{\376\377\000C\000o\000l\000o\000r\000s}{chapter.2}% 10
\BOOKMARK [1][-]{section.2.3}{\376\377\000T\000e\000r\000m}{chapter.2}% 11
\BOOKMARK [1][-]{section.2.4}{\376\377\000F\000i\000l\000e\000s\000y\000s\000t\000e\000m}{chapter.2}% 12
\BOOKMARK [0][-]{chapter.3}{\376\377\000C\000o\000m\000p\000a\000t\000i\000b\000i\000l\000i\000t\000y\000\040\000L\000a\000y\000e\000r\000s\040\024\000O\000p\000e\000n\000C\000o\000m\000p\000u\000t\000e\000r\000s}{}% 13
\BOOKMARK [0][-]{chapter.4}{\376\377\000P\000e\000r\000i\000p\000h\000e\000r\000a\000l\000s}{}% 14
\BOOKMARK [1][-]{section.4.1}{\376\377\000L\000i\000n\000e\000\040\000P\000r\000i\000n\000t\000e\000r}{chapter.4}% 15
\BOOKMARK [0][-]{chapter.5}{\376\377\000R\000e\000f\000e\000r\000e\000n\000c\000e\000s}{}% 16
\BOOKMARK [1][-]{section.1.3}{\376\377\000I\000n\000p\000u\000t}{chapter.1}% 4
\BOOKMARK [1][-]{section.1.4}{\376\377\000K\000e\000y\000s}{chapter.1}% 5
\BOOKMARK [1][-]{section.1.5}{\376\377\000S\000e\000c\000u\000r\000i\000t\000y}{chapter.1}% 6
\BOOKMARK [1][-]{section.1.6}{\376\377\000S\000h\000e\000l\000l}{chapter.1}% 7
\BOOKMARK [1][-]{section.1.7}{\376\377\000T\000e\000r\000m\000i\000n\000a\000l}{chapter.1}% 8
\BOOKMARK [1][-]{section.1.8}{\376\377\000L\000u\000a\000\040\000G\000l\000o\000b\000a\000l\000s}{chapter.1}% 9
\BOOKMARK [1][-]{section.1.9}{\376\377\000C\000h\000a\000n\000g\000e\000s\000\040\000f\000r\000o\000m\000\040\000G\000e\000n\000e\000r\000i\000c\000\040\000L\000u\000a\000\040\000E\000n\000v\000i\000r\000o\000n\000m\000e\000n\000t}{chapter.1}% 10
\BOOKMARK [0][-]{chapter.2}{\376\377\000C\000o\000m\000p\000a\000t\000i\000b\000i\000l\000i\000t\000y\000\040\000L\000a\000y\000e\000r\000s\040\024\000C\000o\000m\000p\000u\000t\000e\000r\000C\000r\000a\000f\000t}{}% 11
\BOOKMARK [1][-]{section.2.1}{\376\377\000B\000i\000t}{chapter.2}% 12
\BOOKMARK [1][-]{section.2.2}{\376\377\000C\000o\000l\000o\000r\000s}{chapter.2}% 13
\BOOKMARK [1][-]{section.2.3}{\376\377\000T\000e\000r\000m}{chapter.2}% 14
\BOOKMARK [1][-]{section.2.4}{\376\377\000F\000i\000l\000e\000s\000y\000s\000t\000e\000m}{chapter.2}% 15
\BOOKMARK [0][-]{chapter.3}{\376\377\000C\000o\000m\000p\000a\000t\000i\000b\000i\000l\000i\000t\000y\000\040\000L\000a\000y\000e\000r\000s\040\024\000O\000p\000e\000n\000C\000o\000m\000p\000u\000t\000e\000r\000s}{}% 16
\BOOKMARK [0][-]{chapter.4}{\376\377\000P\000e\000r\000i\000p\000h\000e\000r\000a\000l\000s}{}% 17
\BOOKMARK [1][-]{section.4.1}{\376\377\000L\000i\000n\000e\000\040\000P\000r\000i\000n\000t\000e\000r}{chapter.4}% 18
\BOOKMARK [0][-]{chapter.5}{\376\377\000R\000e\000f\000e\000r\000e\000n\000c\000e\000s}{}% 19

Binary file not shown.

View File

@@ -15,6 +15,7 @@
\usepackage{ltablex}
\usepackage{parskip}
\usepackage{tasks}
\frenchspacing
\setlength{\parindent}{0pt}
@@ -22,7 +23,9 @@
\setsecnumdepth{subsection}
%% Idioms %%
\hyphenation{Com-put-er-Craft}
\hyphenation{O-pen-Com-put-ers}
@@ -95,349 +98,47 @@
\chapter{APIs and Libraries}
\section{Filesystem}
The Filesystem API provides functions for manipulating files and the filesystem.
The path for the argument of functions blocks `\,.\,.\,' to be entered, preventing users from access outside of the computer and eliminating the potential of harming the real computer of the innocent players.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
fs.list(\textbf{path}: string) & table & Returns list of files in \textbf{path}, in lua table.
\\ \\
fs.exists(\textbf{path}: string) & bool & Checks if \textbf{path} exists on the filesystem.
\\ \\
fs.isDir(\textbf{path}: string) & bool & Checks if \textbf{path} is a directory.
\\ \\
fs.isFile(\textbf{path}: string) & bool & Checks if \textbf{path} is a file.
\\ \\
fs.isReadOnly(\textbf{path}: string) & bool & Checks if \textbf{path} is read only.
\\ \\
fs.getSize(\textbf{path}: string) & int & Returns a size of the file/directory, in bytes.
\\ \\
fs.mkdir(\textbf{path}: string) & bool & Create a directory to \textbf{path}. Returns \textbf{true} upon success.
\\ \\
fs.mv(\textbf{from}: string, \textbf{dest}: string) & bool & Moves the directory to the destination. Subdirectories / files will also be moved. Returns \textbf{true} upon success.
\\ \\
fs.cp(\textbf{from}: string, \textbf{dest}: string) & bool & Copies the directory to the destination. Subdirectories / files will also be copied. Returns \textbf{true} upon success.
\\ \\
fs.rm(\textbf{path}: string) & bool & Deletes the \textbf{path}. If \textbf{path} is a directory, all its members will also be deleted. Returns \textbf{true} upon success.
\\ \\
fs.concat(\textbf{p1}: string, \textbf{p2}: string) & string & Concatenates two paths and return new path as string.
\\ \\
fs.open(\textbf{path}: string, \textbf{mode}: string) & file & Opens file and returns its handle. See section \emph{File Handler} for details.
\\ \\
fs.parent(\textbf{path}: string) & string & Returs parent directory to the \textbf{path}.
\\ \\
fs.dofile(\textbf{path}: string) & nil & Loads the script on \textbf{path} and executes it.
\\ \\
fs.fetchText(\textbf{path}: string) & string & Opens the file on \textbf{path} and returns its contents as a plain text.
\end{tabularx}
\subsection{File Handler}
When it comes to opening a file, there are six modes available---r, w, a, rb, wb, ab, each represents \textbf{r}ead, \textbf{w}rite, \textbf{a}ppend and \textbf{b}yte.
\begin{tabularx}{\textwidth}{l X}
\textbf{\large Function} & \textbf{\large Description}
\\ \\
\endhead
file.close() & Closes the file. Any data wrote will be actually wrote to disk when this function is called.
\\ \\
file.flush() & (in write/append mode) Flushes the data to the file, keeps the handle available afterwards
\\ \\
\multicolumn{2}{c}{\textbf{Read mode}}
\\ \\
file.readLine() & Reads text from the file line by line. Returns string of line, or \emph{nil} if there is no next line.
\\ \\
file.readAll() & Reads and returns whole text in the file as string.
\\ \\
\multicolumn{2}{c}{\textbf{Read binary mode}}
\\ \\
file.read() & Reads single byte in the file as int, or \emph{-1} if end-of-file is reached.
\\ \\
file.readAll() & Reads and returns whole byte in the file as string.
\\ \\
\multicolumn{2}{c}{\textbf{Write/append mode}}
\\ \\
file.write(string) & Writes \textbf{string} to the file.
\\ \\
file.writeLine(string) & Writes \textbf{string} to the file and append line feed.
\\ \\
\multicolumn{2}{c}{\textbf{Write/append binary mode}}
\\ \\
file.write(int) & Writes \textbf{int} to the file.
\\ \\
file.writeBytes(string) & Writes \textbf{string} to the file and append line feed.
\end{tabularx}
\input{api_filesystem}
\section{Hexutils}
\input{api_hexutils}
The Hexutils library provides utility to convert byte value to hexadecimal string.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
hexutils.toHexString(\textbf{bytes}: string) & string & Converts byte array to the string of its hexadecimal representations.
\end{tabularx}
\section{Input}
\input{api_input}
\section{Keys}
\input{api_keys}
\section{Security}
The Serurity API provides functions for security purposes, such as hashing and CSPRNG\footnote{Cryptographically secure psuedo-random number generator}.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
security.toSHA1(string) & string & Returns SHA-256 hash of input string in array of bytes (as a string)
\\ \\
security.toSHA256(string) & string & Returns SHA-1 hash of input string in array of bytes
\\ \\
security.toMD5(string) & string & Returns MD-5 hash of input string in array of bytes
\\ \\
security.randomBytes(\textbf{len}: int) & string & Returns byte array of random values in desired \textbf{len}gth.
\\ \\
security.decodeBase64(string) & string & Decodes Base64 string and returns the result as string.
\\ \\
security.encodeBase64(string) & string & Encodes input string as Base64 format and returns the result as array of bytes.
\end{tabularx}
\input{api_security}
\section{Shell}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
shell.run(\textbf{path}: string) & nil & Loads the script on \textbf{path} and executes it.
\end{tabularx}
\input{api_shell}
\section{Terminal}
The Terminal API provides functions for sending text to the terminals, and drawing text-mode graphics. The API expects connected terminal to use Codepage 437. See section \emph{Codepage} for details.
\subsection{Functions}
Note: cursor coordinates starts from one, not zero.
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
term.write(string) & nil & Writes string to the current cursor position. Line feed is not appended.
\\ \\
term.print(string) & nil & Writes string to the current cursor position and make a new line.
\\ \\
term.newLine() & nil & Make a new line.
\\ \\
term.moveCursor(\textbf{x}: int) & nil & Moves cursor horizontally, starting from 1.
\\ \\
term.width() & int & Returns the width of the terminal. Graphic terminals also can use this.
\\ \\
term.scroll(\textbf{n}: int) & nil & Make a new line \textbf{n} times.
\\ \\
term.isTeletype() & bool & Returns \textbf{true} if the terminal is teletype.
\\ \\
\multicolumn{3}{c}{\textbf{Graphic terminals only}}
\\ \\
term.emit(\textbf{c}: int, \textbf{x}: int, \textbf{y}: int) & nil & Emits \textbf{c} into (\textbf{x}, \textbf{y}), control sequence will not be processed and printed as symbols instead. Cursor will not be moved.
\\ \\
term.emitRaw(\textbf{bufferChar}: int) & nil & Emits \textbf{bufferChar} into into (\textbf{x}, \textbf{y}). Buffer char means a single character actually stored into the screen buffer, has four bits for back- and foreground colours respectively, and eight bits for a letter.
\\ \\
term.emitString(\textbf{s}, \textbf{x}: int, \textbf{y}: int) & nil & Emits \textbf{s} (a string) into (\textbf{x}, \textbf{y}), printing control sequences as symbols. Cursor will not be moved.
\\ \\
\begin{tabular}[t]{@{}l@{}}term.resetColour()\\term.resetColor()\end{tabular} & nil & Resets any colour changes to the defaults.
\\ \\
term.clear() & nil & Clears whole screen buffer and move cursor to (1, 1)
\\ \\
term.clearLine() & nil & Clears current line on the screen buffer, does not moves cursor.
\\ \\
term.setCursor(\textbf{x}: int, \textbf{y}: int) & nil & Moves cursor to (\textbf{x}, \textbf{y})
\\ \\
term.getCursor() & int, int & Returns current coordinates of the cursor.
\\ \\
term.getX() & int & Returns X coordinate of the cursor.
\\ \\
term.getY() & int & Returns Y coordinate of the cursor.
\\ \\
term.setX(int) & nil & Sets X coordinate of the cursor.
\\ \\
term.setY(int) & nil & Sets Y coordinate of the cursor.
\\ \\
term.setCursorBlink(bool) & nil & Sets cursor blinking. \textbf{true} makes the cursor blink.
\\ \\
term.size() & int, int & Returns width and height of the terminal.
\\ \\
term.height() & int & Returns height of the terminal.
\\ \\
term.isCol() & bool & Returns if the terminal supports colour.
\\ \\
term.setForeCol(\textbf{col}: int) & nil & Sets foreground colour to \textbf{col}
\\ \\
term.setBackCol(\textbf{col}: int) & nil & Sets background colour to \textbf{col}.
\\ \\
term.foreCol() & int & Returns current foreground colour.
\\ \\
term.backCol() & int & Returns current background colour.
\end{tabularx}
\subsection{Standard Colours}
\begin{tabularx}{\textwidth}{c l c l c l c l}
0 & \textcolor{black}{Black} & 1 & White & 2 & \textcolor{dimgrey}{Dim grey} & 3 & \textcolor{brightgrey}{Bright grey}
\\ \\
4 & \textcolor{yellow}{Yellow} & 5 & \textcolor{orange}{Orange} & 6 & \textcolor{red}{Red} & 7 & \textcolor{magenta}{Magenta}
\\ \\
8 & \textcolor{purple}{Purple} & 9 & \textcolor{blue}{Blue} & 10 & \textcolor{cyan}{Cyan} & 11 & \textcolor{lime}{Lime}
\\ \\
12 & \textcolor{green}{Green} & 13 & \textcolor{darkgreen}{Dark green} & 14 & \textcolor{brown}{Brown} & 15 & \textcolor{tan}{Tan}
\end{tabularx}
Non-colour terminals support colour index of 0--3.
\subsection{Codepage}
{\center\includegraphics[height=21em]{mda.pdf}}
Character 0x9D (currency symbol) and 0xFA (middle dot) can be accessed with following Lua constants: \emph{MONEYSYM} and \emph{MIDDOT}.
\subsection{Accepted Control Sequences}
\begin{tabularx}{\textwidth}{c X c X}
\textbf{\large No.} & \textbf{\large Description} & \textbf{\large No.} & \textbf{\large Description}
\\ \\
\endhead
7 & BEL. Emits short beep. & 8 & BS. Moves cursor to left 1 character.
\\ \\
9 & TAB. Inserts appropriate horizontal space. Tab size is variable. & 10 & LF. Prints a new line.
\\ \\
12 & FF. Clears everything in screen buffer and moves cursor to (1, 1) & 13 & CR. Moves x coordinate of cursor to 1.
\\ \\
16 & DLE. Sets foreground colour to the default STDERR colour. & 127 & DEL. Backspace and deletes one character.
\\ \\
17 & DC1. Sets foreground colour to 0. (black) & 18 & DC2. Sets foreground colour to 1. (white)
\\ \\
19 & DC3. Sets foreground colour to 2. (dim grey) & 20 & DC4. Sets foreground colour to 3. (bright grey)
\end{tabularx}
\input{api_terminal}
\section{Lua Globals}
\input{luaglobals}
ROMBASIC adds global functions and constants for operability.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
\unemph{\_G.}runScript(\textbf{fun}: str, \textbf{env}: str) & nil & Runs Lua script \textbf{fun} with the environment tag \textbf{env}.
\\ \\
\unemph{\_G.}getMem() & int & Returns the current memory usage in bytes.
\\ \\
\unemph{\_G.}getTotalMem() & int & Returns the total size of the memory installed in the computer, in bytes.
\\ \\
\unemph{\_G.}getFreeMem() & int & Returns the amount of free memory on the computer.
\end{tabularx}
\subsection{Constants}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Name} & \textbf{\large Type} & \textbf{\large Description}
\\ \\
\endhead
\unemph{\_G.}MONEYSYM & string & Currency symbol used in the world. Code 0x9D
\\ \\
\unemph{\_G.}MIDDOT & string & Middle dot used in typography. Code 0xFA (note: 0xF9 is a Dot Product used in Mathematics)
\\ \\
\unemph{\_G.}DC1 & string & Ascii control sequence DC1. Used to change foreground colour to black.
\\ \\
\unemph{\_G.}DC2 & string & Ascii control sequence DC2. Used to change foreground colour to white.
\\ \\
\unemph{\_G.}DC3 & string & Ascii control sequence DC3. Used to change foreground colour to dim grey.
\\ \\
\unemph{\_G.}DC4 & string & Ascii control sequence DC4. Used to change foreground colour to bright grey.
\\ \\
\unemph{\_G.}DLE & string & Ascii control sequence DLE. Used to change foreground colour to terminal's default error text colour.
\\ \\
\_COMPUTER.prompt & string & Default text for prompt input indicator.
\\ \\
\_COMPUTER.verbose & bool & Sets whether print debug information to the console.
\\ \\
\_COMPUTER.loadedCLayer & table & List of names of compatibility layers has been loaded.
\\ \\
\_COMPUTER.bootloader & string & Path to the boot file. Should point to the EFI (/boot/efi).
\\ \\
\_COMPUTER.OEM & string & Manufacturer of the computer. If you \emph{are} a manufacturer, you may want to fill in this variable with your own company's name.
\end{tabularx}
\section{Changes from Generic Lua Environment}
\input{luadifferences}
\chapter[Compatibility Layers---ComputerCraft]{{\LARGE Compatibility Layers} \\ ComputerCraft}
\section{Bit}
The Bit API is for manipulating numbers using bitwise binary operations. The ROMBASIC already comes with Lua's bit32 library so make sure to use that for your casual usage.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l X}
\textbf{\large Function} & \textbf{\large Notes}
\\ \\
\endhead
bit.blshift(n, bits) & Alias of bit32.lshift(n, bits)
\\ \\
bit.brshift(n, bits) & Alias of bit32.arshift(n, bits)
\\ \\
bit.blogic\_rshift(n, bits) & Alias of bit32.brshift(n, bits)
\\ \\
bit.bxor(m, n) & Alias of bit32.bxor(m, n)
\\ \\
bit.bor(m, n) & Alias of bit32.bor(m, n)
\\ \\
bit.band(m, n) & Alias of bit32.band(m, n)
\\ \\
bit.bnot(n) & Alias of bit32.bnot(n)
\end{tabularx}
\input{cc_bit}
\section{Colors}
The Colors API allows you to manipulate sets of colors. This is useful in colors on Advanced Computers and Advanced Monitors. British spellings are also supported.
\subsection{Constants}
When the colours are used in ComputerCraft's Term API, nearest console colours will be used. Below is the table of colours coded with their substitutions.
\begin{tabularx}{\textwidth}{l l l l}
colors.white & colors.\textcolor{orange}{orange} & colors.\textcolor{magenta}{magenta} & colors.\textcolor{cyan}{lightBlue}
\\ \\
colors.\textcolor{yellow}{yellow} & colors.\textcolor{lime}{lime} & colors.\textcolor{tan}{pink} & colors.\textcolor{dimgrey}{gray}
\\ \\
colors.\textcolor{brightgrey}{lightGray} & colors.\textcolor{cyan}{cyan} & colors.\textcolor{purple}{purple} & colors.\textcolor{blue}{blue}
\\ \\
colors.\textcolor{brown}{brown} & colors.\textcolor{green}{green} & colors.\textcolor{red}{red} & colors.\textcolor{black}{black}
\end{tabularx}
Note that pink is understood as \textcolor{tan}{tan} when it is used, lightBlue and cyan are merged to \textcolor{cyan}{cyan}.
\subsection{Functions}
All three functions are not supported, as there is no bundled cable thus there is no use of them.
\input{cc_colors}
\section{Term}
\section{Filesystem}
\chapter[Compatibility Layers---OpenComputers]{{\LARGE Compatibility Layers} \\ OpenComputers}
@@ -445,25 +146,9 @@ All three functions are not supported, as there is no bundled cable thus there i
\chapter{Peripherals}
\section{Line Printer}
\input{peri_lp}
The line printer is a printer that operates on line basis. It only prints text in line-by-line, hence the name, on almost endlessly long roll of papers; it has no notion of page, it just prints. If you want some pages to keep, you must tear them out yourself.
Line printers do not work indefinitely; ignoring the obvious depletion of ink, belt for loading paper will be out of service on about 50 000 lines of printing, give or take a few, or paper will jam if the printer had struck with the unluckiness.
\subsection{Functions}
\begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\
\endhead
lp.print(string) & nil & Prints a line of string.
\\ \\
lp.scroll(\textbf{n}: int) & nil & Scrolls the paper by \textbf{n} lines.
\\ \\
lp.status() & int & Returns a status of the line printer.
\\ \\
lp.reset() & nil & Resets the line printer.
\end{tabularx}
\chapter{References}

View File

@@ -4,27 +4,32 @@
\contentsline {subsection}{\numberline {1.1.2}File Handler}{7}{subsection.1.1.2}
\contentsline {section}{\numberline {1.2}Hexutils}{9}{section.1.2}
\contentsline {subsection}{\numberline {1.2.1}Functions}{9}{subsection.1.2.1}
\contentsline {section}{\numberline {1.3}Security}{10}{section.1.3}
\contentsline {section}{\numberline {1.3}Input}{10}{section.1.3}
\contentsline {subsection}{\numberline {1.3.1}Functions}{10}{subsection.1.3.1}
\contentsline {section}{\numberline {1.4}Shell}{11}{section.1.4}
\contentsline {section}{\numberline {1.5}Terminal}{12}{section.1.5}
\contentsline {section}{\numberline {1.4}Keys}{11}{section.1.4}
\contentsline {subsection}{\numberline {1.4.1}Accepted Key Names}{11}{subsection.1.4.1}
\contentsline {section}{\numberline {1.5}Security}{12}{section.1.5}
\contentsline {subsection}{\numberline {1.5.1}Functions}{12}{subsection.1.5.1}
\contentsline {subsection}{\numberline {1.5.2}Standard Colours}{14}{subsection.1.5.2}
\contentsline {subsection}{\numberline {1.5.3}Codepage}{15}{subsection.1.5.3}
\contentsline {subsection}{\numberline {1.5.4}Accepted Control Sequences}{15}{subsection.1.5.4}
\contentsline {section}{\numberline {1.6}Lua Globals}{17}{section.1.6}
\contentsline {subsection}{\numberline {1.6.1}Functions}{17}{subsection.1.6.1}
\contentsline {subsection}{\numberline {1.6.2}Constants}{17}{subsection.1.6.2}
\contentsline {chapter}{\chapternumberline {2}Compatibility Layers---ComputerCraft}{19}{chapter.2}
\contentsline {section}{\numberline {2.1}Bit}{20}{section.2.1}
\contentsline {subsection}{\numberline {2.1.1}Functions}{20}{subsection.2.1.1}
\contentsline {section}{\numberline {2.2}Colors}{21}{section.2.2}
\contentsline {subsection}{\numberline {2.2.1}Constants}{21}{subsection.2.2.1}
\contentsline {subsection}{\numberline {2.2.2}Functions}{21}{subsection.2.2.2}
\contentsline {section}{\numberline {2.3}Term}{22}{section.2.3}
\contentsline {section}{\numberline {2.4}Filesystem}{23}{section.2.4}
\contentsline {chapter}{\chapternumberline {3}Compatibility Layers---OpenComputers}{25}{chapter.3}
\contentsline {chapter}{\chapternumberline {4}Peripherals}{27}{chapter.4}
\contentsline {section}{\numberline {4.1}Line Printer}{28}{section.4.1}
\contentsline {subsection}{\numberline {4.1.1}Functions}{28}{subsection.4.1.1}
\contentsline {chapter}{\chapternumberline {5}References}{29}{chapter.5}
\contentsline {section}{\numberline {1.6}Shell}{13}{section.1.6}
\contentsline {section}{\numberline {1.7}Terminal}{14}{section.1.7}
\contentsline {subsection}{\numberline {1.7.1}Functions}{14}{subsection.1.7.1}
\contentsline {subsection}{\numberline {1.7.2}Standard Colours}{16}{subsection.1.7.2}
\contentsline {subsection}{\numberline {1.7.3}Codepage}{17}{subsection.1.7.3}
\contentsline {subsection}{\numberline {1.7.4}Accepted Control Sequences}{17}{subsection.1.7.4}
\contentsline {section}{\numberline {1.8}Lua Globals}{18}{section.1.8}
\contentsline {subsection}{\numberline {1.8.1}Functions}{18}{subsection.1.8.1}
\contentsline {subsection}{\numberline {1.8.2}Constants}{18}{subsection.1.8.2}
\contentsline {section}{\numberline {1.9}Changes from Generic Lua Environment}{20}{section.1.9}
\contentsline {chapter}{\chapternumberline {2}Compatibility Layers---ComputerCraft}{21}{chapter.2}
\contentsline {section}{\numberline {2.1}Bit}{22}{section.2.1}
\contentsline {subsection}{\numberline {2.1.1}Functions}{22}{subsection.2.1.1}
\contentsline {section}{\numberline {2.2}Colors}{23}{section.2.2}
\contentsline {subsection}{\numberline {2.2.1}Constants}{23}{subsection.2.2.1}
\contentsline {subsection}{\numberline {2.2.2}Functions}{23}{subsection.2.2.2}
\contentsline {section}{\numberline {2.3}Term}{24}{section.2.3}
\contentsline {section}{\numberline {2.4}Filesystem}{25}{section.2.4}
\contentsline {chapter}{\chapternumberline {3}Compatibility Layers---OpenComputers}{27}{chapter.3}
\contentsline {chapter}{\chapternumberline {4}Peripherals}{29}{chapter.4}
\contentsline {section}{\numberline {4.1}Line Printer}{30}{section.4.1}
\contentsline {subsection}{\numberline {4.1.1}Functions}{30}{subsection.4.1.1}
\contentsline {chapter}{\chapternumberline {5}References}{31}{chapter.5}