Airfix DogFighter Programmer's Manual

ÿtr?

File Types: introduction


In most datafiles, this Data Block is repeated for each Data-item:

NAME LENGTH VALUE
NAME LENGTH VALUE
NAME LENGTH VALUE

At the Start of the Datafile are the File Type, and File Length Descriptors:

TYPE LENGTH
NAME LENGTH VALUE
NAME LENGTH VALUE
NAME LENGTH VALUE

The TYPE and NAME-identifiers are always 4 positions long, and in Capitals.

The LENGTH -fields are also always 4 positions long, in Reverse Hex Notation (see below)
PLEASE NOTE: the length given in this field is always the length of the Value-field following it.
This means that the length as given in the File Length Descriptor LENGTH is always 8 less than the real file length!!

The
VALUE-entries fill the number of positions given in the LENGTH-fields preceding them.
In general, if the Value is a String, this will be terminated by a NULL-value: hex(00).
This NULL-value is included in the length as described in the LENGTH-field, and counts as 1 position.

If the Value is Numeric, it is usually (though not always) in Hexadecimal form with 4 positions. The positions are reversed, however,
with the Least Significant Bit on the Left (First Position), and the Most Significant Bit on the Right.

NOTE: This format is better known in IT as Little Endian, as opposed to Big Endian where the order is reversed.
See This Article for more info.

Example: Decimal 15000 is in Hexadecimal 3A 98, or in 4 Hex-positions: 00 00 3A 98.
In an ADF-file you would find this back as: 98 3A 00 00