The .adv File Header

The adventure binary (.adv) header contains information that's necessary for Flight Simulator to select and authenticate adventure files. The information contained in the .adv header is separate and distinct from the adventure program.

The .adv header file is a code block of 512 bytes; the file's internal structure, expressed in C, is shown in the following example.

typedef struct

{

char adv_id[16];//.adv file signature.

char title[64];//File title string.

char description[256];//File description string.

long version;//APLC internal version number.

long custom_version;//Custom APLC version number.

unsigned long CRC;//CRC of code section.

unsigned long string_table_length;//Number of APL string variables.

unsigned long string_table_offset;//Offset to the string table.

unsigned long code_size;//Number of bytes of APL code.

char reserved[152];//Reserved for future use.

} ADV_FILE_HEADER;//File header structure.

The following table describes the fields included in the .adv header.

Field Description
adv_id A marker that identifies the file as an adventure file. The marker is a text string; as a result, it's easy to identify the file with DOS utilities. Its value is “FS6X Adventure^Z”, where ^Z is a Ctrl+Z (end of file) character.
title Title of the adventure file, as specified by the Title command in the adventure source.
description File description, as specified by the Description command(s) in the adventure source. The file description is a single ASCIIZ string. Word wrapping is automatically handled by Flight Simulator.
long version A version number placed in the header file by the APLC to enable future releases of Flight Simulator to differentiate between earlier and later version .adv files and take appropriate action. This is an internal version number, and it is incremented each time there is a change in the format of .adv files that would make earlier version .adv files no longer work with the new driver. This version number is not intended to be visible to users.
long custom_version See preceding description.
CRC A CRC checksum used to protect data integrity.
string_table_length Specifies the number of APL string variables in the header.
string_table_offset Specifies the offset to the string table.
code_size Specifies the number of bytes of APL code.
reserved Space reserved for future use; filled with zeros, pending future definition.