New update! Check the first post for the link.
Includes:
- Ini file reading/writing/modification
- New sprite drawing system. You can now draw and change a sprite multiple times per frame without using more than one sprite slot. Currently you'll only be able to draw up to 32 objects per frame.
- Sprite registers SX# and SY# (these were undocumented) are now removed in favor of the SETSPRXY operation
- CPU Frequency control (cpu levels 0 to 18, 0-13 are standard sdk frequencies, 14 -18 are overclocks
- Can now choose between automatic error handling or manual error handling in cases where external files may or may not be missing. (Using [Auto Error])
Sample Scripts:
Example reading BAGOS settings from ini file.
Example setting the CPU frequency.
Notes about features:
[Auto Error] - With this pragma set, the interpreter will automatically halt the script if a file that doesn't exist is passed as an argument to an operation (such as LDSPR, INI_OPEN, INI_WRITE, etc.)
Without [Auto Error], It is up to the scripter to handle the error cases on their own. CPU bit X is set on errors, and you can jump when this bit is set using the IFERR operation. For example:
Code:
LDSPR #0, "invalidPath.bmp"
IFERR no_sprite ;if LDSPR failed to load or no such file exists
....
no_sprite PRINT "Error loading sprite"
HALT
CPU Frequency - Not all CPU frequencies are stable on the DS2, so you may encounter decreased performance or even a hard lock when playing with these.
INI Files - If a section or entry doesn't exist in an ini file when reading or writing (INI_GET* and INI_SET*), they are automatically added. If you are adding new sections and entries, don't forget to call INI_WRITE to finalize the changes in the ini file.
Ini format:
The wiki should be updated sometime later this week. If anyone would like to help out with the wiki by writing some examples or even to clear up some explanations, just let me know and I shall get you set up on it! Then maybe the wiki could be updated immediately with the releases with more people working on it.