You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:`leftarrow` + :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.
.. 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.
.. function:: ReadLine: det(0), Str0 = variable name, Ans = line number
12
+
12
13
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.
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.
61
66
67
+
------------
68
+
69
+
.. function:: SpecialChars: det(3)
62
70
63
-
SpecialChars: ``det(3)``
64
71
Stores the ``->`` and ``"`` characters into ``Str9``.
65
72
66
73
Returns:
67
74
* ``Str9``: ``->`` and ``"``, respectively. You can use substrings to extract them. There are also 7 more characters in ``Str9``, which are junk.
68
75
76
+
------------
77
+
78
+
.. function:: CreateVar: det(4), Str0 = variable name
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
+
76
88
Returns:
77
89
* ``Str9``: Intact if no error occured; otherwise, contains an error code.
78
90
* ``Str0``: Intact with program's name to be created.
79
91
80
92
Errors:
81
93
* ``..P:IS:FN`` if the program already exists.
82
94
95
+
------------
96
+
97
+
.. function:: ArcUnarcVar: det(5), Str0 = variable name
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.
133
155
134
156
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).
139
161
140
162
Returns:
141
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.
142
164
143
165
Errors:
144
166
* ``..INVAL:S`` if the string contains invalid characters.
145
167
168
+
------------
169
+
170
+
.. function:: BufSpriteSelect: det(10, width, X, Y, start, length), Str9 = sprite data
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.
149
173
150
174
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.
157
181
158
182
Returns:
159
183
* Sprite drawn to LCD and stored to graph buffer.
160
184
161
185
Errors:
162
186
* ``..INVAL:S`` if the string contains invalid characters.
163
187
188
+
------------
189
+
190
+
.. function:: ExecArcPrgm: det(11, function, temp_prog_number), Ans = program name
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:
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.
190
218
191
219
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.
196
224
197
225
Alternative method: ``det(12, FG_OS, BG_OS)``
198
-
199
226
* ``FG_OS``: Foreground color from TI-OS Colors menu, like RED or BLUE or NAVY.
200
227
* ``BG_OS``: Background color from TI-OS Colors menu, like RED or BLUE or NAVY.
201
228
202
-
To disable this mode, you should call ``det(12, 300)`` before exiting your program.
203
-
204
229
Colors:
205
230
* A list of colors can be found `here <colors.html>`__.
0 commit comments