proper error handling in ROMBASIC

Former-commit-id: b5bd084e6807c765cdd6d3ffff1b1628321b9c6a
Former-commit-id: 55c3bb3cd56c7867809c0819f178aeebf1e46676
This commit is contained in:
Song Minjae
2016-09-22 18:16:38 +09:00
parent 6caae90d7e
commit 433f27bef2
24 changed files with 208 additions and 137 deletions

Binary file not shown.

View File

@@ -5795,13 +5795,13 @@ Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/AppGameContainer.
<DD>&nbsp; <DD>&nbsp;
<DT><A HREF="./org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()"><B>isUpdatingOnlyWhenVisible()</B></A> - <DT><A HREF="./org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()"><B>isUpdatingOnlyWhenVisible()</B></A> -
Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A> Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A>
<DD>Check if this game is only updating when visible to the user (default = true) <DD>Check if this game is only updating when echo to the user (default = true)
<DT><A HREF="./org/newdawn/slick/util/pathfinding/AStarPathFinder.html#isValidLocation(org.newdawn.slick.util.pathfinding.Mover, int, int, int, int)"><B>isValidLocation(Mover, int, int, int, int)</B></A> - <DT><A HREF="./org/newdawn/slick/util/pathfinding/AStarPathFinder.html#isValidLocation(org.newdawn.slick.util.pathfinding.Mover, int, int, int, int)"><B>isValidLocation(Mover, int, int, int, int)</B></A> -
Method in class org.newdawn.slick.util.pathfinding.<A HREF="./org/newdawn/slick/util/pathfinding/AStarPathFinder.html" title="class in org.newdawn.slick.util.pathfinding">AStarPathFinder</A> Method in class org.newdawn.slick.util.pathfinding.<A HREF="./org/newdawn/slick/util/pathfinding/AStarPathFinder.html" title="class in org.newdawn.slick.util.pathfinding">AStarPathFinder</A>
<DD>Check if a given location is valid for the supplied mover <DD>Check if a given location is valid for the supplied mover
<DT><A HREF="./org/newdawn/slick/particles/ParticleSystem.html#isVisible()"><B>isVisible()</B></A> - <DT><A HREF="./org/newdawn/slick/particles/ParticleSystem.html#isVisible()"><B>isVisible()</B></A> -
Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ParticleSystem.html" title="class in org.newdawn.slick.particles">ParticleSystem</A> Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ParticleSystem.html" title="class in org.newdawn.slick.particles">ParticleSystem</A>
<DD>Check if this system is currently visible, i.e. <DD>Check if this system is currently echo, i.e.
<DT><A HREF="./org/newdawn/slick/GameContainer.html#isVSyncRequested()"><B>isVSyncRequested()</B></A> - <DT><A HREF="./org/newdawn/slick/GameContainer.html#isVSyncRequested()"><B>isVSyncRequested()</B></A> -
Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A> Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A>
<DD>True if vsync is requested <DD>True if vsync is requested
@@ -8728,7 +8728,7 @@ Method in class org.newdawn.slick.gui.<A HREF="./org/newdawn/slick/gui/TextField
<DD>Set the position of the cursor <DD>Set the position of the cursor
<DT><A HREF="./org/newdawn/slick/gui/TextField.html#setCursorVisible(boolean)"><B>setCursorVisible(boolean)</B></A> - <DT><A HREF="./org/newdawn/slick/gui/TextField.html#setCursorVisible(boolean)"><B>setCursorVisible(boolean)</B></A> -
Method in class org.newdawn.slick.gui.<A HREF="./org/newdawn/slick/gui/TextField.html" title="class in org.newdawn.slick.gui">TextField</A> Method in class org.newdawn.slick.gui.<A HREF="./org/newdawn/slick/gui/TextField.html" title="class in org.newdawn.slick.gui">TextField</A>
<DD>Indicate whether the mouse cursor should be visible or not <DD>Indicate whether the mouse cursor should be echo or not
<DT><A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.LinearInterpolator.html#setCurve(java.util.ArrayList)"><B>setCurve(ArrayList)</B></A> - <DT><A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.LinearInterpolator.html#setCurve(java.util.ArrayList)"><B>setCurve(ArrayList)</B></A> -
Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.LinearInterpolator.html" title="class in org.newdawn.slick.particles">ConfigurableEmitter.LinearInterpolator</A> Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.LinearInterpolator.html" title="class in org.newdawn.slick.particles">ConfigurableEmitter.LinearInterpolator</A>
<DD>Set the collection of data points to interpolate between <DD>Set the collection of data points to interpolate between
@@ -9412,7 +9412,7 @@ Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/AppGameContainer.
<DD>&nbsp; <DD>&nbsp;
<DT><A HREF="./org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)"><B>setUpdateOnlyWhenVisible(boolean)</B></A> - <DT><A HREF="./org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)"><B>setUpdateOnlyWhenVisible(boolean)</B></A> -
Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A> Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A>
<DD>Indicate if the display should update only when the game is visible <DD>Indicate if the display should update only when the game is echo
(the default is true) (the default is true)
<DT><A HREF="./org/newdawn/slick/opengl/pbuffer/GraphicsFactory.html#setUseFBO(boolean)"><B>setUseFBO(boolean)</B></A> - <DT><A HREF="./org/newdawn/slick/opengl/pbuffer/GraphicsFactory.html#setUseFBO(boolean)"><B>setUseFBO(boolean)</B></A> -
Static method in class org.newdawn.slick.opengl.pbuffer.<A HREF="./org/newdawn/slick/opengl/pbuffer/GraphicsFactory.html" title="class in org.newdawn.slick.opengl.pbuffer">GraphicsFactory</A> Static method in class org.newdawn.slick.opengl.pbuffer.<A HREF="./org/newdawn/slick/opengl/pbuffer/GraphicsFactory.html" title="class in org.newdawn.slick.opengl.pbuffer">GraphicsFactory</A>
@@ -9464,7 +9464,7 @@ Static method in class org.newdawn.slick.util.<A HREF="./org/newdawn/slick/util/
<DD>Indicate that we want verbose logging. <DD>Indicate that we want verbose logging.
<DT><A HREF="./org/newdawn/slick/particles/ParticleSystem.html#setVisible(boolean)"><B>setVisible(boolean)</B></A> - <DT><A HREF="./org/newdawn/slick/particles/ParticleSystem.html#setVisible(boolean)"><B>setVisible(boolean)</B></A> -
Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ParticleSystem.html" title="class in org.newdawn.slick.particles">ParticleSystem</A> Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ParticleSystem.html" title="class in org.newdawn.slick.particles">ParticleSystem</A>
<DD>Indicate whether the particle system should be visible, i.e. <DD>Indicate whether the particle system should be echo, i.e.
<DT><A HREF="./org/newdawn/slick/Music.html#setVolume(float)"><B>setVolume(float)</B></A> - <DT><A HREF="./org/newdawn/slick/Music.html#setVolume(float)"><B>setVolume(float)</B></A> -
Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/Music.html" title="class in org.newdawn.slick">Music</A> Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/Music.html" title="class in org.newdawn.slick">Music</A>
<DD>Set the volume of the music as a factor of the global volume setting <DD>Set the volume of the music as a factor of the global volume setting
@@ -10555,7 +10555,7 @@ Method in class org.newdawn.slick.<A HREF="./org/newdawn/slick/Animation.html" t
<DD><B>Deprecated.</B>&nbsp;<I></I>&nbsp; <DD><B>Deprecated.</B>&nbsp;<I></I>&nbsp;
<DT><A HREF="./org/newdawn/slick/AppGameContainer.html#updateOnlyOnVisible"><B>updateOnlyOnVisible</B></A> - <DT><A HREF="./org/newdawn/slick/AppGameContainer.html#updateOnlyOnVisible"><B>updateOnlyOnVisible</B></A> -
Variable in class org.newdawn.slick.<A HREF="./org/newdawn/slick/AppGameContainer.html" title="class in org.newdawn.slick">AppGameContainer</A> Variable in class org.newdawn.slick.<A HREF="./org/newdawn/slick/AppGameContainer.html" title="class in org.newdawn.slick">AppGameContainer</A>
<DD>True if we should update the game only when the display is visible <DD>True if we should update the game only when the display is echo
<DT><A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.html#updateParticle(org.newdawn.slick.particles.Particle, int)"><B>updateParticle(Particle, int)</B></A> - <DT><A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.html#updateParticle(org.newdawn.slick.particles.Particle, int)"><B>updateParticle(Particle, int)</B></A> -
Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.html" title="class in org.newdawn.slick.particles">ConfigurableEmitter</A> Method in class org.newdawn.slick.particles.<A HREF="./org/newdawn/slick/particles/ConfigurableEmitter.html" title="class in org.newdawn.slick.particles">ConfigurableEmitter</A>
<DD>&nbsp; <DD>&nbsp;

View File

@@ -155,7 +155,7 @@ A game container that will display the game as an stand alone
<TD><CODE><B><A HREF="../../../org/newdawn/slick/AppGameContainer.html#updateOnlyOnVisible">updateOnlyOnVisible</A></B></CODE> <TD><CODE><B><A HREF="../../../org/newdawn/slick/AppGameContainer.html#updateOnlyOnVisible">updateOnlyOnVisible</A></B></CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;True if we should update the game only when the display is visible</TD> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;True if we should update the game only when the display is echo</TD>
</TR> </TR>
</TABLE> </TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.newdawn.slick.GameContainer"><!-- --></A> &nbsp;<A NAME="fields_inherited_from_class_org.newdawn.slick.GameContainer"><!-- --></A>
@@ -263,7 +263,7 @@ A game container that will display the game as an stand alone
<TD><CODE><B><A HREF="../../../org/newdawn/slick/AppGameContainer.html#isUpdatingOnlyWhenVisible()">isUpdatingOnlyWhenVisible</A></B>()</CODE> <TD><CODE><B><A HREF="../../../org/newdawn/slick/AppGameContainer.html#isUpdatingOnlyWhenVisible()">isUpdatingOnlyWhenVisible</A></B>()</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if this game is only updating when visible to the user (default = true)</TD> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if this game is only updating when echo to the user (default = true)</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -389,7 +389,7 @@ A game container that will display the game as an stand alone
<TD><CODE><B><A HREF="../../../org/newdawn/slick/AppGameContainer.html#setUpdateOnlyWhenVisible(boolean)">setUpdateOnlyWhenVisible</A></B>(boolean&nbsp;updateOnlyWhenVisible)</CODE> <TD><CODE><B><A HREF="../../../org/newdawn/slick/AppGameContainer.html#setUpdateOnlyWhenVisible(boolean)">setUpdateOnlyWhenVisible</A></B>(boolean&nbsp;updateOnlyWhenVisible)</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate if the display should update only when the game is visible &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate if the display should update only when the game is echo
(the default is true)</TD> (the default is true)</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
@@ -469,7 +469,7 @@ updateOnlyOnVisible</H3>
<PRE> <PRE>
protected boolean <B>updateOnlyOnVisible</B></PRE> protected boolean <B>updateOnlyOnVisible</B></PRE>
<DL> <DL>
<DD>True if we should update the game only when the display is visible <DD>True if we should update the game only when the display is echo
<P> <P>
<DL> <DL>
</DL> </DL>
@@ -790,14 +790,14 @@ setUpdateOnlyWhenVisible</H3>
public void <B>setUpdateOnlyWhenVisible</B>(boolean&nbsp;updateOnlyWhenVisible)</PRE> public void <B>setUpdateOnlyWhenVisible</B>(boolean&nbsp;updateOnlyWhenVisible)</PRE>
<DL> <DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)">GameContainer</A></CODE></B></DD> <DD><B>Description copied from class: <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)">GameContainer</A></CODE></B></DD>
<DD>Indicate if the display should update only when the game is visible <DD>Indicate if the display should update only when the game is echo
(the default is true) (the default is true)
<P> <P>
<DD><DL> <DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)">setUpdateOnlyWhenVisible</A></CODE> in class <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A></CODE></DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)">setUpdateOnlyWhenVisible</A></CODE> in class <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A></CODE></DL>
</DD> </DD>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>updateOnlyWhenVisible</CODE> - True if we should updated only when the display is visible<DT><B>See Also:</B><DD><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)"><CODE>GameContainer.setUpdateOnlyWhenVisible(boolean)</CODE></A></DL> <DT><B>Parameters:</B><DD><CODE>updateOnlyWhenVisible</CODE> - True if we should updated only when the display is echo<DT><B>See Also:</B><DD><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)"><CODE>GameContainer.setUpdateOnlyWhenVisible(boolean)</CODE></A></DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>
@@ -808,14 +808,14 @@ isUpdatingOnlyWhenVisible</H3>
public boolean <B>isUpdatingOnlyWhenVisible</B>()</PRE> public boolean <B>isUpdatingOnlyWhenVisible</B>()</PRE>
<DL> <DL>
<DD><B>Description copied from class: <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()">GameContainer</A></CODE></B></DD> <DD><B>Description copied from class: <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()">GameContainer</A></CODE></B></DD>
<DD>Check if this game is only updating when visible to the user (default = true) <DD>Check if this game is only updating when echo to the user (default = true)
<P> <P>
<DD><DL> <DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()">isUpdatingOnlyWhenVisible</A></CODE> in class <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A></CODE></DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()">isUpdatingOnlyWhenVisible</A></CODE> in class <CODE><A HREF="../../../org/newdawn/slick/GameContainer.html" title="class in org.newdawn.slick">GameContainer</A></CODE></DL>
</DD> </DD>
<DD><DL> <DD><DL>
<DT><B>Returns:</B><DD>True if the game is only updated when the display is visible<DT><B>See Also:</B><DD><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()"><CODE>GameContainer.isUpdatingOnlyWhenVisible()</CODE></A></DL> <DT><B>Returns:</B><DD>True if the game is only updated when the display is echo<DT><B>See Also:</B><DD><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()"><CODE>GameContainer.isUpdatingOnlyWhenVisible()</CODE></A></DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>

View File

@@ -611,7 +611,7 @@ A generic game container that handles the game loop, fps recording and
<TD><CODE><B><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()">isUpdatingOnlyWhenVisible</A></B>()</CODE> <TD><CODE><B><A HREF="../../../org/newdawn/slick/GameContainer.html#isUpdatingOnlyWhenVisible()">isUpdatingOnlyWhenVisible</A></B>()</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if this game is only updating when visible to the user (default = true)</TD> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if this game is only updating when echo to the user (default = true)</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -879,7 +879,7 @@ A generic game container that handles the game loop, fps recording and
<TD><CODE><B><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)">setUpdateOnlyWhenVisible</A></B>(boolean&nbsp;updateOnlyWhenVisible)</CODE> <TD><CODE><B><A HREF="../../../org/newdawn/slick/GameContainer.html#setUpdateOnlyWhenVisible(boolean)">setUpdateOnlyWhenVisible</A></B>(boolean&nbsp;updateOnlyWhenVisible)</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate if the display should update only when the game is visible &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate if the display should update only when the game is echo
(the default is true)</TD> (the default is true)</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
@@ -2233,14 +2233,14 @@ setUpdateOnlyWhenVisible</H3>
<PRE> <PRE>
public void <B>setUpdateOnlyWhenVisible</B>(boolean&nbsp;updateOnlyWhenVisible)</PRE> public void <B>setUpdateOnlyWhenVisible</B>(boolean&nbsp;updateOnlyWhenVisible)</PRE>
<DL> <DL>
<DD>Indicate if the display should update only when the game is visible <DD>Indicate if the display should update only when the game is echo
(the default is true) (the default is true)
<P> <P>
<DD><DL> <DD><DL>
</DL> </DL>
</DD> </DD>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>updateOnlyWhenVisible</CODE> - True if we should updated only when the display is visible</DL> <DT><B>Parameters:</B><DD><CODE>updateOnlyWhenVisible</CODE> - True if we should updated only when the display is echo</DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>
@@ -2250,14 +2250,14 @@ isUpdatingOnlyWhenVisible</H3>
<PRE> <PRE>
public boolean <B>isUpdatingOnlyWhenVisible</B>()</PRE> public boolean <B>isUpdatingOnlyWhenVisible</B>()</PRE>
<DL> <DL>
<DD>Check if this game is only updating when visible to the user (default = true) <DD>Check if this game is only updating when echo to the user (default = true)
<P> <P>
<DD><DL> <DD><DL>
</DL> </DL>
</DD> </DD>
<DD><DL> <DD><DL>
<DT><B>Returns:</B><DD>True if the game is only updated when the display is visible</DL> <DT><B>Returns:</B><DD>True if the game is only updated when the display is echo</DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>

View File

@@ -1685,7 +1685,7 @@ public void <B>setWorldClip</B>(<A HREF="../../../org/newdawn/slick/geom/Rectang
<DD>Set the world clip to be applied <DD>Set the world clip to be applied
<P> <P>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>clip</CODE> - The area still visible<DT><B>See Also:</B><DD><A HREF="../../../org/newdawn/slick/Graphics.html#setWorldClip(float, float, float, float)"><CODE>setWorldClip(float, float, float, float)</CODE></A></DL> <DT><B>Parameters:</B><DD><CODE>clip</CODE> - The area still echo<DT><B>See Also:</B><DD><A HREF="../../../org/newdawn/slick/Graphics.html#setWorldClip(float, float, float, float)"><CODE>setWorldClip(float, float, float, float)</CODE></A></DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>

View File

@@ -322,7 +322,7 @@ A single text field supporting text entry
<TD><CODE><B><A HREF="../../../../org/newdawn/slick/gui/TextField.html#setCursorVisible(boolean)">setCursorVisible</A></B>(boolean&nbsp;visibleCursor)</CODE> <TD><CODE><B><A HREF="../../../../org/newdawn/slick/gui/TextField.html#setCursorVisible(boolean)">setCursorVisible</A></B>(boolean&nbsp;visibleCursor)</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate whether the mouse cursor should be visible or not</TD> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate whether the mouse cursor should be echo or not</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -697,10 +697,10 @@ setCursorVisible</H3>
<PRE> <PRE>
public void <B>setCursorVisible</B>(boolean&nbsp;visibleCursor)</PRE> public void <B>setCursorVisible</B>(boolean&nbsp;visibleCursor)</PRE>
<DL> <DL>
<DD>Indicate whether the mouse cursor should be visible or not <DD>Indicate whether the mouse cursor should be echo or not
<P> <P>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>visibleCursor</CODE> - True if the mouse cursor should be visible</DL> <DT><B>Parameters:</B><DD><CODE>visibleCursor</CODE> - True if the mouse cursor should be echo</DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>

View File

@@ -321,7 +321,7 @@ A particle syste responsible for maintaining a set of data about individual
<TD><CODE><B><A HREF="../../../../org/newdawn/slick/particles/ParticleSystem.html#isVisible()">isVisible</A></B>()</CODE> <TD><CODE><B><A HREF="../../../../org/newdawn/slick/particles/ParticleSystem.html#isVisible()">isVisible</A></B>()</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if this system is currently visible, i.e.</TD> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if this system is currently echo, i.e.</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -443,10 +443,10 @@ A particle syste responsible for maintaining a set of data about individual
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD> <CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/newdawn/slick/particles/ParticleSystem.html#setVisible(boolean)">setVisible</A></B>(boolean&nbsp;visible)</CODE> <TD><CODE><B><A HREF="../../../../org/newdawn/slick/particles/ParticleSystem.html#setVisible(boolean)">setVisible</A></B>(boolean&nbsp;echo)</CODE>
<BR> <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate whether the particle system should be visible, i.e.</TD> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Indicate whether the particle system should be echo, i.e.</TD>
</TR> </TR>
<TR BGCOLOR="white" CLASS="TableRowColor"> <TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
@@ -687,7 +687,7 @@ isVisible</H3>
<PRE> <PRE>
public boolean <B>isVisible</B>()</PRE> public boolean <B>isVisible</B>()</PRE>
<DL> <DL>
<DD>Check if this system is currently visible, i.e. it's actually <DD>Check if this system is currently echo, i.e. it's actually
rendered rendered
<P> <P>
<DD><DL> <DD><DL>
@@ -700,13 +700,13 @@ public boolean <B>isVisible</B>()</PRE>
<A NAME="setVisible(boolean)"><!-- --></A><H3> <A NAME="setVisible(boolean)"><!-- --></A><H3>
setVisible</H3> setVisible</H3>
<PRE> <PRE>
public void <B>setVisible</B>(boolean&nbsp;visible)</PRE> public void <B>setVisible</B>(boolean&nbsp;echo)</PRE>
<DL> <DL>
<DD>Indicate whether the particle system should be visible, i.e. whether <DD>Indicate whether the particle system should be echo, i.e. whether
it'll actually render it'll actually render
<P> <P>
<DD><DL> <DD><DL>
<DT><B>Parameters:</B><DD><CODE>visible</CODE> - True if the particle system should render</DL> <DT><B>Parameters:</B><DD><CODE>echo</CODE> - True if the particle system should render</DL>
</DD> </DD>
</DL> </DL>
<HR> <HR>

View File

@@ -253,7 +253,7 @@ constructor() : BasicGameState() {
// draw actors // // draw actors //
///////////////// /////////////////
actorContainer.forEach { actor -> 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) actor.drawBody(gc, g)
} }
} }
@@ -281,7 +281,7 @@ constructor() : BasicGameState() {
// draw actor glows // // draw actor glows //
////////////////////// //////////////////////
actorContainer.forEach { actor -> 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) actor.drawGlow(gc, g)
} }
} }

View File

@@ -19,7 +19,8 @@ import org.newdawn.slick.state.StateBasedGame
*/ */
class StateVTTest : BasicGameState() { 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 computerInside = BaseTerrarumComputer(vt)
val vtUI = Image(vt.displayW, vt.displayH) val vtUI = Image(vt.displayW, vt.displayH)

View File

@@ -67,7 +67,7 @@ class ExportMap : ConsoleCommand {
override fun printUsage() { override fun printUsage() {
val echo = Echo() val echo = Echo()
echo.execute("Usage: export <name>") echo.execute("Usage: export <name>")
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") echo.execute("The image can be found at %adddata%/terrarum/Exports")
} }

View File

@@ -14,7 +14,7 @@ import org.newdawn.slick.GameContainer
import org.newdawn.slick.Graphics 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. * Created by minjaesong on 16-03-14.
*/ */
@@ -959,7 +959,7 @@ open class ActorWithBody : Actor(), Visible {
// warnings // warnings
if (sprite == null && isVisible) 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) else if (sprite != null && !isVisible)
println("[ActorWithBody] Caution: actor ${this.javaClass.simpleName} is invisible but the sprite was given.") println("[ActorWithBody] Caution: actor ${this.javaClass.simpleName} is invisible but the sprite was given.")

View File

@@ -670,7 +670,7 @@ object LightmapRenderer {
var blues = IntArray(MUL) // do. var blues = IntArray(MUL) // do.
val render_width = for_x_end - for_x_start val render_width = for_x_end - for_x_start
val render_height = for_y_end - for_y_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 (y in overscan_open..render_height + overscan_open + 1) {
for (x in overscan_open..render_width + overscan_open + 1) { for (x in overscan_open..render_width + overscan_open + 1) {
reds[lightmap[y][x].rawR()] += 1 reds[lightmap[y][x].rawR()] += 1

View File

@@ -19,8 +19,8 @@ _G.DLE = string.char(16) -- default error colour
_G.getMem = function() collectgarbage() return collectgarbage("count") * 1024 end _G.getMem = function() collectgarbage() return collectgarbage("count") * 1024 end
-- getTotalMem: implemented in Kotlin class -- getTotalMem: implemented in Kotlin class
_G.getFreeMem = function() return getTotalMem() - getMem() end _G.getFreeMem = function() return getTotalMem() - getMem() end
_G.runscript = function(s, env) _G.runscript = function(s, source, ...)
local code, reason = load(s, env) local code, reason = load(s, source)
if _G.getFreeMem() <= 0 then if _G.getFreeMem() <= 0 then
print("out of memory") print("out of memory")
@@ -29,9 +29,9 @@ _G.runscript = function(s, env)
end end
if code then if code then
xpcall(code, eprint) xpcall(code(...), eprint)
else else
print(DLE..tostring(reason)) print(DLE..tostring(reason)) -- it catches syntax errors
end end
end end
_G.__scanMode__ = "UNINIT" -- part of inputstream implementation _G.__scanMode__ = "UNINIT" -- part of inputstream implementation
@@ -59,16 +59,22 @@ if shell.status == shell.halt then
end end
-- load Lua prompt, if bios is not found -- load Lua prompt, if bios is not found
if (#_COMPUTER.OEM > 0) then print(_COMPUTER.OEM) end
print("Rom basic "..DC2.._VERSION..DC4) 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(DC2..tostring(math.floor(getFreeMem()/1024+0.5))..DC4.." Kbytes free")
print("To boot your system, run 'boot()'")
print("Ok") print("Ok")
while not native.isHalted() do while not native.isHalted() do
io.write(_COMPUTER.prompt) while not native.isHalted() do
local s = io.read() io.write(_COMPUTER.prompt)
runscript(s, "=stdin") local s = io.read()
xpcall(
function() _G.runscript(s, "=stdin") end,
function(s) print(DLE..s) end -- it catches logical errors
)
end
end end
native.closeInputString() native.closeInputString()
__haltsystemexplicit__()
return return

View File

@@ -6,10 +6,10 @@
-- ALIASES -- -- ALIASES --
------------- -------------
fs.dofile = function(p) fs.dofile = function(p, ...)
local f = fs.open(p, "r") local f = fs.open(p, "r")
local s = f.readAll() local s = f.readAll()
_G.runscript(s, "="..p) _G.runscript(s, "="..p, ...)
end end
_G.loadstring = _G.load _G.loadstring = _G.load
@@ -18,6 +18,15 @@ _G.print = term.print
--_G.dofile = function(f) fs.dofile(f) end --_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) -- -- 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, ...it basically says to close the input if RETURN is hit,
and THIS exact part will close the input for this function. 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.closeInputString()
native.openInput() native.openInput(echo or 0)
_G.__scanMode__ = "line" _G.__scanMode__ = "line"
local s local s
repeat -- we can do this ONLY IF lua execution process is SEPARATE THREAD repeat -- we can do this ONLY IF lua execution process is SEPARATE THREAD
@@ -51,9 +60,9 @@ _G.__scanForLine__ = function()
end end
-- use Keys API to identify the keycode -- 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.closeInputString()
native.openInput() native.openInput(echo or 0)
_G.__scanMode__ = "a_key" _G.__scanMode__ = "a_key"
local key local key
repeat -- we can do this ONLY IF lua execution process is SEPARATE THREAD repeat -- we can do this ONLY IF lua execution process is SEPARATE THREAD
@@ -63,7 +72,7 @@ _G.__scanForChar__ = function()
return key return key
end end
io.read = _G.__scanForLine__ io.read = _G.__scanforline__
----------------- -----------------

View File

@@ -38,6 +38,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
globals["fs"]["open"] = OpenFile(computer) //CC compliant globals["fs"]["open"] = OpenFile(computer) //CC compliant
globals["fs"]["parent"] = GetParentDir(computer) globals["fs"]["parent"] = GetParentDir(computer)
// fs.dofile defined in ROMLIB // fs.dofile defined in ROMLIB
// fs.fetchText defined in ROMLIB
} }
companion object { companion object {
@@ -300,7 +301,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
} }
catch (e: FileNotFoundException) { catch (e: FileNotFoundException) {
e.printStackTrace() e.printStackTrace()
throw LuaError("$path: No such file.") throw LuaError("$path: no such file.")
} }
} }
"rb" -> { "rb" -> {
@@ -312,7 +313,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
} }
catch (e: FileNotFoundException) { catch (e: FileNotFoundException) {
e.printStackTrace() e.printStackTrace()
throw LuaError("$path: No such file.") throw LuaError("$path: no such file.")
} }
} }
"w", "a" -> { "w", "a" -> {
@@ -325,7 +326,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
} }
catch (e: FileNotFoundException) { catch (e: FileNotFoundException) {
e.printStackTrace() e.printStackTrace()
throw LuaError("$path: Is a directory.") throw LuaError("$path: is a directory.")
} }
} }
"wb", "ab" -> { "wb", "ab" -> {
@@ -338,7 +339,7 @@ internal class Filesystem(globals: Globals, computer: BaseTerrarumComputer) {
} }
catch (e: FileNotFoundException) { catch (e: FileNotFoundException) {
e.printStackTrace() e.printStackTrace()
throw LuaError("$path: Is a directory.") throw LuaError("$path: is a directory.")
} }
} }
} }

View File

@@ -1,6 +1,7 @@
package net.torvald.terrarum.virtualcomputer.luaapi package net.torvald.terrarum.virtualcomputer.luaapi
import li.cil.repack.org.luaj.vm2.Globals 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.LuaTable
import li.cil.repack.org.luaj.vm2.LuaValue import li.cil.repack.org.luaj.vm2.LuaValue
import li.cil.repack.org.luaj.vm2.lib.OneArgFunction 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 { 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 return LuaValue.NONE
} }
} }

View File

@@ -32,11 +32,15 @@ internal class Term(globals: Globals, term: Teletype) {
globals["term"]["resetColour"] = Term.ResetColour(term) globals["term"]["resetColour"] = Term.ResetColour(term)
globals["term"]["clear"] = Term.Clear(term) globals["term"]["clear"] = Term.Clear(term)
globals["term"]["clearLine"] = Term.ClearLine(term) globals["term"]["clearLine"] = Term.ClearLine(term)
globals["term"]["setCursor"] = Term.SetCursor(term)
globals["term"]["getCursor"] = Term.GetCursorPos(term) globals["term"]["getCursor"] = Term.GetCursorPos(term)
globals["term"]["getX"] = Term.GetCursorX(term) globals["term"]["getX"] = Term.GetCursorX(term)
globals["term"]["getY"] = Term.GetCursorY(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"]["blink"] = Term.SetCursorBlink(term)
globals["term"]["size"] = Term.GetSize(term) globals["term"]["size"] = Term.GetSize(term)
globals["term"]["height"] = Term.GetHeight(term)
globals["term"]["isCol"] = Term.IsColour(term) globals["term"]["isCol"] = Term.IsColour(term)
globals["term"]["setForeCol"] = Term.SetForeColour(term) globals["term"]["setForeCol"] = Term.SetForeColour(term)
globals["term"]["setBackCol"] = Term.SetBackColour(term) globals["term"]["setBackCol"] = Term.SetBackColour(term)
@@ -100,21 +104,21 @@ internal class Term(globals: Globals, term: Teletype) {
class EmitRaw(val term: Terminal) : ThreeArgFunction() { class EmitRaw(val term: Terminal) : ThreeArgFunction() {
override fun call(p0: LuaValue, x: LuaValue, y: LuaValue): LuaValue { 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 return LuaValue.NONE
} }
} }
class Emit(val term: Terminal) : ThreeArgFunction() { class Emit(val term: Terminal) : ThreeArgFunction() {
override fun call(p0: LuaValue, x: LuaValue, y: LuaValue): LuaValue { 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 return LuaValue.NONE
} }
} }
class EmitString(val term: Terminal) : ThreeArgFunction() { class EmitString(val term: Terminal) : ThreeArgFunction() {
override fun call(p0: LuaValue, x: LuaValue, y: LuaValue): LuaValue { 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 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) */ /** term.setCursorPos(number x) */
class MoveCursor(val tty: Teletype) : OneArgFunction() { class MoveCursor(val tty: Teletype) : OneArgFunction() {
override fun call(p0: LuaValue): LuaValue { 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 */ /** One-based */
class GetCursorPos(val term: Terminal) : VarArgFunction() { class GetCursorPos(val term: Terminal) : VarArgFunction() {
override fun invoke(args: Varargs?): Varargs { 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) */ /** term.setCursorBlink(boolean bool) */
class SetCursorBlink(val term: Terminal) : OneArgFunction() { class SetCursorBlink(val term: Terminal) : OneArgFunction() {
override fun call(p0: LuaValue): LuaValue { 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() { class IsColour(val term: Terminal) : ZeroArgFunction() {
override fun call(): LuaValue { override fun call(): LuaValue {
return LuaValue.valueOf(term.coloursCount > 4) return LuaValue.valueOf(term.coloursCount > 4)

View File

@@ -18,7 +18,8 @@ import java.nio.ByteBuffer
* Created by minjaesong on 16-09-07. * Created by minjaesong on 16-09-07.
*/ */
open class SimpleTextTerminal( 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 { ) : Terminal {
/** /**
* Terminals must support AT LEAST 4 colours. * Terminals must support AT LEAST 4 colours.
@@ -73,14 +74,15 @@ open class SimpleTextTerminal(
val screenBuffer = AAFrame(width, height) 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 fontImg = Image(fontRef)
open protected val fontW = fontImg.width / 16 open protected val fontW = fontImg.width / 16
open protected val fontH = fontImg.height / 16 open protected val fontH = fontImg.height / 16
open protected val font = ColouredFastFont(this, fontRef, fontW, fontH) open protected val font = ColouredFastFont(this, fontRef, fontW, fontH)
override val displayW = fontW * width private val borderSize = 20
override val displayH = fontH * height override val displayW = fontW * width + 2 * borderSize
override val displayH = fontH * height + 2 * borderSize
var TABSIZE = 4 var TABSIZE = 4
@@ -139,20 +141,27 @@ open class SimpleTextTerminal(
blendNormal() 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 (y in 0..height - 1) {
for (x in 0..width - 1) { for (x in 0..width - 1) {
val ch = screenBuffer.getChar(x, y) val ch = screenBuffer.getChar(x, y)
// background // background
g.color = getColor(screenBuffer.getBackgroundColour(x, y)) 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 // foreground
if (ch.toInt() != 0 && ch.toInt() != 32) { if (ch.toInt() != 0 && ch.toInt() != 32) {
g.color = getColor(screenBuffer.getForegroundColour(x, y)) g.color = getColor(screenBuffer.getForegroundColour(x, y))
g.drawString( g.drawString(
Character.toString(ch), 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) g.color = getColor(foreDefault)
if (cursorBlinkOn && cursorBlink) if (cursorBlinkOn && cursorBlink)
g.fillRect( g.fillRect(
fontW * cursorX.toFloat(), fontW * cursorX.toFloat() + borderSize,
fontH * cursorY.toFloat(), fontH * cursorY.toFloat() + borderSize,
fontW.toFloat(), fontW.toFloat(),
fontH.toFloat() fontH.toFloat()
) )
@@ -258,7 +267,7 @@ open class SimpleTextTerminal(
setCursor(x, y) setCursor(x, y)
for (i in 0..s.length - 1) { for (i in 0..s.length - 1) {
emitChar(s[i]) printChar(s[i])
wrap() wrap()
} }
@@ -385,13 +394,15 @@ open class SimpleTextTerminal(
override var lastInputByte: Int = -1 override var lastInputByte: Int = -1
var sb: StringBuilder = StringBuilder() var sb: StringBuilder = StringBuilder()
private var inputOpen = false 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 lastStreamInput = null
lastKeyPress = null lastKeyPress = null
inputOpen = true inputOpen = true
keyPressVisible = echo
if (DEBUG) println("[SimpleTextTerminal] openInput()") if (DEBUG) println("[SimpleTextTerminal] openInput()")
} }
@@ -411,7 +422,8 @@ open class SimpleTextTerminal(
lastStreamInput = sb.toString() lastStreamInput = sb.toString()
sb = StringBuilder() sb = StringBuilder()
if (DEBUG) println("[SimpleTextTerminal] closeInputString(), $lastStreamInput") if (DEBUG)
println("[SimpleTextTerminal] closeInputString(), ${if (keyPressVisible) lastStreamInput else "<keypress hidden>"}")
return lastStreamInput!! return lastStreamInput!!
} }
@@ -421,7 +433,7 @@ open class SimpleTextTerminal(
if (inputOpen) { if (inputOpen) {
if (c == ASCII_CR) if (c == ASCII_CR)
printChar(ASCII_LF) printChar(ASCII_LF)
else else if (keyPressVisible)
printChar(c) printChar(c)
if (!asciiControlInUse.contains(c)) sb.append(c) if (!asciiControlInUse.contains(c)) sb.append(c)
else if (c == ASCII_DEL && sb.length > 0) sb.deleteCharAt(sb.length - 1) else if (c == ASCII_DEL && sb.length > 0) sb.deleteCharAt(sb.length - 1)
@@ -437,7 +449,7 @@ open class SimpleTextTerminal(
val AMBER = Color(255, 183, 0) // P3, 602 nm val AMBER = Color(255, 183, 0) // P3, 602 nm
val IBM_GREEN = Color(74, 255, 0) // P39, 525 nm val IBM_GREEN = Color(74, 255, 0) // P39, 525 nm
val WHITE = Color(228, 234, 255) // P4, 7 500 K val WHITE = Color(228, 234, 255) // P4, 7 500 K
val ELECTRIC_BLUE = Color(0, 239, 255) // imaginary, 486 nm val ELECTRIC_BLUE = Color(0, 226, 255) // imaginary, 483 nm
val RED = Color(250, 0, 0) // <= 645 nm val RED = Color(250, 0, 0) // <= 645 nm
val ASCII_NUL = 0.toChar() val ASCII_NUL = 0.toChar()

View File

@@ -34,7 +34,10 @@ interface Teletype {
fun newLine() fun newLine()
fun scroll(amount: Int = 1) fun scroll(amount: Int = 1)
fun openInput() /**
* @param echo if true, keypresses are echoed to the terminal.
*/
fun openInput(echo: Boolean = true)
fun closeInputKey(keyFromUI: Int): Int fun closeInputKey(keyFromUI: Int): Int
fun closeInputString(): String fun closeInputString(): String

View File

@@ -132,9 +132,9 @@ class TeletypeTerminal : Teletype {
val DEBUG = true val DEBUG = true
/** /**
* 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 lastStreamInput = null
lastKeyPress = null lastKeyPress = null
inputOpen = true inputOpen = true

View File

@@ -1,4 +1,4 @@
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) (format=lualatex 2015.10.5) 21 SEP 2016 19:32 This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) (format=lualatex 2015.10.5) 22 SEP 2016 13:09
restricted \write18 enabled. restricted \write18 enabled.
file:line:error style messages enabled. file:line:error style messages enabled.
**romapidoc.tex **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@curscurs"] = 7
luatexbase-attr: luatexbase.attributes["luaotfload@cursdone"] = 8 luatexbase-attr: luatexbase.attributes["luaotfload@cursdone"] = 8
luatexbase-attr: luatexbase.attributes["luaotfload@state"] = 9 luatexbase-attr: luatexbase.attributes["luaotfload@state"] = 9
luaotfload | main : fontloader loaded in 0.089 seconds luaotfload | main : fontloader loaded in 0.028 seconds
luatexbase-mcb: inserting 'luaotfload.node_processor' luatexbase-mcb: inserting 'luaotfload.node_processor'
at position 1 in 'pre_linebreak_filter' at position 1 in 'pre_linebreak_filter'
luatexbase-mcb: inserting 'luaotfload.node_processor' luatexbase-mcb: inserting 'luaotfload.node_processor'
@@ -1264,52 +1264,52 @@ luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Regular.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf" luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf" luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf" luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf"
Underfull \hbox (badness 2735) in paragraph at lines 136--136 Underfull \hbox (badness 2735) in paragraph at lines 138--138
[][]|\EU2/MyriadPro(0)/m/n/10 Moves the di-rec-tory to the [][]|\EU2/MyriadPro(0)/m/n/10 Moves the di-rec-tory to the
[] []
Underfull \hbox (badness 1655) in paragraph at lines 136--136 Underfull \hbox (badness 1655) in paragraph at lines 138--138
\EU2/MyriadPro(0)/m/n/10 des-ti-na-tion. Sub-di-rec-to-ries / \EU2/MyriadPro(0)/m/n/10 des-ti-na-tion. Sub-di-rec-to-ries /
[] []
Underfull \hbox (badness 2150) in paragraph at lines 136--136 Underfull \hbox (badness 2150) in paragraph at lines 138--138
[][]|\EU2/MyriadPro(0)/m/n/10 Copies the di-rec-tory to the [][]|\EU2/MyriadPro(0)/m/n/10 Copies the di-rec-tory to the
[] []
Underfull \hbox (badness 1655) in paragraph at lines 136--136 Underfull \hbox (badness 1655) in paragraph at lines 138--138
\EU2/MyriadPro(0)/m/n/10 des-ti-na-tion. Sub-di-rec-to-ries / \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 LaTeX Font Info: Font shape `EU2/MyriadPro(0)/m/sl' in size <10> not availabl
e e
(Font) Font shape `EU2/MyriadPro(0)/m/it' tried instead on input li (Font) Font shape `EU2/MyriadPro(0)/m/it' tried instead on input li
ne 136. ne 138.
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf" luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf"
luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf" [6 luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-It.otf" [6
] [7] [8] ] [7] [8]
Underfull \hbox (badness 4792) in paragraph at lines 186--186 Underfull \hbox (badness 4792) in paragraph at lines 188--188
[][]|\EU2/MyriadPro(0)/m/n/10 Con-verts byte ar-ray to the [][]|\EU2/MyriadPro(0)/m/n/10 Con-verts byte ar-ray to the
[] []
[9 [9
] ]
Underfull \hbox (badness 3354) in paragraph at lines 210--210 Underfull \hbox (badness 3354) in paragraph at lines 212--212
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns SHA-256 hash of in-put [][]|\EU2/MyriadPro(0)/m/n/10 Re-turns SHA-256 hash of in-put
[] []
Underfull \hbox (badness 4805) in paragraph at lines 210--210 Underfull \hbox (badness 4805) in paragraph at lines 212--212
[][]|\EU2/MyriadPro(0)/m/n/10 De-codes Base64 string and re- [][]|\EU2/MyriadPro(0)/m/n/10 De-codes Base64 string and re-
[] []
Underfull \hbox (badness 2707) in paragraph at lines 210--210 Underfull \hbox (badness 2707) in paragraph at lines 212--212
[][]|\EU2/MyriadPro(0)/m/n/10 En-codes in-put string as Base64 [][]|\EU2/MyriadPro(0)/m/n/10 En-codes in-put string as Base64
[] []
@@ -1318,47 +1318,45 @@ Underfull \hbox (badness 2707) in paragraph at lines 210--210
] [11 ] [11
] ]
Underfull \hbox (badness 1418) in paragraph at lines 280--280 Underfull \hbox (badness 2165) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Moves cur-sor to (\EU2/MyriadPro(0)/bx/n/10 x\EU2 \EU2/MyriadPro(0)/m/n/10 nal. Graphic ter-mi-nals also can
/MyriadPro(0)/m/n/10 , \EU2/MyriadPro(0)/bx/n/10 y\EU2/MyriadPro(0)/m/n/10 ), s
tart-ing
[] []
Underfull \hbox (badness 2932) in paragraph at lines 280--280 Underfull \hbox (badness 2932) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns \EU2/MyriadPro(0)/bx/n/10 true \EU2/Myri [][]|\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 adPro(0)/m/n/10 if the ter-mi-nal is
[] []
Underfull \hbox (badness 2772) in paragraph at lines 280--280 Underfull \hbox (badness 2772) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Emits \EU2/MyriadPro(0)/bx/n/10 c \EU2/MyriadPro( [][]|\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 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- adPro(0)/bx/n/10 y\EU2/MyriadPro(0)/m/n/10 ), con-trol se-
[] []
Underfull \hbox (badness 3118) in paragraph at lines 280--280 Underfull \hbox (badness 3118) in paragraph at lines 292--292
\EU2/MyriadPro(0)/m/n/10 ing con-trol se-quences as sym- \EU2/MyriadPro(0)/m/n/10 ing con-trol se-quences as sym-
[] []
Underfull \hbox (badness 1365) in paragraph at lines 280--280 Underfull \hbox (badness 1365) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Clears whole screen buffer and [][]|\EU2/MyriadPro(0)/m/n/10 Clears whole screen buffer and
[] []
Underfull \hbox (badness 5022) in paragraph at lines 280--280 Underfull \hbox (badness 5022) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent co-or-di-nates of [][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent co-or-di-nates of
[] []
Underfull \hbox (badness 10000) in paragraph at lines 280--280 Underfull \hbox (badness 10000) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent fore-ground [][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent fore-ground
[] []
Underfull \hbox (badness 10000) in paragraph at lines 280--280 Underfull \hbox (badness 10000) in paragraph at lines 292--292
[][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent back-ground [][]|\EU2/MyriadPro(0)/m/n/10 Re-turns cur-rent back-ground
[] []
@@ -1367,53 +1365,53 @@ Underfull \hbox (badness 10000) in paragraph at lines 280--280
] [13] <mda.pdf, id=152, 597.51233pt x 845.0471pt> ] [13] <mda.pdf, id=152, 597.51233pt x 845.0471pt>
File: mda.pdf Graphic file (type pdf) File: mda.pdf Graphic file (type pdf)
<use mda.pdf> <use mda.pdf>
Package pdftex.def Info: mda.pdf used on input line 298. Package pdftex.def Info: mda.pdf used on input line 310.
(pdftex.def) Requested size: 148.4842pt x 210.0pt. (pdftex.def) Requested size: 148.4842pt x 210.0pt.
Underfull \vbox (badness 10000) has occurred while \output is active [] Underfull \vbox (badness 10000) has occurred while \output is active []
[14] [14]
Underfull \hbox (badness 6658) in paragraph at lines 319--319 Underfull \hbox (badness 6658) in paragraph at lines 331--331
[][]|\EU2/MyriadPro(0)/m/n/10 DEL. Backspace and deletes [][]|\EU2/MyriadPro(0)/m/n/10 DEL. Backspace and deletes
[] []
[15<./mda.pdf>] [16] [15<./mda.pdf>] [16]
Underfull \hbox (badness 1092) in paragraph at lines 340--340 Underfull \hbox (badness 1092) in paragraph at lines 352--352
\EU2/MyriadPro(0)/m/n/10 ory in-stalled in the com-puter, in \EU2/MyriadPro(0)/m/n/10 ory in-stalled in the com-puter, in
[] []
Underfull \hbox (badness 3019) in paragraph at lines 371--371 Underfull \hbox (badness 3019) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Cur-rency sym-bol used in the world. [][]|\EU2/MyriadPro(0)/m/n/10 Cur-rency sym-bol used in the world.
[] []
Underfull \hbox (badness 1888) in paragraph at lines 371--371 Underfull \hbox (badness 1888) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC1. Used to [][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC1. Used to
[] []
Underfull \hbox (badness 1888) in paragraph at lines 371--371 Underfull \hbox (badness 1888) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC2. Used to [][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC2. Used to
[] []
Underfull \hbox (badness 1888) in paragraph at lines 371--371 Underfull \hbox (badness 1888) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC3. Used to [][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC3. Used to
[] []
Underfull \hbox (badness 1888) in paragraph at lines 371--371 Underfull \hbox (badness 1888) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC4. Used to [][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DC4. Used to
[] []
Underfull \hbox (badness 4713) in paragraph at lines 371--371 Underfull \hbox (badness 4713) in paragraph at lines 383--383
\EU2/MyriadPro(0)/m/n/10 change fore-ground colour to bright \EU2/MyriadPro(0)/m/n/10 change fore-ground colour to bright
[] []
Underfull \hbox (badness 2478) in paragraph at lines 371--371 Underfull \hbox (badness 2478) in paragraph at lines 383--383
[][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DLE. Used to [][]|\EU2/MyriadPro(0)/m/n/10 Ascii con-trol se-quence DLE. Used to
[] []
@@ -1445,30 +1443,30 @@ luaotfload | load : Lookup/name: "MyriadPro" -> "MyriadPro-Bold.otf" [19
\tf@toc=\write5 \tf@toc=\write5
\openout5 = romapidoc.toc \openout5 = romapidoc.toc
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 458. Package atveryend Info: Empty hook `BeforeClearDocument' on input line 470.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 458. Package atveryend Info: Empty hook `AfterLastShipout' on input line 470.
(./romapidoc.aux) (./romapidoc.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 458. Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 470.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 458. Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 470.
Package rerunfilecheck Info: File `romapidoc.out' has not changed. Package rerunfilecheck Info: File `romapidoc.out' has not changed.
(rerunfilecheck) Checksum: 3DBAF2167B6CE65D6E1362AF2C8C72DF;1706. (rerunfilecheck) Checksum: 3DBAF2167B6CE65D6E1362AF2C8C72DF;1706.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 458. Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 470.
) )
Here is how much of LuaTeX's memory you used: Here is how much of LuaTeX's memory you used:
25435 strings out of 494693 25435 strings out of 494693
100000,552014 words of node,token memory allocated 125010,552014 words of node,token memory allocated
721 words of node memory still in use: 722 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 1 kern, 5 attribute, 140 glue_spec, 5 attri 3 hlist, 1 vlist, 1 rule, 2 glue, 1 kern, 5 attribute, 140 glue_spec, 5 attri
bute_list, 2 write nodes bute_list, 2 write nodes
avail lists: 2:12868,3:242,4:3140,5:1168,6:5454,7:295,8:17,9:772,10:329 avail lists: 2:14425,3:270,4:3582,5:1296,6:6112,7:343,8:17,9:884,10:384
28549 multiletter control sequences out of 65536+600000 28549 multiletter control sequences out of 65536+600000
62 fonts using 5300671 bytes 62 fonts using 5300671 bytes
55i,12n,59p,1189b,492s stack positions out of 5000i,500n,10000p,200000b,100000s 55i,12n,59p,1189b,492s stack positions out of 5000i,500n,10000p,200000b,100000s
</Library/Fonts/MyriadPro-It.otf></Library/Fonts/MyriadPro-Regular.otf></Library </Library/Fonts/MyriadPro-It.otf></Library/Fonts/MyriadPro-Regular.otf></Library
/Fonts/MyriadPro-Bold.otf> /Fonts/MyriadPro-Bold.otf>
Output written on romapidoc.pdf (29 pages, 200321 bytes). Output written on romapidoc.pdf (29 pages, 200660 bytes).
PDF statistics: 267 PDF objects out of 1000 (max. 8388607) PDF statistics: 267 PDF objects out of 1000 (max. 8388607)
223 compressed objects within 3 object streams 223 compressed objects within 3 object streams

Binary file not shown.

View File

@@ -130,9 +130,11 @@ The path for the argument of functions blocks `\,.\,.\,' to be entered, preventi
\\ \\ \\ \\
fs.open(\textbf{path}: string, \textbf{mode}: string) & file & Opens file and returns its handle. See section \emph{File Handler} for details. 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.dofile(\textbf{path}: string) & nil & Loads the script on \textbf{path} and executes it.
\\ \\ \\ \\
fs.parent(\textbf{path}: string) & string & Returs parent directory to the \textbf{path}. fs.fetchText(\textbf{path}: string) & string & Opens the file on \textbf{path} and returns its contents as a plain text.
\end{tabularx} \end{tabularx}
\subsection{File Handler} \subsection{File Handler}
@@ -226,6 +228,8 @@ The Terminal API provides functions for sending text to the terminals, and drawi
\subsection{Functions} \subsection{Functions}
Note: cursor coordinates starts from one, not zero.
\begin{tabularx}{\textwidth}{l l X} \begin{tabularx}{\textwidth}{l l X}
\textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description} \textbf{\large Function} & \textbf{\large Return} & \textbf{\large Description}
\\ \\ \\ \\
@@ -236,9 +240,9 @@ The Terminal API provides functions for sending text to the terminals, and drawi
\\ \\ \\ \\
term.newLine() & nil & Make a new line. term.newLine() & nil & Make a new line.
\\ \\ \\ \\
term.moveCursor(\textbf{x}: int, \textbf{y}: int) & nil & Moves cursor to (\textbf{x}, \textbf{y}), starting from 1. term.moveCursor(\textbf{x}: int) & nil & Moves cursor horizontally, starting from 1.
\\ \\ \\ \\
term.width() & int & Returns the width of the terminal. Meant to be used with teletypes. 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.scroll(\textbf{n}: int) & nil & Make a new line \textbf{n} times.
\\ \\ \\ \\
@@ -258,16 +262,24 @@ The Terminal API provides functions for sending text to the terminals, and drawi
\\ \\ \\ \\
term.clearLine() & nil & Clears current line on the screen buffer, does not moves cursor. 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.getCursor() & int, int & Returns current coordinates of the cursor.
\\ \\ \\ \\
term.getX() & int & Returns X coordinate of the cursor. term.getX() & int & Returns X coordinate of the cursor.
\\ \\ \\ \\
term.getY() & int & Returns Y 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.blink(bool) & nil & Sets cursor blinking. \textbf{true} makes the cursor blink. term.blink(bool) & nil & Sets cursor blinking. \textbf{true} makes the cursor blink.
\\ \\ \\ \\
term.size() & int, int & Returns width and height of the terminal. 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.isCol() & bool & Returns if the terminal supports colour.
\\ \\ \\ \\
term.setForeCol(\textbf{col}: int) & nil & Sets foreground colour to \textbf{col} term.setForeCol(\textbf{col}: int) & nil & Sets foreground colour to \textbf{col}