***************************************************************************
*******************************
FLIB 3.0
*******************************
by François LEIBER
http://leiber.free.fr/
***************************************************************************
This is an advanced library for BASIC programmers, including many functions, basic as well as sophisticated, compatiblity with all ROM and hardware versions, and no kernel requirement.
Release 3.0, 05-05-2001.
Copyright 2000-2001 by François LEIBER.
This program can be freely distributed, on condition that you leave it unmodified and that you include this text with it.
The complete source of Flib can be downloaded on my web page.
If you ever use it in one of your BASIC programs, please mention me in you readme file, I would be very pleased!
I WROTE THIS LIBRARY FOR ALL THE BASIC PROGRAMMERS, SO, IF YOU EVER NEED A FUNCTION, TELL ME OR YOU'LL NEVER HAVE IT!
By the way, I'm looking for:
- Somebody to port the TI-89 examples to the 92+: I used to do it myself, by I don't have time for this anymore, so 92+ examples aren't updated anymore (but 89 programs usually work perfectly on both calculators).
- Somebody to convert the documentation for Textrider, same time problem.
- Beta testers to test Flib intensively before I release each new version.
Write me if you are ever interested!
- Requirements
- How to use Flib
- History
- Known bugs
- Credits
- Info
Requirements:
- A 89 or a 92+ with any ROM or hardware, no kernel required.
- The programs flib() and flib2(), 15.0 KB.
- A few bytes free to run it.
You can place both programs in any folder (everybody should leave them in 'main' so you won't have a copy in 15 different folders), and I strongly suggest you archive them.
How to use Flib:
You only have to type, usually in a basic program:
example: flib("clrscr","msg:Hello, World!", "slrcl")
If you use functions from the second library (flib2):
example: flib2("version","mkhs:10,500,fl,sc","hide:sc")
The list returned by flib is placed in the variable 'fl'.
Each command is a string, read Flib functions to know what different functions are now available.
History:
v3.0 - 05/05/01 - 7 981 + 8 089 bytes
- I've totally redone the argument engine: now you can not only put numbers, but also variable names or even mathematical expressions, anything that returns a number... In short, no more 'string()'!
- Fixed all the local variable problems, such as changing folder in a program.
- New functions 'beep' and 'beep2' to make sound!
- New functions 'gray2', 'pretty' and 'memcpy'.
- A huge number of minor corrections, mostly so that functions like 'komp', 'group' or 'insertline' won't crash anymore.
- 'getfile' doesn't return twin (i.e. temporary) variables anymore.
- No more problems with some keys in 'menu'.
- Flib2 now allocates memory more dynamically, so no more limitations for recursivity.
- Attention, 'dekomp' and 'komp' are now merged!
Anniversary - 03/12/01 - 6 613 + 7 597 bytes

- The keyword of this release is: stability. Except this, I think you can't make Flib crash anymore; I've added protections everywhere, and fixed a few little things.
- Added functions 'delline', 'insertline', 'mkvar' and 'group' in Flib2.
- Advanced optimisation (but not completely finished).
- A new example for Flib's anniversary.
- Several new examples and utilities, and I've re-writen most of the old ones.
- Compilation with the new beta of TI-GCC.
- Attention: I've merged 'komp' and 'dekomp', which now automatically detects wether it should compress or decompress the variable, so it is simpler and I've saved some space. 'dekomp' is still working, but will definitely be suppressed in the next release.
- Since I lacked time to do what was planned, another version will soon be released, with: no more problems with changing folders, and I promise to get you rid of all those 'string()'...
v2.31 - 02/27/01 - 6 781 + 6 243 bytes
- Version 2.3 proved to be quite buggy, so I had to start work again. This version is only here to correct the previous one :-(
- No more problems to display pictures on the right of the screen.
- No more problems with archived or local variables.
- Protection against too long variable names.
- I've adapted Flib's optimizations to Flib2.
- I've released the (very clean) source of this version on my web page.
v2.3 - 02/20/01 - 6 707 + 6 325 bytes
- Added function 'gray2', and the program is compiled with the new support of grayscale, so they should finally be flicker-less on HW2.
- New compression/decompression algorithm much more efficient, and fixed all the problems in those two functions : mainly, it was the TIOS that compressed the heap at the wrong moment. Thanks to Thomas Nussbaumer for giving me the hint. Attention, this new type is incompatible with the previous one!
- Possibility to write on more than one line with 'msg'.
- Modification of 'map' so it can be used like an advanced CyclePic.
- No more problems when you try to hide/unhide an non-existent variable with a long name.
- Fixed a few optional arguments.
- More protections for 'sprite' and 'map', now impossible to crash.
- 'wait' doesn't crash anymore after 'breakoff'.
- Fixed 'setcont'.
- Fixed 'mkpic', code '13' was not working.
- Still optimized and reduced the size of both libraries.
v2.2 - 11/16/00 - 6 045 + 6 469 bytes
- New compression/decompression functions: 'komp', 'dekomp' and 'kinfo'.
New text-manipulating functions: 'numline' and 'getline'.
- I've raised the size limit for 'fl' to 5 KB.
- No more problems with archived variables.
- No more problems if 'fl' is declared as a local variable, and that you use functions such as 'getfile'.
- No more crashes with 1-high-score variables.
- No more crashes with 'wait:0'.
- Correction of a tiny bug in 'menu'.
- Even more optimizations.
- New examples 'Memory' and 'FlKomp'.
- Include C source to easily make your own gray images for Flib.
v2.1 - 10/02/2000 - 6 359 + 4 263 bytes
New functions to use (static) grayscale. I've compiled the project with the new release, v2.2, of Zeljko Juric's libraries, so grayscale *shouldn't* flicker too much on HW2.
- New contrast functions : 'getcont' and 'setcont'.
- 'wait' doesn't depend any more of the calculator, it now uses constant timers.
- I've updated the examples.
v2.0 - 08/23/00 - 5 749 + 4 467 bytes
- I've finally separated Flib in two distinct libraries: one for the TIOS or more shell-like functions, and the other one for all the others.
Thanks to port your programs for this new version, you just have to add a '2' after 'flib' when you call functions of the second library (refer to Flib functions).
- Two new functions: 'map' and 'drawstrv'.
- 'mkpic' now works with all characters.
- I've translated the whole documentation into html.
v1.8 - 07/25/00 - 8 057 bytes
- Finally! Flib is now compatible with local variables, I needed a whole afternoon to get rid of this :(
- Functions 'hide', 'unhide' and 'state' now work also with folders.
- Function 'drawstr' can now automatically center a string on the screen.
- One new function: 'pixtest'.
- Attention for your program's compatibility: I've suppressed functions 'blink' and 'crypt', which was causing too many problems. I'll integrate a more sophisticated one in a next version.
- Fixed a bug in 'fillrect' which was very slow when the mode argument was omitted.
- Fixed another bug: when Flib returned a '0', the test 'fl[1] = 0' returned 'false'.
- Fixed a third little bug which could have caused problems before.
v1.7 - 05/29/00 - 8 065 bytes
- Added functions 'folder' and the three to handle high-scores: the 8 KB I could use are now full, flib v2 will be separated in two programs or won't be.
- I've re-read everything and re-written many little parts of the source for a maximal optimization.
- I've included a little program to use function mkpic, and also my program Othello that I've finally adapted for Flib.
- 'crypt' function now works much better.
- If nobody writes to ask me to keep these functions, I'm going to remove 'wait', 'reset' and 'blink'.
v1.6 - 05/12/00 - 7 001 bytes
- Added functions 'crypt', 'wait', 'mkpic', 'width' and 'blink'. Now there are 46 functions in Flib!
- Important improvement: Flib now truncates decimal numbers, so there is no more need to write 'exact(int())' everywhere.
- Correction of 'keylow' for the 92+.
- Little improvements to a few functions:
- 'msg' now restores automatically the screen when the user presses a key.
- 'getbyte' can now return more than one byte at a time.
- 'apd', 'initdelay' and 'delay' now return their previous values.
- I have converted the help file for Textrider.
- I started programming a compression function, but it's gonna be hard to do it in less than 1 KB...
v1.5 - 04/19/00 - 5 987 bytes
- Added functions 'menu', 'filltri', 'fillpoly' and 'reset': I know, this one isn't the most useful, but it's the funniest for sure :)
- Removed function 'idcode', I didn't know it was possible to have it with getConfg().
- Function 'breakoff' is much more powerful now; it's not canceled by functions like 'string()'.
- Arguments can now be bigger than 999, it was restricting for functions like 'getbyte' or 'setbyte'.
- When the return value does not exceed 9, flib doesn't return '09' as before, which could cause some strange things (159 - 16 = 65393 for example...)
- Function 'error' now displays the error message corresponding, but it doesn't stop the program, it was quite useless before.
- Most graphical functions now have default arguments, much nicer to use.
- Functions like 'sprite' can't crash anymore, even if the arguments are not numbers.
v1.4b - 04/11/00 - 5 147 bytes
- It's stupid, I should have included this in the previous version, but I was tired yesterday evening...: now the list returned by flib has all it's elements in the right order, it's especially appreciable for functions like 'getfile'.
v1.4 - 04/10/00 - 5 107 bytes
- Several people noticed me that it was impossible to use the list returned by flib when ROM 2.xx was installed, so now flib returns this list in the variable 'fl'. I think it's not as aesthetic as before, but I was surprised the program didn't take much additional memory.
v1.3 - 04/08/00 - 5 029 bytes
- Added functions 'getbyte', 'setbyte', 'savpic', 'picsize' and 'idcode'.
- The argument's size was limited to 255, so in particular you couldn't restore the apd to it's initial value, this is now corrected.
v1.2 - 04/04/00 - 4 303 bytes
- Added functions 'getfile', 'getfolder', 'size', 'state' and 'version'.
- Flib now returns a list, and doesn't need to go through a external symbol (ex-fl), which simplifies a lot the syntax (thanks to the new libraries of Zeljko Juric).
- Functions 'sprite' and 'rclscr' now test if their argument is a picture, it could cause the calc to crash.
- The other graphic functions are now also protected against wrong arguments, Flib should never throw an error now.
v1.1 - 03/21/00 - 3 667 bytes
- Added functions 'apd', 'error', 'sprite', 'savscr', 'rclscr', 'slclr', and the four key functions.
- Fixed 'breakoff' and 'drawstr' (you couldn't display a string beginning with a number).
- Added a few protections (for the arguments number, test to see if 'fl' is archived or not...)
- Two little examples ('flpass' and 'flowkey') are included, as well as a program to create a custom menu to simplify the use of flib.
- 92+ version included, I ported even the examples!
- English translation (I think this was the most tiring part...)
v1.0 - 03/12/00 - 2 153 bytes
- First release, most common functions that don't need to return a value are included (17 of them).
Known bugs:
I don't think there is any real bug, but:
- Some problems can occur if you launch Flib from a Try...EndTry structure; the TIOS seems to handle this structure in a very weird manner. But don't worry, this bug will never crash your calc
- You can cause Flib to crash (only way presently known) by displaying on the very bottom of the screen with 'drawstr' a long string that will write in the memory after the video.
Credits:
- First, some credits go to Alban Gervaise, the first programmer of Basiclib, even though he has disappeared since...
- A big thanks to the whole TI-GCC team and especially to Zeljko Juric for all his libraries and his very complete documentation of the different TIOS functions; without them Flib wouldn't have been possible at all.
- Rusty Wagner for Virtual Ti.
- Thomas Nussbaumer for Ti-Chess, from which I have taken two assembly sub-routines.
- All the people who sent me their opinions, which made this library progress.
- Joel Thompson, who corrected my poor English...
Info:
I know my translation of this text is far from good, but I've already made quite an effort to do it, so be comprehensive, I'm French :-)
For any suggestion, comment, or bug (that would be quite surprising;-) ), you can e-mail me at:
francois.leiber@laposte.net
All ideas are welcome!
All my program updates are first available on my (French) web page:
http://leiber.free.fr
Now that I've begun C programming, I think I'm going to make many other programs, but unfortunately I lack time (studies are becoming quite invasive).
Anyway, I encourage warmly all those who would like to start C programming but who hesitate, and that's why my source code is given in this package. But I repeat, don't change three characters and then replace my name by yours to distribute this program with another name, as it is happening much to often, unfortunately.
Back to the top of the page