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
Copy file name to clipboardExpand all lines: docs/celticiiifunctions.rst
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,7 +284,7 @@ Documentation
284
284
285
285
------------
286
286
287
-
.. function:: ErrorHandle: det(45); Ans = program to run
287
+
.. function:: ErrorHandle: det(45, get_offset); Ans = program to run
288
288
289
289
Executes BASIC code with an error handler installed. That means the code you execute can do anything it wants including divide by zero, and it will simply end the execution but an obvious system error will not trigger. Instead, this command will return with a value that indicates the error condition. This command has two different modes. If ``Ans`` contains a program name (beginning with the ``prgm`` token), it will run that program. If ``Ans`` contains program code, it will execute that code instead. This will also work with programs beginning with the ``Asm84CEPrgm`` token.
290
290
@@ -294,9 +294,11 @@ Documentation
294
294
295
295
Parameters:
296
296
* ``Ans``: The name of the program to run, or TI-BASIC code to be executed
297
+
* ``get_offset``: If ``get_offset`` is 1, ErrorHandle will return the byte offset the error occured at in ``Ans``. If it is 0, it will not. This only works with running programs, not strings.
297
298
298
299
Returns:
299
300
* ``Theta``: Contains the error code returned by the program, or 0 if no error occured.
301
+
* ``Ans``: Contains the byte offset the error occured at, if ``get_offset`` 1 and an error occured. Otherwise ``Ans`` is not modified.
Copy file name to clipboardExpand all lines: docs/gensyntax.rst
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,11 @@ If your program uses Celtic, it is recommended that it makes sure Celtic is inst
35
35
36
36
``det([[20]])`` will equal 90 if Celtic CE is installed. If the program aims to be compatible with Celtic 2 CSE, you may wish to refer to the `list of version codes <https://dcs.cemetech.net/index.php?title=Third-Party_BASIC_Libraries_(Color)>`__ on the DCS Wiki as well.
37
37
38
+
prgmAINSTALL
39
+
~~~~~~~~~~~~
40
+
41
+
You'll notice that along with the CelticCE installer binary, Celtic also comes with a program called **AINSTALL**. This program can be used to install CelticCE's hooks (The part of the installation done after the app has been installed) by running it instead of needing to open the app. Like the **AINSTALL** program in Celtic III, this can be used if you wish to install CelticCE from a TI-BASIC program, by simply running **prgmAINSTALL** in it. Keep in mind that **prgmAINSTALL** will only work if the CelticCE app is present and installed on your calculator.
42
+
38
43
Argument Types
39
44
~~~~~~~~~~~~~~
40
45
@@ -51,6 +56,8 @@ When using ``Str0`` as a program name, simply store the name of the program into
51
56
:"rowSwap(FOO" -> Str0 //AppVar FOO
52
57
:"*row(FOO" -> //group FOO
53
58
59
+
The system programs ``prgm#`` and ``prgm!`` are not supported, so if you attempt to use a Celtic command on them, the command will simply exit.
60
+
54
61
If a string is used, it must be in the RAM when the function is called.
55
62
56
63
.. warning:: In almost all cases, Celtic will detect if you passed invalid arguments and return an error instead. However, in the (extremely) rare case that you tried to pass a string with the length of 0, it will not handle this. Don't worry, there shouldn't be any reason this would happen without you trying to make it happen.
.. function:: ShiftScreen: det(58, direction, amount, x, y, width, height)
243
243
244
-
Moves the screen a specified amount of pixels in a specified direction. The following directions and corresponding values are below:
244
+
Shifts the pixels within a user-specified region of the screen a specified amount of pixels in a specified direction. The following directions and corresponding values are below:
245
245
246
246
===== =========
247
247
Value Direction
@@ -255,6 +255,13 @@ Documentation
255
255
Parameters:
256
256
* ``direction``: Direction to move the screen in, as seen in the table above.
257
257
* ``amount``: The amount of pixels to move the screen.
258
+
* ``x``: Starting X position of the region of the screen to shift.
259
+
* ``y``: Starting Y position of the region of the screen to shift.
260
+
* ``width``: Width of the region of the screen to shift.
261
+
* ``height``: Height of the region of the screen to shift.
262
+
263
+
Alternative method: ``det(58, direction, amount)``
264
+
This alternative method acts as a shorthand way to shift the entire screen, rather than a specified region.
258
265
259
266
Returns:
260
267
* Moves the screen in the specified direction.
@@ -409,3 +416,108 @@ Documentation
409
416
410
417
Returns:
411
418
* ``Ans``: 0 if the rectangles do not intersect, and 1 if they do.
Displays a character specified by the user at ``x``, ``y``, with a user-specified background color as well. ``char`` can range from 0 - 255. In order to figure out the ``char`` value for your preferred character, you can use the handy images below. Simply take the X and Y values on the chart and add them together.
425
+
426
+
.. figure:: images/fontMapSmall.png
427
+
:alt:Chart for determining the code of a specific character (Small font)
428
+
:align:center
429
+
430
+
Small Font
431
+
432
+
.. figure:: images/fontMapLarge.png
433
+
:alt:Chart for determining the code of a specific character (Large font)
434
+
:align:center
435
+
436
+
Large Font
437
+
438
+
Parameters:
439
+
* ``font``: Whether to use the OS large or small font. 0 for the small font and 1 for the large font.
440
+
* ``fg_low``: Low byte of the foreground color.
441
+
* ``fg_high``: High byte of the foreground color.
442
+
* ``bg_low``: Low byte of the background color.
443
+
* ``bg_high``: High byte of the background color.
444
+
* ``x``: X coordinate to display the character at.
445
+
* ``y``: Y coordinate to display the character at.
446
+
* ``char``: The numeric code associated with the character to display. See images above for more info.
447
+
448
+
Alternative method: ``det(66, font, fg_os, bg_os, x, y, char)``
449
+
* ``fg_os``: Foreground color from TI-OS Colors menu, like RED or BLUE or NAVY.
450
+
* ``bg_os``: Background color from TI-OS Colors menu, like RED or BLUE or NAVY.
451
+
452
+
Colors:
453
+
* A list of colors can be found `here <colors.html>`__.
454
+
455
+
Returns:
456
+
* Displays the specified character.
457
+
458
+
------------
459
+
460
+
.. function:: PutTransChar: det(67, font, low, high, x, y, char)
461
+
462
+
Displays a character specified by the user at ``x``, ``y``, with a transparent background. See the above command for information on character codes.
463
+
464
+
Parameters:
465
+
* ``font``: Whether to use the OS large or small font. 0 for the small font and 1 for the large font.
466
+
* ``low``: Low byte of the color.
467
+
* ``high``: High byte of the color.
468
+
* ``x``: X coordinate to display the character at.
469
+
* ``y``: Y coordinate to display the character at.
470
+
* ``char``: The numeric code associated with the character to display. See images above for more info.
471
+
472
+
Alternative method: ``det(67, font, os_color, x, y, char)``
473
+
* ``os_color``: Color from TI-OS Colors menu, like RED or BLUE or NAVY.
474
+
475
+
Colors:
476
+
* A list of colors can be found `here <colors.html>`__.
477
+
478
+
Returns:
479
+
* Displays the specified character.
480
+
481
+
------------
482
+
483
+
.. function:: HorizLine: det(68, low, high, x, y, length)
484
+
485
+
Draws a horizontal line beginning at ``x``, ``y``, with a length of ``length``.
486
+
487
+
Parameters:
488
+
* ``low``: Low byte of the color.
489
+
* ``high``: High byte of the color.
490
+
* ``x``: X coordinate to begin drawing the line at.
491
+
* ``y``: Y coordinate to begin drawing the line at.
492
+
* ``length``: The length of the horizontal line.
493
+
494
+
Alternative method: ``det(68, os_color, x, y, length)``
495
+
* ``os_color``: Color from TI-OS Colors menu, like RED or BLUE or NAVY.
496
+
497
+
Colors:
498
+
* A list of colors can be found `here <colors.html>`__.
499
+
500
+
Returns:
501
+
* Draws a horizontal line ``length`` pixels long, beginning at ``x``, ``y``.
502
+
503
+
------------
504
+
505
+
.. function:: VertLine: det(69, low, high, x, y, length)
506
+
507
+
Draws a vertical line beginning at ``x``, ``y``, with a length of ``length``.
508
+
509
+
Parameters:
510
+
* ``low``: Low byte of the color.
511
+
* ``high``: High byte of the color.
512
+
* ``x``: X coordinate to begin drawing the line at.
513
+
* ``y``: Y coordinate to begin drawing the line at.
514
+
* ``length``: The length of the vertical line.
515
+
516
+
Alternative method: ``det(69, os_color, x, y, length)``
517
+
* ``os_color``: Color from TI-OS Colors menu, like RED or BLUE or NAVY.
518
+
519
+
Colors:
520
+
* A list of colors can be found `here <colors.html>`__.
521
+
522
+
Returns:
523
+
* Draws a vertical line ``length`` pixels long, beginning at ``x``, ``y``.
0 commit comments