I started work on this project almost a year and a half ago as a BASIC program that used Celtic 3 and Omnicalc. It used Omnicalc for the font hooks and Celtic 3 to modify font data. Using this technique, I made games that used chars as sprites. A little after that, assembly finally clicked.
So I started making a program called SpriteLib that made its own font hook and could edit fontsets itself, but I also added sprite drawing routines and other memory editing features. But then I added much more and I could see that I would run out of room. So, I made the APP called BatLib and here is what it has to offer:
BatLib is designed around memory efficiency and speed. Many functions use pure data as opposed to floating point values or hex. Because of this, there are functions that convert data to make life that much easier. For example, if you want to make sprite data for a game, you could go through the task of coming up with the hex and then compressing it using HexToken, but there is an easier way: Just use GetSprite. It will convert a sprite on the graph screen of whatever size you specify to the correct format used by BatLib.
BASIC programs can sometimes get really involved and thus need all the RAM they can get. Luckily, if a command itself cannot source the data directly out of flash, there are other commands that can. If you want to copy Str8 to Str9 and Str8 is archived, you can do something like dim(21,".Str8→Str9
If you have a sprite that needs to move around (like for a walking sprite) there is a command that draws directly to the LCD. What this means is that you can draw on the graph screen, then after that you can just display the sprite. Updating the LCD removes the sprite without changing what was underneath.
There is a rectangle routine currently that can make 12 fill types and is faster and more reliable than using the OS ROM calls. If you ave ever noticed how some of the OS rectangles clear out the pixels around a border, you will note that BatLib does not do this. Plus, the OS has 5 or 6 rectangle routines whereas BatLib has 10 plus 2 shifting routines. The shifting routines shift the pixels inside the rectangle you specify.
There is a command that lets the user store or recall pictures from RAM or archive and can archive, unarchive, or toggle the archive status of the picture. As a note, it stores the current screen, not necessarily the graph screen and pictures store the whole screen including the last row.
If you have ever used list data for games like RPG's you will appreciate the use of SubList as it allows you to grab a portion of a list from RAM or archive.
There is also a command that initiates BASIC ReCode which was another project I started back in May/June and have since included in BatLib. It doesn't have much, but it is intended to be an interpreted programming language that can be used in BASIC.
If you have ever wanted sound in your programs, BatLib offers the command PlayData that does just that-- it converts data to sound. You will need headphones that fit the serial port.
There are several key hooks that can be installed including one that takes a snapshot of the screen and stores it to the graph and one that lets you control the delay speed of repeating keys.
There is a simple line reading function that lets the user define what byte defines a newline. This needs some work as it does not yet recognise the end of a file (so the last byte needs to be a newline). It does read lines from archived variables, too, though.
There is a drawing function that includes 13 drawing tools including simple lines, filling of the graph screen and pixel options. When modifying a pixel, the previous state of the pixel is stored in Ans.
There is a command that lets the user draw rectangles directly to pictures (like drawing directly to Pic1 for example).
There is a command that uses the drawing functions directly on pictures. That means you can pixel test pictures (big thanks go to DJ_O for this idea).
There is a command that can convert a hex string to some other base using arbitrary precision. The hex string can be up to 248 bits. This is really just a beta/placeholder because I plan to add support for other base inputs and much larger numbers. As it is, converting a 248-bit value to decimal is still pretty neat, right? All 'F's produce a 75 digit base 10 number.
There is also a command that provides 6 different font hooks including experimental 8x8 and 6x8 fonts. I made a cursive font for the 8x8 routine (to give an idea of what can be done).
In the unreleased version I am working on implementing some of my other projects such as CopyProg which copies programs or other vars out of RAM or Archive directly to another variable and GetName which returns the name of a variable (like returning the name of the 1st program in the program list).
There are things that I am sure I have missed and I am still revising things in preparation for the next release. Up until now, I have had to change syntax to remain compatible with other apps and I still need to shift around RAM usage. After the syntax is finalised in this version, I will try to make sure it remains backwards compatible.
Here is a list of commands in BatLib (currently). As a note command 16 needs to be replaced:
00-DisableFont
01-IndicatorOff
02-EnableFont
03-SetData
04-LoadData
05-HexToken
06-TokenHex
07-SetMap
08-GetMap
09-GetTile
10-GetKeyGroup
11-GetBytes
12-StoBytes
13-TileMap
14-VarEditByte
15-VarReadByte
16-VarDrawSprit
17-MemEdit
18-MemRead
19-Editbyte
20-ReadByte
21-GetVar
22-ASMHex
23-ASMToken
24-DPutSprite
25-VarType
26-BatteryLevel
27-IncContrast
28-DecContrast
29-Rectangle
30-ScrnToGraph
31-DispChar
32-SetContrast
33-FlagWrite
34-FlagRead
35-GetSprite
36-PicHandle
37-OutputASCII
38-SubList
39-ZAddress
40-BASIC ReCode
41-GetStats
42-AnsType
43-Get2Key
44-PlayData
45-GetChar
46-PortEdit
47-PortRead
48-ScreenShot
49-SpeedyKeys
50-Uninstall
51-DisableKeyHooks
52-HexSprite
53-TokSprite
54-LineRead
55-SetFont
56-Draw
57-GetVersion
58-ShiftGraphRight
59-BaseX
60-DelVar
61-DrawRectVar
62-DrawToVar
63-PxlTestPic
64-CopyProg
??-DispGraph
BatLib is not complete and I plan to add much more. I plan to add a menu routine similar to the TI-89 function PopUp (that is one of my favorite TI-89 commands) and I plan to add arbitrary precision math routines. I also have a lot of work to do with BASIC ReCode because I have not put any time into it in the past few months and I never made it past a few commands.
Again, there are a bunch of things I have not covered (like stringing commands), but I have to go eat... I am sick and I've only eaten twice in the past three days !_!
Okay, bye for now!
So I started making a program called SpriteLib that made its own font hook and could edit fontsets itself, but I also added sprite drawing routines and other memory editing features. But then I added much more and I could see that I would run out of room. So, I made the APP called BatLib and here is what it has to offer:
BatLib is designed around memory efficiency and speed. Many functions use pure data as opposed to floating point values or hex. Because of this, there are functions that convert data to make life that much easier. For example, if you want to make sprite data for a game, you could go through the task of coming up with the hex and then compressing it using HexToken, but there is an easier way: Just use GetSprite. It will convert a sprite on the graph screen of whatever size you specify to the correct format used by BatLib.
BASIC programs can sometimes get really involved and thus need all the RAM they can get. Luckily, if a command itself cannot source the data directly out of flash, there are other commands that can. If you want to copy Str8 to Str9 and Str8 is archived, you can do something like dim(21,".Str8→Str9
If you have a sprite that needs to move around (like for a walking sprite) there is a command that draws directly to the LCD. What this means is that you can draw on the graph screen, then after that you can just display the sprite. Updating the LCD removes the sprite without changing what was underneath.
There is a rectangle routine currently that can make 12 fill types and is faster and more reliable than using the OS ROM calls. If you ave ever noticed how some of the OS rectangles clear out the pixels around a border, you will note that BatLib does not do this. Plus, the OS has 5 or 6 rectangle routines whereas BatLib has 10 plus 2 shifting routines. The shifting routines shift the pixels inside the rectangle you specify.
There is a command that lets the user store or recall pictures from RAM or archive and can archive, unarchive, or toggle the archive status of the picture. As a note, it stores the current screen, not necessarily the graph screen and pictures store the whole screen including the last row.
If you have ever used list data for games like RPG's you will appreciate the use of SubList as it allows you to grab a portion of a list from RAM or archive.
There is also a command that initiates BASIC ReCode which was another project I started back in May/June and have since included in BatLib. It doesn't have much, but it is intended to be an interpreted programming language that can be used in BASIC.
If you have ever wanted sound in your programs, BatLib offers the command PlayData that does just that-- it converts data to sound. You will need headphones that fit the serial port.
There are several key hooks that can be installed including one that takes a snapshot of the screen and stores it to the graph and one that lets you control the delay speed of repeating keys.
There is a simple line reading function that lets the user define what byte defines a newline. This needs some work as it does not yet recognise the end of a file (so the last byte needs to be a newline). It does read lines from archived variables, too, though.
There is a drawing function that includes 13 drawing tools including simple lines, filling of the graph screen and pixel options. When modifying a pixel, the previous state of the pixel is stored in Ans.
There is a command that lets the user draw rectangles directly to pictures (like drawing directly to Pic1 for example).
There is a command that uses the drawing functions directly on pictures. That means you can pixel test pictures (big thanks go to DJ_O for this idea).
There is a command that can convert a hex string to some other base using arbitrary precision. The hex string can be up to 248 bits. This is really just a beta/placeholder because I plan to add support for other base inputs and much larger numbers. As it is, converting a 248-bit value to decimal is still pretty neat, right? All 'F's produce a 75 digit base 10 number.
There is also a command that provides 6 different font hooks including experimental 8x8 and 6x8 fonts. I made a cursive font for the 8x8 routine (to give an idea of what can be done).
In the unreleased version I am working on implementing some of my other projects such as CopyProg which copies programs or other vars out of RAM or Archive directly to another variable and GetName which returns the name of a variable (like returning the name of the 1st program in the program list).
There are things that I am sure I have missed and I am still revising things in preparation for the next release. Up until now, I have had to change syntax to remain compatible with other apps and I still need to shift around RAM usage. After the syntax is finalised in this version, I will try to make sure it remains backwards compatible.
Here is a list of commands in BatLib (currently). As a note command 16 needs to be replaced:
00-DisableFont
01-IndicatorOff
02-EnableFont
03-SetData
04-LoadData
05-HexToken
06-TokenHex
07-SetMap
08-GetMap
09-GetTile
10-GetKeyGroup
11-GetBytes
12-StoBytes
13-TileMap
14-VarEditByte
15-VarReadByte
16-VarDrawSprit
17-MemEdit
18-MemRead
19-Editbyte
20-ReadByte
21-GetVar
22-ASMHex
23-ASMToken
24-DPutSprite
25-VarType
26-BatteryLevel
27-IncContrast
28-DecContrast
29-Rectangle
30-ScrnToGraph
31-DispChar
32-SetContrast
33-FlagWrite
34-FlagRead
35-GetSprite
36-PicHandle
37-OutputASCII
38-SubList
39-ZAddress
40-BASIC ReCode
41-GetStats
42-AnsType
43-Get2Key
44-PlayData
45-GetChar
46-PortEdit
47-PortRead
48-ScreenShot
49-SpeedyKeys
50-Uninstall
51-DisableKeyHooks
52-HexSprite
53-TokSprite
54-LineRead
55-SetFont
56-Draw
57-GetVersion
58-ShiftGraphRight
59-BaseX
60-DelVar
61-DrawRectVar
62-DrawToVar
63-PxlTestPic
64-CopyProg
??-DispGraph
BatLib is not complete and I plan to add much more. I plan to add a menu routine similar to the TI-89 function PopUp (that is one of my favorite TI-89 commands) and I plan to add arbitrary precision math routines. I also have a lot of work to do with BASIC ReCode because I have not put any time into it in the past few months and I never made it past a few commands.
Again, there are a bunch of things I have not covered (like stringing commands), but I have to go eat... I am sick and I've only eaten twice in the past three days !_!
Okay, bye for now!