Skip to content

Commit 93d6801

Browse files
committed
Update documentation
1 parent 60efb03 commit 93d6801

14 files changed

+672
-63
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode
2+
build
23
*.8xp

CelticCE.pdf

51.5 KB
Binary file not shown.

docs/celticiiifunctions.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Celtic III Functions
2+
======================
3+
4+
Overview
5+
~~~~~~~~
6+
Some (not all) of the functions from Celtic III are included in Celtic CE.
7+
8+
Documentation
9+
~~~~~~~~~~~~~
10+
11+
.. function:: GetListElem: det(30, list_element), Ans = list name
12+
13+
Gets a value at ``list_element`` in the list specified. For example, with ``Ans`` equal to ":sub:`L`\FOO" (Where :sub:`L`\ is the list token found in :menuselection:`List --> OPS`). This is useful if the list being accessed is archived, for example.
14+
15+
Parameters:
16+
* ``list_element``: Element of the list to access, beginning at 1. Accessing 0 will return the dimension of the list.
17+
* ``Ans``: Name of the list to access. Begins with the :sub:`L`\ token found in the :menuselection:`List --> OPS`. (:kbd:`2nd` + :kbd:`stat` + :kbd:`left arrow` + :kbd:`alpha` + :kbd:`apps`).
18+
19+
Returns:
20+
* ``Theta``: The number at the element of the list accessed, or the dimension of the list if ``list_element`` was 0.
21+
22+
Errors:
23+
* ``..NT:A:LS`` if the user did not specify a valid list.
24+
* ``..E:NT:FN`` if the entry was not found in the list specified.
25+
26+
------------
27+
28+
.. function:: GetArgType: det(31), Ans = argument to check
29+
30+
Outputs a real number depicting the type of argument in ``Ans``.
31+
32+
Parameters:
33+
* ``Ans``: Argument to check the type of
34+
35+
Returns:
36+
* ``Theta``: The number corresponding to the argument's type. A table with the possible types is below.
37+
38+
====== ========
39+
Number Type
40+
0 Real
41+
1 List
42+
2 Matrix
43+
4 String
44+
12 Complex
45+
13 Cpx List
46+
====== ========
47+
48+
------------
49+
50+
.. function:: ChkStats: det(32, function)
51+
52+
This is a multi-purpose command used to read various system statuses. The output will very based on the specified function. A table with the possible functions and their resulting outputs is below.
53+
54+
======== ==============================================================================
55+
Function Output
56+
0 Total free RAM (In ``Str9``)
57+
1 Total free ROM (Also in ``Str9``)
58+
2 Bootcode (Also in ``Str9``)
59+
3 OS Version (Also in ``Str9``)
60+
4 Hardware version: 0 for 84 Plus CE, 1 for 83 Premium CE (Returns in ``Theta``)
61+
======== ==============================================================================
62+
63+
Parameters:
64+
* ``function``: Function to complete
65+
66+
Returns:
67+
* Varies based on input
68+
69+
------------
70+
71+
.. function:: FindProg: det(33, type), Ans = search string
72+
73+
This does not search for file names, instead it searches for file contents. The search string checks for the beginning contents of a program. Type refers to the type of file to search, with 0 being programs and 1 being appvars. The function will return a string containing the names of the files containing the search phrase, with each name separated by a space.
74+
For example, to look for all the programs beginning with ":DCS", your code would look something like this::
75+
76+
":DCS
77+
det(33, 0)
78+
79+
Parameters:
80+
* ``type``: Type of file to search. 0 for programs, 1 for appvars.
81+
* ``Ans``: Content string to search for. If ``Ans`` does not contain a string, it will return a complete list of all the files of the specified type.
82+
83+
Returns:
84+
* ``Str9``: Contains a list with the names of files containing the search string, separated by spaces. If ``Ans`` was not a string, it returns a list of all files of the specified type.
85+
86+
Errors:
87+
* ``..P:NT:FN`` if no files are found containing the specified search string.

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
author = 'RoccoLox Programs, TIny_Hacker'
2525

2626
# The short X.Y version
27-
version = 'b1.0'
27+
version = 'b1.1'
2828
# The full version, including alpha/beta/rc tags
29-
release = 'Beta 1.0'
29+
release = 'Beta 1.1'
3030

3131

3232
# -- General configuration ---------------------------------------------------

docs/csefunctions.rst

Lines changed: 59 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ These functions are the same as those included in Doors CSE 8 for the TI-84 Plus
88
Documentation
99
~~~~~~~~~~~~~
1010

11-
ReadLine: ``det(0)``, ``Str0`` = **variable name**, ``Ans`` = **line number**
11+
.. function:: ReadLine: det(0), Str0 = variable name, Ans = line number
12+
1213
Reads a line from a program or AppVar. If ``Ans`` (line number) equals 0, then Theta will be overwritten with the number of lines in the program being read. Otherwise, ``Ans`` refers to the line being read.
1314

1415
.. warning::
@@ -25,8 +26,10 @@ ReadLine: ``det(0)``, ``Str0`` = **variable name**, ``Ans`` = **line number**
2526
Errors:
2627
* ``..NULLSTR`` if the line is empty.
2728

29+
------------
30+
31+
.. function:: ReplaceLine: det(1), Str0 = variable name, Ans = line number, Str9 = replacement
2832

29-
ReplaceLine: ``det(1)``, ``Str0`` = **variable name**, ``Ans`` = **line number**, ``Str9`` = **replacement**
3033
Replaces (overwrites) a line in a program or AppVar. ``Ans`` refers to the line to replace.
3134

3235
Parameters:
@@ -40,8 +43,10 @@ ReplaceLine: ``det(1)``, ``Str0`` = **variable name**, ``Ans`` = **line number**
4043
Errors:
4144
* ``..PGM:ARC`` if the file is archived.
4245

46+
------------
47+
48+
.. function:: InsertLine: det(2), Str0 = variable name, Ans = line number, Str9 = contents
4349

44-
InsertLine: ``det(2)``, ``Str0`` = **variable name**, ``Ans`` = **line number**, ``Str9`` = **contents**
4550
Insets a line into a program or AppVar. ``Ans`` refers to the line number to write to.
4651

4752
Parameters:
@@ -59,29 +64,38 @@ InsertLine: ``det(2)``, ``Str0`` = **variable name**, ``Ans`` = **line number**,
5964
.. note::
6065
If your usage of InsertLine results in the program exceeding 65535 bytes (the maximum size of a file), it will result in loss of memory. Celtic does not check if you exceed this filesize, as there should be no reason anyone would do this in the first place.
6166

67+
------------
68+
69+
.. function:: SpecialChars: det(3)
6270

63-
SpecialChars: ``det(3)``
6471
Stores the ``->`` and ``"`` characters into ``Str9``.
6572

6673
Returns:
6774
* ``Str9``: ``->`` and ``"``, respectively. You can use substrings to extract them. There are also 7 more characters in ``Str9``, which are junk.
6875

76+
------------
77+
78+
.. function:: CreateVar: det(4), Str0 = variable name
6979

70-
CreateVar: ``det(4)``, ``Str0`` = **variable name**
7180
Create a program or AppVar given a name.
7281

7382
Parameters:
7483
* ``Str0``: Name of program or AppVar to create.
7584

85+
Alternative method for appvars: ``det(4, HEADER), Str0 = variable name``
86+
* ``HEADER``: whether or not to include a header which allows `CEaShell <https://github.com/roccoloxprograms/shell>`__ to edit the appvar. This extra argument is optional. 1 to include the header, and 0 to not.
87+
7688
Returns:
7789
* ``Str9``: Intact if no error occured; otherwise, contains an error code.
7890
* ``Str0``: Intact with program's name to be created.
7991

8092
Errors:
8193
* ``..P:IS:FN`` if the program already exists.
8294

95+
------------
96+
97+
.. function:: ArcUnarcVar: det(5), Str0 = variable name
8398

84-
ArcUnarcVar: ``det(5)``, ``Str0`` = **variable name**
8599
Archive/unarchive a program or AppVar given a name.
86100

87101
Parameters:
@@ -90,8 +104,10 @@ ArcUnarcVar: ``det(5)``, ``Str0`` = **variable name**
90104
Returns:
91105
* Moves a program or AppVar into RAM if it was in Archive, or into Archive if it was in RAM.
92106

107+
------------
108+
109+
.. function:: DeleteVar: det(6), Str0 = variable name
93110

94-
DeleteVar: ``det(6)``, ``Str0`` = **variable name**
95111
Delete a program variable or an AppVar given a name.
96112

97113
Parameters:
@@ -100,8 +116,10 @@ DeleteVar: ``det(6)``, ``Str0`` = **variable name**
100116
Returns:
101117
* The indicated program or AppVar is deleted.
102118

119+
------------
120+
121+
.. function:: DeleteLine: det(7), Str0 = variable name, Ans = line number
103122

104-
DeleteLine: ``det(7)``, ``Str0`` = **variable name**, ``Ans`` = **line number**
105123
Deletes a line from a program or AppVar. ``Ans`` is the line to delete.
106124

107125
Parameters:
@@ -111,8 +129,10 @@ DeleteLine: ``det(7)``, ``Str0`` = **variable name**, ``Ans`` = **line number**
111129
Returns:
112130
* ``Str9``: Intact if no error occured; otherwise, contains an error code.
113131

132+
------------
133+
134+
.. function:: VarStatus: det(8), Str0 = variable name
114135

115-
VarStatus: ``det(8)``, ``Str0`` = **variable name**
116136
Output status string describing a program or AppVar's current state, including size, visibility, and more.
117137

118138
Parameters:
@@ -127,42 +147,48 @@ VarStatus: ``det(8)``, ``Str0`` = **variable name**
127147
* 5th - 9th character: Size, in bytes
128148
* Example: ``AVL 01337`` = Archived, visible, locked, 1337 bytes.
129149

150+
------------
151+
152+
.. function:: BufSprite: det(9, width, X, Y), Str9 = sprite data
130153

131-
BufSprite: ``det(9, width, X, Y)``, ``Str9`` = **sprite data**
132154
Draws indexed (palette-based) sprite onto the LCD and into the graph buffer. Copies the contents of the graph buffer under the sprite back into Str9, so that you can "erase" the sprite back to the original background. Good for moving player characters, cursors, and the like. Interacts politely with Pic variables and OS drawing commands like ``Line(``, ``Circle(``, ``Text(``, and so on. If you want to draw a lot of different sprites to the screen and won't need to erase them back to the background, then use BufSpriteSelect instead.
133155

134156
Parameters:
135-
* ``Str9`` = Sprite data as ASCII hex, one nibble per byte. The digits 1-F are valid colors (1 = blue, 2 = red, 3 = black, etc), while G will cause the routine to skip to the next line. 0 is normal transparency, and lets the background show through. H is a special kind of transparency that erases back to transparency instead of leaving the background color intact.
136-
* ``X`` = X coordinate to the top-left corner of the sprite.
137-
* ``Y`` = Y coordinate to the top-left corner of the sprite.
138-
* ``width`` = Sprite width (height is computed).
157+
* ``Str9``: Sprite data as ASCII hex, one nibble per byte. The digits 1-F are valid colors (1 = blue, 2 = red, 3 = black, etc), while G will cause the routine to skip to the next line. 0 is normal transparency, and lets the background show through. H is a special kind of transparency that erases back to transparency instead of leaving the background color intact.
158+
* ``X``: X coordinate to the top-left corner of the sprite.
159+
* ``Y``: Y coordinate to the top-left corner of the sprite.
160+
* ``width``: Sprite width (height is computed).
139161

140162
Returns:
141163
* ``Str9``: Same length as input, contains the previous contents of the graph buffer where the sprite was drawn. You can call ``det(9...)`` again without changing Str9 to effectively undo the first sprite draw.
142164

143165
Errors:
144166
* ``..INVAL:S`` if the string contains invalid characters.
145167

168+
------------
169+
170+
.. function:: BufSpriteSelect: det(10, width, X, Y, start, length), Str9 = sprite data
146171

147-
BufSpriteSelect: ``det(10, width, X, Y, start, length)``, ``Str9`` = **sprite data**
148172
Draws indexed (palette-based) sprite onto the LCD and into the graph buffer. Good for drawing tilemaps, backgrounds, and other sprites that you won't want to individually erase. If you want to be able to erase the sprite drawn and restore the background, you should consider BufSprite instead. This routine takes an offset into Str9 and a sprite length as arguments, so that you can pack multiple sprites of different lengths into Str9.
149173

150174
Parameters:
151-
* ``Str9`` = Sprite data as ASCII hex, one nibble per byte. The digits 1-F are valid colors (1 = blue, 2 = red, 3 = black, etc), while G will cause the routine to skip to the next line. 0 is normal transparency, and lets the background show through. H is a special kind of transparency that erases back to transparency instead of leaving the background color intact.
152-
* ``X`` = X coordinate to the top-left corner of the sprite.
153-
* ``Y`` = Y coordinate to the top-left corner of the sprite.
154-
* ``width`` = Sprite width (height is computed).
155-
* ``start`` = Offset into ``Str9`` of the start of pixel data, begins at 0.
156-
* ``length`` = Length of sprite data in characters.
175+
* ``Str9``: Sprite data as ASCII hex, one nibble per byte. The digits 1-F are valid colors (1 = blue, 2 = red, 3 = black, etc), while G will cause the routine to skip to the next line. 0 is normal transparency, and lets the background show through. H is a special kind of transparency that erases back to transparency instead of leaving the background color intact.
176+
* ``X``: X coordinate to the top-left corner of the sprite.
177+
* ``Y``: Y coordinate to the top-left corner of the sprite.
178+
* ``width``: Sprite width (height is computed).
179+
* ``start``: Offset into ``Str9`` of the start of pixel data, begins at 0.
180+
* ``length``: Length of sprite data in characters.
157181

158182
Returns:
159183
* Sprite drawn to LCD and stored to graph buffer.
160184

161185
Errors:
162186
* ``..INVAL:S`` if the string contains invalid characters.
163187

188+
------------
189+
190+
.. function:: ExecArcPrgm: det(11, function, temp_prog_number), Ans = program name
164191

165-
ExecArcPrgm: ``det(11, function, temp_prog_number)``, ``Ans`` = **program name**
166192
Copies a program to the ``XTEMP`` program of the specified ``temp_prog_number``. ``Ans`` is the name of the program to copy. ``function`` refers to the behavior of the ``ExecArcPrgm`` command, as seen in the table below:
167193

168194
==== ================================================================
@@ -174,33 +200,32 @@ ExecArcPrgm: ``det(11, function, temp_prog_number)``, ``Ans`` = **program name**
174200
==== ================================================================
175201

176202
Parameters:
177-
* ``function`` = The requested behavior of the function. Can be 0, 1, or 2.
178-
* ``temp_prog_number`` = The number of the ``XTEMP`` program to create/delete.
179-
* ``Ans`` = Name of program to copy from.
203+
* ``function``: The requested behavior of the function. Can be 0, 1, or 2.
204+
* ``temp_prog_number``: The number of the ``XTEMP`` program to create/delete.
205+
* ``Ans``: Name of program to copy from.
180206

181207
Returns:
182208
* Completes the specified function.
183209

184210
Errors:
185211
* ``..NT:EN:M`` if there is not enough memory to complete the action.
186212

213+
------------
214+
215+
.. function:: DispColor: det(12, FG_LO, FG_HI, BG_LO, BG_HI)
187216

188-
DispColor: ``det(12, FG_LO, FG_HI, BG_LO, BG_HI)``
189-
Changes the foreground and background color for ``Output(``, ``Disp``, and ``Pause`` to arbitrary 16-bit colors, or disables this feature. Due to technical limitations, the foreground and background for ``Text()`` cannot be changed to arbitrary colors.
217+
Changes the foreground and background color for ``Output(``, ``Disp``, and ``Pause`` to arbitrary 16-bit colors, or disables this feature. Due to technical limitations, the foreground and background for ``Text()`` cannot be changed to arbitrary colors. To disable this mode, you should call ``det(12, 300)`` before exiting your program.
190218

191219
Parameters:
192-
* ``FG_LO`` = low byte of foreground color.
193-
* ``FG_HI`` = high byte of foreground color.
194-
* ``BG_LO`` = low byte of background color.
195-
* ``BG_HI`` = high byte of background color.
220+
* ``FG_LO``: low byte of foreground color.
221+
* ``FG_HI``: high byte of foreground color.
222+
* ``BG_LO``: low byte of background color.
223+
* ``BG_HI``: high byte of background color.
196224

197225
Alternative method: ``det(12, FG_OS, BG_OS)``
198-
199226
* ``FG_OS``: Foreground color from TI-OS Colors menu, like RED or BLUE or NAVY.
200227
* ``BG_OS``: Background color from TI-OS Colors menu, like RED or BLUE or NAVY.
201228

202-
To disable this mode, you should call ``det(12, 300)`` before exiting your program.
203-
204229
Colors:
205230
* A list of colors can be found `here <colors.html>`__.
206231

0 commit comments

Comments
 (0)