Omnimaga
Calculator Community => TI Calculators => General Calculator Help => Topic started by: Hot_Dog on November 13, 2010, 04:27:48 pm
-
What is the file format for a Ti-Basic Program? I know all about tokens, but I don't know what comes before and after the token data.
Thanks!
-
i believe the first two bytes are the number token bytes in the program, and then the rest is the data of the program.
-
i believe the first two bytes are the number token bytes in the program, and then the rest is the data of the program.
When I look at the binary/hex code for an .8xp file on the computer, there's more at the beginning than that.
-
This File Format Guide (http://www.ticalc.org/archives/files/fileinfo/247/24750.html) documents it, along with all the other TI file formats.
On a calculator, it's what nemo said- the first two bytes are the length, then it's followed by the data.
This is the text of the guide (minus HTML formatting):
The TI-83+ variable file format
The TI-83+ variable file format has two parts: a header and several variable entries.
The header appears at the beginning of the file and takes the following format:
Note - All 2-byte integers are stored little-endian Intel-style (least significant byte first).
Offset Length Description
0 8 bytes 8-character signature. The signature is always "**TI83F*".
8 3 bytes 3-byte further signature. These three bytes always contain {1Ah, 0Ah, 00h} = {26, 10, 0}
11 (Bh) 42 (2Ah) bytes Comment. The comment is either zero-terminated or padded on the right with space characters.
53 (35h) 2 bytes Length, in bytes, of the data section of the file. This number should be 57 (39h) bytes less than the file size.
55 (37h) n bytes Data section - consists of a number of variable entries (described below).
55 (37h)+n 2 bytes File checksum. This is the lower 16 bits of the sum of all bytes in the data section.
Each variable entry follows this format:
Offset Length Description
0 2 bytes Always has a value of 11 or 13 (Bh or Dh).
2 2 bytes Length, in bytes, of the variable data.
4 1 byte variable type ID byte (see variable type ID's)
5 8 bytes Variable name, padded with NULL characters (0h) on the right.
13 (Dh) 1 byte Version. Usually set to 0 (present if first bytes are Dh).
14 (Eh) 1 byte Flag. Set to 80h if variable is archived, 00h else (present if first bytes are Dh).
15 (Fh) 2 bytes Length, in bytes, of the variable data. (This is a copy of the value in offset 2)
17 (11h) n bytes Variable data. Click here for variable data formats.
-
oh, and the type ID for a program is either 5 or 6. 5 for most programs, 6 if the program is protected.
-
i believe the first two bytes are the number token bytes in the program, and then the rest is the data of the program.
When I look at the binary/hex code for an .8xp file on the computer, there's more at the beginning than that.
On the calc it just the two size bytes and a mess of data, though.
/me wonders what this is for
-
i believe the first two bytes are the number token bytes in the program, and then the rest is the data of the program.
When I look at the binary/hex code for an .8xp file on the computer, there's more at the beginning than that.
On the calc it just the two size bytes and a mess of data, though.
/me wonders what this is for
probably for Correlation project. ;)
-
i believe the first two bytes are the number token bytes in the program, and then the rest is the data of the program.
When I look at the binary/hex code for an .8xp file on the computer, there's more at the beginning than that.
On the calc it just the two size bytes and a mess of data, though.
/me wonders what this is for
probably for Correlation project. ;)
Exactly. I just finished turning bmp fonts into .8xp files
-
Cool to hear Hot Dog! I like to design stuff on Paint or other computer drawing softwares so this might be useful. :)
-
If you don't mind using C#, I have a library for modifying all sorts of files, including .8xp. Let me know if you are interested.
-
If you don't mind using C#, I have a library for modifying all sorts of files, including .8xp. Let me know if you are interested.
I really appreciate that! But I think I've got it made for right now. Thanks, though :)
-
Sure thing.
-
Exactly. I just finished turning bmp fonts into .8xp files
Nice, that sounds really easy to use :D Can't wait till this is out.