Skip to content

Commit 82b4d03

Browse files
Update docs and changelog for 1.3 beta
Co-Authored-By: RoccoLox Programs <roccoloxprograms2018@gmail.com>
1 parent a62d19a commit 82b4d03

File tree

11 files changed

+567
-20
lines changed

11 files changed

+567
-20
lines changed

CHANGELOG.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,62 @@
22

33
All notable changes to the Celtic CE library will be documented in this file.
44

5+
## [1.3.0-beta] - 2023-06-01
6+
7+
### Added
8+
9+
- Graphics Functions:
10+
- GetStringWidth
11+
- TransSprite
12+
- ScaleSprite
13+
- ScaleTSprite
14+
- ScrollScreen
15+
- RGBto565
16+
- DrawRect
17+
- DrawCircle
18+
- FillCircle
19+
- DrawArc
20+
- DispTransText
21+
- ChkRect
22+
- OS Utility Functions:
23+
- SearchFile
24+
- CheckGC
25+
- Celtic III Functions:
26+
- ErrorHandle
27+
- StringRead
28+
- HexToDec
29+
- DecToHex
30+
- EditWord
31+
- BitOperate
32+
- GetProgList
33+
34+
### Changed
35+
36+
- Doors CE 9 Functions:
37+
- DispText command uses a 16-bit number to count the number of characters being displayed on the screen instead of an 8-bit one
38+
- TextRect command renamed to FillRect and no longer uses the TI-OS routine
39+
- Graphics Functions:
40+
- DrawLine command no longer uses the TI-OS routine
41+
- Greatly optimized SetPixel command
42+
- PixelTestColor now returns in Ans
43+
- PutSprite can now read sprite data from a user-specified string variable
44+
- Celtic III Functions:
45+
- FindProg command now returns a memory error if there isn't enough RAM to store the return string
46+
- Split up files
47+
- Better formatting consistency in CHANGELOG.md
48+
- Allocated an extra 3 bytes for a 9th argument to be passed in Celtic instructions
49+
- Celtic now uses its own ConvOP1 routine (borrowed from Doors CS 7 and modified for eZ80) rather than the TI-OS one
50+
- Some arbitrary numbers in the source code were changed to equates for better readability
51+
- X and Y coordinates on the screen are now calculated in VRAM using a routine provided by [calc84maniac](https://github.com/calc84maniac)
52+
- Status bar command preview in the TI-OS BASIC editor now says "NA" instead of "None" when there are no input arguments for a command
53+
- Several minor optimizations
54+
55+
### Fixed
56+
- Installer will automatically delete itself even if the program has been renamed
57+
- Celtic will pop all remaining arguments off the FPS if it encounters an invalid argument
58+
- Celtic correctly detects if not enough arguments have been passed for certain commands
59+
- Longer variable names and groups are now properly detected
60+
561
## [1.2.0-beta] - 2023-02-22
662

763
### Added
@@ -21,15 +77,15 @@ All notable changes to the Celtic CE library will be documented in this file.
2177

2278
### Changed
2379

24-
- OS Utility Functions
80+
- OS Utility Functions:
2581
- PrgmToStr now returns an error if the specified file contains no data
2682
- Jump table is now an LUT. Jumping code has also been reworked
2783
- Optimized app UI code
2884
- Zero out help hook pointer to be safe
2985

3086
### Fixed
3187

32-
- Fixed HidePrgm function to work with archived programs
88+
- Fixed HidePrgm command to work with archived programs
3389

3490
## [1.1.0-beta] - 2022-11-29
3591

@@ -61,12 +117,12 @@ All notable changes to the Celtic CE library will be documented in this file.
61117
### Changed
62118

63119
- Temp storage now uses pixelShadow2 with an offset of 100 bytes instead of using pixelShadow
64-
- ExecHex function no longer has a restriction of 255 characters, instead it is limited to 8192
120+
- ExecHex command no longer has a restriction of 255 characters, instead it is limited to 8192
65121
- Preserve stack pointer when running a command and restore it when exiting to the OS
66122

67123
### Fixed
68124

69-
- Potential error with VarStatus function when a hidden program name starts with a 'T'
125+
- Potential error with VarStatus command when a hidden program name starts with a 'T'
70126

71127
## [1.0.0-beta] - 2022-09-17
72128

CelticCE.pdf

76.8 KB
Binary file not shown.

docs/celticiiifunctions.rst

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,149 @@ Documentation
281281

282282
Errors:
283283
* ``..E:NT:FN`` if the target byte does not exist in the string.
284+
285+
------------
286+
287+
.. function:: ErrorHandle: det(45); Ans = program to run
288+
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+
291+
A list of return values and their corresponding errors can be found in the `error codes <errorcodes.html#ti-os-errors>`__ section, under TI-OS Errors.
292+
293+
.. note:: When using ErrorHandle from the homescreen, it will not run BASIC programs, though it can still run programs beginning with the Asm84CEPrgm token.
294+
295+
Parameters:
296+
* ``Ans``: The name of the program to run, or TI-BASIC code to be executed
297+
298+
Returns:
299+
* ``Theta``: Contains the error code returned by the program, or 0 if no error occured.
300+
301+
Errors:
302+
* ``..NULLVAR`` if the program is empty.
303+
* ``..SUPPORT`` if the file is not a TI-BASIC program.
304+
305+
------------
306+
307+
.. function:: StringRead: det(46, string, start, bytes);
308+
309+
Works almost identically to BASIC's sub() command, except that the output will be in hexadecimal and two-byte tokens will read as two instead of one byte. It is particularly useful for extracting data from a string that may contain nonsensical data that simply needs to be manipulated. If you allow the start point to be zero, the size of the string in bytes is returned instead. For data manipulation, you should use the Edit1Byte command.
310+
311+
Parameters:
312+
* ``string``: Which string variable to read from, where 0 = Str0, 9 = Str9, and so on
313+
* ``start``: The byte of the string to begin reading at
314+
* ``bytes``: How many bytes to read
315+
316+
Returns:
317+
* ``Str9``: The extracted substring.
318+
* ``Theta``: The size of the string in bytes, if ``start`` was 0.
319+
320+
------------
321+
322+
.. function:: HexToDec: det(47); Ans = hex
323+
324+
Converts up to 4 hex digits back to decimal. If you pass a string longer than 4 digits, only the first four are read.
325+
326+
Parameters:
327+
* ``Ans``: Hex string to convert
328+
329+
Returns:
330+
* ``Theta``: Decimal integer converted from hex string.
331+
332+
Errors:
333+
* ``..INVAL:S`` if an invalid hex digit is passed.
334+
335+
------------
336+
337+
.. function:: DecToHex: det(48, number, override)
338+
339+
Converts a number between 0 and 65535 to its hexadecimal equivalent. The number of hexadecimal output to the string will have its leading zeroes stripped so inputting 15 will result in “F” and 16 will result in “10”. If override is 1, it will output all leading zeroes, which may be useful for routines that require four hex digits at all times but cannot spend the memory/time whipping up a BASIC solution to fill the missing zeroes.
340+
341+
Parameters:
342+
* ``number``: Decimal integer to convert
343+
* ``override``: 1 to output all leading zeroes, or 0 to not
344+
345+
Returns:
346+
* ``Str9``: Hex string converted from decimal integer.
347+
348+
------------
349+
350+
.. function:: EditWord: det(49, string, start, word)
351+
352+
This command, otherwise, works just like Edit1Byte. Its documentation is rewritten here for convenience. Replaces a word in some string variable, Str0 to Str9, with a replacement value 0 through 65535 starting at some specified byte (start is at 0). The string supplied is edited directly so there's no output. See Edit1Byte for more details.
353+
354+
The replacement is written in little-endian form and if the number is between 0 and 255, the second byte is written in as a zero.
355+
356+
.. note:: Note: A “word” in this sense is two bytes. Useful for editing a binary string which entries are all two bytes in length, such as a special string tilemap. You’re required, however, to specify offset in bytes. Also know that all words are stored little-endian. That means that the least significant byte is stored before the most significant byte is.
357+
358+
Parameters:
359+
* ``string``: Which string variable to read from, where 0 = Str0, 9 = Str9, and so on
360+
* ``start``: The byte to start editing in the string
361+
* ``word``: The two bytes to rewrite
362+
363+
Returns:
364+
* Modifies the string with the specified word
365+
366+
Errors:
367+
* ``..E:NT:FN`` If the offset is past the end of the string
368+
369+
------------
370+
371+
.. function:: BitOperate: det(50, value1, value2, function)
372+
373+
Performs a bitwise operation between value1 and value2 using a supplied function value. It will only work with up to 16-bit numbers.
374+
375+
The different functions are below:
376+
377+
===== ===========
378+
Value Operation
379+
===== ===========
380+
0 NONE
381+
1 AND
382+
2 OR
383+
3 XOR
384+
4 Left Shift
385+
5 Right Shift
386+
===== ===========
387+
388+
If the numbers are out of bounds, then the function will exit out with an error. This command really helps mask out hex digits but if you use strings to store those digits, you'll need to use the HexToDec command for each value you need.
389+
390+
Parameters:
391+
* ``value1``: First value to perform bit operation with
392+
* ``value2``: Second value to perform bit operation with
393+
* ``function``: Which operation to perform, as seen in the table above
394+
395+
Returns:
396+
* ``Theta``: Result of the bit operation.
397+
398+
------------
399+
400+
.. function:: GetProgList: det(51, type); Ans = search string
401+
402+
This function will return a space-delimited string consisting of the names of programs, appvars, or groups that match partial name of the search string. Which is to say::
403+
404+
"TEMP
405+
det(51, 0)
406+
407+
would return all program names that start with the characters “TEMP”, which may be something like “TEMP001 " or “TEMP001 TEMP002 TEMP003 “, etc.
408+
409+
===== =========
410+
Value File Type
411+
===== =========
412+
0 Programs
413+
1 AppVars
414+
2 Groups
415+
===== =========
416+
417+
.. note::
418+
This command is NOT to be confused with FindProg, which outputs a string consisting of files whose CONTENTS starts with the specified string. Also use the fact that the final name in the list is terminated with a space to make extracting names from the list easier. It also will not find hidden variables.
419+
420+
Parameters:
421+
* ``type``: The type of file to search for, as seen above
422+
* ``Ans``: String to find in file names
423+
424+
Returns:
425+
* ``Str9``: Filtered list of files
426+
427+
Errors:
428+
* ``..S:NT:FN`` if ``Ans`` is not a string
429+
* ``..P:NT:FN`` if no files were found containing the 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.2'
27+
version = 'b1.3'
2828
# The full version, including alpha/beta/rc tags
29-
release = 'Beta 1.2'
29+
release = 'Beta 1.3'
3030

3131

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

docs/csefunctions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Documentation
1010

1111
.. function:: ReadLine: det(0); Str0 = variable name; Ans = line number
1212

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.
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, though it will still return the ``..NUMSTNG`` error, like the original Celtic 2 CSE. Otherwise, ``Ans`` refers to the line being read.
1414

1515
.. warning::
1616
If you attempt to read the line of an assembly program, there is a risk of a reset. If Celtic passes an invalid token to ``Str9``, it could cause a RAM clear.

docs/dcefunctions.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ Documentation
1313

1414
Displays colored text from ``Str9`` at ``x`` and ``y`` on the screen, using the OS large or small font.
1515

16-
.. warning::
17-
you can only use a maximum of 128 characters in ``Str9`` at a time with this command. However, this should be plenty, since the text does not wrap.
18-
1916
Parameters:
2017
* ``large_font`` = whether to use OS large or small font. 0 means to use the OS small font, and 1 means to use the large font.
2118
* ``fg_low``: low byte of foreground color.
@@ -56,7 +53,7 @@ Documentation
5653

5754
------------
5855

59-
.. function:: TextRect: det(15, low, high, x, y, width, height)
56+
.. function:: FillRect: det(15, low, high, x, y, width, height)
6057

6158
Draw a filled, colored rectangle on the screen. This command can also be used to draw an individual pixel by setting the width and height to 1, or a line by setting either the width or height to 1.
6259

docs/errorcodes.rst

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Overview
66

77
Celtic does its best to prevent errors. However, if something goes wrong with running a function, Celtic will return an error code. This can be from lack of memory, an incorrect argument, or something else.
88
Keep in mind that Celtic might not always detect the exact error, or realize that there is one in the first place. You can use the error codes to help with the debugging process.
9+
This page also contains TI-OS errors and the corresponding values returned in the ErrorHandle command.
910

10-
Documentation
11+
Celtic Errors
1112
~~~~~~~~~~~~~
1213

1314
========== ================================================================================================
@@ -34,3 +35,63 @@ Error Code Description
3435
..NT:A:GP The file specified was not a group.
3536
..SUPPORT Whatever happened was not supported by Celtic.
3637
========== ================================================================================================
38+
39+
TI-OS Errors
40+
~~~~~~~~~~~~
41+
42+
===== ===========
43+
Value Error
44+
===== ===========
45+
0 No Error
46+
1 Overflow
47+
2 DivBy0
48+
3 SingularMat
49+
4 Domain
50+
5 Increment
51+
6 Break
52+
7 NonReal
53+
8 Syntax
54+
9 DataType
55+
10 Argument
56+
11 DimMismatch
57+
12 Dimension
58+
13 Undefined
59+
14 Memory
60+
15 Invalid
61+
16 IllegalNest
62+
17 Bound
63+
18 GraphRange
64+
19 Zoom
65+
20 Label
66+
21 Stat
67+
22 Solver
68+
23 Singularity
69+
24 SignChange
70+
25 Iterations
71+
26 BadGuess
72+
27 StatPlot
73+
28 TolTooSmall
74+
29 Reserved
75+
30 Mode
76+
31 LnkErr
77+
32 LnkMemErr
78+
33 LnkTransErr
79+
34 LnkDupErr
80+
35 LnkMemFull
81+
36 Unknown
82+
37 Scale
83+
38 IdNotFound
84+
39 NoMode
85+
40 Validation
86+
41 Length
87+
42 Application
88+
43 AppErr1
89+
44 AppErr2
90+
45 ExpiredApp
91+
46 BadAddr
92+
47 Archived
93+
48 Version
94+
49 ArchFull
95+
50 Variable
96+
51 Duplicate
97+
===== ===========

docs/gensyntax.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you have entered a valid argument, Celtic will tell you what function the arg
1515

1616
Celtic's function preview feature.
1717

18-
The function preview follows a general syntax: "``CommandName(Arguments)``: ``Input Vars`` (if any): ``Output Vars`` (if any)". As you can see in the example above, ReadLine is listed with no arguments, ``Str0`` and ``Ans`` as the input variables, and ``Str9`` or ``theta`` as the output variables.
18+
The function preview follows a general syntax: "``CommandName(Arguments)``: ``Input Vars`` (if any): ``Output Vars`` (if any)". As you can see in the example above, ReadLine is listed with no arguments, ``Str0`` and ``Ans`` as the input variables, and ``Str9`` or ``theta`` as the output variables. If no input variables are necessary (though there are still output variables), it will say "NA" instead. Nothing will be listed of there are no input and output variables.
1919

2020
.. note::
2121
In the event that you pass invalid arguments to Celtic, it will return an error. All errors are returned in ``Str9``. See the `Error Codes <errorcodes.html>`__ page for more information.
@@ -53,6 +53,8 @@ When using ``Str0`` as a program name, simply store the name of the program into
5353

5454
If a string is used, it must be in the RAM when the function is called.
5555

56+
.. 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.
57+
5658
Returns
5759
~~~~~~~
5860
Depending on the function, Celtic will return a value after it runs. For example, the ``SpecialChars`` function fills ``Str9`` with certain special characters.

0 commit comments

Comments
 (0)