Track File Format

From TM Wiki
Jump to: navigation, search

Contents

Introduction

With the release of the program Recompress-TMF, we can now edit individual blocks. This page documents the how the block system works.

Note: much more detail on track files, and .gbx files in general, can be found on the GBX page.

Finding the start of the track data

At this time, the best method is to search the file for the 4th occurrence of the word "PIKS". Then search the file for the 5th occurrence of the @ symbol. This method can be used in applications designed to read the file format, humans should just be able to see where it starts with a hex editor.

Block Definitions

The data for a block definition (remember, block types are only included once, blocks of that type added non-sequentially will find themselves after all block definitions) is as follows:

40 ZZ 00 00 00
@  ?           XXXXXX

where ZZ is the number length of the block type (converted to decimal), and XXXXXX is the block text.

Blocks

After a block definition starts a list of blocks that were created sequentially after the first block of this type (the list includes the first block). A block looks like:

00 XX YY ZZ ?? ?? ?? ?? ?? ?? ?? 40
                                 @

XX, YY and ZZ are the location of this block in hexadecimal.  ?? are unknown values which are not deciphered yet. Following this starts the next block of this type.

If all the blocks of this type are finished, the next value after the @ will be the length of text in a block definition. Because blocks start with 00, you are able to check whether the next value is a block (00) or a new block definition (not 00).

Blocks after their definitions

If the user does not place all blocks of the same type sequentially in-order without selecting other blocks, then there will be blocks at the end of the file.

As of writing, it is not known how to get the block type.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox