<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GreaseMonkey</id>
	<title>ModdingWiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=GreaseMonkey"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/GreaseMonkey"/>
	<updated>2026-05-14T05:01:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8597</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8597"/>
		<updated>2019-05-23T06:26:37Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;HAF Format&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
Also comparing against the BPK format, because HAF uses GIF&#039;s [[LZW Compression]], the end code is 0x101 while the reset code is 0x100.&lt;br /&gt;
&lt;br /&gt;
No transparency appears to be used - these are all keyframes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers ||&lt;br /&gt;
Array for indicating which sound effects to play from the relevant obfuscated [[XM Format]] sound file on each keyframe&lt;br /&gt;
&lt;br /&gt;
* 0 = no sound effect&lt;br /&gt;
* 1 upwards maps directly to an instrument in the XM file&lt;br /&gt;
* Unused instruments will be ignored&lt;br /&gt;
&lt;br /&gt;
{{TODO|Find the XM note / frequency each sample plays at}}&lt;br /&gt;
|-&lt;br /&gt;
| 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)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]], first 16 colours are reserved for the letterbox surrounds which expects a grey ramp&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || min_bit_width || Minimum pixel bit depth. Always seems to be 0x08.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data, exactly how it would be stored in a GIF &#039;&#039;&#039;after&#039;&#039;&#039; the values have been rotated right by 3 bits.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || end_of_image || GIF trailer. Always 0x3B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|The 201st frame of ENDANI.HAF appears to misdecode. Find out why.}}&lt;br /&gt;
&lt;br /&gt;
== Frame data chunks ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || length || Length of this frame data chunk, or 0 to indicate the end of this image.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length] || data || This chunk&#039;s data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.w3.org/Graphics/GIF/spec-gif89a.txt GIF 89a specification] for the particular flavour of LZW used.&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8596</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8596"/>
		<updated>2019-05-23T05:56:51Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Point out the reserved colours in the palette&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;HAF Format&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
Also comparing against the BPK format, because HAF uses GIF&#039;s [[LZW Compression]], the end code is 0x101 while the reset code is 0x100.&lt;br /&gt;
&lt;br /&gt;
No transparency appears to be used - these are all keyframes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers ||&lt;br /&gt;
Array for indicating which sound effects to play from the relevant obfuscated [[XM Format]] sound file on each keyframe&lt;br /&gt;
&lt;br /&gt;
* 0 = no sound effect&lt;br /&gt;
* 1 upwards maps directly to an instrument in the XM file&lt;br /&gt;
* Unused instruments will be ignored&lt;br /&gt;
&lt;br /&gt;
{{TODO|Find the XM note / frequency each sample plays at}}&lt;br /&gt;
|-&lt;br /&gt;
| 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)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]], first 16 colours are reserved for the letterbox surrounds which expects a grey ramp&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || min_lzw_width || Minimum LZW words. Always seems to be 0x08.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data, exactly how it would be stored in a GIF &#039;&#039;&#039;after&#039;&#039;&#039; the values have been rotated right by 3 bits.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || end_of_image || GIF trailer. Always 0x3B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|The 201st frame of ENDANI.HAF appears to misdecode. Find out why.}}&lt;br /&gt;
&lt;br /&gt;
== Frame data chunks ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || length || Length of this frame data chunk, or 0 to indicate the end of this image.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length] || data || This chunk&#039;s data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.w3.org/Graphics/GIF/spec-gif89a.txt GIF 89a specification] for the particular flavour of LZW used.&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8595</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8595"/>
		<updated>2019-05-23T05:54:19Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: I finally poked around with SANIM.HAF in a hex editor. Confirm that the sound triggers and frame lengths are as expected&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;HAF Format&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
Also comparing against the BPK format, because HAF uses GIF&#039;s [[LZW Compression]], the end code is 0x101 while the reset code is 0x100.&lt;br /&gt;
&lt;br /&gt;
No transparency appears to be used - these are all keyframes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers ||&lt;br /&gt;
Array for indicating which sound effects to play from the relevant obfuscated [[XM Format]] sound file on each keyframe&lt;br /&gt;
&lt;br /&gt;
* 0 = no sound effect&lt;br /&gt;
* 1 upwards maps directly to an instrument in the XM file&lt;br /&gt;
* Unused instruments will be ignored&lt;br /&gt;
&lt;br /&gt;
{{TODO|Find the XM note / frequency each sample plays at}}&lt;br /&gt;
|-&lt;br /&gt;
| 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)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || min_lzw_width || Minimum LZW words. Always seems to be 0x08.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data, exactly how it would be stored in a GIF &#039;&#039;&#039;after&#039;&#039;&#039; the values have been rotated right by 3 bits.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || end_of_image || GIF trailer. Always 0x3B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|The 201st frame of ENDANI.HAF appears to misdecode. Find out why.}}&lt;br /&gt;
&lt;br /&gt;
== Frame data chunks ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || length || Length of this frame data chunk, or 0 to indicate the end of this image.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length] || data || This chunk&#039;s data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.w3.org/Graphics/GIF/spec-gif89a.txt GIF 89a specification] for the particular flavour of LZW used.&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8594</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8594"/>
		<updated>2019-05-23T05:36:04Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Link to GIF 89a spec on the W3 mirror; link to LZW Compression&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;HAF Format&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
Also comparing against the BPK format, because HAF uses GIF&#039;s [[LZW Compression]], the end code is 0x101 while the reset code is 0x100.&lt;br /&gt;
&lt;br /&gt;
No transparency appears to be used - these are all keyframes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers || ASSUMED array for indicating which sound effects to play when (0 == no sound effect) {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || frame_lengths || ASSUMED array for indicating how long each frame is to be shown for {{TODO|Confirm this}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || min_lzw_width || Minimum LZW words. Always seems to be 0x08.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data, exactly how it would be stored in a GIF &#039;&#039;&#039;after&#039;&#039;&#039; the values have been rotated right by 3 bits.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || end_of_image || GIF trailer. Always 0x3B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|The 201st frame of ENDANI.HAF appears to misdecode. Find out why.}}&lt;br /&gt;
&lt;br /&gt;
== Frame data chunks ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || length || Length of this frame data chunk, or 0 to indicate the end of this image.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length] || data || This chunk&#039;s data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.w3.org/Graphics/GIF/spec-gif89a.txt GIF 89a specification] for the particular flavour of LZW used.&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8593</id>
		<title>Death Rally</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8593"/>
		<updated>2019-05-23T05:28:20Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Update file formats list. We know these things now. I think.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NoModdingInfo}}&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Death Rally&#039;&#039;&#039; is a top-down car racing game with weapons.  While it apparently has no connection with [[wp:Renaissance (demogroup)|Renaissance]], it nonetheless uses the PMODE/W DOS extender written by Daredevil and Tran - possibly a later version of the protected mode extender used for [[Zone 66]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = dr.bin&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text-mode exit screen&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = tr*-*.*&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Level data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpa&lt;br /&gt;
 | Format = [[Death Rally BPA Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive file storing most of the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpk&lt;br /&gt;
 | Format = [[Death Rally BPK Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Compressed data, usually graphics, usually headerless&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.cmf&lt;br /&gt;
 | Format = [[Death Rally CMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Music and sound effect format, not [[CMF Format]]&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.haf&lt;br /&gt;
 | Format = [[Death Rally HAF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Video used for intro and ending cutscenes&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pal&lt;br /&gt;
 | Format = [[VGA Palette]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 768-byte standard VGA palette (0..63)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.tab&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = 256-byte lookup tables likely for colour effects&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Driving]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=File:Death_Rally_HAF_Format.png&amp;diff=8592</id>
		<title>File:Death Rally HAF Format.png</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=File:Death_Rally_HAF_Format.png&amp;diff=8592"/>
		<updated>2019-05-23T05:26:16Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 934th frame from SANIM.[[Death Rally HAF Format|HAF]] from [[Death Rally]]. I picked it because you can see the &amp;quot;2BAD&amp;quot; numberplate and there is an explosion in the background.&lt;br /&gt;
&lt;br /&gt;
Image was dumped to an 8bpp TGA file, then resaved as a PNG file using GIMP. The palette appears to be complete and untampered.&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=File:Death_Rally_HAF_Format.png&amp;diff=8591</id>
		<title>File:Death Rally HAF Format.png</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=File:Death_Rally_HAF_Format.png&amp;diff=8591"/>
		<updated>2019-05-23T05:25:15Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: The 934th frame from SANIM.HAF from Death Rally. I picked it because you can see the &amp;quot;2BAD&amp;quot; numberplate and there is an explosion in the background.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The 934th frame from SANIM.[[Death Rally HAF Format|HAF]] from [[Death Rally]]. I picked it because you can see the &amp;quot;2BAD&amp;quot; numberplate and there is an explosion in the background.&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8590</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8590"/>
		<updated>2019-05-23T05:23:26Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Unstubbing. Aside from that one frame in ENDANI.HAF that seems to not like me and possibly some frames after it, this format has been fully read.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;HAF Format&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
Also comparing against the BPK format, because HAF uses GIF LZW, the end code is 0x101 while the reset code is 0x100.&lt;br /&gt;
&lt;br /&gt;
No transparency appears to be used - these are all keyframes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers || ASSUMED array for indicating which sound effects to play when (0 == no sound effect) {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || frame_lengths || ASSUMED array for indicating how long each frame is to be shown for {{TODO|Confirm this}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || min_lzw_width || Minimum LZW words. Always seems to be 0x08.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data, exactly how it would be stored in a GIF &#039;&#039;&#039;after&#039;&#039;&#039; the values have been rotated right by 3 bits.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || end_of_image || GIF trailer. Always 0x3B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|The 201st frame of ENDANI.HAF appears to misdecode. Find out why.}}&lt;br /&gt;
&lt;br /&gt;
== Frame data chunks ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || length || Length of this frame data chunk, or 0 to indicate the end of this image.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length] || data || This chunk&#039;s data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8589</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8589"/>
		<updated>2019-05-23T05:19:17Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: OK, this is literally a ripoff of GIF.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120 ?&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;HAF Format&#039;&#039;&#039; 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.&lt;br /&gt;
&lt;br /&gt;
Also comparing against the BPK format, because HAF uses GIF LZW, the end code is 0x101 while the reset code is 0x100.&lt;br /&gt;
&lt;br /&gt;
No transparency appears to be used - these are all keyframes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers || ASSUMED array for indicating which sound effects to play when (0 == no sound effect) {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || frame_lengths || ASSUMED array for indicating how long each frame is to be shown for {{TODO|Confirm this}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || min_lzw_width || Minimum LZW words. Always seems to be 0x08.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data, exactly how it would be stored in a GIF &#039;&#039;&#039;after&#039;&#039;&#039; the values have been rotated right by 3 bits.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || end_of_image || GIF trailer. Always 0x3B.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|The 201st frame of ENDANI.HAF appears to misdecode. Find out why.}}&lt;br /&gt;
&lt;br /&gt;
== Frame data chunks ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT8 || length || Length of this frame data chunk, or 0 to indicate the end of this image.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length] || data || This chunk&#039;s data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8588</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8588"/>
		<updated>2019-05-23T04:14:44Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: A bit more information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120 ?&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;Death Rally HAF Format&#039;&#039;&#039; is a video format made for [[Death Rally]] to store the opening and ending cutscenes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers || ASSUMED array for indicating which sound effects to play when (0 == no sound effect) {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || frame_lengths || ASSUMED array for indicating how long each frame is to be shown for {{TODO|Confirm this}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[2] || magic1 || Always 0x08 0xFF. Unknown purpose.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 0x302] || frame_data || LZW-compressed frame data.&amp;lt;br /&amp;gt;{{TODO|Frames need to actually be extracted to confirm contents. It&#039;s definitely a form of LZW though.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8587</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8587"/>
		<updated>2019-05-23T01:49:03Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: First field confirmed to be frame count.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120 ?&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;Death Rally HAF Format&#039;&#039;&#039; is a video format made for [[Death Rally]] to store the opening and ending cutscenes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || Number of frames in this file&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers || ASSUMED array for indicating which sound effects to play when (0 == no sound effect) {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || frame_lengths || ASSUMED array for indicating how long each frame is to be shown for {{TODO|Confirm this}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 256*3] || frame_data || Compressed frame data.&amp;lt;br /&amp;gt;{{TODO|Current guess: LZW-compressed, then obfuscated, possibly rotated left by 3.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8586</id>
		<title>Death Rally HAF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_HAF_Format&amp;diff=8586"/>
		<updated>2019-05-23T01:22:33Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Initial documentation. Frame data unknown.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
{{Cutscene Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Resolution = 320&amp;amp;times;120 ?&lt;br /&gt;
 | Games ={{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;Death Rally HAF Format&#039;&#039;&#039; is a video format made for [[Death Rally]] to store the opening and ending cutscenes.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || frame_count || ASSUMED number of frames in this file {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || sound_triggers || ASSUMED array for indicating which sound effects to play when (0 == no sound effect) {{TODO|Confirm this}}&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[frame_count] || frame_lengths || ASSUMED array for indicating how long each frame is to be shown for {{TODO|Confirm this}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Then a series of frames follows.&lt;br /&gt;
&lt;br /&gt;
== Frame ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || length || Length of the following two fields in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || palette || Uncompressed [[VGA Palette]]&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[length - 256*3] || frame_data || Compressed frame data.&amp;lt;br /&amp;gt;{{TODO|Current guess: LZW-compressed, then obfuscated, possibly rotated left by 3.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8585</id>
		<title>Death Rally</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8585"/>
		<updated>2019-05-23T01:15:15Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Update file formats list; add HAF file format to list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NoModdingInfo}}&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Death Rally&#039;&#039;&#039; is a top-down car racing game with weapons.  While it apparently has no connection with [[wp:Renaissance (demogroup)|Renaissance]], it nonetheless uses the PMODE/W DOS extender written by Daredevil and Tran - possibly a later version of the protected mode extender used for [[Zone 66]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = dr.bin&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text-mode exit screen&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = tr*-*.*&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Level data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpa&lt;br /&gt;
 | Format = [[Death Rally BPA Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Archive file storing most of the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpk&lt;br /&gt;
 | Format = [[Death Rally BPK Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Compressed data, usually graphics, usually headerless&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.cmf&lt;br /&gt;
 | Format = [[Death Rally CMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Music and sound effect format, not [[CMF Format]]&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.haf&lt;br /&gt;
 | Format = [[Death Rally HAF Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Video used for intro and ending cutscenes&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pal&lt;br /&gt;
 | Format = [[VGA Palette]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 768-byte standard VGA palette (0..63)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.tab&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = 256-byte lookup tables likely for colour effects&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Driving]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_Level_Format&amp;diff=8584</id>
		<title>Death Rally Level Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_Level_Format&amp;diff=8584"/>
		<updated>2019-05-22T09:36:39Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: I forgot to add a backlink, oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
The TR?.BPA files in [[Death Rally]] contain data for each level, or &amp;quot;track&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Files ==&lt;br /&gt;
&lt;br /&gt;
Note: A Large image is 4 times the width and 4 times the height of a Small image. For example, TR1&#039;s Large images are 960&amp;amp;times;600, while TR1&#039;s Small images are 240&amp;amp;times;150.&lt;br /&gt;
&lt;br /&gt;
* TR?-IMA.BPK: Large RIX3 image containing the base track image, minus any of the 3D polygon effects.&lt;br /&gt;
* TR?-LR1.BPK: Small RIX3 image containing what looks like how far a point is to the left or the right side of the track.&lt;br /&gt;
* TR?-MAS.BPK: Large RIX3 image containing what looks like the main track surface information.&lt;br /&gt;
* TR?-VAI.BPK: Small RIX3 image containing what looks like the checkpoints for each pixel on the track.&lt;br /&gt;
&lt;br /&gt;
Unknown purpose:&lt;br /&gt;
&lt;br /&gt;
* TR?-BLO.TAB: 256 UINT8 values. Possibly for car shadows?&lt;br /&gt;
* TR?-DRV.DAT: 512 single-precision float values.&lt;br /&gt;
* TR?-FLIP.PAL: Standard VGA palette. Not the same palette as the TR?-IMA.BPK one.&lt;br /&gt;
* TR?-INF.BIN: 127 (U?)INT32LE values.&lt;br /&gt;
* TR?-LIT.TAB: 256 UINT8 values. Possibly for car headlamp lighting?&lt;br /&gt;
* TR?-OHI.DAT: 256 (U?)INT32LE values.&lt;br /&gt;
* TR?-SCE.BPK: A large file with a lot of INT32LE values in it. Probably 3D polygon data.&lt;br /&gt;
* TR?-SHA.BPK: A moderately-sized file consisting entirely of (U?)INT32LE values.&lt;br /&gt;
* TR?-SKI.TAB: 256 UINT8 values. Possibly for car skid marks?&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_Level_Format&amp;diff=8583</id>
		<title>Death Rally Level Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_Level_Format&amp;diff=8583"/>
		<updated>2019-05-22T08:45:08Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Initial documentation. Most of the files are unknown, but most of those are pretty guessable.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
The TR?.BPA files contain data for each level, or &amp;quot;track&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Files ==&lt;br /&gt;
&lt;br /&gt;
Note: A Large image is 4 times the width and 4 times the height of a Small image. For example, TR1&#039;s Large images are 960&amp;amp;times;600, while TR1&#039;s Small images are 240&amp;amp;times;150.&lt;br /&gt;
&lt;br /&gt;
* TR?-IMA.BPK: Large RIX3 image containing the base track image, minus any of the 3D polygon effects.&lt;br /&gt;
* TR?-LR1.BPK: Small RIX3 image containing what looks like how far a point is to the left or the right side of the track.&lt;br /&gt;
* TR?-MAS.BPK: Large RIX3 image containing what looks like the main track surface information.&lt;br /&gt;
* TR?-VAI.BPK: Small RIX3 image containing what looks like the checkpoints for each pixel on the track.&lt;br /&gt;
&lt;br /&gt;
Unknown purpose:&lt;br /&gt;
&lt;br /&gt;
* TR?-BLO.TAB: 256 UINT8 values. Possibly for car shadows?&lt;br /&gt;
* TR?-DRV.DAT: 512 single-precision float values.&lt;br /&gt;
* TR?-FLIP.PAL: Standard VGA palette. Not the same palette as the TR?-IMA.BPK one.&lt;br /&gt;
* TR?-INF.BIN: 127 (U?)INT32LE values.&lt;br /&gt;
* TR?-LIT.TAB: 256 UINT8 values. Possibly for car headlamp lighting?&lt;br /&gt;
* TR?-OHI.DAT: 256 (U?)INT32LE values.&lt;br /&gt;
* TR?-SCE.BPK: A large file with a lot of INT32LE values in it. Probably 3D polygon data.&lt;br /&gt;
* TR?-SHA.BPK: A moderately-sized file consisting entirely of (U?)INT32LE values.&lt;br /&gt;
* TR?-SKI.TAB: 256 UINT8 values. Possibly for car skid marks?&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Death Rally]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_BPK_Format&amp;diff=8582</id>
		<title>Death Rally BPK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_BPK_Format&amp;diff=8582"/>
		<updated>2019-05-22T08:18:12Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Elaborate on RIX3 image format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Image Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Depth = 8&lt;br /&gt;
 | MinSize = ?&amp;amp;times;?&lt;br /&gt;
 | MaxSize = ?&amp;amp;times;?&lt;br /&gt;
 | Palette = Shared&lt;br /&gt;
 | NumPlanes = 1&lt;br /&gt;
 | HasTransparency = ?&lt;br /&gt;
 | HasHitmap = ?&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Death Rally}}}}&lt;br /&gt;
&lt;br /&gt;
The BPK format is a format used by [[Death Rally]] which usually contains graphics.&lt;br /&gt;
&lt;br /&gt;
It contains encrypted [[LZW Compression|LZW-compressed]] data.&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
&lt;br /&gt;
Before the image is compressed, every byte is rotated left by 3 bits.&lt;br /&gt;
&lt;br /&gt;
So after the image is decompressed, every byte needs to be rotated right by 3 bits.&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
The BPK format uses [[LZW Compression]] of each byte in the image, using the values 0x100 to mark EOF and 0x101 to reset the LZW tables. The initial bit width is 9 bits. The dictionary size is capped at 4096 entries, so the bit width is capped at 12 bits. Once the dictionary is full, it accepts no more entries until the dictionary is reset and the width then gets returned to 9 bits.&lt;br /&gt;
&lt;br /&gt;
{{TODO|Some files (e.g. TIRE?.BPK in MENU.BPA) contain data after the EOF mark. Figure out what&#039;s going on here.}}&lt;br /&gt;
&lt;br /&gt;
The data is packed in little-endian and always starts with an LZW table reset (0x101). There is no bit swapping.&lt;br /&gt;
&lt;br /&gt;
So, at the start of the file, you&#039;ll have bytes in this form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aaaaaaaa&lt;br /&gt;
bbbbbbbA&lt;br /&gt;
ccccccBB&lt;br /&gt;
dddddCCC&lt;br /&gt;
eeeeDDDD&lt;br /&gt;
fffEEEEE&lt;br /&gt;
ggFFFFFF&lt;br /&gt;
hGGGGGGG&lt;br /&gt;
HHHHHHHH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While the bit width is 9 bits, these are to be interpreted as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Aaaaaaaaa&lt;br /&gt;
BBbbbbbbb&lt;br /&gt;
CCCcccccc&lt;br /&gt;
DDDDddddd&lt;br /&gt;
EEEEEeeee&lt;br /&gt;
FFFFFFfff&lt;br /&gt;
GGGGGGGgg&lt;br /&gt;
HHHHHHHHh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
The formats identified here are:&lt;br /&gt;
&lt;br /&gt;
* [[Raw VGA Image]] - image dimensions are unknown.&lt;br /&gt;
* RIX3 image - comes with a header featuring dimensions and a palette. Pixels are stored left-to-right then top-to-bottom, one byte per pixel as per VGA.&lt;br /&gt;
* Some other formats of currently unknown purpose. {{TODO|For TR?-SHA there&#039;s a lot of INT32LE values. And for TR?-SCE there&#039;s a lot of INT32LE values offset by 1 byte or something.}}&lt;br /&gt;
&lt;br /&gt;
=== RIX3 images ===&lt;br /&gt;
&lt;br /&gt;
RIX3 images have the following header:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| char[4] || The string &amp;quot;RIX3&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || Image width&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || Image height&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE || Unknown purpose, appears to always be 0x00AF&lt;br /&gt;
|-&lt;br /&gt;
| UINT8[256][3] || Image palette&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{TODO|Should this be shifted out to a separate page, or should we wait until the subformats have been better fleshed-out?}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Encryption algorithms]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_BPK_Format&amp;diff=8581</id>
		<title>Death Rally BPK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_BPK_Format&amp;diff=8581"/>
		<updated>2019-05-22T07:56:22Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: This format has multiple purposes which need to be investigated.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Image Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Depth = 8&lt;br /&gt;
 | MinSize = ?&amp;amp;times;?&lt;br /&gt;
 | MaxSize = ?&amp;amp;times;?&lt;br /&gt;
 | Palette = Shared&lt;br /&gt;
 | NumPlanes = 1&lt;br /&gt;
 | HasTransparency = ?&lt;br /&gt;
 | HasHitmap = ?&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Death Rally}}}}&lt;br /&gt;
&lt;br /&gt;
The BPK format is a graphics format used by [[Death Rally]].&lt;br /&gt;
&lt;br /&gt;
It contains encrypted [[LZW Compression|LZW-compressed]] 8-bit graphics data with no header and no embedded palette.&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
&lt;br /&gt;
Before the image is compressed, every byte is rotated left by 3 bits.&lt;br /&gt;
&lt;br /&gt;
So after the image is decompressed, every byte needs to be rotated right by 3 bits.&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
The BPK format uses [[LZW Compression]] of each byte in the image, using the values 0x100 to mark EOF and 0x101 to reset the LZW tables. The initial bit width is 9 bits. The dictionary size is capped at 4096 entries, so the bit width is capped at 12 bits. Once the dictionary is full, it accepts no more entries until the dictionary is reset and the width then gets returned to 9 bits.&lt;br /&gt;
&lt;br /&gt;
{{TODO|Some files (e.g. TIRE?.BPK in MENU.BPA) contain data after the EOF mark. Figure out what&#039;s going on here.}}&lt;br /&gt;
&lt;br /&gt;
The data is packed in little-endian and always starts with an LZW table reset (0x101). There is no bit swapping.&lt;br /&gt;
&lt;br /&gt;
So, at the start of the file, you&#039;ll have bytes in this form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aaaaaaaa&lt;br /&gt;
bbbbbbbA&lt;br /&gt;
ccccccBB&lt;br /&gt;
dddddCCC&lt;br /&gt;
eeeeDDDD&lt;br /&gt;
fffEEEEE&lt;br /&gt;
ggFFFFFF&lt;br /&gt;
hGGGGGGG&lt;br /&gt;
HHHHHHHH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While the bit width is 9 bits, these are to be interpreted as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Aaaaaaaaa&lt;br /&gt;
BBbbbbbbb&lt;br /&gt;
CCCcccccc&lt;br /&gt;
DDDDddddd&lt;br /&gt;
EEEEEeeee&lt;br /&gt;
FFFFFFfff&lt;br /&gt;
GGGGGGGgg&lt;br /&gt;
HHHHHHHHh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Image data ==&lt;br /&gt;
&lt;br /&gt;
There is no width or height information stored within the file itself.&lt;br /&gt;
&lt;br /&gt;
{{TODO|For the level files this is not true. For most level files (TR?-IMA, -LR1, -MAS, -VAI) there&#039;s a &amp;quot;RIX3&amp;quot; header followed by 3 UINT16LE values, a VGA palette, and then the graphics data follows. For -SHA there&#039;s a lot of INT32LE values. And for -SCE there&#039;s a lot of INT32LE values offset by 1 byte or something.}}&lt;br /&gt;
&lt;br /&gt;
Pixels are stored left-to-right then top-to-bottom, one byte per pixel as per VGA.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Encryption algorithms]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=User:GreaseMonkey&amp;diff=8580</id>
		<title>User:GreaseMonkey</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=User:GreaseMonkey&amp;diff=8580"/>
		<updated>2019-05-22T06:57:35Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi. I like tearing games apart and making them do horrible things.&lt;br /&gt;
&lt;br /&gt;
Wiki contributions:&lt;br /&gt;
&lt;br /&gt;
* [[Death Rally]]: Reverse engineered some formats after noticing that the game was classified as &amp;quot;Unmoddable&amp;quot;, I happened to have a copy of it lying around, and it only had the archive format documented. So for at least getting that documented and therefore getting me started with tearing the rest of the game apart, thanks [[User:Ceidwad|Ceidwad]]!&lt;br /&gt;
&lt;br /&gt;
Some other things:&lt;br /&gt;
&lt;br /&gt;
* I&#039;ve been doing horrible things to [[ZZT]] and [[Super ZZT]] over the past few months. If you&#039;d like a memory map for these I could start putting what I&#039;ve got together, as a memory map does come in handy when you want to make a mess of how the game works by moving stuff from off the board to other places.&lt;br /&gt;
* For non-DOS stuff I&#039;ve reverse-engineered a few PS1 games, most notably Tony Hawk&#039;s Pro Skater 2 and Gran Turismo 1.&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8579</id>
		<title>Death Rally</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8579"/>
		<updated>2019-05-22T06:31:30Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Mark BPK as known&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NoModdingInfo}}&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Death Rally&#039;&#039;&#039; is a top-down car racing game with weapons.  While it apparently has no connection with [[wp:Renaissance (demogroup)|Renaissance]], it nonetheless uses the PMODE/W DOS extender written by Daredevil and Tran - possibly a later version of the protected mode extender used for [[Zone 66]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = dr.bin&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text-mode exit screen&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = tr*.bin&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Assumed part of the level format&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpa&lt;br /&gt;
 | Format = [[Death Rally BPA Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Archive file storing most of the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpk&lt;br /&gt;
 | Format = [[Death Rally BPK Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Graphics data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.cmf&lt;br /&gt;
 | Format = [[Death Rally CMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Music and sound effect format, not [[CMF Format]]&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.dat&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Assumed part of the level format&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pal&lt;br /&gt;
 | Format = [[VGA Palette]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 768-byte standard VGA palette (0..63)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.tab&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Assumed part of the level format&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Driving]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_BPK_Format&amp;diff=8578</id>
		<title>Death Rally BPK Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_BPK_Format&amp;diff=8578"/>
		<updated>2019-05-22T06:27:14Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Initial documentation, needs more work. Plain LZW with a bit rotation not-really-encryption layer.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Image Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | Depth = 8&lt;br /&gt;
 | MinSize = ?&amp;amp;times;?&lt;br /&gt;
 | MaxSize = ?&amp;amp;times;?&lt;br /&gt;
 | Palette = Shared&lt;br /&gt;
 | NumPlanes = 1&lt;br /&gt;
 | HasTransparency = ?&lt;br /&gt;
 | HasHitmap = ?&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Death Rally}}}}&lt;br /&gt;
&lt;br /&gt;
The BPK format is a graphics format used by [[Death Rally]].&lt;br /&gt;
&lt;br /&gt;
It contains encrypted [[LZW Compression|LZW-compressed]] 8-bit graphics data with no header and no embedded palette.&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
&lt;br /&gt;
Before the image is compressed, every byte is rotated left by 3 bits.&lt;br /&gt;
&lt;br /&gt;
So after the image is decompressed, every byte needs to be rotated right by 3 bits.&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
The BPK format uses [[LZW Compression]] of each byte in the image, using the values 0x100 to mark EOF and 0x101 to reset the LZW tables. The initial bit width is 9 bits. The dictionary size is capped at 4096 entries, so the bit width is capped at 12 bits. Once the dictionary is full, it accepts no more entries until the dictionary is reset and the width then gets returned to 9 bits.&lt;br /&gt;
&lt;br /&gt;
{{TODO|Some files (e.g. TIRE?.BPK in MENU.BPA) contain data after the EOF mark. Figure out what&#039;s going on here.}}&lt;br /&gt;
&lt;br /&gt;
The data is packed in little-endian and always starts with an LZW table reset (0x101). There is no bit swapping.&lt;br /&gt;
&lt;br /&gt;
So, at the start of the file, you&#039;ll have bytes in this form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aaaaaaaa&lt;br /&gt;
bbbbbbbA&lt;br /&gt;
ccccccBB&lt;br /&gt;
dddddCCC&lt;br /&gt;
eeeeDDDD&lt;br /&gt;
fffEEEEE&lt;br /&gt;
ggFFFFFF&lt;br /&gt;
hGGGGGGG&lt;br /&gt;
HHHHHHHH&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While the bit width is 9 bits, these are to be interpreted as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Aaaaaaaaa&lt;br /&gt;
BBbbbbbbb&lt;br /&gt;
CCCcccccc&lt;br /&gt;
DDDDddddd&lt;br /&gt;
EEEEEeeee&lt;br /&gt;
FFFFFFfff&lt;br /&gt;
GGGGGGGgg&lt;br /&gt;
HHHHHHHHh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Image data ==&lt;br /&gt;
&lt;br /&gt;
There is no width or height information stored within the file itself.&lt;br /&gt;
&lt;br /&gt;
Pixels are stored left-to-right then top-to-bottom, one byte per pixel as per VGA.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Encryption algorithms]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_CMF_Format&amp;diff=8577</id>
		<title>Death Rally CMF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_CMF_Format&amp;diff=8577"/>
		<updated>2019-05-22T06:03:15Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: I should probably declare the sample code as public domain&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Tracked&lt;br /&gt;
 | Instruments = PCM&lt;br /&gt;
 | NumChannels = 16&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = ?&lt;br /&gt;
 | NumOrders = ?&lt;br /&gt;
 | Tags = Title&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
CMF files in [[Death Rally]] are obfuscated sound and music files.&lt;br /&gt;
&lt;br /&gt;
Music is stored in [[S3M Format]] (traditionally created with Scream Tracker 3), while sound effects are stored as samples in [[XM Format]] (traditionally created with FastTracker 2).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not to be confused with the [[CMF Format|Creative Music Format]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
&lt;br /&gt;
The encryption has a period of 0x700 bytes.&lt;br /&gt;
&lt;br /&gt;
To decrypt the files, for each byte:&lt;br /&gt;
&lt;br /&gt;
# Rotate the byte left by the file position modulo 7.&lt;br /&gt;
# Subtract 0x6D.&lt;br /&gt;
# Subtract the file position multiplied by 0x11.&lt;br /&gt;
&lt;br /&gt;
Which means that to apply the encryption, for each byte:&lt;br /&gt;
&lt;br /&gt;
# Add the file position multiplied by 0x11.&lt;br /&gt;
# Add 0x6D.&lt;br /&gt;
# Rotate the value right by the file position modulo 7.&lt;br /&gt;
&lt;br /&gt;
=== Sample code ===&lt;br /&gt;
&lt;br /&gt;
Decryption in Python 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    # Written by GreaseMonkey, 2019. Public domain. Do with it what you will.&lt;br /&gt;
    data = bytearray(open(input_cmf_fname, &amp;quot;rb&amp;quot;).read())&lt;br /&gt;
    for pos in range(len(data)):&lt;br /&gt;
        v = data[pos]&lt;br /&gt;
        v = ((v&amp;lt;&amp;lt;(pos%7))|(v&amp;gt;&amp;gt;(8-(pos%7)))) &amp;amp; 0xFF&lt;br /&gt;
        v = (v - (0x6D + (pos*0x11))) &amp;amp; 0xFF&lt;br /&gt;
        data[pos] = v&lt;br /&gt;
    with open(out_s3m_or_xm_fname, &amp;quot;wb&amp;quot;) as outfp:&lt;br /&gt;
        outfp.write(data)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Encryption algorithms]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8576</id>
		<title>Death Rally</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally&amp;diff=8576"/>
		<updated>2019-05-22T05:59:34Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Mark CMF as known&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NoModdingInfo}}&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = No&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = No&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Death Rally&#039;&#039;&#039; is a top-down car racing game with weapons.  While it apparently has no connection with [[wp:Renaissance (demogroup)|Renaissance]], it nonetheless uses the PMODE/W DOS extender written by Daredevil and Tran - possibly a later version of the protected mode extender used for [[Zone 66]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = dr.bin&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text-mode exit screen&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = tr*.bin&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Assumed part of the level format&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpa&lt;br /&gt;
 | Format = [[Death Rally BPA Format]]&lt;br /&gt;
 | KnownFormat = Partial&lt;br /&gt;
 | Desc = Archive file storing most of the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.bpk&lt;br /&gt;
 | Format = [[Death Rally BPK Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Sprite graphics&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.cmf&lt;br /&gt;
 | Format = [[Death Rally CMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Music and sound effect format, not [[CMF Format]]&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.dat&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Assumed part of the level format&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pal&lt;br /&gt;
 | Format = [[VGA Palette]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 768-byte standard VGA palette (0..63)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.tab&lt;br /&gt;
 | Format = [[Death Rally Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Assumed part of the level format&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Driving]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_CMF_Format&amp;diff=8575</id>
		<title>Death Rally CMF Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Death_Rally_CMF_Format&amp;diff=8575"/>
		<updated>2019-05-22T05:57:14Z</updated>

		<summary type="html">&lt;p&gt;GreaseMonkey: Initial documentation. This is an encrypted S3M or XM file.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Music Infobox&lt;br /&gt;
 | Type = Tracked&lt;br /&gt;
 | Instruments = PCM&lt;br /&gt;
 | NumChannels = 16&lt;br /&gt;
 | NumTracks = 1&lt;br /&gt;
 | NumPatterns = ?&lt;br /&gt;
 | NumOrders = ?&lt;br /&gt;
 | Tags = Title&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Death Rally}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
CMF files in [[Death Rally]] are obfuscated sound and music files.&lt;br /&gt;
&lt;br /&gt;
Music is stored in [[S3M Format]] (traditionally created with Scream Tracker 3), while sound effects are stored as samples in [[XM Format]] (traditionally created with FastTracker 2).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not to be confused with the [[CMF Format|Creative Music Format]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Encryption ==&lt;br /&gt;
&lt;br /&gt;
The encryption has a period of 0x700 bytes.&lt;br /&gt;
&lt;br /&gt;
To decrypt the files, for each byte:&lt;br /&gt;
&lt;br /&gt;
# Rotate the byte left by the file position modulo 7.&lt;br /&gt;
# Subtract 0x6D.&lt;br /&gt;
# Subtract the file position multiplied by 0x11.&lt;br /&gt;
&lt;br /&gt;
Which means that to apply the encryption, for each byte:&lt;br /&gt;
&lt;br /&gt;
# Add the file position multiplied by 0x11.&lt;br /&gt;
# Add 0x6D.&lt;br /&gt;
# Rotate the value right by the file position modulo 7.&lt;br /&gt;
&lt;br /&gt;
=== Sample code ===&lt;br /&gt;
&lt;br /&gt;
Decryption:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    data = bytearray(open(input_cmf_fname, &amp;quot;rb&amp;quot;).read())&lt;br /&gt;
    for pos in range(len(data)):&lt;br /&gt;
        v = data[pos]&lt;br /&gt;
        v = ((v&amp;lt;&amp;lt;(pos%7))|(v&amp;gt;&amp;gt;(8-(pos%7)))) &amp;amp; 0xFF&lt;br /&gt;
        v = (v - (0x6D + (pos*0x11))) &amp;amp; 0xFF&lt;br /&gt;
        data[pos] = v&lt;br /&gt;
    with open(out_s3m_or_xm_fname, &amp;quot;wb&amp;quot;) as outfp:&lt;br /&gt;
        outfp.write(data)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:GreaseMonkey|GreaseMonkey]]. If you find this information helpful in a project you&#039;re working on, please give credit where credit is due. (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:Encryption algorithms]]&lt;/div&gt;</summary>
		<author><name>GreaseMonkey</name></author>
	</entry>
</feed>