Death Rally HAF Format

From ModdingWiki
Jump to: navigation, search
Death Rally HAF Format
Death Rally HAF Format.png
Format typeCutscene
Maximum lengthUnknown

The HAF Format is a video format made for Death Rally to store the opening and ending cutscenes. Its individual frames appear to be lifted verbatim from the GIF Format, EXCEPT the pixel values have been rotated right 3 bits, basically making this the opposite of what the Death Rally BPK Format does.

Also comparing against the BPK format, because HAF uses GIF's LZW Compression, the end code is 0x101 while the reset code is 0x100.

No transparency appears to be used - these are all keyframes.


Data type Name Description
UINT16LE frame_count Number of frames in this file
UINT8[frame_count] sound_triggers

Array for indicating which sound effects to play from the relevant obfuscated XM Format sound file on each keyframe

  • 0 = no sound effect
  • 1 upwards maps directly to an instrument in the XM file
  • Unused instruments will be ignored

! Find the XM note / frequency each sample plays at

UINT8[frame_count] frame_lengths Array for indicating how long each frame is to be shown for, in 1/70ths of a second (0 == move on to the next frame as fast as possible)

Then a series of frames follows.


Data type Name Description
UINT16LE length Length of the following two fields in bytes.
UINT8[256][3] palette Uncompressed VGA Palette, first 16 colours are reserved for the letterbox surrounds which expects a grey ramp
UINT8 min_bit_width Minimum pixel bit depth. Always seems to be 0x08.
UINT8[length - 0x302] frame_data LZW-compressed frame data, exactly how it would be stored in a GIF after the values have been rotated right by 3 bits.
UINT8 end_of_image GIF trailer. Always 0x3B.

! The 201st frame of ENDANI.HAF appears to misdecode. Find out why.

Frame data chunks

Data type Name Description
UINT8 length Length of this frame data chunk, or 0 to indicate the end of this image.
UINT8[length] data This chunk's data.


This file format was reverse engineered by GreaseMonkey. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)

External Links