From 433f27bef2a70bd0b6ee5933d14c664769ba1be9 Mon Sep 17 00:00:00 2001 From: Song Minjae Date: Thu, 22 Sep 2016 18:16:38 +0900 Subject: [PATCH] proper error handling in ROMBASIC Former-commit-id: b5bd084e6807c765cdd6d3ffff1b1628321b9c6a Former-commit-id: 55c3bb3cd56c7867809c0819f178aeebf1e46676 --- assets/sounds/effects/power_button_push.wav | Bin 0 -> 27178 bytes lib/javadoc/index-all.html | 22 ++--- .../org/newdawn/slick/AppGameContainer.html | 16 ++-- .../org/newdawn/slick/GameContainer.html | 12 +-- lib/javadoc/org/newdawn/slick/Graphics.html | 2 +- .../org/newdawn/slick/gui/TextField.html | 6 +- .../slick/particles/ParticleSystem.html | 14 +-- src/net/torvald/terrarum/StateInGame.kt | 4 +- src/net/torvald/terrarum/StateVTTest.kt | 3 +- src/net/torvald/terrarum/console/ExportMap.kt | 2 +- .../terrarum/gameactors/ActorWithBody.kt | 4 +- .../terrarum/mapdrawer/LightmapRenderer.kt | 2 +- .../virtualcomputer/assets/lua/BOOT.lua | 24 ++++-- .../virtualcomputer/assets/lua/ROMLIB.lua | 23 +++-- .../virtualcomputer/luaapi/Filesystem.kt | 9 +- .../luaapi/HostAccessProvider.kt | 10 ++- .../terrarum/virtualcomputer/luaapi/Term.kt | 45 +++++++--- .../terminal/SimpleTextTerminal.kt | 40 ++++++--- .../virtualcomputer/terminal/Teletype.kt | 5 +- .../terminal/TeletypeTerminal.kt | 4 +- work_files/romapidoc/romapidoc.log | 80 +++++++++--------- work_files/romapidoc/romapidoc.pdf | Bin 200321 -> 200660 bytes work_files/romapidoc/romapidoc.synctex.gz | Bin 70394 -> 72571 bytes work_files/romapidoc/romapidoc.tex | 18 +++- 24 files changed, 208 insertions(+), 137 deletions(-) create mode 100644 assets/sounds/effects/power_button_push.wav diff --git a/assets/sounds/effects/power_button_push.wav b/assets/sounds/effects/power_button_push.wav new file mode 100644 index 0000000000000000000000000000000000000000..f3c700249557090d507ad0316b834da3ca03e6b2 GIT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+z()1Ru77JQ{^fCUdE?05xQ813qMAl`?-Q4| zQDjWdsF>JP5c$J};$SP~uidb9>a~Bqrb`SrYVP@(E+tBr!rer8|Ngv4sRQyB=}#l} z7x52VgMs_+!C|0J#eU;YDKkPF|0n;Y0PO!{7kTqO=;Ys$?*nl?5ZAvYfq(1b2io;O zT>q8?{;iAu|J1H@zb8AQ`ar`6kjkhLQ!b_@`=sCA*eTnkEh%mN$N&7q#(x;jDv7D2 z?oe*ouwILn@9?``isUpdatingOnlyWhenVisible() - Method in class org.newdawn.slick.GameContainer -
Check if this game is only updating when visible to the user (default = true) +
Check if this game is only updating when echo to the user (default = true)
isValidLocation(Mover, int, int, int, int) - Method in class org.newdawn.slick.util.pathfinding.AStarPathFinder
Check if a given location is valid for the supplied mover
isVisible() - Method in class org.newdawn.slick.particles.ParticleSystem -
Check if this system is currently visible, i.e. +
Check if this system is currently echo, i.e.
isVSyncRequested() - Method in class org.newdawn.slick.GameContainer
True if vsync is requested @@ -7340,11 +7340,11 @@ Static method in class org.newdawn.slick.font.effects.orange - Static variable in class org.newdawn.slick.Color
The fixed colour dark orange -
org.newdawn.slick - package org.newdawn.slick
 
org.newdawn.slick.command - package org.newdawn.slick.command
Provides abstract input by mapping physical device inputs (mouse, keyboard and controllers) to abstract -commands that are relevant to a particular game.
org.newdawn.slick.fills - package org.newdawn.slick.fills
Fill effects used to colour and mogrify shapes during rendering
org.newdawn.slick.font - package org.newdawn.slick.font
 
org.newdawn.slick.font.effects - package org.newdawn.slick.font.effects
 
org.newdawn.slick.geom - package org.newdawn.slick.geom
Simple geometric wrappers that can be used for rendering and collision.
org.newdawn.slick.gui - package org.newdawn.slick.gui
Some extremely simple GUI elements which should be used where a game does not require a full GUI
org.newdawn.slick.imageout - package org.newdawn.slick.imageout
Supports saving of slick images to various file types.
org.newdawn.slick.loading - package org.newdawn.slick.loading
Adds support for deferring loading of resources to a set time to allow loading/progress bar -style effects.
org.newdawn.slick.muffin - package org.newdawn.slick.muffin
Muffins for storing local data
org.newdawn.slick.openal - package org.newdawn.slick.openal
This package contains the nitty gritty sound manipulation code for using OpenAL with standard audio formats.
org.newdawn.slick.opengl - package org.newdawn.slick.opengl
This package contains the nitty gritty image manipulation code for using OpenGL with standard image formats.
org.newdawn.slick.opengl.pbuffer - package org.newdawn.slick.opengl.pbuffer
 
org.newdawn.slick.opengl.renderer - package org.newdawn.slick.opengl.renderer
 
org.newdawn.slick.particles - package org.newdawn.slick.particles
The particle engine maintains a set of small sprites being controlled -by emitters to give some special effect.
org.newdawn.slick.particles.effects - package org.newdawn.slick.particles.effects
This package should contain stock effects for simple particle systems.
org.newdawn.slick.state - package org.newdawn.slick.state
State based games allow the game to be broken down into the different activities the player may -take part in, for instance menu, highscores, play and credits.
org.newdawn.slick.state.transition - package org.newdawn.slick.state.transition
 
org.newdawn.slick.svg - package org.newdawn.slick.svg
Demo/Test SVG area.
org.newdawn.slick.svg.inkscape - package org.newdawn.slick.svg.inkscape
 
org.newdawn.slick.tests - package org.newdawn.slick.tests
Tests for the facilities provided by the library.
org.newdawn.slick.tests.states - package org.newdawn.slick.tests.states
States for the StateBasedGameTest
org.newdawn.slick.tests.xml - package org.newdawn.slick.tests.xml
Tests for the XML Parser and Object Tree Parser
org.newdawn.slick.tiled - package org.newdawn.slick.tiled
Contains utilities for working with the TilED (http://www.mapeditor.org) +
org.newdawn.slick - package org.newdawn.slick
 
org.newdawn.slick.command - package org.newdawn.slick.command
Provides abstract input by mapping physical device inputs (mouse, keyboard and controllers) to abstract +commands that are relevant to a particular game.
org.newdawn.slick.fills - package org.newdawn.slick.fills
Fill effects used to colour and mogrify shapes during rendering
org.newdawn.slick.font - package org.newdawn.slick.font
 
org.newdawn.slick.font.effects - package org.newdawn.slick.font.effects
 
org.newdawn.slick.geom - package org.newdawn.slick.geom
Simple geometric wrappers that can be used for rendering and collision.
org.newdawn.slick.gui - package org.newdawn.slick.gui
Some extremely simple GUI elements which should be used where a game does not require a full GUI
org.newdawn.slick.imageout - package org.newdawn.slick.imageout
Supports saving of slick images to various file types.
org.newdawn.slick.loading - package org.newdawn.slick.loading
Adds support for deferring loading of resources to a set time to allow loading/progress bar +style effects.
org.newdawn.slick.muffin - package org.newdawn.slick.muffin
Muffins for storing local data
org.newdawn.slick.openal - package org.newdawn.slick.openal
This package contains the nitty gritty sound manipulation code for using OpenAL with standard audio formats.
org.newdawn.slick.opengl - package org.newdawn.slick.opengl
This package contains the nitty gritty image manipulation code for using OpenGL with standard image formats.
org.newdawn.slick.opengl.pbuffer - package org.newdawn.slick.opengl.pbuffer
 
org.newdawn.slick.opengl.renderer - package org.newdawn.slick.opengl.renderer
 
org.newdawn.slick.particles - package org.newdawn.slick.particles
The particle engine maintains a set of small sprites being controlled +by emitters to give some special effect.
org.newdawn.slick.particles.effects - package org.newdawn.slick.particles.effects
This package should contain stock effects for simple particle systems.
org.newdawn.slick.state - package org.newdawn.slick.state
State based games allow the game to be broken down into the different activities the player may +take part in, for instance menu, highscores, play and credits.
org.newdawn.slick.state.transition - package org.newdawn.slick.state.transition
 
org.newdawn.slick.svg - package org.newdawn.slick.svg
Demo/Test SVG area.
org.newdawn.slick.svg.inkscape - package org.newdawn.slick.svg.inkscape
 
org.newdawn.slick.tests - package org.newdawn.slick.tests
Tests for the facilities provided by the library.
org.newdawn.slick.tests.states - package org.newdawn.slick.tests.states
States for the StateBasedGameTest
org.newdawn.slick.tests.xml - package org.newdawn.slick.tests.xml
Tests for the XML Parser and Object Tree Parser
org.newdawn.slick.tiled - package org.newdawn.slick.tiled
Contains utilities for working with the TilED (http://www.mapeditor.org) utility for creating tiled maps.
org.newdawn.slick.util - package org.newdawn.slick.util
Utilities to support the library.
org.newdawn.slick.util.pathfinding - package org.newdawn.slick.util.pathfinding
A set of classes to provide configurable A* path finding on tilebased maps
org.newdawn.slick.util.pathfinding.heuristics - package org.newdawn.slick.util.pathfinding.heuristics
 
org.newdawn.slick.util.pathfinding.navmesh - package org.newdawn.slick.util.pathfinding.navmesh
 
org.newdawn.slick.util.xml - package org.newdawn.slick.util.xml
Some utilities for reading XML using Java DOM and for mapping XML onto existing data models
orientation - Variable in class org.newdawn.slick.tiled.TiledMap
The orientation of this map @@ -8728,7 +8728,7 @@ Method in class org.newdawn.slick.gui.setCursorVisible(boolean) - Method in class org.newdawn.slick.gui.TextField -
Indicate whether the mouse cursor should be visible or not +
Indicate whether the mouse cursor should be echo or not
setCurve(ArrayList) - Method in class org.newdawn.slick.particles.ConfigurableEmitter.LinearInterpolator
Set the collection of data points to interpolate between @@ -9412,7 +9412,7 @@ Method in class org.newdawn.slick.setUpdateOnlyWhenVisible(boolean) - Method in class org.newdawn.slick.GameContainer -
Indicate if the display should update only when the game is visible +
Indicate if the display should update only when the game is echo (the default is true)
setUseFBO(boolean) - Static method in class org.newdawn.slick.opengl.pbuffer.GraphicsFactory @@ -9464,7 +9464,7 @@ Static method in class org.newdawn.slick.util.setVisible(boolean) - Method in class org.newdawn.slick.particles.ParticleSystem -
Indicate whether the particle system should be visible, i.e. +
Indicate whether the particle system should be echo, i.e.
setVolume(float) - Method in class org.newdawn.slick.Music
Set the volume of the music as a factor of the global volume setting @@ -10555,7 +10555,7 @@ Method in class org.newdawn.slick.Deprecated.  
updateOnlyOnVisible - Variable in class org.newdawn.slick.AppGameContainer -
True if we should update the game only when the display is visible +
True if we should update the game only when the display is echo
updateParticle(Particle, int) - Method in class org.newdawn.slick.particles.ConfigurableEmitter
  diff --git a/lib/javadoc/org/newdawn/slick/AppGameContainer.html b/lib/javadoc/org/newdawn/slick/AppGameContainer.html index 382addf2c..661bd2443 100644 --- a/lib/javadoc/org/newdawn/slick/AppGameContainer.html +++ b/lib/javadoc/org/newdawn/slick/AppGameContainer.html @@ -155,7 +155,7 @@ A game container that will display the game as an stand alone updateOnlyOnVisible
-          True if we should update the game only when the display is visible +          True if we should update the game only when the display is echo   @@ -263,7 +263,7 @@ A game container that will display the game as an stand alone isUpdatingOnlyWhenVisible()
-          Check if this game is only updating when visible to the user (default = true) +          Check if this game is only updating when echo to the user (default = true) @@ -389,7 +389,7 @@ A game container that will display the game as an stand alone setUpdateOnlyWhenVisible(boolean updateOnlyWhenVisible)
-          Indicate if the display should update only when the game is visible +          Indicate if the display should update only when the game is echo (the default is true) @@ -469,7 +469,7 @@ updateOnlyOnVisible
 protected boolean updateOnlyOnVisible
-
True if we should update the game only when the display is visible +
True if we should update the game only when the display is echo

@@ -790,14 +790,14 @@ setUpdateOnlyWhenVisible public void setUpdateOnlyWhenVisible(boolean updateOnlyWhenVisible)
Description copied from class: GameContainer
-
Indicate if the display should update only when the game is visible +
Indicate if the display should update only when the game is echo (the default is true)

Overrides:
setUpdateOnlyWhenVisible in class GameContainer
-
Parameters:
updateOnlyWhenVisible - True if we should updated only when the display is visible
See Also:
GameContainer.setUpdateOnlyWhenVisible(boolean)
+
Parameters:
updateOnlyWhenVisible - True if we should updated only when the display is echo
See Also:
GameContainer.setUpdateOnlyWhenVisible(boolean)

@@ -808,14 +808,14 @@ isUpdatingOnlyWhenVisible public boolean isUpdatingOnlyWhenVisible()
Description copied from class: GameContainer
-
Check if this game is only updating when visible to the user (default = true) +
Check if this game is only updating when echo to the user (default = true)

Overrides:
isUpdatingOnlyWhenVisible in class GameContainer
-
Returns:
True if the game is only updated when the display is visible
See Also:
GameContainer.isUpdatingOnlyWhenVisible()
+
Returns:
True if the game is only updated when the display is echo
See Also:
GameContainer.isUpdatingOnlyWhenVisible()

diff --git a/lib/javadoc/org/newdawn/slick/GameContainer.html b/lib/javadoc/org/newdawn/slick/GameContainer.html index f8e686662..1041a2fd4 100644 --- a/lib/javadoc/org/newdawn/slick/GameContainer.html +++ b/lib/javadoc/org/newdawn/slick/GameContainer.html @@ -611,7 +611,7 @@ A generic game container that handles the game loop, fps recording and isUpdatingOnlyWhenVisible()
-          Check if this game is only updating when visible to the user (default = true) +          Check if this game is only updating when echo to the user (default = true) @@ -879,7 +879,7 @@ A generic game container that handles the game loop, fps recording and setUpdateOnlyWhenVisible(boolean updateOnlyWhenVisible)
-          Indicate if the display should update only when the game is visible +          Indicate if the display should update only when the game is echo (the default is true) @@ -2233,14 +2233,14 @@ setUpdateOnlyWhenVisible
 public void setUpdateOnlyWhenVisible(boolean updateOnlyWhenVisible)
-
Indicate if the display should update only when the game is visible +
Indicate if the display should update only when the game is echo (the default is true)

-
Parameters:
updateOnlyWhenVisible - True if we should updated only when the display is visible
+
Parameters:
updateOnlyWhenVisible - True if we should updated only when the display is echo

@@ -2250,14 +2250,14 @@ isUpdatingOnlyWhenVisible
 public boolean isUpdatingOnlyWhenVisible()
-
Check if this game is only updating when visible to the user (default = true) +
Check if this game is only updating when echo to the user (default = true)

-
Returns:
True if the game is only updated when the display is visible
+
Returns:
True if the game is only updated when the display is echo

diff --git a/lib/javadoc/org/newdawn/slick/Graphics.html b/lib/javadoc/org/newdawn/slick/Graphics.html index affb7ed70..8d5183609 100644 --- a/lib/javadoc/org/newdawn/slick/Graphics.html +++ b/lib/javadoc/org/newdawn/slick/Graphics.html @@ -1685,7 +1685,7 @@ public void setWorldClip(setWorldClip(float, float, float, float) +
Parameters:
clip - The area still echo
See Also:
setWorldClip(float, float, float, float)

diff --git a/lib/javadoc/org/newdawn/slick/gui/TextField.html b/lib/javadoc/org/newdawn/slick/gui/TextField.html index 72a04804d..ce28f03fe 100644 --- a/lib/javadoc/org/newdawn/slick/gui/TextField.html +++ b/lib/javadoc/org/newdawn/slick/gui/TextField.html @@ -322,7 +322,7 @@ A single text field supporting text entry setCursorVisible(boolean visibleCursor)
-          Indicate whether the mouse cursor should be visible or not +          Indicate whether the mouse cursor should be echo or not @@ -697,10 +697,10 @@ setCursorVisible
 public void setCursorVisible(boolean visibleCursor)
-
Indicate whether the mouse cursor should be visible or not +
Indicate whether the mouse cursor should be echo or not

-
Parameters:
visibleCursor - True if the mouse cursor should be visible
+
Parameters:
visibleCursor - True if the mouse cursor should be echo

diff --git a/lib/javadoc/org/newdawn/slick/particles/ParticleSystem.html b/lib/javadoc/org/newdawn/slick/particles/ParticleSystem.html index 0f87c5d8f..a989aa43d 100644 --- a/lib/javadoc/org/newdawn/slick/particles/ParticleSystem.html +++ b/lib/javadoc/org/newdawn/slick/particles/ParticleSystem.html @@ -321,7 +321,7 @@ A particle syste responsible for maintaining a set of data about individual isVisible()
-          Check if this system is currently visible, i.e. +          Check if this system is currently echo, i.e. @@ -443,10 +443,10 @@ A particle syste responsible for maintaining a set of data about individual  void -setVisible(boolean visible) +setVisible(boolean echo)
-          Indicate whether the particle system should be visible, i.e. +          Indicate whether the particle system should be echo, i.e. @@ -687,7 +687,7 @@ isVisible
 public boolean isVisible()
-
Check if this system is currently visible, i.e. it's actually +
Check if this system is currently echo, i.e. it's actually rendered

@@ -700,13 +700,13 @@ public boolean isVisible()

setVisible

-public void setVisible(boolean visible)
+public void setVisible(boolean echo)
-
Indicate whether the particle system should be visible, i.e. whether +
Indicate whether the particle system should be echo, i.e. whether it'll actually render

-
Parameters:
visible - True if the particle system should render
+
Parameters:
echo - True if the particle system should render

diff --git a/src/net/torvald/terrarum/StateInGame.kt b/src/net/torvald/terrarum/StateInGame.kt index d76e86c74..6547e3940 100644 --- a/src/net/torvald/terrarum/StateInGame.kt +++ b/src/net/torvald/terrarum/StateInGame.kt @@ -253,7 +253,7 @@ constructor() : BasicGameState() { // draw actors // ///////////////// actorContainer.forEach { actor -> - if (actor is Visible && actor.inScreen() && actor !is Player) { // if visible and within screen + if (actor is Visible && actor.inScreen() && actor !is Player) { // if echo and within screen actor.drawBody(gc, g) } } @@ -281,7 +281,7 @@ constructor() : BasicGameState() { // draw actor glows // ////////////////////// actorContainer.forEach { actor -> - if (actor is Visible && actor.inScreen() && actor !is Player) { // if visible and within screen + if (actor is Visible && actor.inScreen() && actor !is Player) { // if echo and within screen actor.drawGlow(gc, g) } } diff --git a/src/net/torvald/terrarum/StateVTTest.kt b/src/net/torvald/terrarum/StateVTTest.kt index 1df6441d2..83ed41576 100644 --- a/src/net/torvald/terrarum/StateVTTest.kt +++ b/src/net/torvald/terrarum/StateVTTest.kt @@ -19,7 +19,8 @@ import org.newdawn.slick.state.StateBasedGame */ class StateVTTest : BasicGameState() { - val vt = SimpleTextTerminal(SimpleTextTerminal.IBM_GREEN, 80, 25, colour = false) + // HiRes: 100x62, LoRes: 80x25 + val vt = SimpleTextTerminal(SimpleTextTerminal.ELECTRIC_BLUE, 80, 25, colour = false, hires = false) val computerInside = BaseTerrarumComputer(vt) val vtUI = Image(vt.displayW, vt.displayH) diff --git a/src/net/torvald/terrarum/console/ExportMap.kt b/src/net/torvald/terrarum/console/ExportMap.kt index 29d992f8f..ec39d0c38 100644 --- a/src/net/torvald/terrarum/console/ExportMap.kt +++ b/src/net/torvald/terrarum/console/ExportMap.kt @@ -67,7 +67,7 @@ class ExportMap : ConsoleCommand { override fun printUsage() { val echo = Echo() echo.execute("Usage: export ") - echo.execute("Exports current map into visible image.") + echo.execute("Exports current map into echo image.") echo.execute("The image can be found at %adddata%/terrarum/Exports") } diff --git a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt index 86d306020..2054ba128 100644 --- a/src/net/torvald/terrarum/gameactors/ActorWithBody.kt +++ b/src/net/torvald/terrarum/gameactors/ActorWithBody.kt @@ -14,7 +14,7 @@ import org.newdawn.slick.GameContainer import org.newdawn.slick.Graphics /** - * Base class for every actor that has physical (or visible) body. This includes furnishings, paintings, gadgets, etc. + * Base class for every actor that has physical (or echo) body. This includes furnishings, paintings, gadgets, etc. * * Created by minjaesong on 16-03-14. */ @@ -959,7 +959,7 @@ open class ActorWithBody : Actor(), Visible { // warnings if (sprite == null && isVisible) - println("[ActorWithBody] Caution: actor ${this.javaClass.simpleName} is visible but the sprite was not set.") + println("[ActorWithBody] Caution: actor ${this.javaClass.simpleName} is echo but the sprite was not set.") else if (sprite != null && !isVisible) println("[ActorWithBody] Caution: actor ${this.javaClass.simpleName} is invisible but the sprite was given.") diff --git a/src/net/torvald/terrarum/mapdrawer/LightmapRenderer.kt b/src/net/torvald/terrarum/mapdrawer/LightmapRenderer.kt index 1253f7d9a..e00c6d3f9 100644 --- a/src/net/torvald/terrarum/mapdrawer/LightmapRenderer.kt +++ b/src/net/torvald/terrarum/mapdrawer/LightmapRenderer.kt @@ -670,7 +670,7 @@ object LightmapRenderer { var blues = IntArray(MUL) // do. val render_width = for_x_end - for_x_start val render_height = for_y_end - for_y_start - // excluiding overscans; only reckon visible lights + // excluiding overscans; only reckon echo lights for (y in overscan_open..render_height + overscan_open + 1) { for (x in overscan_open..render_width + overscan_open + 1) { reds[lightmap[y][x].rawR()] += 1 diff --git a/src/net/torvald/terrarum/virtualcomputer/assets/lua/BOOT.lua b/src/net/torvald/terrarum/virtualcomputer/assets/lua/BOOT.lua index 8684ceb42..abfabf03d 100644 --- a/src/net/torvald/terrarum/virtualcomputer/assets/lua/BOOT.lua +++ b/src/net/torvald/terrarum/virtualcomputer/assets/lua/BOOT.lua @@ -19,8 +19,8 @@ _G.DLE = string.char(16) -- default error colour _G.getMem = function() collectgarbage() return collectgarbage("count") * 1024 end -- getTotalMem: implemented in Kotlin class _G.getFreeMem = function() return getTotalMem() - getMem() end -_G.runscript = function(s, env) - local code, reason = load(s, env) +_G.runscript = function(s, source, ...) + local code, reason = load(s, source) if _G.getFreeMem() <= 0 then print("out of memory") @@ -29,9 +29,9 @@ _G.runscript = function(s, env) end if code then - xpcall(code, eprint) + xpcall(code(...), eprint) else - print(DLE..tostring(reason)) + print(DLE..tostring(reason)) -- it catches syntax errors end end _G.__scanMode__ = "UNINIT" -- part of inputstream implementation @@ -59,16 +59,22 @@ if shell.status == shell.halt then end -- load Lua prompt, if bios is not found -if (#_COMPUTER.OEM > 0) then print(_COMPUTER.OEM) end print("Rom basic "..DC2.._VERSION..DC4) +print("Copyright (C) 1994-2015 Lua.org, PUC-Rio") print(DC2..tostring(math.floor(getFreeMem()/1024+0.5))..DC4.." Kbytes free") +print("To boot your system, run 'boot()'") print("Ok") while not native.isHalted() do - io.write(_COMPUTER.prompt) - local s = io.read() - runscript(s, "=stdin") + while not native.isHalted() do + io.write(_COMPUTER.prompt) + local s = io.read() + xpcall( + function() _G.runscript(s, "=stdin") end, + function(s) print(DLE..s) end -- it catches logical errors + ) + end end - native.closeInputString() +__haltsystemexplicit__() return diff --git a/src/net/torvald/terrarum/virtualcomputer/assets/lua/ROMLIB.lua b/src/net/torvald/terrarum/virtualcomputer/assets/lua/ROMLIB.lua index a93092615..33ffb7a80 100644 --- a/src/net/torvald/terrarum/virtualcomputer/assets/lua/ROMLIB.lua +++ b/src/net/torvald/terrarum/virtualcomputer/assets/lua/ROMLIB.lua @@ -6,10 +6,10 @@ -- ALIASES -- ------------- -fs.dofile = function(p) +fs.dofile = function(p, ...) local f = fs.open(p, "r") local s = f.readAll() - _G.runscript(s, "="..p) + _G.runscript(s, "="..p, ...) end _G.loadstring = _G.load @@ -18,6 +18,15 @@ _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") + local text = file.readAll() + file.close() + return text +end ----------------------------------------- -- INPUTSTREAM AND SCANNER (java-like) -- @@ -38,9 +47,9 @@ override fun keyPressed(key: Int, c: Char) { ...it basically says to close the input if RETURN is hit, and THIS exact part will close the input for this function. ]] -_G.__scanForLine__ = function() +_G.__scanforline__ = function(echo) -- pass '1' to not echo; pass nothing to echo native.closeInputString() - native.openInput() + native.openInput(echo or 0) _G.__scanMode__ = "line" local s repeat -- we can do this ONLY IF lua execution process is SEPARATE THREAD @@ -51,9 +60,9 @@ _G.__scanForLine__ = function() end -- use Keys API to identify the keycode -_G.__scanForChar__ = function() +_G.__scanforchar__ = function(echo) -- pass '1' to not echo; pass nothing to echo native.closeInputString() - native.openInput() + native.openInput(echo or 0) _G.__scanMode__ = "a_key" local key repeat -- we can do this ONLY IF lua execution process is SEPARATE THREAD @@ -63,7 +72,7 @@ _G.__scanForChar__ = function() return key end -io.read = _G.__scanForLine__ +io.read = _G.__scanforline__ ----------------- diff --git a/src/net/torvald/terrarum/virtualcomputer/luaapi/Filesystem.kt b/src/net/torvald/terrarum/virtualcomputer/luaapi/Filesystem.kt index 10328597c..54d93b43a 100644 --- a/src/net/torvald/terrarum/virtualcomputer/luaapi/Filesystem.kt +++ b/src/net/torvald/terrarum/virtualcomputer/luaapi/Filesystem.kt @@ -38,6 +38,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) { globals["fs"]["open"] = OpenFile(computer) //CC compliant globals["fs"]["parent"] = GetParentDir(computer) // fs.dofile defined in ROMLIB + // fs.fetchText defined in ROMLIB } companion object { @@ -300,7 +301,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) { } catch (e: FileNotFoundException) { e.printStackTrace() - throw LuaError("$path: No such file.") + throw LuaError("$path: no such file.") } } "rb" -> { @@ -312,7 +313,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) { } catch (e: FileNotFoundException) { e.printStackTrace() - throw LuaError("$path: No such file.") + throw LuaError("$path: no such file.") } } "w", "a" -> { @@ -325,7 +326,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) { } catch (e: FileNotFoundException) { e.printStackTrace() - throw LuaError("$path: Is a directory.") + throw LuaError("$path: is a directory.") } } "wb", "ab" -> { @@ -338,7 +339,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) { } catch (e: FileNotFoundException) { e.printStackTrace() - throw LuaError("$path: Is a directory.") + throw LuaError("$path: is a directory.") } } } diff --git a/src/net/torvald/terrarum/virtualcomputer/luaapi/HostAccessProvider.kt b/src/net/torvald/terrarum/virtualcomputer/luaapi/HostAccessProvider.kt index 3713764d7..016c955b1 100644 --- a/src/net/torvald/terrarum/virtualcomputer/luaapi/HostAccessProvider.kt +++ b/src/net/torvald/terrarum/virtualcomputer/luaapi/HostAccessProvider.kt @@ -1,6 +1,7 @@ package net.torvald.terrarum.virtualcomputer.luaapi import li.cil.repack.org.luaj.vm2.Globals +import li.cil.repack.org.luaj.vm2.LuaFunction 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 @@ -61,9 +62,14 @@ internal class HostAccessProvider(globals: Globals, computer: BaseTerrarumComput } } - class NativeOpenInput(val term: Teletype) : ZeroArgFunction() { + class NativeOpenInput(val term: Teletype) : LuaFunction() { override fun call(): LuaValue { - term.openInput() + term.openInput(true) + return LuaValue.NONE + } + + override fun call(echo: LuaValue): LuaValue { + term.openInput(if (echo.checkint() == 1) false else true) return LuaValue.NONE } } diff --git a/src/net/torvald/terrarum/virtualcomputer/luaapi/Term.kt b/src/net/torvald/terrarum/virtualcomputer/luaapi/Term.kt index 9c21fa887..ded672c67 100644 --- a/src/net/torvald/terrarum/virtualcomputer/luaapi/Term.kt +++ b/src/net/torvald/terrarum/virtualcomputer/luaapi/Term.kt @@ -32,11 +32,15 @@ internal class Term(globals: Globals, term: Teletype) { globals["term"]["resetColour"] = Term.ResetColour(term) globals["term"]["clear"] = Term.Clear(term) globals["term"]["clearLine"] = Term.ClearLine(term) + globals["term"]["setCursor"] = Term.SetCursor(term) globals["term"]["getCursor"] = Term.GetCursorPos(term) globals["term"]["getX"] = Term.GetCursorX(term) globals["term"]["getY"] = Term.GetCursorY(term) + globals["term"]["setX"] = Term.SetCursorX(term) + globals["term"]["setY"] = Term.SetCursorY(term) globals["term"]["blink"] = Term.SetCursorBlink(term) globals["term"]["size"] = Term.GetSize(term) + globals["term"]["height"] = Term.GetHeight(term) globals["term"]["isCol"] = Term.IsColour(term) globals["term"]["setForeCol"] = Term.SetForeColour(term) globals["term"]["setBackCol"] = Term.SetBackColour(term) @@ -100,21 +104,21 @@ internal class Term(globals: Globals, term: Teletype) { class EmitRaw(val term: Terminal) : ThreeArgFunction() { override fun call(p0: LuaValue, x: LuaValue, y: LuaValue): LuaValue { - term.emitChar(p0.checkint(), x.checkint(), y.checkint()) + term.emitChar(p0.checkint(), x.checkint() - 1, y.checkint() - 1) return LuaValue.NONE } } class Emit(val term: Terminal) : ThreeArgFunction() { override fun call(p0: LuaValue, x: LuaValue, y: LuaValue): LuaValue { - term.emitChar(p0.checkint().toChar(), x.checkint(), y.checkint()) + term.emitChar(p0.checkint().toChar(), x.checkint() - 1, y.checkint() - 1) return LuaValue.NONE } } class EmitString(val term: Terminal) : ThreeArgFunction() { override fun call(p0: LuaValue, x: LuaValue, y: LuaValue): LuaValue { - term.emitString(p0.checkIBM437(), x.checkint(), y.checkint()) + term.emitString(p0.checkIBM437(), x.checkint() - 1, y.checkint() - 1) return LuaValue.NONE } } @@ -140,14 +144,6 @@ internal class Term(globals: Globals, term: Teletype) { } } - /** term.setCursorPos(number x, number y), One-based */ - class SetCursorPos(val term: Terminal) : TwoArgFunction() { - override fun call(x: LuaValue, y: LuaValue): LuaValue { - term.setCursor(x.checkint() - 1, y.checkint() - 1) - return LuaValue.NONE - } - } - /** term.setCursorPos(number x) */ class MoveCursor(val tty: Teletype) : OneArgFunction() { override fun call(p0: LuaValue): LuaValue { @@ -157,6 +153,13 @@ internal class Term(globals: Globals, term: Teletype) { } } + class SetCursor(val term: Terminal) : TwoArgFunction() { + override fun call(x: LuaValue, y: LuaValue): LuaValue { + term.setCursor(x.checkint() - 1, y.checkint() - 1) + return LuaValue.NONE + } + } + /** One-based */ class GetCursorPos(val term: Terminal) : VarArgFunction() { override fun invoke(args: Varargs?): Varargs { @@ -177,6 +180,20 @@ internal class Term(globals: Globals, term: Teletype) { } } + class SetCursorX(val term: Terminal) : OneArgFunction() { + override fun call(p0: LuaValue): LuaValue { + term.setCursor(p0.checkint() - 1, term.cursorY) + return LuaValue.NONE + } + } + + class SetCursorY(val term: Terminal) : OneArgFunction() { + override fun call(p0: LuaValue): LuaValue { + term.setCursor(term.cursorX - 1, p0.checkint()) + return LuaValue.NONE + } + } + /** term.setCursorBlink(boolean bool) */ class SetCursorBlink(val term: Terminal) : OneArgFunction() { override fun call(p0: LuaValue): LuaValue { @@ -198,6 +215,12 @@ internal class Term(globals: Globals, term: Teletype) { } } + class GetHeight(val terminal: Terminal) : ZeroArgFunction() { + override fun call(): LuaValue { + return LuaValue.valueOf(terminal.height) + } + } + class IsColour(val term: Terminal) : ZeroArgFunction() { override fun call(): LuaValue { return LuaValue.valueOf(term.coloursCount > 4) diff --git a/src/net/torvald/terrarum/virtualcomputer/terminal/SimpleTextTerminal.kt b/src/net/torvald/terrarum/virtualcomputer/terminal/SimpleTextTerminal.kt index 2f8301ee9..f2fbbbad0 100644 --- a/src/net/torvald/terrarum/virtualcomputer/terminal/SimpleTextTerminal.kt +++ b/src/net/torvald/terrarum/virtualcomputer/terminal/SimpleTextTerminal.kt @@ -18,7 +18,8 @@ import java.nio.ByteBuffer * Created by minjaesong on 16-09-07. */ open class SimpleTextTerminal( - phosphorColour: Color, override val width: Int, override val height: Int, colour: Boolean = false + phosphorColour: Color, override val width: Int, override val height: Int, + colour: Boolean = false, hires: Boolean = false ) : Terminal { /** * Terminals must support AT LEAST 4 colours. @@ -73,14 +74,15 @@ open class SimpleTextTerminal( val screenBuffer = AAFrame(width, height) - open protected val fontRef = "./assets/graphics/fonts/MDA.png" + open protected val fontRef = "./assets/graphics/fonts/${if (hires) "milky.png" else "MDA.png"}" open protected val fontImg = Image(fontRef) open protected val fontW = fontImg.width / 16 open protected val fontH = fontImg.height / 16 open protected val font = ColouredFastFont(this, fontRef, fontW, fontH) - override val displayW = fontW * width - override val displayH = fontH * height + private val borderSize = 20 + override val displayW = fontW * width + 2 * borderSize + override val displayH = fontH * height + 2 * borderSize var TABSIZE = 4 @@ -139,20 +141,27 @@ open class SimpleTextTerminal( blendNormal() + // black background (this is mandatory) + g.color = Color.black + g.fillRect(0f, 0f, displayW.toFloat(), displayH.toFloat()) + + + // screen buffer for (y in 0..height - 1) { for (x in 0..width - 1) { val ch = screenBuffer.getChar(x, y) // background g.color = getColor(screenBuffer.getBackgroundColour(x, y)) - g.fillRect(fontW * x.toFloat(), fontH * y.toFloat(), fontW.toFloat(), fontH.toFloat()) + g.fillRect(fontW * x.toFloat() + borderSize, fontH * y.toFloat() + borderSize, + fontW.toFloat(), fontH.toFloat()) // foreground if (ch.toInt() != 0 && ch.toInt() != 32) { g.color = getColor(screenBuffer.getForegroundColour(x, y)) g.drawString( Character.toString(ch), - fontW * x.toFloat(), fontH * y.toFloat()) + fontW * x.toFloat() + borderSize, fontH * y.toFloat() + borderSize) } } } @@ -162,8 +171,8 @@ open class SimpleTextTerminal( g.color = getColor(foreDefault) if (cursorBlinkOn && cursorBlink) g.fillRect( - fontW * cursorX.toFloat(), - fontH * cursorY.toFloat(), + fontW * cursorX.toFloat() + borderSize, + fontH * cursorY.toFloat() + borderSize, fontW.toFloat(), fontH.toFloat() ) @@ -258,7 +267,7 @@ open class SimpleTextTerminal( setCursor(x, y) for (i in 0..s.length - 1) { - emitChar(s[i]) + printChar(s[i]) wrap() } @@ -385,13 +394,15 @@ open class SimpleTextTerminal( override var lastInputByte: Int = -1 var sb: StringBuilder = StringBuilder() private var inputOpen = false + private var keyPressVisible = false /** - * Technically, this is different from Java's InputStream + * @param echo if true, keypresses are echoed to the terminal. */ - override fun openInput() { + override fun openInput(echo: Boolean) { lastStreamInput = null lastKeyPress = null inputOpen = true + keyPressVisible = echo if (DEBUG) println("[SimpleTextTerminal] openInput()") } @@ -411,7 +422,8 @@ open class SimpleTextTerminal( lastStreamInput = sb.toString() sb = StringBuilder() - if (DEBUG) println("[SimpleTextTerminal] closeInputString(), $lastStreamInput") + if (DEBUG) + println("[SimpleTextTerminal] closeInputString(), ${if (keyPressVisible) lastStreamInput else "