********************************************************




by François LEIBER

http://leiber.free.fr


Description


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.


Version 3.2, 04 - 02 - 2004
Copyright 2000-2004 by François LEIBER

This program is distributed under the GPL license, for further information please refer to the GPL.txt or http://www.gnu.org/licenses/licenses.html#GPL.
If you ever use it in one of your BASIC programs, please mention me in you readme file, I would be very pleased!

Summary


    1. Requirements
    2. How to use Flib
    3. History
    4. Known bugs
    5. Credits
    6. Info

Requirements

  • A TI-89, a TI-92+ or a Voyager 200 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, anyway your programs can make a temporary copy of it in their own folder if they need to), 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.2 GPL - 04/02/04 - 7 783 + 7 883 octets
    • Now under the GPL license!
    • Compilation with TI-GCC 0.95b6.


    v3.2 - 09/04/03 - 7 701 + 7 681 bytes

    • Compilation with TI-GCC 0.94SP4 + GCC 3.3.1, and tests with the Voyager 200 calculator!
    • You can now add a variable to a GROUP.
    • Added NO_CALC_DETECT and NO_AMS_CHECK to save space (about 150 bytes per library).
    • Several other minor optimisations.
    • Fixed a bug in 'ginfo' when one of the variables of the group was more than 32 KB.
    • Some additional modifications to try to stabilize the successive compressions/decompressions.
    • Now desactivates 'breakoff' before the 'map' calls who loop, it doesn't freeze the calculator anymore.
    • Redesign of the html pages of documentation; moreover they are now smaller.


    v3.1 - 12/05/01 - 8069 + 7 893 bytes

    • New functions 'type', 'ginfo', and 'pinfo'.
    • My university!Possibility to extract only one variable from a group.
    • 'hide' folds the folders before hiding them, so that the variable(s) they contain will also be hidden.
    • Some new protections for 'komp', 'group', and local variables, it shouldn't crash anymore.
    • I've re-written the asm parts of Flib myself.
    • Compilation using -Os (to save space) with TI-GCC 0.92 SP2.
    • A few other corrections and optimizations.


    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.
    • 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.41 - 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 by displaying on the very bottom of the screen with 'drawstr' a long string that will write in the memory after the video.

    By the way, I am absolutely not responsible for all that you may do on your calculator with these libraries, I give no warranty concerning their innocuity...

    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.

    • TATMF <tatmf.free.fr> for his pictures.

    • All the people who sent me their opinions, which made this library progress.

    • Joel Thompson, who corrected my poor English...


    Info

    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

    I encourage warmly all those who would like to start C programming but who hesitate, and that's why Flib is open-source!
    This library is distributed under the GPL license, wich means for example that you have the right to change the source code and distibute a modified version, but only if you respect the differents points of the license.
    However, Flib should be a universal library, so try not distributing modified versions anarchically, which would penalize the programs' compatibility. But you can always ask me to integrate your modifications into the "official" version of Flib, so that everybody can benefit from them :)

    Back to the top