Skip to content

Commit d635774

Browse files
Update documentation
Co-Authored-By: RoccoLox Programs <roccoloxprograms2018@gmail.com>
1 parent 673bd79 commit d635774

9 files changed

Lines changed: 315 additions & 121 deletions

docs/celticiiifunctions.rst

Lines changed: 199 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Some (not all) of the functions from Celtic III are included in Celtic CE.
88
Documentation
99
~~~~~~~~~~~~~
1010

11-
.. function:: GetListElem: det(30, list_element), Ans = list name
11+
.. function:: GetListElem: det(30, list_element); Ans = list name
1212

1313
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.
1414

@@ -25,7 +25,7 @@ Documentation
2525

2626
------------
2727

28-
.. function:: GetArgType: det(31), Ans = argument to check
28+
.. function:: GetArgType: det(31); Ans = argument to check
2929

3030
Outputs a real number depicting the type of argument in ``Ans``.
3131

@@ -68,7 +68,7 @@ Documentation
6868

6969
------------
7070

71-
.. function:: FindProg: det(33, type), Ans = search string
71+
.. function:: FindProg: det(33, type); Ans = search string
7272

7373
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.
7474
For example, to look for all the programs beginning with ":DCS", your code would look something like this::
@@ -85,3 +85,199 @@ Documentation
8585

8686
Errors:
8787
* ``..P:NT:FN`` if no files are found containing the specified search string.
88+
89+
------------
90+
91+
.. function:: UngroupFile: det(34, overwrite); Str0 = group name
92+
93+
This function ungroups the programs and AppVars from a group file specified in ``Str0``. It will only apply to files that are programs and AppVars, not other types like lists. If ``overwrite`` is true (not 0), files which already exist will be overwritten. If it is false (0), files will be preserved.
94+
The group name (in ``Str0``) must be preceded by the ``*row(`` token, as specified in `General Syntax <gensyntax.html#argument-types>`__.
95+
96+
Parameters:
97+
* ``overwrite``: Whether or not to overwrite files that already exist when extracting.
98+
* ``Str0``: Contains the name of the specified group. The name must be preceded by the ``*row(`` token.
99+
100+
Returns:
101+
* Ungroups all programs and AppVars from the specified group.
102+
103+
Errors:
104+
* ``..G:NT:FN`` if the group specified does not exist.
105+
* ``..P:NT:FN`` if no files in the group are able to be ungrouped (no programs or AppVars).
106+
107+
------------
108+
109+
.. function:: GetGroup: det(35); Str0 = group name
110+
111+
Puts the names of all program and AppVar files present in the specified group into ``Str9``, separated by spaces. The names will be in the same order in the string as they are found in the group.
112+
The group name (in ``Str0``) must be preceded by the ``*row(`` token, as specified in `General Syntax <gensyntax.html#argument-types>`__.
113+
114+
Parameters:
115+
* ``Str0``: Contains the name of the specified group. The name must be preceded by the ``*row(`` token.
116+
117+
Returns:
118+
* ``Str9``: Contains a list of the names of all programs and AppVars in the group, separated by spaces.
119+
120+
Errors:
121+
* ``..G:NT:FN`` if the group specified does not exist.
122+
* ``..P:NT:FN`` if no files in the group are valid (no programs or AppVars).
123+
124+
------------
125+
126+
.. function:: ExtGroup: det(36, item); Str0 = group name
127+
128+
Extracts the program or AppVar specified by ``item`` from the group specified in ``Str0``. If ``item`` is 1, it extracts the first program or AppVar, 2 extracts the second, and so on. This can be useful paired with ``GetGroup`` to figure out the order of the files in the group. If the file already exists with the same name, it will not be overwritten.
129+
The group name (in ``Str0``) must be preceded by the ``*row(`` token, as specified in `General Syntax <gensyntax.html#argument-types>`__.
130+
131+
.. warning::
132+
``item`` only counts programs and AppVars, and ignores other types, like lists. If ``item`` is 2, it refers to the second **valid** file, not necessarily the second file including all types.
133+
134+
Parameters:
135+
* ``item``: The item in the group to extract. Only applies to programs and AppVars, and begins at 1.
136+
137+
Returns:
138+
* Extracts the specified program or AppVar from the group.
139+
140+
Errors:
141+
* ``..G:NT:FN`` if the group specified does not exist.
142+
* ``..E:NT:FN`` if the specified item did not exist.
143+
* ``..P:IS:FN`` if the program already exists.
144+
145+
------------
146+
147+
.. function:: GroupMem: det(37, item); Str0 = group name
148+
149+
Returns the size of the program or AppVar specfied by ``item`` from the group specified in ``Str0``. ``item`` behaves the same way as in ``ExtGroup``.
150+
The group name (in ``Str0``) must be preceded by the ``*row(`` token, as specified in `General Syntax <gensyntax.html#argument-types>`__.
151+
152+
Parameters:
153+
* ``item``: The item in the group to extract. Only applies to programs and AppVars, and begins at 1.
154+
155+
Returns:
156+
* ``theta``: The size of the specified program or AppVar from the group.
157+
158+
Errors:
159+
* ``..G:NT:FN`` if the group specified does not exist.
160+
* ``..E:NT:FN`` if the specified item did not exist.
161+
162+
------------
163+
164+
.. function:: BinRead: det(38, byte_start, number_of_bytes); Str0 = file name
165+
166+
Reads the contents of a file starting at ``byte_start`` for ``number_of_bytes`` bytes. ``byte_start`` is 0-indexed, meaning that the first byte of the program is 0, the second is 1, and so on. The output will be a hex string representing the bytes. For example, if the following bytes were in memory:
167+
168+
==== == == == == ==
169+
Byte 0 1 2 3 4
170+
Data EF 7B 66 6F 6F
171+
==== == == == == ==
172+
173+
``Str9`` would contain this::
174+
175+
EF7B666F6F
176+
177+
Parameters:
178+
* ``byte_start``: The byte of the file to start reading from. It is 0-indexed, so the first byte of the file is 0, the second is 1, and so on.
179+
* ``number_of_bytes``: The number of bytes to read, starting at ``byte_start``. You can also read past the end of the file.
180+
* ``Str0``: The name of the file to read from. For AppVars, the name should be preceded by the ``rowSwap(`` token.
181+
182+
Returns:
183+
* ``Str9``: Contains a text string of hex representing the bytes read.
184+
185+
------------
186+
187+
.. function:: BinWrite: det(39, byte_start); Str9 = hex string to write; Str0 = file name
188+
189+
Writes the hex bytes represented in ``Str9`` to the file specified by ``Str0``, starting at ``byte_start``. ``byte_start`` is 0-indexed, meaning that the first byte of the program is 0, the second is 1, and so on.
190+
191+
Parameters:
192+
* ``byte_start``: The byte of the file to start writing to. It is 0-indexed, so the first byte of the file is 0, the second is 1, and so on.
193+
* ``Str9``: Contains a text string of hex representing the bytes to write.
194+
* ``Str0``: The name of the file to write to. For AppVars, the name should be preceded by the ``rowSwap(`` token.
195+
196+
Returns:
197+
* Writes the bytes specified in ``Str9`` to the specified file.
198+
199+
Errors:
200+
* ``..E:NT:FN`` if ``byte_start`` is past the end of the file.
201+
* ``..INVAL:S`` if there is not an even number of characters in the string or an invalid hex character is present.
202+
* ``..NT:EN:M`` if there is not enough memory to complete the write.
203+
204+
------------
205+
206+
.. function:: BinDelete: det(40, byte_start, number_of_bytes); Str0 = file name
207+
208+
Deletes the ``number_of_bytes`` bytes from the file specified by ``Str0``, starting at ``byte_start``. ``byte_start`` is 0-indexed, meaning that the first byte of the program is 0, the second is 1, and so on.
209+
210+
Parameters:
211+
* ``byte_start``: The byte of the file to start deleting from. It is 0-indexed, so the first byte of the file is 0, the second is 1, and so on.
212+
* ``number_of_bytes``: The number of bytes to delete.
213+
* ``Str0``: The name of the file to delete from. For AppVars, the name should be preceded by the ``rowSwap(`` token.
214+
215+
Returns:
216+
* Deletes the specified number of bytes from the specified file.
217+
218+
Errors:
219+
* ``..E:NT:FN`` if ``byte_start`` is past the end of the file, or the number of bytes deleted would exceed the end of the file.
220+
221+
------------
222+
223+
.. function:: HexToBin: det(41); Ans = hex string
224+
225+
Outputs the binary equivalent of the input string in ``Ans``. For example, if you did this::
226+
227+
:"464F4F424152
228+
:det(41)
229+
230+
The result would be ``"FOOBAR"``.
231+
232+
Parameters:
233+
* ``Ans``: Hex string to convert.
234+
235+
Returns:
236+
* ``Str9``: The converted string.
237+
238+
Errors:
239+
* ``..INVAL:S`` if there is not an even number of characters in the string or an invalid hex character is present.
240+
241+
------------
242+
243+
.. function:: BinToHex: det(42); Ans = token string
244+
245+
Outputs the hex equivalent of the input string in ``Ans``. For example, if you did this::
246+
247+
:"FOOBAR
248+
:det(42)
249+
250+
The result would be ``"464F4F424152"``.
251+
252+
Parameters:
253+
* ``Ans``: Binary string to convert.
254+
255+
Returns:
256+
* ``Str9``: The converted string.
257+
258+
------------
259+
260+
.. function:: GraphCopy: det(43)
261+
262+
Copies the graph buffer to the screen.
263+
264+
------------
265+
266+
.. function:: Edit1Byte: det(44, string_number, target_byte, replace_byte)
267+
268+
Replaces the byte at ``target_byte`` of the specified string with the byte specified by ``replace_byte``. ``target_byte`` is 0-indexed, meaning that the first byte of the program is 0, the second is 1, and so on. For example::
269+
270+
:det(44, 0, 0, 255)
271+
272+
This code will replace byte 0 of ``Str0`` with the byte 255 in decimal, or 0xFF in hex.
273+
274+
Parameters:
275+
* ``string_number``: The string to modify. 0 is ``Str0``, 1 is ``Str1``, and so on.
276+
* ``target_byte``: The byte of the string to modify. It is 0-indexed, so the first byte of the file is 0, the second is 1, and so on.
277+
* ``replace_byte``: The byte to replace the target byte with, in decimal format. Can be 0 - 255 (0x00 - 0xFF).
278+
279+
Returns:
280+
* Replaces the target byte of a string with the specified replacement byte.
281+
282+
Errors:
283+
* ``..E:NT:FN`` if the target byte does not exist in the string.

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'Celtic CE'
23-
copyright = '2022, RoccoLox Programs, TIny_Hacker'
23+
copyright = '2022 - 2023, RoccoLox Programs, TIny_Hacker'
2424
author = 'RoccoLox Programs, TIny_Hacker'
2525

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

3131

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

docs/csefunctions.rst

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

11-
.. function:: ReadLine: det(0), Str0 = variable name, Ans = line number
11+
.. function:: ReadLine: det(0); Str0 = variable name; Ans = line number
1212

1313
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.
1414

@@ -28,7 +28,7 @@ Documentation
2828

2929
------------
3030

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

3333
Replaces (overwrites) a line in a program or AppVar. ``Ans`` refers to the line to replace.
3434

@@ -45,7 +45,7 @@ Documentation
4545

4646
------------
4747

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

5050
Insets a line into a program or AppVar. ``Ans`` refers to the line number to write to.
5151

@@ -71,11 +71,11 @@ Documentation
7171
Stores the ``->`` and ``"`` characters into ``Str9``.
7272

7373
Returns:
74-
* ``Str9``: ``->`` and ``"``, respectively. You can use substrings to extract them. There are also 7 more characters in ``Str9``, which are junk.
74+
* ``Str9``: ``->`` and ``"``, respectively. you can use substrings to extract them. There are also 7 more characters in ``Str9``, which are junk.
7575

7676
------------
7777

78-
.. function:: CreateVar: det(4), Str0 = variable name
78+
.. function:: CreateVar: det(4); Str0 = variable name
7979

8080
Create a program or AppVar given a name.
8181

@@ -94,7 +94,7 @@ Documentation
9494

9595
------------
9696

97-
.. function:: ArcUnarcVar: det(5), Str0 = variable name
97+
.. function:: ArcUnarcVar: det(5); Str0 = variable name
9898

9999
Archive/unarchive a program or AppVar given a name.
100100

@@ -106,7 +106,7 @@ Documentation
106106

107107
------------
108108

109-
.. function:: DeleteVar: det(6), Str0 = variable name
109+
.. function:: DeleteVar: det(6); Str0 = variable name
110110

111111
Delete a program variable or an AppVar given a name.
112112

@@ -118,7 +118,7 @@ Documentation
118118

119119
------------
120120

121-
.. function:: DeleteLine: det(7), Str0 = variable name, Ans = line number
121+
.. function:: DeleteLine: det(7); Str0 = variable name; Ans = line number
122122

123123
Deletes a line from a program or AppVar. ``Ans`` is the line to delete.
124124

@@ -131,7 +131,7 @@ Documentation
131131

132132
------------
133133

134-
.. function:: VarStatus: det(8), Str0 = variable name
134+
.. function:: VarStatus: det(8); Str0 = variable name
135135

136136
Output status string describing a program or AppVar's current state, including size, visibility, and more.
137137

@@ -149,32 +149,32 @@ Documentation
149149

150150
------------
151151

152-
.. function:: BufSprite: det(9, width, X, Y), Str9 = sprite data
152+
.. function:: BufSprite: det(9, width, x, y); Str9 = sprite data
153153

154154
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.
155155

156156
Parameters:
157157
* ``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.
158+
* ``x``: x coordinate to the top-left corner of the sprite.
159+
* ``y``: y coordinate to the top-left corner of the sprite.
160160
* ``width``: Sprite width (height is computed).
161161

162162
Returns:
163-
* ``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.
163+
* ``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.
164164

165165
Errors:
166166
* ``..INVAL:S`` if the string contains invalid characters.
167167

168168
------------
169169

170-
.. function:: BufSpriteSelect: det(10, width, X, Y, start, length), Str9 = sprite data
170+
.. function:: BufSpriteSelect: det(10, width, x, y, start, length); Str9 = sprite data
171171

172172
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.
173173

174174
Parameters:
175175
* ``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.
176+
* ``x``: x coordinate to the top-left corner of the sprite.
177+
* ``y``: y coordinate to the top-left corner of the sprite.
178178
* ``width``: Sprite width (height is computed).
179179
* ``start``: Offset into ``Str9`` of the start of pixel data, begins at 0.
180180
* ``length``: Length of sprite data in characters.
@@ -187,7 +187,7 @@ Documentation
187187

188188
------------
189189

190-
.. function:: ExecArcPrgm: det(11, function, temp_prog_number), Ans = program name
190+
.. function:: ExecArcPrgm: det(11, function, temp_prog_number); Ans = program name
191191

192192
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:
193193

@@ -212,19 +212,19 @@ Documentation
212212

213213
------------
214214

215-
.. function:: DispColor: det(12, FG_LO, FG_HI, BG_LO, BG_HI)
215+
.. function:: DispColor: det(12, fg_low, fg_high, bg_low, bg_high)
216216

217217
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.
218218

219219
Parameters:
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.
224-
225-
Alternative method: ``det(12, FG_OS, BG_OS)``
226-
* ``FG_OS``: Foreground color from TI-OS Colors menu, like RED or BLUE or NAVY.
227-
* ``BG_OS``: Background color from TI-OS Colors menu, like RED or BLUE or NAVY.
220+
* ``fg_low``: low byte of foreground color.
221+
* ``fg_high``: high byte of foreground color.
222+
* ``bg_low``: low byte of background color.
223+
* ``bg_high``: high byte of background color.
224+
225+
Alternative method: ``det(12, fg_os, bg_os)``
226+
* ``fg_os``: Foreground color from TI-OS Colors menu, like RED or BLUE or NAVy.
227+
* ``bg_os``: Background color from TI-OS Colors menu, like RED or BLUE or NAVy.
228228

229229
Colors:
230230
* A list of colors can be found `here <colors.html>`__.

0 commit comments

Comments
 (0)