---------------------------------------------------------------------- The .92G file format Version 1.0 ---------------------------------------------------------------------- Document by Andy Selle (aselle@ticalc.org) Special Thanks to David Ellsworth (davidell@ticalc.org) for his explanation of the format and his corrections. Thanks to David Brodbeck (gull@cyberspace.com) for his file on the subject and Magnus Hagander (mha@ticalc.org) for his corrections on that said file. (C)1998 Andy Selle NOTE: All the data is in little-endian format. That is, the least significant byte is written before the most significant. The TI-92's group file format is very interesting. Once you take a look at it, it is quite simple. The beginning consists of the standard TI calculator file signature with the **TI??**??... It can be best described with this info: offset length description ------ ------ ----------- $00 $0A The header "**TI92**" 0x01 0x00 $0A $08 Default Folder Name (zero terminated unless 8 chars) $12 $28 Comment (blank padded) $3A $02 Number of variables (including folders) Next, we have a table of all the variables and folders that are stored here. Each entry is 16 bytes long. There will be as many of these as the word stored at $3A (the number of variables). This table contains both variables and folders. Here is the format of variable entries: Variables are listed in a table. The data is later, and it is pointed to by the offsets in the following format. 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |-----------|-----------------------|-----|-----| A B C D Letter Length Description ------ ------ ----------- A 0x04 Long word containing offset of the variable data B 0x08 Name of variable (zero terminated if not 8 characters) C 0x02 Byte containing the type of variable this is D 0x02 Just 0's ... Here is the format of folders: Folder entries share the same table as variable entries. All variables following a folder entry will be considered to be in the given folder. This trend continues until another folder entry replaces the first one. Then, subsequent variables are placed in that folder. If no folder entries are included, then variables are considered to be part of the folder named at file offset 0x0A. If this is null, then it is considered to be in the current directory when a link program sends it. 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |-----------|-----------------------|-----|-----| A B C D Letter Length Description ------ ------ ----------- A 0x04 Long word containing pointer to first var in folder B 0x08 Name of folder (zero terminated if not 8 chars) C 0x02 Type of var D 0x02 Word containing number of variables in the folder After all the headers there is one more long word containing the offset to the first byte that is invalid (past the end of the file)... this is the byte after the checksum. Then there are the following bytes... $A5 $5A The next part is the data part of all the variables... The offset in the table points to a structure of the following format: 00 01 02 03 04 05 06...06+(length) X X+1 |-----------|-----|----------------|-----| A B C D Letter Length Description ------ ------- ----------- A $04 Long word of zeros B $02 Word telling length C Data (length is the value stored in previous word) D $02 Checksum (word) The checksum is obtained by adding all the data bytes together starting from the first data byte of the variable. Then you binary AND it with 0xFFFF. It is stored as a word after every variable data. Here is a list of variable types: --------------------------------- $00 Expression $04 list $06 matrix $0A Data $0B Text $0C String $0D GDB $0E FIG $10 PIC $12 PRGM $13 Function $14 Macro $1F Folder If you have any questions, feel free to email me at my address listed at the top of the file. -Andy