Re: *.92T files for Ti92, header composition?


[Prev][Next][Index][Thread]

Re: *.92T files for Ti92, header composition?



"Lelong." <@nordnet.fr> writes:
>
> I'm writing an edition program for text files on Ti92 (*.92T) but i've got
> problems with the meaning of the header of the file...

Their syntax is really complicated contrary to TI-8x ones.

> I noticed this elements:
>
> "**92**": The most difficult to understand!!!
> An ASCII char 1 (written chr(1)) from now- certainely a siparator
>
> " <Name of folder> " - Must let 2 spaces before and after? The last one
> separate name of folder from the rest of the file?
>
> The, a variable number or chars? what do they mean? From the name of the
> file to the end of thes characters, 8 bytes... Maximum lenght of folder
> names... Only the number of chars matter?
>
> Then, the comment string, fixed lenght, ended by chr(1)
>
> " R   ", a chr(12), a R then 3 chr(12)
>
> name of file, 8 chras ended by  chr(11)
>
> 18 chars, whith "%Z" always at the same place... (chars number 8 et 9)...
>
> ---body of text---
>
> 3 last char, differents froma file to  A l'aide!!!other...
>
> Here it is. I must know the meaning of this header. I would like making file
> from nothing, not only editing them...
> More, using always the same header (except for the filename and the folder
> name) for all the new files is'nt sure.

You're right, here is a file (92g.txt) by Andy Stelle who explains how to
do that. Good luck !
I advice you against using the notepad for editing those files. Use a
binary editor instead (like hedit or beav)

Salut

--
ICQ: 18176290
"Utiliser Windows, c'est comme jouer ` Badaboum :
 quand on rajoute une pihce, tout s'icroule !"



----------------------------------------------------------------------
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       <var>   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


References: