<?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=K1n9+Duk3</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=K1n9+Duk3"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/K1n9_Duk3"/>
	<updated>2026-05-15T04:02:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=ProGraphx_Toolbox_tileset_format&amp;diff=12482</id>
		<title>ProGraphx Toolbox tileset format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=ProGraphx_Toolbox_tileset_format&amp;diff=12482"/>
		<updated>2025-10-20T05:57:39Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Header */ fixed typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | ImageNativeWidth = Y&lt;br /&gt;
 | Hardware1 = EGA&lt;br /&gt;
 | MaxTiles = 255 per subtileset, unlimited subtilesets&lt;br /&gt;
 | Palette = Default EGA&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 0&amp;amp;times;0&lt;br /&gt;
 | TileMaxSize = 2040&amp;amp;times;255&lt;br /&gt;
 | NumPlanes = 5&lt;br /&gt;
 | PlaneArrangement = [[Byte-planar EGA]]&lt;br /&gt;
 | HasTransparency = Y&lt;br /&gt;
 | HasHitmap = N&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = Y&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Operation: Airlift}}&lt;br /&gt;
   {{Game|Dark Ages}}&lt;br /&gt;
   {{Game|Duke Nukem}}&lt;br /&gt;
   {{Game|Crystal Caves}}&lt;br /&gt;
   {{Game|FBI Fred}}&lt;br /&gt;
   {{Game|Secret Agent}}&lt;br /&gt;
}}&lt;br /&gt;
This file format is used by the ProGraphx Toolbox to store images used for map tiles in a game.&lt;br /&gt;
__TOC__&lt;br /&gt;
The ProGraphx Toolbox, written by Peder Jungck, is used by the following games:&lt;br /&gt;
&lt;br /&gt;
* [[Operation: Airlift]] - &amp;lt;tt&amp;gt;AIRLIFT.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.0 EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039;&lt;br /&gt;
* [[Dark Ages]] - &amp;lt;tt&amp;gt;DA3.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.0 EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039; (DA1.EXE and DA2.EXE contain gibberish)&lt;br /&gt;
* [[Duke Nukem]] - &amp;lt;tt&amp;gt;DN1.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.0 EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039;&lt;br /&gt;
* [[Crystal Caves]] - &amp;lt;tt&amp;gt;CC1.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.5 320x200 PAN EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039;&lt;br /&gt;
* [[FBI Fred]] - &amp;lt;tt&amp;gt;FBIFRED.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.5 EGA/VGAProGraphx EGA/VGA Toolbox  (c) 1990&#039;&#039;&lt;br /&gt;
* [[Secret Agent]] - &amp;lt;tt&amp;gt;SAM1.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;ProGraphx EGA/VGA Toolbox Version 2.0 320x200 EGA/VGA Copyright 1991 by Peder Jungck&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file consists of a number of tilesets one after the other.  Each tileset is made up of a collection of small images (usually 8&amp;amp;times;8 or 16&amp;amp;times;16, but the format supports up to 2040&amp;amp;times;255.)&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Secret Agent&#039;&#039;&#039; the files are encrypted with [[Secret Agent encryption]].   In the other games there is no encryption.&lt;br /&gt;
&lt;br /&gt;
=== Signature ===&lt;br /&gt;
&lt;br /&gt;
There is no signature, however careful processing of the header can be used to check whether the last tileset ends at exactly the end of the file (allowing for padding in some versions of the format.)  If not, it is unlikely to be in this format.  Be careful that files with zero values don&#039;t cause an endless loop when calculating offsets.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
Each tileset begins with 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;
|[[BYTE]] count||Number of sprites in this chunk (50 in most cases)&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]] width||Sprite width, in packets (not in pixels)&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]] height||Sprite height, in pixels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The image data for the tileset follows the header.  After the image data either the next header begins, or the file ends.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Operation: Airlift:&#039;&#039;&#039; Each tileset is padded up to the nearest multiple of 128 bytes. {{TODO|Check if header is ignored by the game}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dark Ages:&#039;&#039;&#039; Each tileset is padded up to 8064 bytes, except for the last tileset, which contains 2 sprites and is padded up to 384 bytes. The game executables will ignore the entire header of the tileset files and simply load a hard-coded amount of image data into memory, skipping the 3-byte header data. There is never more than one tileset in each file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Duke Nukem:&#039;&#039;&#039; Most tilesets are padded up to the nearest multiple of 128 bytes, except for the backdrop files (DROP*.DN?) which have no padding. The backdrop files also have all three header bytes set to zero. For these files, the number of sprites is always 130, the width is always 2 (bytes) and the height is always 16. The game executables will always ignore the entire header of all the tileset files and simply load a hard-coded amount of image data into memory, skipping the 3-byte header data. There is never more than one tileset in each file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Crystal Caves:&#039;&#039;&#039; The file ends after the last tile&#039;s image data, there is no padding. The game executables will ignore the entire header of the tileset files and simply load a hard-coded amount of tilesets (and a hard-coded amount of bytes per tileset) into memory. Only the main 16x16 pixel tileset file CC?.GFX contains multiple tilesets (23 tilesets in total, 50 tiles each), the other 8x8 pixel tileset files only contain a single tileset per file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FBI Fred:&#039;&#039;&#039; Each tileset is padded up to 8064 bytes, except for the last tileset which contains 23 sprites and is padded up to 3712 bytes. {{TODO|Check if header is ignored by the game}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Secret Agent:&#039;&#039;&#039; Each tileset is padded up to 8064 bytes for 16×16 sprite files (SAM?01.GFX), and 2048 bytes for 8×8 sprite files (SAM?02.GFX). The game executables will ignore the entire header of the tileset files and simply load a hard-coded amount of tilesets (and a hard-coded amount of bytes per tileset) into memory. The 16x16 pixel tileset file contains 16 tilesets and the 8x8 pixel tileset file contains 3 tilesets.&lt;br /&gt;
&lt;br /&gt;
For those files with padding at the end, be careful not to interpret the padding as the presence of more tiles.&lt;br /&gt;
&lt;br /&gt;
=== Image data ===&lt;br /&gt;
&lt;br /&gt;
The image data is in [[Byte-planar EGA]] format with five planes, so reading &amp;lt;tt&amp;gt;width &amp;amp;times; height &amp;amp;times; 5&amp;lt;/tt&amp;gt; bytes will read in enough data for a single image (one tile.)  This value multiplied by the number of tiles (&amp;lt;tt&amp;gt;count&amp;lt;/tt&amp;gt;) will yield the number of bytes in the entire tileset, which can be used to skip directly to the next tileset in the file (if any.)&lt;br /&gt;
&lt;br /&gt;
The first byte in each tile&#039;s data is the transparency plane (1 == opaque, 0 == transparent), and the following four bytes/planes are blue, green, red and intensity.  The MSB in each byte (10000000) is the first/left-most pixel, and the eighth pixel is the LSB (00000001).  This means if the bits are processed in a loop, as the X direction increases to the right (0, 1, 2) the bit value decreases (0x80, 0x40, 0x20.)&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* For at least &#039;&#039;&#039;Duke Nukem&#039;&#039;&#039;, the game seems to ignore the header of &#039;&#039;all&#039;&#039; files in this format.  You can set the entire header of any tileset file to zero values and the game will still load them properly.  This also means that you cannot use larger tilesets without modifying the executable.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format has been reverse engineered by many people over the years.  [[User:K1n9_Duk3|K1n9_Duk3]] discovered that Duke Nukem uses this format.  [[User:Frenkel|Frenkel]] identified the similarities amongst all the games using the file format, and realised they all use the ProGraphx Toolbox.  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=ProGraphx_Toolbox_tileset_format&amp;diff=12476</id>
		<title>ProGraphx Toolbox tileset format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=ProGraphx_Toolbox_tileset_format&amp;diff=12476"/>
		<updated>2025-10-10T08:28:19Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Header */ most games ignore the headers and read hard-coded amounts of data&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | ImageNativeWidth = Y&lt;br /&gt;
 | Hardware1 = EGA&lt;br /&gt;
 | MaxTiles = 255 per subtileset, unlimited subtilesets&lt;br /&gt;
 | Palette = Default EGA&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 0&amp;amp;times;0&lt;br /&gt;
 | TileMaxSize = 2040&amp;amp;times;255&lt;br /&gt;
 | NumPlanes = 5&lt;br /&gt;
 | PlaneArrangement = [[Byte-planar EGA]]&lt;br /&gt;
 | HasTransparency = Y&lt;br /&gt;
 | HasHitmap = N&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = Y&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Operation: Airlift}}&lt;br /&gt;
   {{Game|Dark Ages}}&lt;br /&gt;
   {{Game|Duke Nukem}}&lt;br /&gt;
   {{Game|Crystal Caves}}&lt;br /&gt;
   {{Game|FBI Fred}}&lt;br /&gt;
   {{Game|Secret Agent}}&lt;br /&gt;
}}&lt;br /&gt;
This file format is used by the ProGraphx Toolbox to store images used for map tiles in a game.&lt;br /&gt;
__TOC__&lt;br /&gt;
The ProGraphx Toolbox, written by Peder Jungck, is used by the following games:&lt;br /&gt;
&lt;br /&gt;
* [[Operation: Airlift]] - &amp;lt;tt&amp;gt;AIRLIFT.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.0 EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039;&lt;br /&gt;
* [[Dark Ages]] - &amp;lt;tt&amp;gt;DA3.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.0 EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039; (DA1.EXE and DA2.EXE contain gibberish)&lt;br /&gt;
* [[Duke Nukem]] - &amp;lt;tt&amp;gt;DN1.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.0 EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039;&lt;br /&gt;
* [[Crystal Caves]] - &amp;lt;tt&amp;gt;CC1.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.5 320x200 PAN EGA/VGAProGraphx EGA/VGA Toolbox&#039;&#039;&lt;br /&gt;
* [[FBI Fred]] - &amp;lt;tt&amp;gt;FBIFRED.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;Version 1.5 EGA/VGAProGraphx EGA/VGA Toolbox  (c) 1990&#039;&#039;&lt;br /&gt;
* [[Secret Agent]] - &amp;lt;tt&amp;gt;SAM1.EXE&amp;lt;/tt&amp;gt; contains the string &#039;&#039;ProGraphx EGA/VGA Toolbox Version 2.0 320x200 EGA/VGA Copyright 1991 by Peder Jungck&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file consists of a number of tilesets one after the other.  Each tileset is made up of a collection of small images (usually 8&amp;amp;times;8 or 16&amp;amp;times;16, but the format supports up to 2040&amp;amp;times;255.)&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Secret Agent&#039;&#039;&#039; the files are encrypted with [[Secret Agent encryption]].   In the other games there is no encryption.&lt;br /&gt;
&lt;br /&gt;
=== Signature ===&lt;br /&gt;
&lt;br /&gt;
There is no signature, however careful processing of the header can be used to check whether the last tileset ends at exactly the end of the file (allowing for padding in some versions of the format.)  If not, it is unlikely to be in this format.  Be careful that files with zero values don&#039;t cause an endless loop when calculating offsets.&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
Each tileset begins with 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;
|[[BYTE]] count||Number of sprites in this chunk (50 in most cases)&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]] width||Sprite width, in packets (not in pixels)&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]] height||Sprite height, in pixels&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The image data for the tileset follows the header.  After the image data either the next header begins, or the file ends.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Operation: Airlift:&#039;&#039;&#039; Each tileset is padded up to the nearest multiple of 128 bytes. {{TODO|Check if header is ignored by the game}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dark Ages:&#039;&#039;&#039; Each tileset is padded up to 8064 bytes, except for the last tileset, which contains 2 sprites and is padded up to 384 bytes. The game executables will ignore the entire header of the tileset files and simply load a hard-coded amount of image data into memory, skipping the 3-byte header data. There is never more that one tileset in each file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Duke Nukem:&#039;&#039;&#039; Most tilesets are padded up to the nearest multiple of 128 bytes, except for the backdrop files (DROP*.DN?) which have no padding. The backdrop files also have all three header bytes set to zero. For these files, the number of sprites is always 130, the width is always 2 (bytes) and the height is always 16. The game executables will always ignore the entire header of all the tileset files and simply load a hard-coded amount of image data into memory, skipping the 3-byte header data. There is never more that one tileset in each file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Crystal Caves:&#039;&#039;&#039; The file ends after the last tile&#039;s image data, there is no padding. The game executables will ignore the entire header of the tileset files and simply load a hard-coded amount of tilesets (and a hard-coded amount of bytes per tileset) into memory. Only the main 16x16 pixel tileset file CC?.GFX contains multiple tilesets (23 tilesets in total, 50 tiles each), the other 8x8 pixel tileset files only contain a single tileset per file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;FBI Fred:&#039;&#039;&#039; Each tileset is padded up to 8064 bytes, except for the last tileset which contains 23 sprites and is padded up to 3712 bytes. {{TODO|Check if header is ignored by the game}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Secret Agent:&#039;&#039;&#039; Each tileset is padded up to 8064 bytes for 16×16 sprite files (SAM?01.GFX), and 2048 bytes for 8×8 sprite files (SAM?02.GFX). The game executables will ignore the entire header of the tileset files and simply load a hard-coded amount of tilesets (and a hard-coded amount of bytes per tileset) into memory. The 16x16 pixel tileset file contains 16 tilesets and the 8x8 pixel tileset file contains 3 tilesets.&lt;br /&gt;
&lt;br /&gt;
For those files with padding at the end, be careful not to interpret the padding as the presence of more tiles.&lt;br /&gt;
&lt;br /&gt;
=== Image data ===&lt;br /&gt;
&lt;br /&gt;
The image data is in [[Byte-planar EGA]] format with five planes, so reading &amp;lt;tt&amp;gt;width &amp;amp;times; height &amp;amp;times; 5&amp;lt;/tt&amp;gt; bytes will read in enough data for a single image (one tile.)  This value multiplied by the number of tiles (&amp;lt;tt&amp;gt;count&amp;lt;/tt&amp;gt;) will yield the number of bytes in the entire tileset, which can be used to skip directly to the next tileset in the file (if any.)&lt;br /&gt;
&lt;br /&gt;
The first byte in each tile&#039;s data is the transparency plane (1 == opaque, 0 == transparent), and the following four bytes/planes are blue, green, red and intensity.  The MSB in each byte (10000000) is the first/left-most pixel, and the eighth pixel is the LSB (00000001).  This means if the bits are processed in a loop, as the X direction increases to the right (0, 1, 2) the bit value decreases (0x80, 0x40, 0x20.)&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* For at least &#039;&#039;&#039;Duke Nukem&#039;&#039;&#039;, the game seems to ignore the header of &#039;&#039;all&#039;&#039; files in this format.  You can set the entire header of any tileset file to zero values and the game will still load them properly.  This also means that you cannot use larger tilesets without modifying the executable.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format has been reverse engineered by many people over the years.  [[User:K1n9_Duk3|K1n9_Duk3]] discovered that Duke Nukem uses this format.  [[User:Frenkel|Frenkel]] identified the similarities amongst all the games using the file format, and realised they all use the ProGraphx Toolbox.  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Pharaoh%27s_Tomb&amp;diff=12475</id>
		<title>Pharaoh&#039;s Tomb</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Pharaoh%27s_Tomb&amp;diff=12475"/>
		<updated>2025-10-10T07:40:29Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* File formats */ link to image format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
&#039;&#039;&#039;Pharaoh&#039;s Tomb&#039;&#039;&#039; is a platform game by Micro F/X Software from 1990 with CGA graphics.&lt;br /&gt;
&lt;br /&gt;
==File formats==&lt;br /&gt;
*[[Turbo Pascal 3.0 Image Format]] - tile images, stored in the executable&lt;br /&gt;
*[[Pharaoh&#039;s Tomb Map Format]] - levels are stored in the EXE file&lt;br /&gt;
*[[SAV Format (Pharaoh&#039;s Tomb)]] - savegames&lt;br /&gt;
*[[Pharaoh&#039;s Tomb &amp;amp; Arctic Adventure Fullscreen Image Format]] - title screen image (in [[PCX Format]])&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*A level editor can be found [http://crystalshard.net/?p=8&amp;amp;s=51 here].&lt;br /&gt;
*Maps can be found [http://www.zanderz.net/index.php?id=gamemaps here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Puzzle]]&lt;br /&gt;
[[Category:Pharaoh&#039;s Tomb]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Arctic_Adventure&amp;diff=12474</id>
		<title>Arctic Adventure</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Arctic_Adventure&amp;diff=12474"/>
		<updated>2025-10-10T07:39:03Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added link to image format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
&#039;&#039;&#039;Arctic Adventure&#039;&#039;&#039; is a puzzle platformer by George Broussard/Apogee Software from 1991 with CGA graphics.&lt;br /&gt;
&lt;br /&gt;
==File formats==&lt;br /&gt;
*[[Turbo Pascal 3.0 Image Format]] - tile images, stored in the executable&lt;br /&gt;
*[[Arctic Adventure Map Format]] - levels are stored in the EXE file&lt;br /&gt;
*[[Pharaoh&#039;s Tomb &amp;amp; Arctic Adventure Fullscreen Image Format]] - full screen image files (title screen, map screen, loading screen) in [[PCX Format]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Puzzle]]&lt;br /&gt;
[[Category:Arctic Adventure]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Turbo_Pascal_3.0_Image_Format&amp;diff=12473</id>
		<title>Turbo Pascal 3.0 Image Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Turbo_Pascal_3.0_Image_Format&amp;diff=12473"/>
		<updated>2025-10-10T07:38:05Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: basic format, feel free to clean this up and move parts ito the PT and AA pages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Both Pharaoh&#039;s Tomb and Arctic Adventure store their tile images directly inside the game&#039;s executable. The image data is stored in the same image format used by Turbo Pascal 3.0&#039;s &amp;quot;Extended Graphics&amp;quot; and &amp;quot;Turtlegraphics&amp;quot; driver, just with extra padding at the end of each image.&lt;br /&gt;
&lt;br /&gt;
This driver was superseded by the BGI driver in Turbo Pascal 4.0, but the later versions generally still included the old driver in the form of the GRAPH3.TPU unit for compatibility, albeit with practically no documentation on what the procedures and functions in this unit actually do and how to use them.&lt;br /&gt;
&lt;br /&gt;
Each image begins with the following 6-byte header:&lt;br /&gt;
&lt;br /&gt;
  0 | UINT16LE | iNumBits | bits per pixel, 1 for 640x200 mode, 2 for 320x200 mode (always 2 in Pharaoh&#039;s Tomb and Arctic Adventure)&lt;br /&gt;
  2 | UINT16LE | iWidth   | image width, in pixels&lt;br /&gt;
  4 | UINT16LE | iHeight  | image height, in pixels&lt;br /&gt;
&lt;br /&gt;
The Turbo Pascal 3.0 Reference Manual lists the following formula for calculating the minimal size of a buffer for a given image in 320x200 mode:&lt;br /&gt;
&lt;br /&gt;
  Size = ((Width + 3) div 4)*Height*2 + 6&lt;br /&gt;
&lt;br /&gt;
And the official size requirement for images in 640x200 mode is:&lt;br /&gt;
&lt;br /&gt;
  Size = ((Width + 7) div 8)*Height + 6&lt;br /&gt;
&lt;br /&gt;
That means a 16x16 pixel image will require 134 bytes in this format when using the formula for 320x200 mode. But given the format and the way the image data is stored, 70 bytes should be enough. The formula should really have used Height + 6 instead of Height*2 + 6 at the end. Perhaps this implies that support for 16-color graphics was supposed to be implemented, or maybe it was just an error in the Turbo Pascal 3.0 documentation.&lt;br /&gt;
&lt;br /&gt;
The image data is stored as raw CGA-like data, left to right, bottom to top. Unlike the memory layout of CGA graphics cards, the odd and even lines of the image are not split in any way. The first byte of image data contains the color information for the first 4 (or 8) pixels on the left of the bottom-most row of the image.&lt;br /&gt;
&lt;br /&gt;
The most-significant bit(s) inside each byte of image data store the color index for the leftmost pixel covered by that byte. If iNumBits is 2, the two most significant bits store the color index for the leftmost pixel (a color index from 0 to 3) and there are 4 pixels per byte. If iNumBits is 1, the most significant bit stores the color index for the leftmost pixel (either 0 or 1) and there are 8 pixels stored in each byte.&lt;br /&gt;
&lt;br /&gt;
If the width, in pixels, does not fill all bits of the last byte in each row, the extra bits will be ignored. For example, if the width of the image is 1, only the most significant bit (or the two most significant bits in 320x200 mode) of each byte will contain the color index for that one pixel and the other bits will be ignored when drawing the image.&lt;br /&gt;
&lt;br /&gt;
Sample C code to &amp;quot;draw&amp;quot; an image to the screen in a context where x=0 is the left edge of the screen and y=0 is the top edge of the screen would look like this:&lt;br /&gt;
&lt;br /&gt;
 void DrawImage(int filehandle, int px, int py)&lt;br /&gt;
 {&lt;br /&gt;
 	UINT16 iNumBits, iWidth, iHeight;&lt;br /&gt;
 	UINT16 x, y;&lt;br /&gt;
 	&lt;br /&gt;
 	iNumBits = ReadUINT16LE(filehandle);&lt;br /&gt;
 	iWidth = ReadUINT16LE(filehandle);&lt;br /&gt;
 	iHeight = ReadUINT16LE(filehandle);&lt;br /&gt;
 	&lt;br /&gt;
 	for (y = iHeight-1; y &amp;gt;= 0; y--)&lt;br /&gt;
 	{&lt;br /&gt;
 		BYTE buffer;&lt;br /&gt;
 		int bitsleft = 0;&lt;br /&gt;
 		&lt;br /&gt;
 		for (x = 0; x &amp;lt; iWidth; x++)&lt;br /&gt;
 		{&lt;br /&gt;
 			BYTE colorindex;&lt;br /&gt;
 			&lt;br /&gt;
 			if (bitsleft == 0)&lt;br /&gt;
 			{&lt;br /&gt;
 				buffer = ReadBYTE(filehandle);&lt;br /&gt;
 				bitsleft = 8;&lt;br /&gt;
 			}&lt;br /&gt;
 			&lt;br /&gt;
 			colorindex = buffer &amp;gt;&amp;gt; (8-iNumBits);&lt;br /&gt;
 			DrawPixel(px+x, py+y, colorindex);&lt;br /&gt;
 			&lt;br /&gt;
 			buffer &amp;lt;&amp;lt;= iNumBits;&lt;br /&gt;
 			bitsleft -= iNumBits;&lt;br /&gt;
 		}&lt;br /&gt;
 	}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
In Pharaoh&#039;s Tomb and Arctic Adventure, all images are 16x16 pixels, but every tile image is always 156 bytes long, not 134 or 70. This wastes quite a lot of memory, but is harmless otherwise. The tile images are stored as a single block inside the executables.&lt;br /&gt;
&lt;br /&gt;
 File Name  | Ver. | EXE Size | Offset  | Number of Tiles&lt;br /&gt;
 -----------+------+----------+---------+----------------&lt;br /&gt;
 PTOMB1.EXE | v3.0 |  0x1F730 | 0x18250 | 160 tiles&lt;br /&gt;
 PTOMB2.EXE | v3.0 |  0x1F790 | 0x182B0 | 160 tiles&lt;br /&gt;
 PTOMB3.EXE | v3.0 |  0x1F6E0 | 0x18200 | 160 tiles&lt;br /&gt;
 PTOMB4.EXE | v3.0 |  0x1F6E0 | 0x18200 | 160 tiles&lt;br /&gt;
    AA1.EXE | v2.0 |  0x22800 | 0x1C450 | 152 tiles&lt;br /&gt;
    AA2.EXE | v2.0 |  0x22790 | 0x1C3E0 | 152 tiles&lt;br /&gt;
    AA3.EXE | v2.0 |  0x22780 | 0x1C3D0 | 152 tiles&lt;br /&gt;
    AA4.EXE | v2.0 |  0x227C0 | 0x1C410 | 152 tiles&lt;br /&gt;
&lt;br /&gt;
Older versions of Pharaoh&#039;s Tomb (v2.0, v2.2, v2.3) store some of the tile images in a slightly different order than the later versions (v2.9, v3.0), but every version stores them as a sequence of 156-byte-blocks with no other data in between these blocks.&lt;br /&gt;
&lt;br /&gt;
Note: The EXE Size values given in the table are the executable image sizes. The offsets in the table are relative to the start of the executable image. Since the original executables are compressed with LZEXE, the size of the uncompressed executable and the absolute position of the data in it may vary depending on which program was used to decompress the files. UNLZEXE might produce a slightly different file than UNP, for example. To calculate the absolute file position, read a UINT16LE value at position 8 in the decompressed executable and multiply that value by 16 to get the start offset of the executable image. Add that value to the offset given in the table to get the correct file position.&lt;br /&gt;
&lt;br /&gt;
The following patch scripts allow you to extract the tile image data with K1n9_Duk3&#039;s Patching Utility:&lt;br /&gt;
&lt;br /&gt;
 %exefile ptomb1.exe 0x1F730&lt;br /&gt;
 %dump tileset.pt1 $18250 $6180&lt;br /&gt;
 %abort&lt;br /&gt;
&lt;br /&gt;
 %exefile aa1.exe 0x22800&lt;br /&gt;
 %dump tileset.aa1 $1C450 $5CA0&lt;br /&gt;
 %abort&lt;br /&gt;
&lt;br /&gt;
The %exefile mode causes the patching utility to operate on the executable image, so you can use the EXE sizes and offsets given in the table and don&#039;t need to worry about caclulating an absolute file position.&lt;br /&gt;
&lt;br /&gt;
The same tool can also be used to insert modified tile image data into the executable. Simply use a script in the following form:&lt;br /&gt;
&lt;br /&gt;
 %exefile ptomb1.exe 0x1F730&lt;br /&gt;
 %patchfile $18250 tileset.pt1 0 $6180&lt;br /&gt;
 %end&lt;br /&gt;
&lt;br /&gt;
 %exefile aa1.exe 0x22800&lt;br /&gt;
 %patchfile $1C450 tileset.pt1 0 $5CA0&lt;br /&gt;
 %end&lt;br /&gt;
&lt;br /&gt;
And don&#039;t forget to save the patched file at the end.&lt;br /&gt;
&lt;br /&gt;
Trivia: Since the 16x16 pixel images in Pharaoh&#039;s Tomb and Arctic Adventure really only take up 70 bytes, the remaining 86 bytes in each image contain whatever data was previously stored at that memory location when the images were grabbed. This can be literally anything, even parts of the game&#039;s source code.&lt;br /&gt;
&lt;br /&gt;
The following pieces of source code can be found in Pharaoh&#039;s Tomb:&lt;br /&gt;
&lt;br /&gt;
 d(7 ,&#039;x    x xx x    x   x&#039;);&lt;br /&gt;
 d(8 ,&#039;xx  xx              &#039;);&lt;br /&gt;
 &lt;br /&gt;
 d(11,&#039;xxxxxx     Y   xxxxx&#039;);&lt;br /&gt;
 d(12,&#039;xxxxxxxxxxxxxxxxxxx&lt;br /&gt;
 &lt;br /&gt;
 object.frame := object.frame + 1;&lt;br /&gt;
 If object.frame = 5 Then object&lt;br /&gt;
 &lt;br /&gt;
 if (getdotcolor(man.x,man.y+x)=0) and&lt;br /&gt;
 (getdotcolor(man.x+15,man.y+x)&lt;br /&gt;
 &lt;br /&gt;
 ve to answer 10 in a row to get the bonus.&lt;br /&gt;
 By registering this game, you will receive &lt;br /&gt;
&lt;br /&gt;
The last two lines definitely come from either Trivia Whiz or Next Generation Trivia and have nothing to do with Pharaoh&#039;s Tomb. The lines calling the &amp;quot;d&amp;quot; procedure at the beginning are how the levels are defined in the source code for Pharaoh&#039;s Tomb, but this particular layout does not appear to be used for any of the levels in the final game.&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Pharaoh%27s_Tomb_%26_Arctic_Adventure_Fullscreen_Image_Format&amp;diff=12471</id>
		<title>Pharaoh&#039;s Tomb &amp; Arctic Adventure Fullscreen Image Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Pharaoh%27s_Tomb_%26_Arctic_Adventure_Fullscreen_Image_Format&amp;diff=12471"/>
		<updated>2025-10-04T18:01:13Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Added a link to the PCX Format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Image Infobox&lt;br /&gt;
 | Hardware1 = CGA&lt;br /&gt;
 | Depth = 2-bit (CGA)&lt;br /&gt;
 | MinSize = 320&amp;amp;times;200&lt;br /&gt;
 | MaxSize = 320&amp;amp;times;200&lt;br /&gt;
 | Palette = Standard CGA&lt;br /&gt;
 | NumPlanes = 1&lt;br /&gt;
 | HasTransparency = No&lt;br /&gt;
 | HasHitmap = No&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Pharaoh&#039;s Tomb}}&lt;br /&gt;
   {{Game|Arctic Adventure}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is actually just a description of a CGA version of the [[PCX Format]].&lt;br /&gt;
&lt;br /&gt;
This format is used by [[Pharaoh&#039;s Tomb]] and [[Arctic Adventure]] to store full-screen (320 &amp;amp;times; 200) images. Known extensions are &amp;lt;tt&amp;gt;*.mnu&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;*.map&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;*.pix&amp;lt;/tt&amp;gt;, with the latter two being unique to Arctic Adventure. It&#039;s not currently known if the format is able to store images of different sizes, since there are no other known examples of files in this format yet other than those found in the aforementioned two games.&lt;br /&gt;
&lt;br /&gt;
Pharaoh&#039;s Tomb only stores the title screen background graphic using this file format. Arctic Adventure uses it for the title screen (&amp;lt;tt&amp;gt;AA?.MNU&amp;lt;/tt&amp;gt;), map/overworld background screen (&amp;lt;tt&amp;gt;AA?.MAP&amp;lt;/tt&amp;gt;), and a few pieces of large text (&amp;lt;tt&amp;gt;AA?.PIX&amp;lt;/tt&amp;gt;), like &amp;quot;Please Wait...&amp;quot;, combined into a single image.&lt;br /&gt;
&lt;br /&gt;
== Image ==&lt;br /&gt;
&lt;br /&gt;
Files start with a 128-byte header, whose format and purpose is currently unknown, followed by variable length RLE-compressed image data. When uncompressed, the data is a raw CGA graphics mode screen, exactly 16000 bytes in size. It consists of 200 rows of 80 bytes, with each byte describing 4 pixels. To correctly interpret the data, CGA palette 0 (green/red/brown) should be used for Pharaoh&#039;s Tomb, and palette 1 (cyan/magenta/light gray) for Arctic Adventure.&lt;br /&gt;
&lt;br /&gt;
Interestingly, the headers for Arctic Adventure contain mostly 0s, whereas the files for Pharaoh&#039;s Tomb have the same bytes filled with repeating sequences of &amp;lt;tt&amp;gt;0xC1 0xFF 0xBF&amp;lt;/tt&amp;gt;. Other bytes are mostly identical between the headers of both games.&lt;br /&gt;
&lt;br /&gt;
=== RLE Compression ===&lt;br /&gt;
&lt;br /&gt;
The compression scheme is fairly simple. Any byte value less than or equal to &amp;lt;tt&amp;gt;0xC0&amp;lt;/tt&amp;gt; should be copied verbatim. When encountering a value greater than &amp;lt;tt&amp;gt;0xC0&amp;lt;/tt&amp;gt;, the byte following afterwards should be repeated &amp;lt;tt&amp;gt;value - 0xC0&amp;lt;/tt&amp;gt; times. For example, the byte sequence &amp;lt;tt&amp;gt;0xC2 0xFF 0x0F&amp;lt;/tt&amp;gt; expands to &amp;lt;tt&amp;gt;0xFF 0xFF 0x0F&amp;lt;/tt&amp;gt;. There is no specific end marker, so data should be read until reaching end of file. As a safe-guard against corrupt or unexpected files, it&#039;s probably a good idea to also stop reading as soon as 16000 bytes of unpacked data have been produced.&lt;br /&gt;
&lt;br /&gt;
== Source Code ==&lt;br /&gt;
&lt;br /&gt;
The following C# class can load files in this format and convert them into &amp;lt;tt&amp;gt;System.Drawing.Bitmap&amp;lt;/tt&amp;gt; objects, which can be saved using standard formats.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public static class AaPtImageParser&lt;br /&gt;
{&lt;br /&gt;
  // Loads an image in Arctic Adventure/Pharaoh&#039;s Tomb format into a Bitmap object.&lt;br /&gt;
  // usePalette1 should be set to true for Arctic Adventure, false for Pharaoh&#039;s Tomb.&lt;br /&gt;
  public static Bitmap LoadImage(string filename, bool usePalette1)&lt;br /&gt;
  {&lt;br /&gt;
    var cgaBytes = UnpackImage(filename);&lt;br /&gt;
&lt;br /&gt;
    var image = new Bitmap(320, 200);&lt;br /&gt;
&lt;br /&gt;
    var palette = usePalette1 ? CGA_PALETTE_1 : CGA_PALETTE_0;&lt;br /&gt;
&lt;br /&gt;
    // Convert CGA image data to RGBA&lt;br /&gt;
    for (var row = 0; row &amp;lt; 200; ++row)&lt;br /&gt;
    {&lt;br /&gt;
      for (var col = 0; col &amp;lt; 80; ++col)&lt;br /&gt;
      {&lt;br /&gt;
        for (var pixel = 0; pixel &amp;lt; 4; ++pixel)&lt;br /&gt;
        {&lt;br /&gt;
          var shift = (3 - pixel) * 2;&lt;br /&gt;
          var mask = 0b11 &amp;lt;&amp;lt; shift;&lt;br /&gt;
          var bits = (cgaBytes[col + row * 80] &amp;amp; mask) &amp;gt;&amp;gt; shift;&lt;br /&gt;
&lt;br /&gt;
          image.SetPixel(col * 4 + pixel, row, palette[bits]);&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return image;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private static Color[] CGA_PALETTE_0 = [&lt;br /&gt;
    Color.FromArgb(255, 0, 0, 0),&lt;br /&gt;
    Color.FromArgb(255, 0, 0xAA, 0),&lt;br /&gt;
    Color.FromArgb(255, 0xAA, 0, 0),&lt;br /&gt;
    Color.FromArgb(255, 0xAA, 0x55, 0),&lt;br /&gt;
  ];&lt;br /&gt;
&lt;br /&gt;
  private static Color[] CGA_PALETTE_1 = [&lt;br /&gt;
    Color.FromArgb(255, 0, 0, 0),&lt;br /&gt;
    Color.FromArgb(255, 0, 0xAA, 0xAA),&lt;br /&gt;
    Color.FromArgb(255, 0xAA, 0, 0xAA),&lt;br /&gt;
    Color.FromArgb(255, 0xAA, 0xAA, 0xAA),&lt;br /&gt;
  ];&lt;br /&gt;
&lt;br /&gt;
  private static byte[] UnpackImage(string filename)&lt;br /&gt;
  {&lt;br /&gt;
    byte[] cgaBytes = new byte[16000];&lt;br /&gt;
    int dstIndex = 0;&lt;br /&gt;
&lt;br /&gt;
    using (var stream = File.Open(filename, FileMode.Open))&lt;br /&gt;
    {&lt;br /&gt;
      // Skip over file header&lt;br /&gt;
      stream.Seek(0x80, SeekOrigin.Begin);&lt;br /&gt;
&lt;br /&gt;
      // Decompress RLE data&lt;br /&gt;
      var reader = new BinaryReader(stream);&lt;br /&gt;
&lt;br /&gt;
      while (stream.Position &amp;lt; stream.Length)&lt;br /&gt;
      {&lt;br /&gt;
        var marker = reader.ReadByte();&lt;br /&gt;
&lt;br /&gt;
        if (marker &amp;gt; 0xC0)&lt;br /&gt;
        {&lt;br /&gt;
          // Repeating sequence&lt;br /&gt;
          var value = reader.ReadByte();&lt;br /&gt;
&lt;br /&gt;
          for (var i = 0; i &amp;lt; marker - 0xC0; ++i)&lt;br /&gt;
          {&lt;br /&gt;
            cgaBytes[dstIndex] = value;&lt;br /&gt;
            dstIndex++;&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
        {&lt;br /&gt;
          // Single byte&lt;br /&gt;
          cgaBytes[dstIndex] = marker;&lt;br /&gt;
          dstIndex++;&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return cgaBytes;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This graphic format was reverse engineered by [[User:Lethal guitar|Lethal_guitar]]. 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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Arctic_Adventure&amp;diff=12470</id>
		<title>Arctic Adventure</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Arctic_Adventure&amp;diff=12470"/>
		<updated>2025-10-04T17:56:31Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* File formats */ Full-screen images are CGA PCX Files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
&#039;&#039;&#039;Arctic Adventure&#039;&#039;&#039; is a puzzle platformer by George Broussard/Apogee Software from 1991 with CGA graphics.&lt;br /&gt;
&lt;br /&gt;
==File formats==&lt;br /&gt;
*[[Arctic Adventure Map Format]] - levels are stored in the EXE file&lt;br /&gt;
*[[Pharaoh&#039;s Tomb &amp;amp; Arctic Adventure Fullscreen Image Format]] - full screen image files (title screen, map screen, loading screen) in [[PCX Format]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Puzzle]]&lt;br /&gt;
[[Category:Arctic Adventure]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Pharaoh%27s_Tomb&amp;diff=12469</id>
		<title>Pharaoh&#039;s Tomb</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Pharaoh%27s_Tomb&amp;diff=12469"/>
		<updated>2025-10-04T17:53:31Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Title screens are CGA PCX images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
&#039;&#039;&#039;Pharaoh&#039;s Tomb&#039;&#039;&#039; is a platform game by Micro F/X Software from 1990 with CGA graphics.&lt;br /&gt;
&lt;br /&gt;
==File formats==&lt;br /&gt;
*[[Pharaoh&#039;s Tomb Map Format]] - levels are stored in the EXE file&lt;br /&gt;
*[[SAV Format (Pharaoh&#039;s Tomb)]] - savegames&lt;br /&gt;
*[[Pharaoh&#039;s Tomb &amp;amp; Arctic Adventure Fullscreen Image Format]] - title screen image (in [[PCX Format]])&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*A level editor can be found [http://crystalshard.net/?p=8&amp;amp;s=51 here].&lt;br /&gt;
*Maps can be found [http://www.zanderz.net/index.php?id=gamemaps here].&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Puzzle]]&lt;br /&gt;
[[Category:Pharaoh&#039;s Tomb]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves&amp;diff=9841</id>
		<title>Crystal Caves</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Crystal_Caves&amp;diff=9841"/>
		<updated>2021-06-07T05:55:48Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Undo revision 8356 by Szevvy (talk) - it replaced the Crystal Caves page with the contents of the Keen Dreams page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = None&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Crystal Caves]] is a platform game often noted for the smoothness of the game creature animations, due to the programmer deciding to use more animation frames than was typical at the time.&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 = N/A&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = N/A&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;
{{FileFormatTool&lt;br /&gt;
| Name = [http://sfprod.shikadi.net/old/games/crystalcaves.htm#tile_modifier CCmod]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = N/A&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 = *.apg&amp;lt;br/&amp;gt;*.cdt&amp;lt;br/&amp;gt;*.end&amp;lt;br/&amp;gt;*.ttl&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 320&amp;amp;times;200 16-colour full screen images&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.gfx&lt;br /&gt;
 | Format = [[ProGraphx Toolbox tileset format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 16&amp;amp;times;16 16-colour sprites&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mni&lt;br /&gt;
 | Format = [[ProGraphx Toolbox tileset format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 8&amp;amp;times;8 16-colour sprites, like the characters and icons on the status bar.  Not to be confused with the MNI files from [[Cosmo&#039;s Cosmic Adventures]]&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.snd&lt;br /&gt;
 | Format = [[Crystal Caves Sound format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = PC speaker sound effects (a modified form of [[Inverse Frequency Sound format]])&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = cc?.exe&lt;br /&gt;
 | Format = [[Crystal Caves Map Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game levels are stored inside the main game .exe&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
&lt;br /&gt;
* Episode 1, level 16 is made up primarily of green pipes.  Two join types (left/right/top and left/open-down) were drawn and have usable level codes, however they were not used in the game.&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Commander_Keen_Dreams&amp;diff=9840</id>
		<title>Commander Keen Dreams</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Commander_Keen_Dreams&amp;diff=9840"/>
		<updated>2021-06-07T05:52:08Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Undo revision 8354 by Szevvy (talk) - it replaced the Keen Dreams page with the contents of the Keen 1-3 page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&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;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
* [[AudioT Format]] - used for storing sound and music data&lt;br /&gt;
* [[B800 Text]] - there are a couple of text screens in the main .EXE file (including the text displayed on the screen when you quit)&lt;br /&gt;
* [[EGAGraph Format]] - used for storing graphics, text and miscellaneous data&lt;br /&gt;
* [[Keen Dreams level Format]] - used for storing level maps&lt;br /&gt;
* [[Keen 4-6 Action Format]] Sprite&#039;s behaviors are governed by this&lt;br /&gt;
* [[Keen 4-6 Tileinfo Format]] Tile information are governed by this&lt;br /&gt;
* [[Softdisk Library Format]] - The start menu is in this format&lt;br /&gt;
* [[SLIB compression]] The title screen is compressed with this&lt;br /&gt;
&lt;br /&gt;
Compression used in KeenDreams is complex; most of the &#039;registered&#039; (Non shareware) executables are compressed using [[PKLite compression]] and demo versions have additional files or filenames.  Uniquely, the game maps are compressed using [[Huffman Compression]] instead of [[Carmack compression]], as they were made with an earlier version of [[TED5]] (TED3).&lt;br /&gt;
&lt;br /&gt;
== Versions ==&lt;br /&gt;
&lt;br /&gt;
There are no less than six versions of Keen Dreams available; these differ very little in actual gameplay, but markedly in file structure. Most of these are listed at [[http://www.shikadi.net/keenwiki/Keen_Dreams_Versions the Commander Keen Wiki]] (They omit version 1.0 and the Id Anthology)&lt;br /&gt;
&lt;br /&gt;
The main moddable version is version 1.13, which is not the latest version of the game. Notably it has less in-game help and text, requires the player to run a program from Gamer&#039;s Edge before playing and names its files differently from the later Keen 4-6 manner. It also uses a seperate file for its start screen, which is unusual.&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
* [[Commander Keen 1-3]]&lt;br /&gt;
* [[Commander Keen 4-6]]&lt;br /&gt;
* The [[KeenWiki:Main Page|Commander Keen Wiki]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Softdisk]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem_II_Actor_Info&amp;diff=9601</id>
		<title>Duke Nukem II Actor Info</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem_II_Actor_Info&amp;diff=9601"/>
		<updated>2021-04-15T00:02:42Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added missing info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | Hardware1 = EGA&lt;br /&gt;
 | MaxTiles = 65,536&lt;br /&gt;
 | Palette = External&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 0&amp;amp;times;0&lt;br /&gt;
 | TileMaxSize = 524,280&amp;amp;times;524,280&lt;br /&gt;
 | NumPlanes = 5&lt;br /&gt;
 | PlaneArrangement = Byte Planar&lt;br /&gt;
 | HasTransparency = Y&lt;br /&gt;
 | HasHitmap = N&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = Y&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Duke Nukem II}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The tile arrangement for the [[Duke Nukem II]] actors (game characters) is stored in &amp;lt;tt&amp;gt;ACTRINFO.MNI&amp;lt;/tt&amp;gt; in the main &amp;lt;tt&amp;gt;NUKEM2.CMP&amp;lt;/tt&amp;gt; group file.  This file describes how to arrange the bare 8&amp;amp;times;8 tiles found in the corresponding tileset, so that they form a frame belonging to an actor animation.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iNumActors||Number of actors described in the file&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iOffset[iNumActors]||Array of UINT16 offsets to the actor info structure (double these values to turn them into byte offsets)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Following this structure the first actor data should begin.  The actor data runs end-to-end, and &amp;lt;tt&amp;gt;iOffset&amp;lt;/tt&amp;gt; should only be required when jumping to a particular actor&#039;s offset.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;iNumActors&amp;lt;/tt&amp;gt; is technically the UINT16-offset of the first structure, however if it is treated as such it becomes difficult to find the number of actors described by the file.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iNumFrames||Number of frames this actor has&lt;br /&gt;
|-&lt;br /&gt;
|INT16LE iDrawIndex||Seems to define when the actor will be drawn to the screen &lt;br /&gt;
|-&lt;br /&gt;
|ACTOR_FRAME frameInfo[iNumFrames]||Structure holding information about the frame&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The iDrawIndex value ranges from -1 to 3. Actors with a lower index will be updated and drawn first, the actors with highest index last. Any value smaller than -1 or greater than 3 is invalid and will prevent the actor from being spawned in a level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;ACTOR_FRAME&amp;lt;/tt&amp;gt; is defined as:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|INT16LE iHotspotX||X-coord of hotspot (in tiles, can be negative)&lt;br /&gt;
|-&lt;br /&gt;
|INT16LE iHotspotY||Y-coord of hotspot (in tiles, can be negative)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iHeight||Frame height (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iWidth||Frame width (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE iDataOffset||Offset into &amp;lt;tt&amp;gt;ACTORS.MNI&amp;lt;/tt&amp;gt; where the tile data starts&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iPadding1||never used&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iPadding2||never used&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The hotspot is the location in the image which should appear at the offset given in the map layer.  In other words, take the actor location, subtract iHotspotX number of tiles from the X-coordinate, subtract iHotspotY number of tiles from the Y-coordinate, and the actor will appear at the correct location.&lt;br /&gt;
&lt;br /&gt;
The two padding values at the end are inserted to allow the game to calculate the start of the &amp;lt;tt&amp;gt;ACTOR_FRAME&amp;lt;/tt&amp;gt; data for each frame with the same formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;start = (iOffset[actor] + 8 * frame + 2) * 2&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means the padding values are effectively dummies for the &amp;lt;tt&amp;gt;iNumFrames&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;iDrawIndex&amp;lt;/tt&amp;gt; values. Even though these padding values could theroretically be omitted for the last frame of each actor entry, they are always present in the original files.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;ACTORS.MNI&amp;lt;/tt&amp;gt; contains some bytes that are not used by any actor frame. These bytes are found at the end of every 64KB block (exactly 65536 bytes) of data. In the original file, no sprite frame is split across these 64KB blocks. The image data is written to the end of the block to fill it up, then the new block is started, containing the entire image data of the sprite&#039;s frame.&lt;br /&gt;
&lt;br /&gt;
However, [[Duke Nukem II]] seems to be able to handle the image data correctly, even if it is split across two of these blocks. This might have just been a limitation in the original tool that was used to create the &amp;lt;tt&amp;gt;ACTORS.MNI&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
The data for sprite number 29 is in a slightly different format. Instead of 4 colour planes and a mask plane, the image data for the frames of this sprite only consist of two planes. The frames of this sprite store the big 8*16 pixel font used in the menus. Furthermore, the game is hard-coded to draw this font at 8*16 pixles, i.e. 1 tile wide and 2 tiles high.&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Id_Software_RLEW_compression&amp;diff=9600</id>
		<title>Id Software RLEW compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Id_Software_RLEW_compression&amp;diff=9600"/>
		<updated>2021-04-14T22:56:02Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: listed which games use RLEB and what it is used for&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:id Software RLEW compression}}&lt;br /&gt;
{{Compression Infobox&lt;br /&gt;
 | Type = Stream&lt;br /&gt;
 | UnitSize = 2-byte&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Catacomb Apocalypse}}&lt;br /&gt;
   {{Game|Catacomb Armageddon}}&lt;br /&gt;
   {{Game|Commander Keen 1-3}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 2}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Hovertank 3-D}}&lt;br /&gt;
   {{Game|Super 3-D Noah&#039;s Ark}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Shadow Knights}}&lt;br /&gt;
   {{Game|Slordax}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;id Software RLEW compression&#039;&#039;&#039; was used in a number of id&#039;s early games.  It is an [[RLE Compression]] algorithm that works at the word level, where each word is a group of two bytes (16 bits).  The algorithm is used on files that themselves use 16-bit words as their basic units, such as game levels, where a single 16-bit value such as &amp;quot;12 34&amp;quot; might be repeated multiple times in a row.  A byte-level RLE algorithm would not be able to compress this data at all, as each byte is different to the previous, however the same RLE algorithm operating at the 16-bit word level can achieve good compression.&lt;br /&gt;
&lt;br /&gt;
The use of 16-bit values over 8-bit also yields other benefits, such as the maximum repetition count increasing from around 256 to 65,536, allowing even greater compression of data with large numbers of repeated values.  The RLE code word can also be chosen to be less likely to appear in the data, minimising the number of escapes required.  While 8-bit RLE has a 1 in 256 chance of a given byte needing to be escaped, 16-bit RLE reduces that to 1 in 65,536.&lt;br /&gt;
&lt;br /&gt;
RLEW compression is almost exclusively used to compress level data. Most revisions of the early game engines by id Software used arrays of 16 bit values to store the level data.&lt;br /&gt;
&lt;br /&gt;
== Algorithm ==&lt;br /&gt;
&lt;br /&gt;
The algorithm is very straightforward.  Every 16-bit value is passed through unchanged until an RLE code value is encountered.  Typically this is 0xFEFE or 0xABCD (the latter stored as the two bytes 0xCD 0xAB in little-endian order).  When this code word is read, instead of writing it out like the other values, two further words are read.  The first is the number of times to repeat the word, and the second is the value to be repeated.&lt;br /&gt;
&lt;br /&gt;
All 16-bit words are in little-endian order, although in practice only the code word and the repeat count need to be treated as little-endian.  The other values can be read in either endian so long as they are read and written unchanged.&lt;br /&gt;
&lt;br /&gt;
Data is usually read from the start of a file to the end, but many implementations have the size of the decompressed data as a [[UINT16LE]] at the beginning of the file.  This should be used where possible so that trailing data at the end of the file does not inadvertently get read as input data.&lt;br /&gt;
&lt;br /&gt;
A simple algorithm for decompressing this format is as follows;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;If implemented, get the first word in the file (here called &amp;lt;tt&amp;gt;finalLength&amp;lt;/tt&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;While the length of the output data is less than &amp;lt;tt&amp;gt;finalLength&amp;lt;/tt&amp;gt;:&lt;br /&gt;
    &amp;lt;ol style=&amp;quot;list-style-type:lower-alpha&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Read a word from the input data&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Is this word the RLE code word? (e.g. 0xFEFE)&lt;br /&gt;
      &amp;lt;ul&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;If yes;&lt;br /&gt;
          &amp;lt;ol style=&amp;quot;list-style-type:lower-roman&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Get the next two words, the first as &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; and the second as &amp;lt;tt&amp;gt;Value&amp;lt;/tt&amp;gt;.&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Write Value as a word, &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; times.&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Move forward three words and go to 2.&amp;lt;/li&amp;gt;&lt;br /&gt;
          &amp;lt;/ol&amp;gt;&lt;br /&gt;
        &amp;lt;/li&amp;gt;&lt;br /&gt;
        &amp;lt;li&amp;gt;If no;&lt;br /&gt;
          &amp;lt;ol style=&amp;quot;list-style-type:lower-roman&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Write the word to the output.&amp;lt;/li&amp;gt;&lt;br /&gt;
            &amp;lt;li&amp;gt;Move forward a word and go to 2.&amp;lt;/li&amp;gt;&lt;br /&gt;
          &amp;lt;/ol&amp;gt;&lt;br /&gt;
        &amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Minimal compression ===&lt;br /&gt;
&lt;br /&gt;
As only the code word needs to be handled specially, a quick compression function can be implemented by passing through all values as-is, and if the code word has just been written then it is followed by the additional words 0x0001 and the code word again.  For example if the code word is 0xFEFE, then it will end up in the output as &amp;lt;tt&amp;gt;FEFE 0001 FEFE&amp;lt;/tt&amp;gt;, meaning &amp;quot;RLE sequence begins: write 0xFEFE once&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Inefficiencies and hidden data ===&lt;br /&gt;
&lt;br /&gt;
It is interesting to note that as only the RLEW code word needs to be escaped, no other word would ever need to be repeated only once.  This means the escape sequence &amp;lt;tt&amp;gt;FEFE 0001 FEFE&amp;lt;/tt&amp;gt; could have been shortened to &amp;lt;tt&amp;gt;FEFE 0001&amp;lt;/tt&amp;gt; by omitting the field containing the word to repeat, with the assumption that the only word ever written just once is the RLEW code word itself.&lt;br /&gt;
&lt;br /&gt;
Furthermore, the &amp;lt;tt&amp;gt;Count&amp;lt;/tt&amp;gt; field in the RLE sequence is set to 1 to write the word once.  This means it can be set to 0 to write the word zero times, effectively discarding that word.  In theory this could allow &amp;quot;hidden&amp;quot; data to be embedded in the compressed data stream that would be skipped over by the decompressor and not affect the output decompressed data.&lt;br /&gt;
&lt;br /&gt;
Most RLE algorithms avoid this inefficiency by adding 1 (or more) to the count value before using it, meaning a count of 0 writes the word once, a count of 1 writes it twice, and so on.  In this case, as the RLE sequence takes up three words, no space is saved until at least four words are converted into an RLE code.  This means adding 3 to the count would have been most efficient, with a count of 0 reserved as a special case for handling the escaping of the code word itself.  Thus 0 would write the code word, 1 would repeat the word 4 times, 2 would repeat it 5 times, and so on.  Words appearing 2 or 3 times in a row would be written out as-is without incurring any space penalty, with the sole exception of the RLEW code word appearing 2 or 3 times in a row, which would incur a small space penalty.&lt;br /&gt;
&lt;br /&gt;
=== RLEB compression ===&lt;br /&gt;
&lt;br /&gt;
This is almost exactly the same as RLEW compression. The only difference is that it operates on bytes instead of words. The flag value for this compression is $FE in most cases.&lt;br /&gt;
&lt;br /&gt;
[[Dangerous Dave 2]], [[Rescue Rover]] and [[Shadow Knights]] use this method to compress some of their full-screen images. [[Rescue Rover]] and [[Shadow Knights]] also use this method to compress the game&#039;s sprite graphics.&lt;br /&gt;
&lt;br /&gt;
=== Example code ===&lt;br /&gt;
&lt;br /&gt;
* Javascript: the [https://github.com/camoto-project/gamecompjs/blob/master/formats/cmp-rlew-id.js cmp-rlew-id] algorithm in gamecomp.js (full compression and decompression)&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Talk:FLIC_Format&amp;diff=9580</id>
		<title>Talk:FLIC Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Talk:FLIC_Format&amp;diff=9580"/>
		<updated>2021-04-08T22:30:28Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Created page with &amp;quot;A subset of this format has already been documented as Duke Nukem II Animation Format and a more complete specification of the [http://www.compuphase.com/flic.htm FLIC For...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A subset of this format has already been documented as [[Duke Nukem II Animation Format]] and a more complete specification of the [http://www.compuphase.com/flic.htm FLIC Format] extists elsewhere. Given that fact, I&#039;m not sure if it would be worth the time and effort to add all of this information to the wiki instead of just linking to the other page. But if you have time to kill, feel free to do it anyway. --[[User:K1n9 Duk3|K1n9 Duk3]] ([[User talk:K1n9 Duk3|talk]]) 22:29, 8 April 2021 (GMT)&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_RLE_compression&amp;diff=9521</id>
		<title>Keen 1-3 RLE compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_RLE_compression&amp;diff=9521"/>
		<updated>2021-03-19T03:20:26Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Example code */ another version of the assembly code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Compression Infobox&lt;br /&gt;
 | Type = Stream&lt;br /&gt;
 | UnitSize = 1-bit&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Catacomb}}&lt;br /&gt;
   {{Game|Commander Keen 1-3}}&lt;br /&gt;
   {{Game|Dangerous Dave}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Commander Keen 1-3]] uses [[RLE Compression]] to compress its 320x200 &amp;lt;tt&amp;gt;FINALE.CKx&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PREVIEWx.CK1&amp;lt;/tt&amp;gt; screens.  [[Dangerous Dave]] also uses this format to compress its graphics. It was previously used in [[Catacomb|Catacomb I and II]] for the level data (not the graphics). This is one of many possible ways to create a functional RLE system.&lt;br /&gt;
&lt;br /&gt;
The compressed file consists of a UINT32LE giving the decompressed size, followed by the compressed data.&lt;br /&gt;
&lt;br /&gt;
The compressed data is processed in a loop.  After each byte is read, its value is used to select an action.  If the high bit is set (val &amp;amp; 0x80) then one more than the lower seven bits ((val &amp;amp; 0x7F) + 1) is the number of following bytes passed through unchanged.  If the high bit was not set, then that value plus three is the number of times the following byte is repeated.&lt;br /&gt;
&lt;br /&gt;
The next byte is then read and the same procedure followed until there is no more data or the decompressed size in the header has been reached.&lt;br /&gt;
&lt;br /&gt;
An illustration:&lt;br /&gt;
&lt;br /&gt;
 80 aa 00 00 81 bb cc 05 dd&lt;br /&gt;
&lt;br /&gt;
This data is interpreted as follows:&lt;br /&gt;
&lt;br /&gt;
 80 aa     # Copy AA through unchanged&lt;br /&gt;
 00 00     # Repeat 00 three times&lt;br /&gt;
 81 bb cc  # Copy BB and CC through unchanged&lt;br /&gt;
 05 dd     # Repeat DD eight times&lt;br /&gt;
&lt;br /&gt;
Or as pseudocode:&lt;br /&gt;
&lt;br /&gt;
* Get the initial dword [Final length]&lt;br /&gt;
* If [Decompressed data length] &amp;lt; [Final length] then:&lt;br /&gt;
*# Read a byte [Value]&lt;br /&gt;
*# If the byte value &amp;gt;= 128, then:&lt;br /&gt;
*#* Read and output the next [value - 127] bytes&lt;br /&gt;
*#* Move forward [Value - 126] bytes and return to step 1.&lt;br /&gt;
*# If the byte value &amp;lt; 128, then:&lt;br /&gt;
*#* Read the next byte and output it (value + 3) times.&lt;br /&gt;
*#* Move forward 2 bytes and return to step 1.&lt;br /&gt;
&lt;br /&gt;
It can be seen that this system is not optimal since two repeating bytes must be treated as non-repeating.&lt;br /&gt;
&lt;br /&gt;
=== Implementation bugs ===&lt;br /&gt;
&lt;br /&gt;
Some implementations of this particular RLE algorithm have a bug that causes the decompression code to behave erraticly for compressed data whose expanded size exceeds a certain amount of bytes. Since the original games were programmed for 16 bit x86 processors, memory pointers need to be adjusted when reaching a 64k boundary. The RLE implementation adjusts the output pointer incorrectly when the offset reaches 0xFF00 (Dangerous Dave) or 0xFFF0 ([[Commander Keen 1-3]], [[Catacomb II]]). Reaching said offset causes the code to add &amp;lt;tt&amp;gt;offset / 16&amp;lt;/tt&amp;gt; to the segment part of the address (which is correct), but then it sets the offset to 0 instead of setting it the remainder of that division (i.e. bitwise AND the offset value with 0xF). This effectively makes the decompression code overwrite up to 15 bytes of the already generated output.&lt;br /&gt;
&lt;br /&gt;
The offset is only checked after writing a run of repeating or non-repeating data, which makes it hard to predict what the actual offset will be when the limit is reached and the pointer is normalized. If the four least significant bits of the offset are 0 at that point, then the offset will be adjusted correctly and no corruption occurs, otherwise up to 15 bytes are overwritten.&lt;br /&gt;
&lt;br /&gt;
A possible workaround for this bug would be to make sure the RLE compression routines generate data that ends a run at offset 0xFF00 (or 0xFFF0, depending on which number the decompression code uses). This means the compression code needs to keep track of the 16 bit offset value the decompression code is going to use and produce a special, slightly less effectively compressed run when that offset is reached.&lt;br /&gt;
&lt;br /&gt;
This implementation bug is usually not a problem, since most data compressed with this algorithm is nowhere near 64k. In [[Commander Keen 1-3]], this form of RLE stores full-screen EGA images, which are only 32000 bytes when decompressed. The first two [[Catacomb]] games use this for their levels, which are only 4096 bytes when decompressed.&lt;br /&gt;
&lt;br /&gt;
Note that the limit of 0xFFF0 in Keen 1-3 and Catacomb II also means that certain run lengths can cause an overflow of the offset value that will remain undetected by the decompression code, causing it to start overwriting the last 64k written the output. For example, if the current offset is 0xFFEF, which is smaller than the limit of 0xFFF0, the code doesn&#039;t adjust the offset and proceeds with the next RLE run. If that run writes 17 bytes to the output, the new offset will be 0x0000 instead of 0x10000 (since the code is using 16 bit registers/variables), and the new offset will still be considered smaller than 0xFFF0. Again, this is not a big problem, since these games never use any compressed data large enough to trigger this.&lt;br /&gt;
&lt;br /&gt;
=== Example code ===&lt;br /&gt;
&lt;br /&gt;
* Javascript: the [https://github.com/Malvineous/gamecompjs/blob/master/formats/cmp-rle-id.js cmp-rle-id] algorithm in gamecomp.js&lt;br /&gt;
&lt;br /&gt;
* x86 Assembly: [https://github.com/CatacombGames/TheCatacomb/blob/88947aa28b92be001ca093c613fb4b9c893c4cc5/RLEASM.ASM#L204 RLEASM.ASM] from [[Catacomb II|The Catacomb]] source code (including the offset normalization bug)&lt;br /&gt;
&lt;br /&gt;
* x86 Assembly: [https://github.com/CatacombGames/Catacomb/blob/e657bc3aa8fef0d89bd09aa8fa0e051941c66518/CATASM.ASM#L2010 CATASM.ASM] from [[Catacomb]] source code (has a limit of 0xFF00, but not the normalization bug)&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_RLE_compression&amp;diff=9520</id>
		<title>Keen 1-3 RLE compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_RLE_compression&amp;diff=9520"/>
		<updated>2021-03-19T03:06:38Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Example code */ link to the bug in the implementation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Compression Infobox&lt;br /&gt;
 | Type = Stream&lt;br /&gt;
 | UnitSize = 1-bit&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Catacomb}}&lt;br /&gt;
   {{Game|Commander Keen 1-3}}&lt;br /&gt;
   {{Game|Dangerous Dave}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Commander Keen 1-3]] uses [[RLE Compression]] to compress its 320x200 &amp;lt;tt&amp;gt;FINALE.CKx&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PREVIEWx.CK1&amp;lt;/tt&amp;gt; screens.  [[Dangerous Dave]] also uses this format to compress its graphics. It was previously used in [[Catacomb|Catacomb I and II]] for the level data (not the graphics). This is one of many possible ways to create a functional RLE system.&lt;br /&gt;
&lt;br /&gt;
The compressed file consists of a UINT32LE giving the decompressed size, followed by the compressed data.&lt;br /&gt;
&lt;br /&gt;
The compressed data is processed in a loop.  After each byte is read, its value is used to select an action.  If the high bit is set (val &amp;amp; 0x80) then one more than the lower seven bits ((val &amp;amp; 0x7F) + 1) is the number of following bytes passed through unchanged.  If the high bit was not set, then that value plus three is the number of times the following byte is repeated.&lt;br /&gt;
&lt;br /&gt;
The next byte is then read and the same procedure followed until there is no more data or the decompressed size in the header has been reached.&lt;br /&gt;
&lt;br /&gt;
An illustration:&lt;br /&gt;
&lt;br /&gt;
 80 aa 00 00 81 bb cc 05 dd&lt;br /&gt;
&lt;br /&gt;
This data is interpreted as follows:&lt;br /&gt;
&lt;br /&gt;
 80 aa     # Copy AA through unchanged&lt;br /&gt;
 00 00     # Repeat 00 three times&lt;br /&gt;
 81 bb cc  # Copy BB and CC through unchanged&lt;br /&gt;
 05 dd     # Repeat DD eight times&lt;br /&gt;
&lt;br /&gt;
Or as pseudocode:&lt;br /&gt;
&lt;br /&gt;
* Get the initial dword [Final length]&lt;br /&gt;
* If [Decompressed data length] &amp;lt; [Final length] then:&lt;br /&gt;
*# Read a byte [Value]&lt;br /&gt;
*# If the byte value &amp;gt;= 128, then:&lt;br /&gt;
*#* Read and output the next [value - 127] bytes&lt;br /&gt;
*#* Move forward [Value - 126] bytes and return to step 1.&lt;br /&gt;
*# If the byte value &amp;lt; 128, then:&lt;br /&gt;
*#* Read the next byte and output it (value + 3) times.&lt;br /&gt;
*#* Move forward 2 bytes and return to step 1.&lt;br /&gt;
&lt;br /&gt;
It can be seen that this system is not optimal since two repeating bytes must be treated as non-repeating.&lt;br /&gt;
&lt;br /&gt;
=== Implementation bugs ===&lt;br /&gt;
&lt;br /&gt;
Some implementations of this particular RLE algorithm have a bug that causes the decompression code to behave erraticly for compressed data whose expanded size exceeds a certain amount of bytes. Since the original games were programmed for 16 bit x86 processors, memory pointers need to be adjusted when reaching a 64k boundary. The RLE implementation adjusts the output pointer incorrectly when the offset reaches 0xFF00 (Dangerous Dave) or 0xFFF0 ([[Commander Keen 1-3]], [[Catacomb II]]). Reaching said offset causes the code to add &amp;lt;tt&amp;gt;offset / 16&amp;lt;/tt&amp;gt; to the segment part of the address (which is correct), but then it sets the offset to 0 instead of setting it the remainder of that division (i.e. bitwise AND the offset value with 0xF). This effectively makes the decompression code overwrite up to 15 bytes of the already generated output.&lt;br /&gt;
&lt;br /&gt;
The offset is only checked after writing a run of repeating or non-repeating data, which makes it hard to predict what the actual offset will be when the limit is reached and the pointer is normalized. If the four least significant bits of the offset are 0 at that point, then the offset will be adjusted correctly and no corruption occurs, otherwise up to 15 bytes are overwritten.&lt;br /&gt;
&lt;br /&gt;
A possible workaround for this bug would be to make sure the RLE compression routines generate data that ends a run at offset 0xFF00 (or 0xFFF0, depending on which number the decompression code uses). This means the compression code needs to keep track of the 16 bit offset value the decompression code is going to use and produce a special, slightly less effectively compressed run when that offset is reached.&lt;br /&gt;
&lt;br /&gt;
This implementation bug is usually not a problem, since most data compressed with this algorithm is nowhere near 64k. In [[Commander Keen 1-3]], this form of RLE stores full-screen EGA images, which are only 32000 bytes when decompressed. The first two [[Catacomb]] games use this for their levels, which are only 4096 bytes when decompressed.&lt;br /&gt;
&lt;br /&gt;
Note that the limit of 0xFFF0 in Keen 1-3 and Catacomb II also means that certain run lengths can cause an overflow of the offset value that will remain undetected by the decompression code, causing it to start overwriting the last 64k written the output. For example, if the current offset is 0xFFEF, which is smaller than the limit of 0xFFF0, the code doesn&#039;t adjust the offset and proceeds with the next RLE run. If that run writes 17 bytes to the output, the new offset will be 0x0000 instead of 0x10000 (since the code is using 16 bit registers/variables), and the new offset will still be considered smaller than 0xFFF0. Again, this is not a big problem, since these games never use any compressed data large enough to trigger this.&lt;br /&gt;
&lt;br /&gt;
=== Example code ===&lt;br /&gt;
&lt;br /&gt;
* Javascript: the [https://github.com/Malvineous/gamecompjs/blob/master/formats/cmp-rle-id.js cmp-rle-id] algorithm in gamecomp.js&lt;br /&gt;
&lt;br /&gt;
* x86 Assembly: [https://github.com/CatacombGames/TheCatacomb/blob/88947aa28b92be001ca093c613fb4b9c893c4cc5/RLEASM.ASM#L204 RLEASM.ASM] from [[Catacomb II|The Catacomb]] source code (including the offset normalization bug)&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Dangerous_Dave_Tileset_Format&amp;diff=9519</id>
		<title>Dangerous Dave Tileset Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Dangerous_Dave_Tileset_Format&amp;diff=9519"/>
		<updated>2021-03-19T02:57:09Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: it isn&amp;#039;t necessarily always one byte that is skipped. Could be anything from 0 to 15 bytes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | Image = ddave-tileset-vga.png&lt;br /&gt;
 | ImageNativeWidth = Y&lt;br /&gt;
 | Hardware1 = CGA&lt;br /&gt;
 | Hardware2 = EGA&lt;br /&gt;
 | Hardware3 = VGA&lt;br /&gt;
 | MaxTiles = 2&amp;lt;sup&amp;gt;32&amp;lt;/sup&amp;gt;-1&lt;br /&gt;
 | Palette = CGA 1i, Default EGA, shared VGA&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 16&amp;amp;times;16 (0-53), 0&amp;amp;times;0 (54+)&lt;br /&gt;
 | TileMaxSize = 16&amp;amp;times;16 (0-53), 65535&amp;amp;times;65535 (54+)&lt;br /&gt;
 | NumPlanes = 1 (CGA/VGA), 4 (EGA)&lt;br /&gt;
 | PlaneArrangement = [[Linear CGA]], [[Row-planar EGA]], Linear VGA&lt;br /&gt;
 | HasTransparency = N&lt;br /&gt;
 | HasHitmap = N&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Dangerous Dave}}&lt;br /&gt;
}}&lt;br /&gt;
Apart from the interface graphics (menu, font, etc.) [[Dangerous Dave]] stores its graphics in three files in this format.  The EGA graphics are stored externally in &amp;lt;tt&amp;gt;EGADAVE.DAV&amp;lt;/tt&amp;gt;, while the CGA and VGA graphics are stored internally in &amp;lt;tt&amp;gt;DAVE.EXE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These graphics in this format are the tiles and sprites, and most images used in-level.&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Both the CGA and VGA data (stored in the .exe) is compressed with [[Keen 1-3 RLE compression]].  (This is not counting the LZEXE compression applied to the final .exe as a whole.)  The compression applies to the entire file, headers and all.  The EGA data (stored in &amp;lt;tt&amp;gt;EGADAVE.DAV&amp;lt;/tt&amp;gt;) is not compressed.&lt;br /&gt;
&lt;br /&gt;
The game allocates a buffer of exactly 90112 (0x16000) bytes for the decompressed tile graphics, so even though the original VGA tileset only has an expanded size of 71238 bytes, there is still some space left for additional graphics.&lt;br /&gt;
&lt;br /&gt;
Due to [[Keen 1-3 RLE compression#Implementation bugs|a bug in the RLE decompression code]] used by the game, great care must be taken when decompressing the original VGA tile graphicss or compressing new tile graphics that are larger than 65,280 (0xFF00) bytes. &lt;br /&gt;
&lt;br /&gt;
The decompression code needs to normalize its pointers when it passes offset 0xFF00 in the output stream, but it does not do so correctly.  This means no RLE compression code must run across a 65,280 byte boundary, otherwise the game will not load the graphics correctly.  When compressing modified graphics this can be achieved by only compressing 65,280 bytes at a time.&lt;br /&gt;
&lt;br /&gt;
For example the code &amp;lt;tt&amp;gt;0B 00&amp;lt;/tt&amp;gt; (&amp;quot;repeat 0x00 14 times&amp;quot;) might have to be changed to &amp;lt;tt&amp;gt;02 00 06 00&amp;lt;/tt&amp;gt; (&amp;quot;repeat 0x00 five times, then repeat 0x00 nine times&amp;quot;) if the 65,280 byte boundary occurs in the middle of the code.  (In this case the boundary would be between the &amp;lt;tt&amp;gt;02 00&amp;lt;/tt&amp;gt; code and the &amp;lt;tt&amp;gt;06 00&amp;lt;/tt&amp;gt; code.)  The last RLE code must result in bytes from index 0 to index 65,279 being written, with the next RLE code outputting byte 65,280.  Failing to take this into account when compressing data will result in the decompression code skipping/overwriting between 1 and 15 bytes at this boundary.&lt;br /&gt;
&lt;br /&gt;
For the original VGA tileset data of this game, this means after decompressing the first 65,280 bytes of the tileset data, one extra byte must be read and discarded.  Failure to take this into account when reading the file will cause the last 10 images in the VGA tileset to appear as though they are 2048 pixels wide instead of 8 pixels wide.&lt;br /&gt;
&lt;br /&gt;
Note that previous versions of this page said this extra byte was inserted every 65,536 bytes but this is incorrect - image #157 (the final frame in the &amp;quot;Dangerous Dave&amp;quot; title screen animation) will have the first few rows of the image come out differently to the way it looks in the game if the &amp;quot;padding&amp;quot; byte is every 65,536 bytes.  Having the &amp;quot;padding&amp;quot; byte at 65,280 bytes makes more sense as this is the offset at which the RLE decoder &amp;quot;normalizes&amp;quot; its pointers incorrectly, so that&#039;s what causes the code to copy one byte fewer than it should.&lt;br /&gt;
&lt;br /&gt;
Note that as this is a side effect of the RLE compression, this extra byte only needs to be handled for the CGA and VGA graphics.  As the EGA graphics are not compressed, they do not have this extra byte.&lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
After decompression (if required), the file starts with the number of chunks (graphics) in the file, followed by a number of values giving the offset of each chunk.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT32LE]] count||Number of images in the file&lt;br /&gt;
|-&lt;br /&gt;
|[[UINT32LE]] offsets[count]||Offset of image data&lt;br /&gt;
|-&lt;br /&gt;
|[[BYTE]] data[]||Image data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are two types of chunks, those that are 128 bytes in size are taken to be 16x16 tiles (by default the first 53 chunks are these) and consist entirely of raw graphics data with no header. Other chunks start with two [[UINT16LE]] values giving the width and height of the graphic in pixels followed by the image data.&lt;br /&gt;
&lt;br /&gt;
== Image formats ==&lt;br /&gt;
&lt;br /&gt;
=== CGA ===&lt;br /&gt;
[[Image:ddave-tileset-cga.png|frame|right|Partial CGA tileset]]&lt;br /&gt;
Image data is [[Linear CGA]] (like VGA but 2bpp instead of 8bpp.)  In other words, it&#039;s not split up into planes like the EGA data is.  The pixels are broken up in big-endian order within the byte, so this value:&lt;br /&gt;
&lt;br /&gt;
 11001001  (0xC9)&lt;br /&gt;
&lt;br /&gt;
Would translate as four pixels of the following values:&lt;br /&gt;
&lt;br /&gt;
 11 00 10 01  (3, 0, 2, 1)&lt;br /&gt;
&lt;br /&gt;
The actual colours for each pixel depend on the active CGA palette, of which there are three basic ones.  See [[wp:Color Graphics Adapter]] for details.&lt;br /&gt;
&lt;br /&gt;
=== EGA ===&lt;br /&gt;
[[Image:ddave-tileset-ega.png|frame|right|Partial EGA tileset]]&lt;br /&gt;
All EGA data is stored in the [[Row-planar EGA]] arrangement, meaning each graphic is split into rows which are then split into EGA planes.&lt;br /&gt;
&lt;br /&gt;
All graphics have four planes, stored in the order I, R, G, B. Tiles are first, followed by player sprites, enemy sprites, in-level images and in-level font.&lt;br /&gt;
&lt;br /&gt;
This is a very basic implementation of EGA data.  The only masked sprite is the player sprite (the only sprite that needs to appear over colored tiles and other sprites - enemy sprites are drawn using XOR to avoid the mask, at the expense of causing colour changes should they ever overlap map tiles.)  Masking is accomplished by storing the mask as a second, black and white image - that is, black and white EGA.  The mask graphic is the same size, in pixels and bytes, as the sprite image it masks - a very wasteful way of doing things.&lt;br /&gt;
&lt;br /&gt;
Dave is also interesting in that it contains graphics whose width does not divide evenly by eight pixels. As EGA data these are stored as if they divided by the next highest multiple of 8 pixels (a 26x8 image is stored like a 32x8 image, with the &#039;extra&#039; space being blank.)  This is standard for storing images padded to a certain byte width (e.g. .BMP images) however it is not often done in games due to the &#039;wasted&#039; space.&lt;br /&gt;
&lt;br /&gt;
=== VGA ===&lt;br /&gt;
[[Image:ddave-tileset-vga.png|frame|right|Partial VGA tileset]]&lt;br /&gt;
The VGA data is standard 8bpp single-plane data.  The palette is stored in the main EXE file (see [[Dangerous Dave]] for its location.)&lt;br /&gt;
&lt;br /&gt;
== Example code ==&lt;br /&gt;
&lt;br /&gt;
* Javascript: [https://github.com/Malvineous/gamegraphicsjs/blob/master/formats/tls-ddave.js tls-ddave] in Camoto&#039;s gamegraphics.js&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format and the EGA + VGA graphics were reverse engineered by [[User:Levellass|Levellass]], and the RLE algorithm and CGA graphics were reverse engineered by [[User:Malvineous|Malvineous]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_RLE_compression&amp;diff=9518</id>
		<title>Keen 1-3 RLE compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_RLE_compression&amp;diff=9518"/>
		<updated>2021-03-19T02:12:39Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: more detailed explanation of the RLE bug and how to work around it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Compression Infobox&lt;br /&gt;
 | Type = Stream&lt;br /&gt;
 | UnitSize = 1-bit&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Catacomb}}&lt;br /&gt;
   {{Game|Commander Keen 1-3}}&lt;br /&gt;
   {{Game|Dangerous Dave}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Commander Keen 1-3]] uses [[RLE Compression]] to compress its 320x200 &amp;lt;tt&amp;gt;FINALE.CKx&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;PREVIEWx.CK1&amp;lt;/tt&amp;gt; screens.  [[Dangerous Dave]] also uses this format to compress its graphics. It was previously used in [[Catacomb|Catacomb I and II]] for the level data (not the graphics). This is one of many possible ways to create a functional RLE system.&lt;br /&gt;
&lt;br /&gt;
The compressed file consists of a UINT32LE giving the decompressed size, followed by the compressed data.&lt;br /&gt;
&lt;br /&gt;
The compressed data is processed in a loop.  After each byte is read, its value is used to select an action.  If the high bit is set (val &amp;amp; 0x80) then one more than the lower seven bits ((val &amp;amp; 0x7F) + 1) is the number of following bytes passed through unchanged.  If the high bit was not set, then that value plus three is the number of times the following byte is repeated.&lt;br /&gt;
&lt;br /&gt;
The next byte is then read and the same procedure followed until there is no more data or the decompressed size in the header has been reached.&lt;br /&gt;
&lt;br /&gt;
An illustration:&lt;br /&gt;
&lt;br /&gt;
 80 aa 00 00 81 bb cc 05 dd&lt;br /&gt;
&lt;br /&gt;
This data is interpreted as follows:&lt;br /&gt;
&lt;br /&gt;
 80 aa     # Copy AA through unchanged&lt;br /&gt;
 00 00     # Repeat 00 three times&lt;br /&gt;
 81 bb cc  # Copy BB and CC through unchanged&lt;br /&gt;
 05 dd     # Repeat DD eight times&lt;br /&gt;
&lt;br /&gt;
Or as pseudocode:&lt;br /&gt;
&lt;br /&gt;
* Get the initial dword [Final length]&lt;br /&gt;
* If [Decompressed data length] &amp;lt; [Final length] then:&lt;br /&gt;
*# Read a byte [Value]&lt;br /&gt;
*# If the byte value &amp;gt;= 128, then:&lt;br /&gt;
*#* Read and output the next [value - 127] bytes&lt;br /&gt;
*#* Move forward [Value - 126] bytes and return to step 1.&lt;br /&gt;
*# If the byte value &amp;lt; 128, then:&lt;br /&gt;
*#* Read the next byte and output it (value + 3) times.&lt;br /&gt;
*#* Move forward 2 bytes and return to step 1.&lt;br /&gt;
&lt;br /&gt;
It can be seen that this system is not optimal since two repeating bytes must be treated as non-repeating.&lt;br /&gt;
&lt;br /&gt;
=== Implementation bugs ===&lt;br /&gt;
&lt;br /&gt;
Some implementations of this particular RLE algorithm have a bug that causes the decompression code to behave erraticly for compressed data whose expanded size exceeds a certain amount of bytes. Since the original games were programmed for 16 bit x86 processors, memory pointers need to be adjusted when reaching a 64k boundary. The RLE implementation adjusts the output pointer incorrectly when the offset reaches 0xFF00 (Dangerous Dave) or 0xFFF0 ([[Commander Keen 1-3]], [[Catacomb II]]). Reaching said offset causes the code to add &amp;lt;tt&amp;gt;offset / 16&amp;lt;/tt&amp;gt; to the segment part of the address (which is correct), but then it sets the offset to 0 instead of setting it the remainder of that division (i.e. bitwise AND the offset value with 0xF). This effectively makes the decompression code overwrite up to 15 bytes of the already generated output.&lt;br /&gt;
&lt;br /&gt;
The offset is only checked after writing a run of repeating or non-repeating data, which makes it hard to predict what the actual offset will be when the limit is reached and the pointer is normalized. If the four least significant bits of the offset are 0 at that point, then the offset will be adjusted correctly and no corruption occurs, otherwise up to 15 bytes are overwritten.&lt;br /&gt;
&lt;br /&gt;
A possible workaround for this bug would be to make sure the RLE compression routines generate data that ends a run at offset 0xFF00 (or 0xFFF0, depending on which number the decompression code uses). This means the compression code needs to keep track of the 16 bit offset value the decompression code is going to use and produce a special, slightly less effectively compressed run when that offset is reached.&lt;br /&gt;
&lt;br /&gt;
This implementation bug is usually not a problem, since most data compressed with this algorithm is nowhere near 64k. In [[Commander Keen 1-3]], this form of RLE stores full-screen EGA images, which are only 32000 bytes when decompressed. The first two [[Catacomb]] games use this for their levels, which are only 4096 bytes when decompressed.&lt;br /&gt;
&lt;br /&gt;
Note that the limit of 0xFFF0 in Keen 1-3 and Catacomb II also means that certain run lengths can cause an overflow of the offset value that will remain undetected by the decompression code, causing it to start overwriting the last 64k written the output. For example, if the current offset is 0xFFEF, which is smaller than the limit of 0xFFF0, the code doesn&#039;t adjust the offset and proceeds with the next RLE run. If that run writes 17 bytes to the output, the new offset will be 0x0000 instead of 0x10000 (since the code is using 16 bit registers/variables), and the new offset will still be considered smaller than 0xFFF0. Again, this is not a big problem, since these games never use any compressed data large enough to trigger this.&lt;br /&gt;
&lt;br /&gt;
=== Example code ===&lt;br /&gt;
&lt;br /&gt;
* Javascript: the [https://github.com/Malvineous/gamecompjs/blob/master/formats/cmp-rle-id.js cmp-rle-id] algorithm in gamecomp.js&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=9517</id>
		<title>GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=9517"/>
		<updated>2021-03-19T00:46:24Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: no truly uncomressed version has been reported yet - all currently known variations use RLEW compression&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Viewport = &#039;&#039;Varies by game&#039;&#039;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Noah&#039;s Ark 3D}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Rescue Rover 2}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;GameMaps Format&#039;&#039;&#039; stores levels in a number of [[:Category:id Software]] games. The filenames and compression varies somewhat across different games but all files stored in this format were produced by the [[TED5]] level editor.&lt;br /&gt;
&lt;br /&gt;
There are three main varieties of the file format. The most basic version is just [[RLEW compression|RLEW compressed]], the other two are either [[Carmack compression|carmackized]] or [[Huffman Compression|Huffman compressed]] on top of the RLEW compression. Each variation has its own file naming scheme and pattern of external/internal files.&lt;br /&gt;
&lt;br /&gt;
There are two main components to the format.  The game maps proper, which contain the actual level data, and the map headers, which contain both the location of each level&#039;s data within the game maps file, and the tile info for the game.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! RLEW !! Carmackization !! Huffman !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Bio Menace || Yes || No || No || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Aliens of Gold || Yes || No || No || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Blake Stone: Planet Strike || Yes || No || No || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb 3-D || Yes || Yes || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Abyss || Yes || Yes || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Apocalypse || Yes || Yes || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Catacomb Armageddon || Yes || Yes || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen Dreams || Yes || No || Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| Commander Keen 4-6 || Yes || No || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Corridor 7 Alien Invasion || Yes || No || No || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 3 || Yes || No || Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| Dangerous Dave 4 || Yes || No || Yes ||&lt;br /&gt;
|-&lt;br /&gt;
| Noah&#039;s Ark 3D || Yes || ? || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Operation Body Count || Yes || No || No || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Rescue Rover 2 || Yes || Yes || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Spear of Destiny || Yes || Yes || No ||&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.0) || Yes || No || No || Uses MAPTEMP.xxx (only RLEW compression)&lt;br /&gt;
|-&lt;br /&gt;
| Wolfenstein 3-D (v1.1 and above)|| Yes || Yes || No ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The games that use Huffman compression will have a MAPDICT (embedded in the game&#039;s main executable).  Those missing the map dictionary are not Huffman encoded.&lt;br /&gt;
&lt;br /&gt;
To work out whether Carmackization is used, read the first UINT16LE in a map plane (the field storing the decompressed size).  If the value matches the expected size of the plane (i.e. width * height * 2), then only RLEW compression is used.  If it doesn&#039;t match, check the second UINT16LE in the file (which will become the first UINT16LE once Carmackization has been removed).  If this matches the expected plane size then the plane must first have Carmackization removed followed by removal of RLEW. The exception to this rule are plane sizes that have either 0xA7 or 0xA8 as the high byte (i.e. any value from 0xA700 to 0xA8FF), as those values would have been encoded differently by the [[Carmack compression]] algorithm.&lt;br /&gt;
&lt;br /&gt;
== Data structures==&lt;br /&gt;
&lt;br /&gt;
The map data is split into two files: The map header (&amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt;) and the main map file (usually &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt;). The map header may be embedded in the game&#039;s main executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; is the working format saved by [[TED5]] when maps are being edited and can be directly accessed and edited by this utility, allowing changes to be made to the game. Note that if the MAPHEAD file exists as an external file, the game always reads it from a file named named &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; for both the &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; and the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; variation. TED5 also saves a &amp;lt;tt&amp;gt;MAPTHEAD.xx&amp;lt;/tt&amp;gt; file when editing maps, but that file is only used by TED5 and usually omitted from any game release.&lt;br /&gt;
&lt;br /&gt;
The maps were often compressed even further for the public release versions of the games. This more compressed version of the map file was saved as &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; by TED5. Later releases would omit the additional compression layer and ship with the &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; file instead. One possible reason for this could be that the size of the games grew to the point where they would no longer fit onto and be playable from a single floppy disk, and therefore the additional compression was no longer worth the amount of time it took to compress the maps and re-compile the code.&lt;br /&gt;
&lt;br /&gt;
=== Map headers (MAPHEAD) ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[UINT16LE]] || magic || Magic word signalling [[RLEW compression]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[INT32LE]][100] || ptr || 100 pointers to start of level 0-99 data in the game maps file&lt;br /&gt;
|-&lt;br /&gt;
| 402 || {{TODO|Unknown}} || tileinfo || Optional tileinfo data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The map header file (MAPHEAD) is of varying length and contains three main types of data.&lt;br /&gt;
&lt;br /&gt;
* The first is the magic word or flag used for RLEW compression, which is almost always $ABCD in the original files. It could be changed to any other value if necessary.&lt;br /&gt;
&lt;br /&gt;
* The second is 100 level pointers which give the location of the start of level data in the GAMEMAPS file, relative to the start of that file.  A value less than 1 indicates no level (generally 0, but occasionally -1 (0xFFFFFFFF) is used). Using -1 should be preferred over 0, as the pre-Wolf3D version of the engine will treat any negative value as &amp;quot;a non existant map&amp;quot; [sic!] and quit with an appropriate error message, while 0 will cause it to try reading a level header at offset 0 (where the &amp;quot;TED5v1.0&amp;quot; string is usually stored), which will cause all kinds of errors as there is clearly no valid level header at that offset.&lt;br /&gt;
&lt;br /&gt;
* The third is the tileinfo data, which contains tile properties for each tile used in level creation. (These are masked and unmasked and either 8x8, 16x16 or 32x32.)&lt;br /&gt;
&lt;br /&gt;
Many programs treat the tileinfo as a separate file from the MAPHEAD and it is possible to modify a game in this manner.  Indeed, some games such as Wolfenstein 3-D do not have any tileinfo data at all in the map header file (giving a total file length of 402 bytes.) However TED5 works with any tileinfo data in the MAPHEAD.&lt;br /&gt;
&lt;br /&gt;
=== Map data (GAMEMAPS) ===&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file consists of the string &amp;quot;TED5v1.0&amp;quot; and a number of compressed chunks of varying length.  Each level in the file will have from two to four chunks (usually four) depending on the game, with all levels in a given game having the same number of chunks.  These are the level header and 1-3 planes (foreground, background and sprite/info.)  The chunks are in no particular order and it is possible to read through the entire file decompressing chunks as they&#039;re found.&lt;br /&gt;
&lt;br /&gt;
Chunks are ordered by the MAPHEAD file, which will point to the GAMEMAPS level header chunks which in turn contain pointers to the other GAMEMAPS chunks used by that level.&lt;br /&gt;
&lt;br /&gt;
All level data is in the form of [[UINT16LE]] values (or in the case of pointers, [[UINT32LE]].)&lt;br /&gt;
&lt;br /&gt;
==== Level headers ====&lt;br /&gt;
&lt;br /&gt;
The header for each level inside the GAMEMAPS file (which is pointed to by MAPHEAD) is 38 bytes long and &#039;&#039;never&#039;&#039; RLEW compressed.  If the GAMEMAPS file is using Huffman compression, the level header itself is Huffman-compressed.  In that case, the size of the compressed level header can be found in the MAPHEAD file.  Since the uncompressed level header always has a size of 38 bytes, that size is not stored at the beginning of the compressed data.  The header is sometimes followed by a signature &amp;quot;!ID!&amp;quot; string, which would give the header a total size of 42 bytes, but that string is not part of the actual level header.&lt;br /&gt;
&lt;br /&gt;
Plane 0 is background using unmasked tiles, plane 1 is foreground and uses masked tiles, and plane 2 is sprite/info.  Levels must contain a background plane and usually an infoplane.&lt;br /&gt;
&lt;br /&gt;
For the compressed size of each level plane, a value of 0 indicates the plane does not exist. The offset value for unused planes appears to be set to a random number with the most significant byte set to 0xFF, making it either a negative number or an offset close to the 4 gigabyte range. The games only check the compressed size and ignore the offset if the size is 0.&lt;br /&gt;
&lt;br /&gt;
Note that Wolf3D is hard-coded to always load the first two planes, even if the compressed size of a plane is 0. Wolf3D also ignores the width and height stored in the level header and just assumes the level is 64x64 tiles. This also applies to Blake Stone and probably any other game based on the Wolf3D code.&lt;br /&gt;
&lt;br /&gt;
All versions of the &amp;quot;Id Software Caching Manager&amp;quot; ignore the expanded size value at the beginning of the RLEW data and just assume that the size is the same as the size of the plane (width * height * 2).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || UINT32LE || offPlane0 || Offset in GAMEMAPS to beginning of compressed plane 0 data (or 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || UINT32LE || offPlane1 || Offset in GAMEMAPS to beginning of compressed plane 1 data (or 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || UINT32LE || offPlane2 || Offset in GAMEMAPS to beginning of compressed plane 2 data (or 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 12 || UINT16LE || lenPlane0 || Length of compressed plane 0 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 14 || UINT16LE || lenPlane1 || Length of compressed plane 1 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || UINT16LE || lenPlane2 || Length of compressed plane 2 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || UINT16LE || width || Width of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || UINT16LE || height || Height of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || char[16] || name || Internal name for level (used only by editor, not displayed in-game. null-terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D, a 4-byte signature string (&amp;quot;!ID!&amp;quot;) will normally be present directly after the level name. The signature does not appear to be used anywhere, but is useful for distinguishing between v1.0 files (the signature string is missing), and files for v1.1 and later (includes the signature string).&lt;br /&gt;
&lt;br /&gt;
== Carmack compression ==&lt;br /&gt;
&lt;br /&gt;
[[Carmack compression]] is the method used to compress later &#039;&#039;id Software&#039;&#039; games, when file size was still a concern.  It is the most efficient and complex compression method and was created specifically to work with the 16-bit word structure of the GameMaps file.  The compression is detailed on its [[Carmack compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Carmackized game maps files are external &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; files and the map header is usually (but not always) stored internally in the executable.  The map header must be extracted and the game maps decompressed before TED5 can access them.  TED5 itself can produce carmackized files and external &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; files. Carmackization does not replace the RLEW compression used in uncompressed data, but compresses this data, that is, the data is doubly compressed.&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D v1.0, map files are not carmackized, only RLEW compression is applied.&lt;br /&gt;
&lt;br /&gt;
== Huffman compression ==&lt;br /&gt;
&lt;br /&gt;
[[Huffman Compression]] was probably used by earlier versions of TED5 (but possibly not TED5 at all) before carmackization was introduced.  It uses the same method to compress its data as is used by &#039;&#039;id Software&#039;&#039; games to compress their graphics and sounds.  Again this compression method works with RLEW compressed data and has its [[Huffman Compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Huffman compression is easily detected since it works on the bit level and thus disrupts the word structure of the game data.  This is easily seen in a hex editor.  Compressed data will not contain the string $00 $00 or indeed even $00 very often. (In contrast, even carmackized data contains both strings hundreds of times.)&lt;br /&gt;
&lt;br /&gt;
There will be two internal files for this format: the map header and the Huffman dictionary (which is always the first dictionary in the executable.)  The map header format is also slightly different, being 502 bytes long, the extra 100 bytes being the length of the compressed level headers in the game maps data, which occur immediately after the normal level header offsets and before the tileinfo. Each entry is one octet indicating the decompressed header length in bytes or zero if the level does not exist. (These can be ignored when decompressing since Huffman data can be read until the decompressed level header&#039;s fixed size is reached, but if they are omitted when writing the MAPHEAD, the game may experience a buffer overflow when reading the maps.)&lt;br /&gt;
&lt;br /&gt;
== Location of internal files ==&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file itself is always external, but in the case of compression, the MAPHEAD is stored internally in the main .exe file.  Executables are themselves compressed with either with LZEXE or PKLite.  Once the .exe has been decompressed it is a trivial task to find the MAPHEAD as it will start with the UINT16LE value $ABCD (i.e. the byte $CD followed by the byte $AB.)  For level editing purposes only the first 402 (or 502) bytes of the file need to be extracted, though it is possible to read the MAPHEAD file to calculate its length.&lt;br /&gt;
&lt;br /&gt;
The following table lists the offsets of the MAPHEAD file for various games, relative to the start of the decompressed game .exe file.&lt;br /&gt;
&lt;br /&gt;
{{TODO|TODO: Add all known versions of all games}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! Version !! Location !! Filename !! Offset !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bio Menace]] || Freeware || External || &amp;lt;tt&amp;gt;MAPHEAD.BM[123]&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]]: Aliens of Gold || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.BS1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]] 2: Planet Strike || All || External || &amp;lt;tt&amp;gt;MAPHEAD.VSI&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb 3-D]] (3) || 1.00 || Internal || &amp;lt;tt&amp;gt;CAT3D.EXE&amp;lt;/tt&amp;gt; || $1C570 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Abyss]] (4) || 1.13 || Internal || &amp;lt;tt&amp;gt;CATABYSS.EXE&amp;lt;/tt&amp;gt; || $1C510 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Armageddon]] (5) || 1.01a || Internal || &amp;lt;tt&amp;gt;CATARMA.EXE&amp;lt;/tt&amp;gt; || $1D900 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Apocalypse]] (6) || 1.00b || Internal || &amp;lt;tt&amp;gt;CATAPOC.EXE&amp;lt;/tt&amp;gt; || $1DD50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| [[Corridor 7 Alien Invasion]] || Demo || External || &amp;lt;tt&amp;gt;MAPHEAD.DMO&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|| CD || Internal || &amp;lt;tt&amp;gt;CORR7CD.EXE&amp;lt;/tt&amp;gt; || $30D50 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
| Floppy || Internal || &amp;lt;tt&amp;gt;C7.EXE&amp;lt;/tt&amp;gt; || $24BF0 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Commander Keen 4-6|Keen 4]] || Special Demo || ? || ? || ? || File is PKLite compressed&lt;br /&gt;
|-&lt;br /&gt;
| 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN4E.EXE&amp;lt;/tt&amp;gt; || $24830 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 5]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN5E.EXE&amp;lt;/tt&amp;gt; || $25990 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 6]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN6.EXE&amp;lt;/tt&amp;gt; || $25080 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen Dreams]] || 1.13 || Internal || ? || $1FA50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Noah&#039;s Ark 3D]] || All || External || ? || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Operation Body Count]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.BC&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Spear of Destiny]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.SOD&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Wolfenstein 3-D]] || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.WL1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered || External || &amp;lt;tt&amp;gt;MAPHEAD.WL6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
* [[TED5]] can edit the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; format of any games that use it.  It is the original editor used to create these files.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by Andrew Durdin (adurdin).  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=EXE_Format&amp;diff=9507</id>
		<title>EXE Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=EXE_Format&amp;diff=9507"/>
		<updated>2021-03-14T00:24:17Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Relocation table */ explained use and structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Executable Infobox&lt;br /&gt;
 | Interpreted = N&lt;br /&gt;
 | Platform = MS-DOS&lt;br /&gt;
 | Code = 16-bit x86&lt;br /&gt;
 | Hidden = Y&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;EXE format&#039;&#039;&#039; is used by all but the smallest DOS games to store the machine code instructions for running the game itself.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
=== Signature ===&lt;br /&gt;
&lt;br /&gt;
The first two characters of the file are &amp;quot;MZ&amp;quot;.  The following values (see below) will indicate the size of the .exe file, however this should not be relied upon because it is not uncommon for additional data to be appended onto the end of the .exe.  The other header fields can however be inspected to ensure the values are sensible, particularly the ones about memory requirements which will never ask for more than 640 kB of memory, otherwise the file would not run on the majority of DOS machines.&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;
| [[char]] || signature[2] || &amp;quot;MZ&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || lenFinal || Size of final block in the file, or &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; if the final block is a full 512 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || numBlocks || Number of 512-byte blocks in the file, including the final block which may not be the full 512 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || numReloc || Number of entries in the relocation table.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || pgHeader || Number of 16-byte blocks (paragraphs) in the file header, including the &amp;quot;MZ&amp;quot; and up until the machine code starts.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || pgMemExtra || Number of 16-byte paragraphs of extra memory that must be allocated for the program to run.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || pgMemMax || If the program doesn&#039;t need all available memory, this value can limit it to a smaller number of paragraphs.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || segSS || Stack segment offset.  This value is added to the load segment and set as the stack segment (&amp;lt;tt&amp;gt;SS&amp;lt;/tt&amp;gt; register).&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || regSP || Initial value of the &amp;lt;tt&amp;gt;SP&amp;lt;/tt&amp;gt; (stack pointer/index into stack) register.  The stack is located at the segment:offset &amp;lt;tt&amp;gt;SS:SP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || checknum || Usually ignored and set to zero.  Supposedly if all UINT16LE values in the file are summed they should equal zero, and this value can be tweaked to ensure that is the case.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || regIP || Initial value of the &amp;lt;tt&amp;gt;IP&amp;lt;/tt&amp;gt; (instruction pointer) register, where execution will actually begin.  This is normally 0x100 as DOS writes some information (the PSP) between memory offsets 0 and 0x100.  This means the first 0x100 bytes of the file are usually 0x00 bytes to avoid code getting overwritten, however to avoid wasting this space in the .exe files, some programs set &amp;lt;tt&amp;gt;regCS&amp;lt;/tt&amp;gt; to -16 which will cause everything to be shifted back by 0x100 bytes.  This means the code gets loaded at offset 0, then before it gets overwritten with the PSP &amp;lt;tt&amp;gt;regCS&amp;lt;/tt&amp;gt; is applied, changing the segment and making the code visible at offset 0x100 instead.  Thus the PSP can be written to memory before the code and execution begins at offset 0x100, without needing 0x100 bytes of zeroes at the start of the machine code.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || regCS || Offset for the &amp;lt;tt&amp;gt;CS&amp;lt;/tt&amp;gt; (code segment) register relative to the segment the code was loaded in.  Execution begins at &amp;lt;tt&amp;gt;CS:IP&amp;lt;/tt&amp;gt; so a value of &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt; would skip the first 16 bytes of code that follows the .exe header.  May be negative.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || offReloc || Offset of the first entry in the relocation table, relative to the start of the .exe file.  Increasing this value allows more data to be stored in the .exe header.  [[PKLite]] for example uses it to store a copyright message.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || overlayIndex || Overlay number, or zero for the main .exe file.  Rarely used.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional data can appear in the header until &amp;lt;tt&amp;gt;offReloc&amp;lt;/tt&amp;gt; is reached where the relocation table begins.&lt;br /&gt;
&lt;br /&gt;
=== Relocation table ===&lt;br /&gt;
&lt;br /&gt;
The relocation table consists of a number of four-byte entries.  Beginning at offset &amp;lt;tt&amp;gt;offReloc&amp;lt;/tt&amp;gt; from the start of the file and continuing until &amp;lt;tt&amp;gt;numReloc&amp;lt;/tt&amp;gt; four-byte entries have been read.&lt;br /&gt;
&lt;br /&gt;
Additional data can appear after the relocation table, until offset &amp;lt;tt&amp;gt;pgHeader * 16&amp;lt;/tt&amp;gt; where the machine code begins.&lt;br /&gt;
&lt;br /&gt;
The relocation table lists all the instances in the machine code part of the executable that contain a segment address, either in the form of a pure segment address or as part of a far jump, far pointer or a far function call. These segment addresses are stored in the file as relative values (relative to the beginning of the machine code) and need to be adjusted (&amp;quot;relocated&amp;quot;) to the absolute memory position into which the executable is loaded.&lt;br /&gt;
&lt;br /&gt;
Each entry in the relocation table consists of two [[UINT16LE]] values. The first value is an offset and the second one is a paragraph address. The full address can be calculated from this as &amp;lt;tt&amp;gt;offset + paragraph * 16&amp;lt;/tt&amp;gt;. This address itself is relative to the beginning of the machine code, so adding &amp;lt;tt&amp;gt;pgHeader * 16&amp;lt;/tt&amp;gt; to it would give the absolute position inside the .EXE file where the segment address that needs to be adjusted is stored. The relocation modifies that byte as well as the one following after it.&lt;br /&gt;
&lt;br /&gt;
When modifying the code inside an exectuable file, it is vital to keep track of the bytes that need relocation, as the relocation process will modify those bytes and potentially break whatever code was inserted at that point. While it is possible to work around that limitation, the better alternative is to just add or remove relocation table entries as required.&lt;br /&gt;
&lt;br /&gt;
It does not seem to matter how the full address is split into the offset and paragraph parts for the relocation table entries, as long as the offset is never set to 0xFFFF and &amp;lt;tt&amp;gt;offset + paragraph * 16&amp;lt;/tt&amp;gt; matches the intended address. Setting the paragraph address to &amp;lt;tt&amp;gt;address / 16&amp;lt;/tt&amp;gt; and the offset to &amp;lt;tt&amp;gt;address % 16&amp;lt;/tt&amp;gt; should work fine for any address.&lt;br /&gt;
&lt;br /&gt;
=== Machine code ===&lt;br /&gt;
&lt;br /&gt;
The actual machine code that runs begins at the end of the .exe header (file offset &amp;lt;tt&amp;gt;pgHeader * 16&amp;lt;/tt&amp;gt;) and continues until the last (possibly partial) block has been read.  This can be calculated like so:&lt;br /&gt;
&lt;br /&gt;
    lenCode = numBlocks * 512&lt;br /&gt;
    if (lenFinal != 0) {&lt;br /&gt;
        // Last block is not 512 but less than this, so adjust it.&lt;br /&gt;
        lenCode = lenCode - 512&lt;br /&gt;
        lenCode = lenCode + lenFinal&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
After this point it is possible for more data to be stored in the .exe, but it will not be loaded into memory by DOS and is essentially ignored.  Some games use this to store extra game data in their main .exe, opening their own .exe file at runtime to read out the extra data.  These can often be spotted by the fact that the .exe file is much larger than one that will typically fit into memory.&lt;br /&gt;
&lt;br /&gt;
To calculate the offset of this extra data, find the beginning of the code (&amp;lt;tt&amp;gt;pgHeader * 16&amp;lt;/tt&amp;gt;) and add the size of the code (&amp;lt;tt&amp;gt;lenCode&amp;lt;/tt&amp;gt; above).  This will be the offset of the trailing data, or if there is none, it will match the size of the .exe file itself.&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
A few schemes exist to compress .exe files while still leaving them executable.  These work by compressing the original code and inserting a small decompression routine at the start of the data.  When DOS loads the .exe into memory, it ends up running the decompression routine instead of the original code.  This routine expands the compressed data and then passes control to it so the program appears to work as normal.  The trick with this process is figuring out how to decompress the data while using as little extra memory as possible, as most .exe files take up large amounts of memory and there is typically not enough memory to store both the compressed and decompressed code at the same time.  So the decompressor must carefully expand the data such that it overwrites only the compressed data that has already been decompressed and is no longer needed.&lt;br /&gt;
&lt;br /&gt;
Typically the .exe file headers are set up such that DOS will load both the decompression routine and the compressed code into memory at the same time, so the decompressor does not have to worry about opening and reading files.&lt;br /&gt;
&lt;br /&gt;
The individual compression schemes are documented on their own pages, but they refer back to the .exe headers described here.  There are many more schemes than listed here as this list only includes those used by games documented on this wiki.&lt;br /&gt;
&lt;br /&gt;
* [[LZEXE]]&lt;br /&gt;
* [[PKLite]]&lt;br /&gt;
&lt;br /&gt;
== Successors ==&lt;br /&gt;
&lt;br /&gt;
The .exe format has been extended to add functionality and to work on other platforms:&lt;br /&gt;
&lt;br /&gt;
* [[New Executable (NE) Format]] was introduced with 16-bit Windows.&lt;br /&gt;
* [[Linear Executable (LX/LE) Format]] adds 32-bit support and was used by many DOS games from the late 1990s running in protected mode (DOS4GW).&lt;br /&gt;
* [[Portable Executable (PE) Format]] was introduced with 32-bit Windows.&lt;br /&gt;
&lt;br /&gt;
Most of these extensions are backwards compatible in that a small &amp;quot;MZ&amp;quot; stub is included that prints an error if the file is run on a platform that does not support the extensions.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=exe}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = MS-DOS debug.exe&lt;br /&gt;
| Platform = MS-DOS&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| editHidden = Yes&lt;br /&gt;
| notes = Loads into correct offsets, disassemble with &amp;quot;u&amp;quot; command.&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[LZEXE]]&lt;br /&gt;
| Platform = MS-DOS&lt;br /&gt;
| canView = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = Yes, LZEXE&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[PKLite]]&lt;br /&gt;
| Platform = MS-DOS&lt;br /&gt;
| canView = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = Yes, PKLite&lt;br /&gt;
| canDecompress = Yes, PKLite&lt;br /&gt;
| editHidden = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[LZEXE|UNLZEXE]]&lt;br /&gt;
| Platform = MS-DOS&lt;br /&gt;
| canView = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| canDecompress = Yes, LZEXE&lt;br /&gt;
| editHidden = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [https://github.com/devbrain/mz-explode/ mz-explode]&lt;br /&gt;
| Platform = Portable&lt;br /&gt;
| canView = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| canDecompress = Yes, [[LZEXE|LZEXE]], [[PKLite|PKLite]], [[Knowledge Dynamics LZW COMPRESSOR|KNOWLEDGE DYNAMICS]], [[Microsoft EXEPACK|EXEPACK]]&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| notes = C++ library&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
The .exe structure was taken from the [http://www.delorie.com/djgpp/doc/exe/ DJGPP documentation].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Monster_Bash_Sprite_Format&amp;diff=9503</id>
		<title>Monster Bash Sprite Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Monster_Bash_Sprite_Format&amp;diff=9503"/>
		<updated>2021-03-13T00:03:29Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* File format */ shifted sprites have an odd quirk&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | ImageNativeWidth = Y&lt;br /&gt;
 | Hardware1 = EGA&lt;br /&gt;
 | MaxTiles = Unlimited&lt;br /&gt;
 | Palette = Shared&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 0&lt;br /&gt;
 | TileMaxSize = 255&amp;amp;times;255&lt;br /&gt;
 | NumPlanes = 5&lt;br /&gt;
 | PlaneArrangement = Variable&lt;br /&gt;
 | HasTransparency = Yes&lt;br /&gt;
 | HasHitmap = Yes, as a rectangle&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Monster Bash}}&lt;br /&gt;
   {{Game|Scubaventure}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
A Monster Bash sprite contains multiple 16-colour EGA images (for example, an enemy sprite contains all the animation frames for that sprite.)  This format is trickier than most, as it contains an arbitrary number of colour planes - the EGA contains four colour planes (red, green, blue and intensity) but each plane in the Monster Bash sprite can refer to multiple EGA planes &#039;&#039;at the same time&#039;&#039; (so you could have a &amp;quot;magenta plane&amp;quot; in the file, which puts data into the EGA red and blue planes at the same time!)&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
=== Signature ===&lt;br /&gt;
&lt;br /&gt;
All sprite files begin with a single 0xFF byte. The games never checks this value and just skips past it.  To correctly detect this file format, the following tests can be used:&lt;br /&gt;
&lt;br /&gt;
* The last image block should end at the end of the file, there should be no trailing data (except a possible trailing 0x00 depending on the decompressor used)&lt;br /&gt;
* The last byte in each image block should be 0x00 to signal the final plane of image data&lt;br /&gt;
&lt;br /&gt;
=== Image list ===&lt;br /&gt;
&lt;br /&gt;
A number of image blocks immediately follow the signature byte, repeating until EOF:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iSize||Size of this sprite&lt;br /&gt;
|-&lt;br /&gt;
|BYTE cData[iSize]||Block of image data, iSize bytes long&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Image format ===&lt;br /&gt;
&lt;br /&gt;
Each of the blocks of image data in the above structure contains an image header, followed by multiple planes of data.  The header looks like this:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iFlags||Flags/shifts&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iHeight||Height of the image in pixels&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iWidth||Width of the image in pixels&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iReserved||Must always be set to zero (The game occasionally treats iWidth as a [[UINT16LE]])&lt;br /&gt;
|-&lt;br /&gt;
|INT16LE iHotspotX||Image is offset by this many pixels (see below)&lt;br /&gt;
|-&lt;br /&gt;
|INT16LE iHotspotY||Image is offset by this many pixels&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iRectX||Right-coordinate of collision rectangle (object position is left-coordinate)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iRectY||Bottom-coordinate of collision rectangle (object position is top-coordinate)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The upper four bits of &amp;lt;tt&amp;gt;iFlags&amp;lt;/tt&amp;gt; can be one or more of these values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Unused/unknown&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Set if the sprite is wider than 64 pixels (tells engine to use fallback drawing routine)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Unused/unknown&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Unused/unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The lower four bits of &amp;lt;tt&amp;gt;iFlags&amp;lt;/tt&amp;gt; specify the number of shifts a sprite has.  These make drawing graphics faster on non-byte boundaries.  Most sprites have a value of 1 here (no shifts, just the original image) which makes the game perform any shift at drawing time.  Sprites that need to be drawn frequently (such as projectiles) typically have a higher value here (2, 4 or 8.)  This causes the game to generate this many shifts when loading the sprite, to speed up drawing at the expense of taking up more memory.  The &amp;quot;rock&amp;quot; sprite is one of the few that have frames with a shift value other than 1.&lt;br /&gt;
&lt;br /&gt;
If a sprite has a shift count greater than 1, the game expects the &amp;lt;tt&amp;gt;iPlaneBits&amp;lt;/tt&amp;gt; value of the first image block to be the same as the width (in bytes) of the image. The game uses this value to calculate &amp;lt;tt&amp;gt;iPlaneSize&amp;lt;/tt&amp;gt; as &amp;lt;tt&amp;gt;iWidth * iPlaneBits&amp;lt;/tt&amp;gt;. This value is then used to calculate total number of image planes for the current sprite, so that the code knows how big the buffer for the shifted copies must be. This quirk means that the color planes for shifted sprites cannot be chosen as freely as those for non-shifted sprites, possibly increasing the size of the sprite data by another plane.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;object position&amp;quot; as tracked by the game is the top-left corner of the collision rectangle.  &amp;lt;tt&amp;gt;iRectX&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;iRectY&amp;lt;/tt&amp;gt; indicate the bottom-right corner of the collision rectangle.  &amp;lt;tt&amp;gt;iHotspotX&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;iHotspotY&amp;lt;/tt&amp;gt; indicate how far up and to the left the image should be shifted.  These (usually negative) values should be added to the object location to draw the sprite frame at the correct location.  For instance if &amp;lt;tt&amp;gt;iHotspotX&amp;lt;/tt&amp;gt; is -5, then the image is shifted left by five pixels, so the object location is at x=5 (five pixels into the image).  Tweaking these variables allows the collision rectangle to be set arbitrarily, with the only restriction being that the object location tracked by the game will always be part of the collision rectangle.&lt;br /&gt;
&lt;br /&gt;
After this header, a number of data planes follow one after the other.  Each plane of data can contain the image data for &#039;&#039;&#039;multiple&#039;&#039;&#039; EGA planes.  For example, if EGA plane 1 is blue and EGA plane 2 is green, then a single Monster Bash plane can have a bit flag for 3, which means the data is for EGA plane 1 &#039;&#039;&#039;and&#039;&#039;&#039; 2 (&amp;lt;code&amp;gt;1 | 2 == 3&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The very first plane in the image is always transparency, and the &amp;lt;tt&amp;gt;iPlaneBits&amp;lt;/tt&amp;gt; has special meaning here - it is set to the width of the image, in bytes.  This can be calculated with the formula &amp;lt;tt&amp;gt;width_bytes = (width_pixels + 7) / 8&amp;lt;/tt&amp;gt;.  Each plane is of the following structure:&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 || iPlaneBits || Which colours this plane holds (or image width in bytes, for transparency plane)&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[iPlaneSize] || cPlaneData || Plane data, one bit-per-pixel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;iPlaneSize&amp;lt;/tt&amp;gt; is the size of the data in the plane.  In order to calculate this, you must take the width of the image (in pixels, obtained from the frame&#039;s header above) and round this up to the nearest byte boundary.  For example, if the image is eight pixels wide, it will take up eight bits which fits in one byte.  If the image is nine pixels wide, this will take up nine bits, so two bytes are required to hold each scanline of data.  The plane size is then the number of bytes in a scanline multiplied by the image height.  You can use a formula like one of the following to calculate the various values, where &amp;lt;i&amp;gt;width&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;height&amp;lt;/i&amp;gt; are the image dimensions in pixels:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;i&amp;gt;bits per scanline&amp;lt;/i&amp;gt; = &amp;lt;i&amp;gt;width&amp;lt;/i&amp;gt; + (8 - (&amp;lt;i&amp;gt;width&amp;lt;/i&amp;gt; % 8))&lt;br /&gt;
 &amp;lt;i&amp;gt;bytes per scanline&amp;lt;/i&amp;gt; = (&amp;lt;i&amp;gt;width&amp;lt;/i&amp;gt; + 7) / 8&lt;br /&gt;
 &amp;lt;i&amp;gt;bytes per plane&amp;lt;/i&amp;gt; = &amp;lt;i&amp;gt;bytes per scanline&amp;lt;/i&amp;gt; * &amp;lt;i&amp;gt;height&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An image that&#039;s 56x99 pixels, should have a plane size of 693 bytes (7 bytes per scanline.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;iPlaneBits&amp;lt;/tt&amp;gt; indicates which EGA planes the data applies to.  If this value is zero the end of the data has been reached.  If for example the value is 0x06, this means the plane should be drawn on EGA plane 0x02 and EGA plane 0x04.&lt;br /&gt;
&lt;br /&gt;
This means a given EGA plane (say red, or green) can be updated by multiple image planes.  To handle this, each plane&#039;s data should be applied using an XOR operation, so that a one-bit in the incoming plane will flip the bit for that colour in the image (so it may get flipped on in one plane, but flipped off again when the next plane is read in.)&lt;br /&gt;
&lt;br /&gt;
Once the image plane identified by 0x00 has been reached, the rendering of the image is complete.  There is no data following &amp;lt;tt&amp;gt;iPlaneBits&amp;lt;/tt&amp;gt; in this case.&lt;br /&gt;
&lt;br /&gt;
Note that it is possible to set a colour for a transparent pixel.  If this is done (i.e. a transparent pixel is not set to black in the other planes) the value will be combined (via XOR) with whatever is behind it.  To get proper transparency, those pixels that are transparent should always be set to black.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* The number of image planes is not stored in the file.  The only known way of precalculating this is by working it out from the size of the image.  The alternative of simply reading in image planes until one for bit 0 is reached is also undesirable, as a corrupt image could result in the program reading far too much data out of the file.  Even a rough calculation of the number of image planes will act as a safeguard against this.&lt;br /&gt;
&lt;br /&gt;
* If an image is not a multiple of eight pixels across, the last byte on each row will contain unused pixels.  These pixels must be set to black and marked as transparent, otherwise the game will draw them but fail to erase them as they are past the edge of the image.  This will leave a trail of visual artefacts as the sprite moves around.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=image}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = Yes&lt;br /&gt;
| canImport = Yes&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows GUI&lt;br /&gt;
| canView = Yes&lt;br /&gt;
| canExport = Yes&lt;br /&gt;
| canImport = No&lt;br /&gt;
| editMetadata = N/A&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]].  Key parts (shifts, flags, transparency planebits special case) were reverse engineered by [[User:Lemm|Lemm]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Monster_Bash_Level_Format&amp;diff=9502</id>
		<title>Monster Bash Level Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Monster_Bash_Level_Format&amp;diff=9502"/>
		<updated>2021-03-12T23:23:43Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Background layer */ The first two bytes are actually two UINT8 values (width and height in tiles)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Tile size = 16&amp;amp;times;16&lt;br /&gt;
 | Viewport = 320&amp;amp;times;200&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Monster Bash}}&lt;br /&gt;
   {{Game|Scubaventure}}&lt;br /&gt;
}}&lt;br /&gt;
[[Monster Bash]] stores its levels across a number of different files inside &amp;lt;tt&amp;gt;[[DAT Format (Monster Bash)|BASHx.DAT]]&amp;lt;/tt&amp;gt;.  Annoyingly, many of the files have the same filename and only differ in the &#039;filetype code&#039; also stored in the .DAT file.&lt;br /&gt;
&lt;br /&gt;
== Map description file ==&lt;br /&gt;
&lt;br /&gt;
Each map contains a file (of .DAT filetype code #0) which contains the filenames of the other associated files for the level.  The file contains a number of fixed-length strings of 31 bytes each, corresponding to a filename in the main .DAT file.  Note that the DAT file will have multiple files matching the names used here, so the DAT filetype codes (or fake filename extensions) are used to differentiate between particular files.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description !! DAT filetype code/extension&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] bgtiles[31] || Filename of the background tileset || 3 (.tbg)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] fgtiles[31] || Filename of the foreground tileset || 4 (.tfg)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] bonustiles[31] || Filename of the bonus tileset || 5 (.tbn)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] sprites[31] || Name of the sprite list || 6 (.sgl)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] palette[31] || Filename of the palette file(?) || 14 (.pal)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] sounds[31] || Filename of the PC speaker sound effects || 8 (.snd)&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] unknown[31] || Unused slot? (contains &amp;quot;UNNAMED&amp;quot;) || N/A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Tilesets ==&lt;br /&gt;
&lt;br /&gt;
Each map file uses three tilesets - one for the background and two for the foreground (called &#039;&#039;bonus&#039;&#039; and &#039;&#039;fg&#039;&#039; below.)  See [[DAT Format (Monster Bash)]] for details on the file types and image format.  The animation frames for each sprite are stored in separate files (one file per sprite.)&lt;br /&gt;
&lt;br /&gt;
== Background layer ==&lt;br /&gt;
&lt;br /&gt;
The background layer is a list of 16-bit indices into the background tileset.  It is stored in a file of .DAT filetype code #1.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] mapWidth || Width of map, in tiles&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] mapHeight || Height of map, in tiles&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] mapWidthBytes || Width of map, in bytes (divide by two to get width in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] pixelWidth || Width of map, in pixels (divide by 16 to get width in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] pixelHeight || Height of map, in pixels (divide by 16 to get height in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] tiles[mapWidth * mapHeight] || Tile codes, one per tile&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The lower nine bits of each tilecode are indices into the background tileset (so if &amp;lt;code&amp;gt;tilecode &amp;amp; 0x1FF&amp;lt;/code&amp;gt; was 2, the third tile from the background tileset would be drawn at that location.)&lt;br /&gt;
&lt;br /&gt;
The upper seven bits control the tile&#039;s behaviour:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Bit !! Binary (Decimal) !! Mask !! Purpose when bit is 1&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0000001  (1) || 0x0200 || Can&#039;t walk right into tile&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 0000010  (2) || 0x0400 || Can&#039;t walk left into tile&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 0000100  (4) || 0x0800 || Can&#039;t fall down through tile (i.e. ground tiles you stand on)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 0001000  (8) || 0x1000 || Can&#039;t jump up through tile&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 0010000 (16) || 0x2000 || Foreground tile contains an interactive item (point, spear, zombie spawning grave, etc.)&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0100000 (32) || 0x4000 || Slanted tile (direction controlled by foreground tile)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || 1000000 (64) || 0x8000 || Climbable (ladder)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Foreground layer ==&lt;br /&gt;
&lt;br /&gt;
The foreground layer is a list of 8-bit indices into the two masked tilesets.  It is stored in a file of .DAT filetype code #2 (.mfg).&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] mapWidth || Width of map, in tiles&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] tiles[mapWidth * mapHeight] || Tile codes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The height of the layer is the same as for the background layer.  If the background layer is unavailable, it can be approximated by dividing the file&#039;s size by the map width, but as some files have an extra 0x00 byte at the end this method requires a little more effort to work correctly.&lt;br /&gt;
&lt;br /&gt;
Each byte represents an index to the tileset.  Values with the high bit unset (less than 128) are indices into the &#039;&#039;bonus&#039;&#039; tileset, and values with the high bit set (&amp;gt;= 128) are indices into the &#039;&#039;fg&#039;&#039; tileset (so a map code of 129 refers to the second tile in the &#039;&#039;fg&#039;&#039; tileset.)&lt;br /&gt;
&lt;br /&gt;
Foreground tiles are drawn at the very front (obscuring background tiles and sprites), while the bonus tiles are drawn behind sprites, only obscuring the background tiles.&lt;br /&gt;
&lt;br /&gt;
== Sprite layer ==&lt;br /&gt;
&lt;br /&gt;
The sprite layer is a list of sprite filenames and their coordinates.  It is stored in a file of .DAT filetype code #7 (.msp), while the sprites themselves are .DAT filetype code #64 (.spr).&lt;br /&gt;
&lt;br /&gt;
The sprite layer begins with an unknown [[UINT16LE]] value which always seems to be 0xFFFE, followed by the below structure repeated until EOF.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Data type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] len || Length of this structure, including this field&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] unknown || Always 0x00000000&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] unknown || Unused? Changing seems to have no effect&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] unknown || Always 0x0000&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] x || X-offset, in pixels&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] y || Y-offset, in pixels&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] padding[22] || ?&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] filename[len-44] || Sprite filename, with two terminating nulls&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Sprite list (.sgl) ==&lt;br /&gt;
&lt;br /&gt;
When loading a level, the engine needs to preload all sprites that will be used in the level.  Each sprite must be explicitly listed (even if it&#039;s listed in the sprite layer) as well as other associated sprites, such as the knife sprite thrown by the knife-thrower.  The game will misbehave if it attempts to draw a sprite that has not been loaded.&lt;br /&gt;
&lt;br /&gt;
The names of these sprites are listed in the Sprite List (.sgl) file.  This file contains one ASCII filename (no extension) padded with 0x00 to 31 bytes long, one after the other until EOF.&lt;br /&gt;
&lt;br /&gt;
The official files store the sprite names in alphabetical order, however this is not required.&lt;br /&gt;
&lt;br /&gt;
This list will always include some names, like those belonging to the player sprite and the health gauge, however others only need to be included if related sprites exist in the level.  No need to load the zombie head sprites if there are no zombies in the level, for instance (doing so won&#039;t cause any harm, but may use up too much memory preventing the level from loading.)&lt;br /&gt;
&lt;br /&gt;
The following table lists the sprites that should appear in this list, based on the sprites appearing in the sprite layer.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sprite name (.msp) !! Additional required sprites (.sgl)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;(Mandatory)&#039;&#039; || arrows blank border border2 cat chunk dog flag float100? guage heart leaf rock? {{TODO|Maybe only if rock powerup is used?}} score splat white&lt;br /&gt;
|-&lt;br /&gt;
| main_l&amp;lt;br/&amp;gt;main_r || break_screen crack crawl_left crawl_right dirt_l dirt_r main_die main_exit main_hat_l main_hat_r main_l main_meter main_r main_stars&lt;br /&gt;
|-&lt;br /&gt;
| axe || axe&lt;br /&gt;
|-&lt;br /&gt;
| cloud || lightn&lt;br /&gt;
|-&lt;br /&gt;
| cyclops_l&amp;lt;br/&amp;gt;cyclops_r || cyclops_l cyclops_r cyc_horn_l cyc_horn_r {{TODO|Confirm these last two are needed}}&lt;br /&gt;
|-&lt;br /&gt;
| devil_l&amp;lt;br/&amp;gt;devil_r || devil_l devil_r pfork_l pfork_r&lt;br /&gt;
|-&lt;br /&gt;
| guy_jump || guy_jump&lt;br /&gt;
|-&lt;br /&gt;
| hand_l&amp;lt;br/&amp;gt;hand_r || hand_l hand_r&lt;br /&gt;
|-&lt;br /&gt;
| horse || horse&lt;br /&gt;
|-&lt;br /&gt;
| iman_l&amp;lt;br/&amp;gt;iman_r || iman_l iman_r hat&lt;br /&gt;
|-&lt;br /&gt;
| knifee || knifee knife&lt;br /&gt;
|-&lt;br /&gt;
| knifee_ud || knifee_ud knife&lt;br /&gt;
|-&lt;br /&gt;
| mouse || mouse&lt;br /&gt;
|-&lt;br /&gt;
| nemesis || main_broom (plus all main_r dependent sprites)&lt;br /&gt;
|-&lt;br /&gt;
| score1up || score1up&lt;br /&gt;
|-&lt;br /&gt;
| skelet_l&amp;lt;br/&amp;gt;skelet_r || skelet_l sketet_r jaw_l jaw_r&lt;br /&gt;
|-&lt;br /&gt;
| snake || snake&lt;br /&gt;
|-&lt;br /&gt;
| swamp_l&amp;lt;br/&amp;gt;swamp_r&amp;lt;br/&amp;gt;swamp2_l&amp;lt;br/&amp;gt;swamp2_r || swamp_l swamp_r swamp2_l swamp2_r swamp_scum2_l swamp_scum2_r swamp_scum_l swamp_scum_r&lt;br /&gt;
|-&lt;br /&gt;
| teeth_l&amp;lt;br/&amp;gt;teeth_r || teeth_l teeth_r&lt;br /&gt;
|-&lt;br /&gt;
| tman_bl&amp;lt;br/&amp;gt;tman_br || tman_bl tman_br pellet_h&lt;br /&gt;
|-&lt;br /&gt;
| tman_ld&amp;lt;br/&amp;gt;tman_lu || tman_ld tman_lu pellet_h&lt;br /&gt;
|-&lt;br /&gt;
| tman_rd&amp;lt;br/&amp;gt;tman_ru || tman_rd tman_ru pellet_h&lt;br /&gt;
|-&lt;br /&gt;
| tman_tl&amp;lt;br/&amp;gt;tman_tr || tman_tl tman_tr pellet_h&lt;br /&gt;
|-&lt;br /&gt;
| vulture || vulture vulture_l vulture_r&lt;br /&gt;
|-&lt;br /&gt;
| zb_l&amp;lt;br/&amp;gt;zb_r || zb_l zb_r zbh_l zbh_r zhead zhead_r&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following table lists the sprites that should appear, based on tiles appearing in the foreground layer:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Map element !! Additional required sprites (.sgl)&lt;br /&gt;
|-&lt;br /&gt;
| collapsing walkway || plank plank_r&lt;br /&gt;
|-&lt;br /&gt;
| skull (point item) || skullw&lt;br /&gt;
|-&lt;br /&gt;
| dragon || drag_b drag_eye drag_fire drag_l smoke1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_Saved_game_format&amp;diff=9501</id>
		<title>Keen 1-3 Saved game format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Keen_1-3_Saved_game_format&amp;diff=9501"/>
		<updated>2021-03-12T23:16:14Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: some values are signed ints, removed TODO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Playerdata Infobox&lt;br /&gt;
 | Config = Yes&lt;br /&gt;
 | Storing = Score&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Commander Keen 1-3}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Commander Keen 1-3]]&#039;s saved game files are stored in &amp;lt;tt&amp;gt;SAVEDx.CKy&amp;lt;/tt&amp;gt;. The same format and function is used for all 3 episodes of Keen.  The files are 92 bytes long and consist of the following:&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]] || gotBattery || Have battery part? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotVacuum || Have vacuum cleaner part? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotJoystick || Have joystick part? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotPogo || Have pogo stick? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotWhiskey || Have whiskey part? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotKeycardR || Have red keycard? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotKeycardG || Have green keycard? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotKeycardB || Have blue keycard? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || gotKeycardY || Have yellow keycard? 0=no, 1=yes&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]][16] || levelDone || 16 values for each level, 0=incomplete, 1=completed. With the 32 levels patch this becomes 32 1-byte entries.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || numLives || Number of lives Keen has left&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || ammo || Number of shots Keen has left&lt;br /&gt;
|-&lt;br /&gt;
| [[INT32LE]] || score || Player score&lt;br /&gt;
|-&lt;br /&gt;
| [[INT32LE]] || posX || Location on world map, in &amp;quot;global&amp;quot; units (256 units = 1 pixel, 4096 units = 1 tile)&lt;br /&gt;
|-&lt;br /&gt;
| [[INT32LE]] || posY || Location on world map, in &amp;quot;global&amp;quot; units (256 units = 1 pixel, 4096 units = 1 tile)&lt;br /&gt;
|-&lt;br /&gt;
| [[INT32LE]] || viewportX || Location of left of visible screen, in &amp;quot;global&amp;quot; units.  Usually player location minus nine tiles.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT32LE]] || viewportY || Location of top of visible screen, in &amp;quot;global&amp;quot; units.  Usually player location minus three tiles, but variable.&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]][9] || cities || In Keen 2, cities saved. 9 2-byte entries, the last seems not to be a valid city, but is kept in memory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Keycard values are usually set to 0 in saved games, since saving the game is only allowed on the world map and the game takes away all keycards when exiting a level in any way. Because this behavior only changes the keycard values when returning to the world map, loading a saved game that has the keycard values set to 1 will allow the player to enter any level with the keycards still in the inventory.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Keen needs the &#039;pogo got&#039; value in all 3 episodes of Keen, even though he&#039;s never without it and it&#039;s never displayed in episodes 2 or 3.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Levellass|Levellass]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Commander_Keen_4-6&amp;diff=9500</id>
		<title>Commander Keen 4-6</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Commander_Keen_4-6&amp;diff=9500"/>
		<updated>2021-03-12T22:42:00Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Tools */ added all known offsets (copied from GalaxyView). Still missing KEEN5C v1.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Title = Commander Keen 4.png&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = Edit&lt;br /&gt;
 | Story = Edit&lt;br /&gt;
 | Interface = Edit&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;Commander Keen: Goodbye Galaxy&#039;&#039;&#039; is a very popular platform scroller, which set the benchmark for this style of game on a PC.&lt;br /&gt;
&lt;br /&gt;
There is a large amount of modding info in the [[keenwiki:Galaxy Tools|modding section of the KeenWiki]] and there is an extensive [[keenwiki:Category:Patches|patch library]] allowing the game to be extended and changed considerably.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:Abiathar|Abiathar]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = Replace&lt;br /&gt;
| sfx = Edit&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[CKPatch]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&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 = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:IMF Creator|IMF Creator]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = Create&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = Yes&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:Keen: Next (level editor)|Keen: Next]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:Keengraph|Keengraph]]&lt;br /&gt;
| Platform = DOS/Win/Linux&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:KeenWave|KeenWave]]&lt;br /&gt;
| Platform = DOS/Win/Linux&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = Replace&lt;br /&gt;
| sfx = Edit&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = EModKeen/LModKeen&lt;br /&gt;
| Platform = Win/Linux&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:ModKeen|ModKeen]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:The Omegamatic|The Omegamatic]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:The Photachyon Transceiver|The Photachyon Transceiver]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[keenwiki:Startext|Startext]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = No&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = Edit&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[TED5]]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| grp = N/A&lt;br /&gt;
| map = View&lt;br /&gt;
| gfx = View&lt;br /&gt;
| mus = View&lt;br /&gt;
| sfx = View&lt;br /&gt;
| txt = View&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot;/&amp;gt;&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = audio.ck[456]&lt;br /&gt;
 | Format = [[AudioT Format]], [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Sound and music&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = config.ck[456]&lt;br /&gt;
 | Format = [[Keen 4-6 Configuration File]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Settings and high scores&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = egagraph.ck[456]&lt;br /&gt;
 | Format = [[EGAGraph Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Graphics, text and miscellaneous data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = gamemaps.ck[456]&lt;br /&gt;
 | Format = [[GameMaps Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Level maps&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = keen[456]e.exe&lt;br /&gt;
 | Format = [[B800 Text]], [[Keen 4-6 Action Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = There are a couple of text screens in the main .EXE file (including the text displayed on the screen when you quit)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = keen[456]e.exe&lt;br /&gt;
 | Format = [[Keen 4-6 Action Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Sprite behaviours are governed by this&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = keen[456]e.exe&lt;br /&gt;
 | Format = [[Keen 4-6 Tileinfo Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Tile information are governed by this&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
The main executable also contains a number of important blocks of data.  The offsets below apply after removing LZEXE compression.  &amp;quot;xGA&amp;quot; refers to &amp;quot;CGA&amp;quot; or &amp;quot;EGA&amp;quot; depending on the game variant.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!rowspan=2| File !!rowspan=2| Size !!rowspan=2| Version&lt;br /&gt;
!colspan=2| AUDIOHED.CKx&lt;br /&gt;
!colspan=2| AUDIODCT.CKx&lt;br /&gt;
!colspan=2| MAPHEAD.CKx&lt;br /&gt;
!colspan=2| MAPDICT.CKx&lt;br /&gt;
!colspan=2| xGAHEAD.CKx&lt;br /&gt;
!colspan=2| xGADICT.CKx&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Length&lt;br /&gt;
! Offset !! Length&lt;br /&gt;
! Offset !! Length&lt;br /&gt;
! Offset !! Length&lt;br /&gt;
! Offset !! Length&lt;br /&gt;
! Offset !! Length&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| KEEN4C.EXE || 248480 || 1.0&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 131984 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 216486 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 146880 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 132640 || 14232&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 217510 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 248496 || 1.1&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 132000 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 216502 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 146896 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 132656 || 14232&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 217526 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 253056 || 1.4&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 136096 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 221020 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 151008 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 136752 || 14256&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 222044 || 1024&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=7| KEEN4E.EXE || 262240 || Demo&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 136336 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 159744 || 18780&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 229382 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 258064 || 1.0&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 141696 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 224758 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 156592 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 142352 || 14232&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 225782 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 259232 || 1.1&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 142672 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 225922 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 157568 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 143328 || 14232&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 226946 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 259920 || 1.2&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 143264 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 226612 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 158176 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 143920 || 14256&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 227636 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 263488 || 1.4&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 146416 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 230134 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 161328 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 147072 || 14256&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 231158 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 263488 || 1.4f&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 146416 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 230134 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 161328 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 147072 || 14256&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 231158 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 264864 || 1.4g&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 147664 || 652&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 231382 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 162576 || 402 + 23004&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 148320 || 14256&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 232406 || 1024&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| KEEN5C.EXE || ? || 1.0&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| ? || ?&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| ? || ?&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| ? || ?&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| ? || ?&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| ? || ?&lt;br /&gt;
|-&lt;br /&gt;
| 255248 || 1.4&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 138944 || 828&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 222600 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 154576 || 402 + 23688&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 139776 || 14790&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 223624 || 1024&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| KEEN5E.EXE || 262176 || 1.0&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 146032 || 828&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 228234 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 161664 || 402 + 23688&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 146864 || 14796&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 229258 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 266096 || 1.4&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 149632 || 828&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 232132 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 165264 || 402 + 23688&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 150464 || 14796&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 233156 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 267616 || 1.4g&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 151008 || 828&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 233508 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 166640 || 402 + 23688&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 151840 || 14796&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 234532 || 1024&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| KEEN6C.EXE || 256656 || 1.0&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 130848 || 760&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 222626 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 148288 || 402 + 23904&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 131616 || 16665&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 223650 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 261984 || 1.4&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 135728 || 760&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 227888 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 153168 || 402 + 23904&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 136496 || 16665&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 228912 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 261456 || 1.5&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 135072 || 760&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 227232 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 152512 || 402 + 23904&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 135840 || 16665&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 228256 || 1024&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=5| KEEN6E.EXE || 236112 || Demo&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 123872 || 588&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 203328 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 137568 || 402 + 19152&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 124464 || 13098&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 204352 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 238368 || Promo&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 126224 || 588&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 205590 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 139920 || 402 + 19152&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 126816 || 13098&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 206614 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 266032 || 1.0&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 140320 || 760&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 230674 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 157776 || 402 + 23904&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 141088 || 16683&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 231698 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 271696 || 1.4&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 145488 || 760&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 236270 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 162944 || 402 + 23904&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 146256 || 16683&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 237294 || 1024&lt;br /&gt;
|-&lt;br /&gt;
| 270896 || 1.5&lt;br /&gt;
&amp;lt;!-- AUDIOHED --&amp;gt;| 164528 || 760&lt;br /&gt;
&amp;lt;!-- AUDIODCT --&amp;gt;| 235342 || 1024&lt;br /&gt;
&amp;lt;!-- MAPHEAD --&amp;gt;| 181984 || 402 + 23904&lt;br /&gt;
&amp;lt;!-- MAPDICT --&amp;gt;| N/A || N/A&lt;br /&gt;
&amp;lt;!-- xGAHEAD --&amp;gt;| 165296 || 16683&lt;br /&gt;
&amp;lt;!-- xGADICT --&amp;gt;| 236366 || 1024&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the offsets and EXE sizes given here are only valid for files that have been decompressed with UNLZEXE. Decompressing the executables with other utilities like UNP may generate executables with a slightly different header size and therefore the size of the executable will not match the values listed above and the offsets will be invalid for such files.&lt;br /&gt;
&lt;br /&gt;
=== AudioT Format Details ===&lt;br /&gt;
&lt;br /&gt;
Keen 4, 5 and 6 use the compressed version of the [[AudioT Format]] to store music and sound. The main audio file for each game, the AUDIOT.xxx file, is called AUDIO.CKx (for example, AUDIO.CK4 for Keen 4).&lt;br /&gt;
&lt;br /&gt;
The two secondary files needed for this format, the AUDIOHED.CKx and AUDIODCT.CKx, are embedded inside the main .exe file of each game as listed above.&lt;br /&gt;
&lt;br /&gt;
== Related Links ==&lt;br /&gt;
&lt;br /&gt;
* [[Commander Keen 1-3]]&lt;br /&gt;
* [[Commander Keen Dreams]]&lt;br /&gt;
* The [[KeenWiki:Main Page|Commander Keen Wiki]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:id Software]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Talk:Commander_Keen_4-6&amp;diff=9497</id>
		<title>Talk:Commander Keen 4-6</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Talk:Commander_Keen_4-6&amp;diff=9497"/>
		<updated>2021-03-12T02:18:43Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: reply to Szevvy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Can we get the save game format up here?&lt;br /&gt;
[[User:Lemm|Lemm]] 08:09, 21 October 2010 (GMT)&lt;br /&gt;
&lt;br /&gt;
: How would that be done? I know the format of Keen 4-6 roughly, as well as several games related to it (Keen Dreams, Dangerous Dave 3/4, Biomenace, Catacomb 3D...) what would we title the page, would every game have a different format though they&#039;re broadly similar? --[[User:Levellass|Endian? What are you on about?]] 05:17, 9 November 2010 (GMT)&lt;br /&gt;
&lt;br /&gt;
:: Does the Keen engine have a name?  Otherwise you could just call the page [[Keen 4-6 Savegame Format]] and link to it from the other game pages, a bit like how some Xargon and Jill of the Jungle pages link to each other because of shared formats.  At any rate if you have the info it&#039;d be better to document it anywhere here and we can clean it up later! -- [[User:Malvineous|Malvineous]] 23:12, 14 November 2010 (GMT)&lt;br /&gt;
&lt;br /&gt;
So I&#039;ve got offsets for most of the exe data - map, audio, etc - in Wombat, under scripts/games/commander keen 4-6.script.txt. I know mine are correct, because I&#039;ve tested to make sure maps etc work across all the versions I support.  Looking at the exe table, the values filled out (Keen 4 1.4, Keen 5 1.4) are different to mine for the maphead, which makes me reluctant to fill the rest out.  I suspect what&#039;s going on is that Wombat decompresses lzexe compressed exes differently to whatever was used to get the offsets in the table...are the ones in there after putting them through unzlexe, or something else? [[User:Szevvy|Szevvy]] ([[User talk:Szevvy|talk]]) 00:54, 12 March 2021 (GMT)&lt;br /&gt;
&lt;br /&gt;
:: The offsets currently on the page are not absolute file positions, they are relative to the start of the executable &amp;quot;image&amp;quot;. These numbers would be for use with CKPATCH for patching the mapheads directly, for example. To get an absolute file position, you would need to calculate the size of the EXE header and add that size value to the offset. See also [http://keenmodding.org/viewtopic.php?f=31&amp;amp;p=34490#p34490 this thread at keenmodding]. --[[User:K1n9 Duk3|K1n9 Duk3]] ([[User talk:K1n9 Duk3|talk]]) 02:18, 12 March 2021 (GMT)&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&amp;diff=9332</id>
		<title>Cosmo&#039;s Cosmic Adventure</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&amp;diff=9332"/>
		<updated>2021-01-01T00:47:01Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Game Engines */ moved STATUS.MNI to tileset section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Title = Cosmo&#039;s_Cosmic_Adventure.gif&lt;br /&gt;
 | Levels = Edit&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = Edit&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;Cosmo&#039;s Cosmic Adventure&#039;&#039;&#039;, also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a comet collision forces them to land their ship on a dangerous and uncharted planet.&lt;br /&gt;
&lt;br /&gt;
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.&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 = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]&lt;br /&gt;
| Platform = DOS GUI&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]&lt;br /&gt;
| Platform = Windows GUI&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = Edit&lt;br /&gt;
| sfx = Edit&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]&lt;br /&gt;
| Platform = DOS console&lt;br /&gt;
| grp = No&lt;br /&gt;
| map = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]&lt;br /&gt;
| Platform = DOS console&lt;br /&gt;
| grp = Read&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows GUI&lt;br /&gt;
| grp = View&lt;br /&gt;
| map = View&lt;br /&gt;
| gfx = View&lt;br /&gt;
| mus = View&lt;br /&gt;
| sfx = View&lt;br /&gt;
| txt = View&lt;br /&gt;
| sav = No&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== Game Engines ==&lt;br /&gt;
[https://github.com/yuv422/cosmo-engine Cosmo-Engine] - An open source game engine for playing Cosmo&#039;s Cosmic Adventure on modern systems.&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mni (32,000 bytes)&lt;br /&gt;
 | Format = [[Raw EGA data#Planar|Full-screen planar EGA]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 320&amp;amp;times;200 full-screen images (in four planes: blue, green, red, intensity)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mni (4,000 bytes)&lt;br /&gt;
 | Format = [[B800 Text]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Text screens shown at exit&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = actors.mni&amp;lt;br/&amp;gt;bd*.mni&amp;lt;br/&amp;gt;cartoon.mni&amp;lt;br/&amp;gt;masktile.mni&amp;lt;br/&amp;gt;players.mni&amp;lt;br/&amp;gt;status.mni&amp;lt;br/&amp;gt;tiles.mni&lt;br /&gt;
 | Format = [[Cosmo Tileset Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Tilesets with 8&amp;amp;times;8 tiles&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = tileattr.mni&lt;br /&gt;
 | Format = [[Cosmo Tile Attributes]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Tile properties&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = cosmo*.stn&amp;lt;br/&amp;gt;cosmo*.vol&lt;br /&gt;
 | Format = [[VOL Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive file storing the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = a*.mni&lt;br /&gt;
 | Format = [[Cosmo Level Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = m*.mni&amp;lt;br/&amp;gt;(except masktile.mni)&lt;br /&gt;
 | Format = [[IMF Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music - see [[#Notes]] below&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = sounds*.mni&lt;br /&gt;
 | Format = [[Inverse Frequency Sound format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = PC speaker sound effects&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = cosmo*.sv*&lt;br /&gt;
 | Format = [[Cosmo Savegame Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Saved games.  &amp;lt;tt&amp;gt;cosmo?.svt&amp;lt;/tt&amp;gt; is a temporary save written at the start of each level&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *info.mni&lt;br /&gt;
 | Format = [[Cosmo Tileinfo Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = How to lay out the actor tiles into complete frames&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = prevdemo.mni&lt;br /&gt;
 | Format = [[Cosmo Demo Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game demo format&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = cosmo*.cfg&lt;br /&gt;
 | Format = [[Cosmo Config Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game configuration format&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Graphics limitations and glitches:&lt;br /&gt;
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it&#039;s intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. &lt;br /&gt;
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.&lt;br /&gt;
** If an actor (a good example would be Cosmo himself) is behind a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.&lt;br /&gt;
&lt;br /&gt;
*Directory miscellany:&lt;br /&gt;
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present.  Any game files in the current directory will not be read while the VOL/STN files are present.  To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.&lt;br /&gt;
** A directory path (relative to the current directory) can be given on the command line.  Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead.  This is probably to allow running the game directly from read-only media like a CD.&lt;br /&gt;
** The &amp;lt;tt&amp;gt;*.stn&amp;lt;/tt&amp;gt; files appear to be for &amp;quot;standard&amp;quot; data common to all episodes, as the files are identical between all three games.  It is a curiosity that there are three identical STN files, rather than a single &amp;lt;tt&amp;gt;cosmo.stn&amp;lt;/tt&amp;gt; shared amongst all three episodes.&lt;br /&gt;
&lt;br /&gt;
*Game Engine Glitches:&lt;br /&gt;
**In editing levels, if two or more blue moving platforms collide, the tiles that overlap will disappear. Furthermore, if Cosmo stands anywhere on any one of these platforms when they collide, he will literally be deleted from the level, and the game engine will treat him as if he had died or fallen off the bottom of the screen, restarting the level over again.&lt;br /&gt;
**If a player actor is not specified in a level file, a unique event can occur. The level coordinates of the player from the previous level (or any level, if using the warp cheat) carry over, meaning that the player can enter the level in a very different spot than what was intended before, even entering the level trapped inside a wall!&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Tileset_Format&amp;diff=9331</id>
		<title>Cosmo Tileset Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Tileset_Format&amp;diff=9331"/>
		<updated>2021-01-01T00:44:38Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Cosmo&amp;#039;s Cosmic Adventures */ added STATUS.MNI&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | Hardware1 = EGA&lt;br /&gt;
 | MaxTiles = Fixed, varies&lt;br /&gt;
 | Palette = Default EGA&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 8&amp;amp;times;8&lt;br /&gt;
 | TileMaxSize = 8&amp;amp;times;8&lt;br /&gt;
 | NumPlanes = 4-5&lt;br /&gt;
 | PlaneArrangement = [[Raw EGA data#Byte-planar EGA data|Byte-planar]]&lt;br /&gt;
 | HasTransparency = Y&lt;br /&gt;
 | HasHitmap = N&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Cosmo&#039;s Cosmic Adventures}}&lt;br /&gt;
   {{Game|Duke Nukem II}}&lt;br /&gt;
   {{Game|Major Stryker}}&lt;br /&gt;
}}&lt;br /&gt;
The &amp;lt;b&amp;gt;Cosmo Tileset Format&amp;lt;/b&amp;gt; is the graphics format used by [[Cosmo&#039;s Cosmic Adventures]] (and later [[Duke Nukem II]]) for storing a collection of images, used for nearly all graphics in the game, from tiles to sprites to background images.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The format is quite simple, as it contains no header or index information, consisting simply of [[Raw EGA data]]. The file consists of a number of 8x8 tiles divided into EGA planes stored consecutively. These images then may make up larger images such as sprites o backgrounds.  Most files are four plane (16-colour) however the &amp;quot;mask&amp;quot; files are five plane (16-colour + transparency.) The planes are stored in the order: transparency (0=opaque, 1=transparent), blue, green, red, intensity.  This also applies to Duke Nukem II which is actually a 16-colour game, even though the VGA palette changes cleverly disguise it as 256-colour.&lt;br /&gt;
&lt;br /&gt;
This means each tile will take up eight bytes per plane, or 32 bytes for a 4-plane tile and 40 bytes for a 5-plane tile.  This makes it easy to seek to a particular tile&#039;s offset, or to calculate the number of tiles in the file based on its size (assuming the number of planes is known in advance.) However this is complicated by the fact that larger files are broken up into 65535 byte ($FFFF) blocks and that those blocks may be padded with random data.&lt;br /&gt;
&lt;br /&gt;
If the tilesets are being displayed on-screen for a human to look at, most of them have an ideal width which makes all the tiles line up across each row.  This width depends on the tileset and is shown in the table below.  Some tilesets (primarily the ones used for game creatures) will have different widths depending on the creature itself (and these are stored in [[Cosmo Tileinfo Format|separate files]].)&lt;br /&gt;
&lt;br /&gt;
== Known files ==&lt;br /&gt;
&lt;br /&gt;
This is the list of known files in this format, along with the number of planes and the tilecount of each file.&lt;br /&gt;
&lt;br /&gt;
=== Cosmo&#039;s Cosmic Adventures ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Filename!!Planes!!Tiles!!Best Width!!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|actors.mni||5||4797 (file size doesn&#039;t divide evenly!)||N/A||Enemy/creature animations&lt;br /&gt;
|-&lt;br /&gt;
|bd*.mni||4||720||40||Map backdrop images&lt;br /&gt;
|-&lt;br /&gt;
|cartoon.mni||5||1632||N/A||Images for game story&lt;br /&gt;
|-&lt;br /&gt;
|masktile.mni||5||1000||40||Masked/transparent tiles for map foreground layer&lt;br /&gt;
|-&lt;br /&gt;
|players.mni||5||750||N/A||Main game character animations&lt;br /&gt;
|-&lt;br /&gt;
|status.mni||4||228||38||Background graphics for the in-game status bar&lt;br /&gt;
|-&lt;br /&gt;
|tiles.mni||4||2000||40||Solid tiles for map background layer&lt;br /&gt;
|-&lt;br /&gt;
|fonts.mni||5||100||N/A||Masked font tiles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;ACTORS.MNI&amp;lt;/tt&amp;gt; file consists of multiple blocks, each sized up to 65535 bytes. This means that the last 15 bytes of each full block can be ignored as they don&#039;t contain enough data to fill a tile (as said before, a masked tile has a size of 40 bytes) and no entry in &amp;lt;tt&amp;gt;ACTRINFO.MNI&amp;lt;/tt&amp;gt; (see [[Cosmo Tileinfo Format]]) actually reads those bytes. This restriction might also apply to the other files, but none of them is larger than 64280 bytes.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;FONTS.MNI&amp;lt;/tt&amp;gt;, a pixel will be &#039;&#039;solid&#039;&#039; if the mask bit is set, otherwise it will be transparent (just like in Duke 1). In all the other masked files, the pixel will be &#039;&#039;transparent&#039;&#039; if the mask bit is set.&lt;br /&gt;
&lt;br /&gt;
=== Duke Nukem II ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Filename!!Planes!!Tiles!!Best Width!!Purpose&lt;br /&gt;
|-&lt;br /&gt;
|czone*.mni||4/5||100/160||40||Map background/foreground tiles (see [[Duke Nukem II CZone Format]])&lt;br /&gt;
|-&lt;br /&gt;
|drop*.mni||4||720||40||Map backdrop images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;ACTORS.MNI&amp;lt;/tt&amp;gt; also is in this format, but with mixed entry types. Most entries are 5-plane graphics (masked), but there are also some 2-plane graphics (with one plane used as a mask) included, which store the bigger (8&amp;amp;times;16 pixel) font used in the menus.&lt;br /&gt;
&lt;br /&gt;
=== Major Stryker ===&lt;br /&gt;
&lt;br /&gt;
See [[Major Stryker Tileset Format]].  The format is identical except most tiles are 16&amp;amp;times;16 instead, although a couple of tilesets are in Cosmo format.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]], [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/ among others].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers&amp;diff=8841</id>
		<title>Mystic Towers</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers&amp;diff=8841"/>
		<updated>2019-10-13T23:50:49Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: the DOS version doesn&amp;#039;t use the Amiga sprite banks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Mystic Towers]] is an isometric action/puzzle game starring the comical wizard Baron Baldric. Gameplay revolves around destroying all monsters in each tower, as well as the tower&#039;s monster generator, which requires a special bomb spell to blow up.&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 = Some&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 = *.dat&lt;br /&gt;
 | Format = [[DAT Format (Mystic Towers)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing most of the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.fnt&lt;br /&gt;
 | Format = 8&amp;amp;times;8 monochrome font bitmap&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 8&amp;amp;times;8 font&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mod&lt;br /&gt;
 | Format = [[MOD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Protracker Modul (Music)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pcs&lt;br /&gt;
 | Format = [[Mystic Towers PC Speaker Sound Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing PC Speaker Sounds&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pcx&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 320&amp;amp;times;200 full-screen images&amp;lt;br&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Mystic Towers ignores the PCX header, so all PCX images must be 320&amp;amp;times;200 pixels.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.sbk&lt;br /&gt;
 | Format = [[Mystic Towers Sound Bank Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing 8Bit signed PCM Mono Audio Files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.sp&lt;br /&gt;
 | Format = [[Mystic Towers Sprite Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sprites. Palettes are taken from the PCX files.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.spp&lt;br /&gt;
 | Format = [[Mystic Towers Sprite Palettes Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Stores 32 colors for &#039;MAIN2.PCX&#039; index 33 - 64 as 6-bit DAC RGB&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.tab&lt;br /&gt;
 | Format = [[Mystic Towers Highscore Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Stores the highscore table&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = MagicID: &#039;AmBk&#039;&lt;br /&gt;
 | Format = [[Amiga OS Memory Bank]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = ?&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = MagicID: &#039;AmSp&#039;&lt;br /&gt;
 | Format = [[Amiga OS Sprite Bank]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sprites with 5-bit palette (never used in the DOS version)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = MYSTMSG1&lt;br /&gt;
 | Format = Game Messages Format&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = XOR 85 coded file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = DEMO&lt;br /&gt;
 | Format = [[Mystic Towers Demo Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = ?&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers_Sprite_Format&amp;diff=8840</id>
		<title>Mystic Towers Sprite Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers_Sprite_Format&amp;diff=8840"/>
		<updated>2019-10-13T23:34:39Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: fixed typos and removed the NeedMoreInfo tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tileset Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | MaxTiles = 65535&lt;br /&gt;
 | Palette = Shared&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 0&lt;br /&gt;
 | TileMaxSize = 255&amp;amp;times;65535&lt;br /&gt;
 | NumPlanes = 1&lt;br /&gt;
 | HasTransparency = Yes&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Mystic Towers}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
Files in this format begin with a generic bank header also found in other files used by [[Mystic Towers]].&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]] || iNumEntries || Number of chunks (sub-files) in this file&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]][iNumEntries] || iOffsets || Offset of each chunk (from the beginning of the file)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The sprite data found at each offset has the following 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]] || iWidth || Width of the sprite, in pixels&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || iHeight || Height of the sprite, in pixels&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || iUnused || Either 0 or 5. The game ignores this value.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || iOffX || Offset for drawing the sprite; moves the sprite &amp;lt;tt&amp;gt;(iOffX &amp;amp; 0x3FFF)&amp;lt;/tt&amp;gt; pixels to the left.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || iOffY || Offset for drawing the sprite; moves the sprite up by &amp;lt;tt&amp;gt;iOffY&amp;lt;/tt&amp;gt; pixels.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Sprite header is followed directly by the image data. For every row of the image, the following data structure is repeated:&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;
| [[BYTE]] || bSkip || Skip this amount of pixels (move to the right)&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] || bLen || Amount of pixel bytes&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][bLen] || pixels || pixel data (0=transparent)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After parsing one of these data blocks, the draw pointer is moved to the beginning of the next row and the next data block is processed. That means the transparent parts at the left and right side of each row have no pixel data and are to be left untouched (or set to 0 to indicate transparency).&lt;br /&gt;
&lt;br /&gt;
If one of the pixel bytes in the middle of the row is 0, that pixel is also supposed to be transparent and will not be drawn by the game.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Even though the sprite header stores the image width as a [[UINT16LE]], the usage of [[BYTE]] values in the row data means that each row can only have up to 255 visible pixels and that it is impossible to access anything beyond the first 510 pixels.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:K1n9_Duk3|K1n9_Duk3]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers_Sprite_Format&amp;diff=8839</id>
		<title>Mystic Towers Sprite Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers_Sprite_Format&amp;diff=8839"/>
		<updated>2019-10-13T23:21:00Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: basic format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Tileset Infobox&lt;br /&gt;
 | Hardware1 = VGA&lt;br /&gt;
 | MaxTiles = 65535&lt;br /&gt;
 | Palette = Shared&lt;br /&gt;
 | Names = N&lt;br /&gt;
 | TileMinSize = 0&lt;br /&gt;
 | TileMaxSize = 255&amp;amp;times;65535&lt;br /&gt;
 | NumPlanes = 1&lt;br /&gt;
 | HasTransparency = Yes&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subtilesets = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Mystic Towers}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
Files in this format begin with a generic bank header also found in other files used by [[Mystic Towers]].&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]] || iNumEntries || Number of chunks (sub-files) in this file&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]][iNumEntries] || iOffsets || Offset of each chunk (from the beginning of the file)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The sprite data found at each offset has the following 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]] || iWidth || Width of the sprite, in pixels&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || iHeight || Height of the sprite, in pixels&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] || iUnused || Either 0 or 5. The game ignores this value.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || iOffX || Offset for drawing the sprite; moves the srite &amp;lt;tt&amp;gt;(iOffX &amp;amp; 0x3FFF)&amp;lt;/tt&amp;gt; pixels to the left.&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || iOffY || Offset for drawing the sprite; moves the sprite up by &amp;lt;tt&amp;gt;iOffY&amp;lt;/tt&amp;gt; pixels.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Sprite header is followed directly by the image data. For every row of the image, the following data structure is reapeated:&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;
| [[BYTE]] || bSkip || Skip this amount of pixels (move to the right)&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] || bLen || Amount of pixel bytes&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][bLen] || pixels || pixel data (0=transparent)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After parsing one of these data blocks, the draw pointer is moved to the beginning of the next row and the next data block is processed. That means the transparent parts at the left and right side of each row have no pixel data and are to be left untouched (or set to 0 to indicate transparency, see below).&lt;br /&gt;
&lt;br /&gt;
If one of the pixel bytes in the middle of the row is 0, that pixel is also supposed to be transparent and will not be drawn by the game.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Even though the sprite header stores the image width as a [[UINT16LE]], the usage of [[BYTE]] values in the row data means that each row can only have up to 255 visible pixels and that it is impossible to access anything beyond the first 510 pixels.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:K1n9_Duk3|K1n9_Duk3]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers_PC_Speaker_Sound_Format&amp;diff=8838</id>
		<title>Mystic Towers PC Speaker Sound Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers_PC_Speaker_Sound_Format&amp;diff=8838"/>
		<updated>2019-10-13T22:39:02Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: basic format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Sound Infobox&lt;br /&gt;
 | Type = PC Speaker&lt;br /&gt;
 | Count = 0-65535&lt;br /&gt;
 | Rate = 50 Hz&lt;br /&gt;
 | NumChannels = 1&lt;br /&gt;
 | BitsPerSample = 16&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Tags = None&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Mystic Towers}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
Files in this format begin with a generic bank header also found in other files used by [[Mystic Towers]].&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]] || iNumEntries || Number of chunks (sub-files) in this file&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]][iNumEntries] || iOffsets || Offset of each chunk (from the beginning of the file)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each sound itself is just an array of 32 [[UINT16LE]] values, so each sound has a size of 64 bytes. Each value in the array is shifted two bits to the right to convert it into a sound frequency in Hertz that is to be generated by the PC speaker.&lt;br /&gt;
&lt;br /&gt;
If the resulting frequency value is 10,000 Hz or higher, no sound will be played. Otherwise the frequency value is passed as an argument to Turbo-Pascal&#039;s Sound() procedure.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:K1n9_Duk3|K1n9_Duk3]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers&amp;diff=8837</id>
		<title>Mystic Towers</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Mystic_Towers&amp;diff=8837"/>
		<updated>2019-10-13T22:01:46Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Tools */ renamed format links and added a few bits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = No&lt;br /&gt;
 | Sprites = No&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = Edit&lt;br /&gt;
 | Text = No&lt;br /&gt;
 | Story = No&lt;br /&gt;
 | Interface = No&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Mystic Towers]] is an isometric action/puzzle game starring the comical wizard Baron Baldric. Gameplay revolves around destroying all monsters in each tower, as well as the tower&#039;s monster generator, which requires a special bomb spell to blow up.&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 = Some&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 = *.dat&lt;br /&gt;
 | Format = [[DAT Format (Mystic Towers)]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing most of the game data&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.fnt&lt;br /&gt;
 | Format = 8&amp;amp;times;8 monochrome font bitmap&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 8&amp;amp;times;8 font&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.mod&lt;br /&gt;
 | Format = [[MOD Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Protracker Modul (Music)&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pcs&lt;br /&gt;
 | Format = [[Mystic Towers PC Speaker Sound Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing PC Speaker Sounds&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pcx&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = 320&amp;amp;times;200 full-screen images&amp;lt;br&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; Mystic Towers ignores the PCX header, so all PCX images must be 320&amp;amp;times;200 pixels.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.sbk&lt;br /&gt;
 | Format = [[Mystic Towers Sound Bank Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing 8Bit signed PCM Mono Audio Files&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.sp&lt;br /&gt;
 | Format = [[Mystic Towers Sprite Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sprites. Palettes are taken from the PCX files.&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.spp&lt;br /&gt;
 | Format = [[Mystic Towers Sprite Palettes Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Stores 32 colors for &#039;MAIN2.PCX&#039; index 33 - 64 as 6-bit DAC RGB&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.tab&lt;br /&gt;
 | Format = [[Mystic Towers Highscore Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Stores the highscore table&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = MagicID: &#039;AmBk&#039;&lt;br /&gt;
 | Format = [[Amiga OS Memory Bank]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = ?&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = MagicID: &#039;AmSp&#039;&lt;br /&gt;
 | Format = [[Amiga OS Sprite Bank]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing sprites with 5-bit palette&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = MYSTMSG1&lt;br /&gt;
 | Format = Game Messages Format&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = XOR 85 coded file&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = DEMO&lt;br /&gt;
 | Format = [[Mystic Towers Demo Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = ?&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=TED5&amp;diff=8819</id>
		<title>TED5</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=TED5&amp;diff=8819"/>
		<updated>2019-08-29T21:28:08Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: updated 3drealms download link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tool Infobox&lt;br /&gt;
 | Image = TED5-Keen4.png&lt;br /&gt;
 | Platform = DOS&lt;br /&gt;
 | Download = [http://legacy.3drealms.com/downloads.html#rott 3drealms.com]&lt;br /&gt;
 | Edit1 = Map&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Commander Keen 4-6}}&lt;br /&gt;
   {{Game|Commander Keen Dreams}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Rise of the Triad}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Tile Editor v5.0 (TED5) is a level editor written by [[:Category:id Software|id Software]] that has been used to create the levels for many of their games. It edits the [[GameMaps Format]] seen in many older id Software games and is also apparently able to edit the [[Commander Keen 1-3 Level format]], though how is not known.&lt;br /&gt;
&lt;br /&gt;
== Files used by TED5 ==&lt;br /&gt;
&lt;br /&gt;
TED5 is compatible with any ID game that has a &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; file. However the actual &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; file is the final product, many other supporting files are required for TED5 to function.&lt;br /&gt;
&lt;br /&gt;
If the game is &#039;compressed&#039;, it will not have most of these files. [[Commander Keen 4-6]] is one such game. In contrast &#039;uncompressed&#039; games such as [[Bio Menace]] will have the full complement of files. Sadly, most games are compressed, as this is most efficient.&lt;br /&gt;
&lt;br /&gt;
=== EGAGRAPH.xxx, EGAHEAD.xxx and EGADCT.xxx ===&lt;br /&gt;
&lt;br /&gt;
These are explained fully under [[EGAGraph Format]]; they are respectively the game graphics, the graphics header and the [[Huffman Compression]] dictionary for decompressing graphics. Compressed games will just have the &amp;lt;tt&amp;gt;EGAGRAPH&amp;lt;/tt&amp;gt;; with the HEAD and DCT files stored internally in the executable. Uncompressed games will have an external &amp;lt;tt&amp;gt;EGAHEAD&amp;lt;/tt&amp;gt; and no need for an &amp;lt;tt&amp;gt;EGADCT&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Like all Huffman dictionaries, the &amp;lt;tt&amp;gt;EGADCT&amp;lt;/tt&amp;gt; file can be located in the executable by looking for the string &amp;lt;tt&amp;gt;$FD $01 $00 $00 $00 $00&amp;lt;/tt&amp;gt; which is found at the file&#039;s end. (The file will be 1024 bytes long.) The &amp;lt;tt&amp;gt;EGAHEAD&amp;lt;/tt&amp;gt; file can be located by looking for a 4 (Or 3) byte string which is the &amp;lt;tt&amp;gt;EGAGRAPH&amp;lt;/tt&amp;gt; file size, this is always the last entry. (If you then proceed to move backwards until you reach a zero value entry, you will have the start of the file.)&lt;br /&gt;
&lt;br /&gt;
You will receive an error if these files are absent. If the DCT is missing then TED5 will assume graphics are uncompressed.&lt;br /&gt;
&amp;lt;!-- TODO: A list of the locations of the head and dct for supported games --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Gamemaps ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; file is not used, but is produced by TED5. It contains the compressed game maps and is produced from the &amp;lt;tt&amp;gt;MAPTEMP&amp;lt;/tt&amp;gt; file when the user selects &#039;Carmackize maps&#039; in TED5. Carmackization is complex and takes a long time to do. Because of this it is recommended that modders use Instant Carma! (See below)&lt;br /&gt;
&lt;br /&gt;
=== GFXINFOE.xxx ===&lt;br /&gt;
&lt;br /&gt;
This is a 46 byte file that contains data allowing TED5 to extract the graphics used in levels.It consists of a number of numbers and locations of various tile types.&lt;br /&gt;
&lt;br /&gt;
Levels can be made of 8x8, 16x16 or 32x32 tiles (Always 16 color EGA.) Levels have a foreground plane, and may also have a background and info (Sprite) plane.The structure of the &amp;lt;tt&amp;gt;GFXINFOE&amp;lt;/tt&amp;gt; file is as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Offset!!Type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||[[UINT16LE]]||Number of 8x8 background tiles&lt;br /&gt;
|-&lt;br /&gt;
|2||[[UINT16LE]]||Number of 8x8 foreground tiles&lt;br /&gt;
|-&lt;br /&gt;
|4||[[UINT16LE]]||Number of 16x16 background tiles&lt;br /&gt;
|-&lt;br /&gt;
|6||[[UINT16LE]]||Number of 16x16 foreground tiles&lt;br /&gt;
|-&lt;br /&gt;
|8||[[UINT16LE]]||Number of 32x32 background tiles&lt;br /&gt;
|-&lt;br /&gt;
|10||[[UINT16LE]]||Number of 32x32 foreground tiles&lt;br /&gt;
|-&lt;br /&gt;
|12||[[UINT16LE]]||8x8 back tile start&lt;br /&gt;
|-&lt;br /&gt;
|14||[[UINT16LE]]||8x8 fore tile start&lt;br /&gt;
|-&lt;br /&gt;
|16||[[UINT16LE]]||16x16 back start&lt;br /&gt;
|-&lt;br /&gt;
|18||[[UINT16LE]]||16x16 fore start&lt;br /&gt;
|-&lt;br /&gt;
|20||[[UINT16LE]]||32x32 back start&lt;br /&gt;
|-&lt;br /&gt;
|22||[[UINT16LE]]||32x32 fore start &lt;br /&gt;
|-&lt;br /&gt;
|24||[[UINT16LE]]||Number of pictures&lt;br /&gt;
|-&lt;br /&gt;
|26||[[UINT16LE]]||Number of masked pictures&lt;br /&gt;
|-&lt;br /&gt;
|28||[[UINT16LE]]||Number of sprites&lt;br /&gt;
|-&lt;br /&gt;
|30||[[UINT16LE]]||Picture start&lt;br /&gt;
|-&lt;br /&gt;
|32||[[UINT16LE]]||Mask picture start&lt;br /&gt;
|-&lt;br /&gt;
|34||[[UINT16LE]]||Sprite start&lt;br /&gt;
|-&lt;br /&gt;
|36||[[UINT16LE]]||&amp;quot;offpicstr&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|38||[[UINT16LE]]||&amp;quot;offpicmstr&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|40||[[UINT16LE]]||&amp;quot;offstrstr&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|42||[[UINT16LE]]||Number of extra EGA resources&lt;br /&gt;
|-&lt;br /&gt;
|44||[[UINT16LE]]||Extra EGA resource start&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The location (Start) given for tiles is the entry in the &amp;lt;tt&amp;gt;EGAHEAD.xxx&amp;lt;/tt&amp;gt; file, most &amp;lt;tt&amp;gt;EGAHEAD.xxx&amp;lt;/tt&amp;gt; files consist of 3 byte entries so the actual location, in bytes, in the file is three times this, though older games (Such as [[Commander Keen Dreams]]) have 4 byte entries. (It is not known if or how TED5 tells the difference between these.) Each tile has its own entry in the header.&lt;br /&gt;
&lt;br /&gt;
The icons used by TED5 (For sprites, etc) are calculated as follows; icons follow directly after background tiles, then foreground tiles. There will thus be some &#039;extra&#039; slots between the back and fore tiles. These are used as the number of icons.&lt;br /&gt;
&lt;br /&gt;
This file is found with uncompressed games, but has to be created for compressed games. It is not currently known if it can be extracted somehow from the executable or if it is hard coded for each game.&lt;br /&gt;
&lt;br /&gt;
=== Maptemp and Mapthead ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;MAPTEMP&amp;lt;/tt&amp;gt; file contains the uncarmackized level maps. Carmackization is a form of compression related to [[Keen 1-3 LZW compression]] in that it employs a sliding window. &amp;lt;tt&amp;gt;MAPTEMP&amp;lt;/tt&amp;gt; is however [[RLE Compression]] compressed to avoid excess size. This is easy for TED5 to edit though. This file is changed each time levels are saved in TED5 and is not used by the game. To make usable levels you must select the item &#039;Carmackize maps&#039; in the file menu, which will produce the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;MAPTHEAD&amp;lt;/tt&amp;gt; is the header for the &amp;lt;tt&amp;gt;MAPTEMP&amp;lt;/tt&amp;gt; file. When maps are carmackized it is used to create the &amp;lt;tt&amp;gt;MAPHEAD&amp;lt;/tt&amp;gt; file. &amp;lt;tt&amp;gt;MAPTHEAD&amp;lt;/tt&amp;gt; contains several variables used by TED5 and some older games. Notably it has information for IDs tileinfo program to work with. Its structure is as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Offset!!Type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||[[UINT16LE]]||Bit field for level planes (+1 unmasked, +2 masked, +4 infoplane)&lt;br /&gt;
|-&lt;br /&gt;
|2||[[UINT16LE]]||Type of tile (8x8 = 1, 16x16 = 2, 32x32 = 3)&lt;br /&gt;
|-&lt;br /&gt;
|4||[[UINT16LE]]|||Number of unmasked tileinfo (TILEINFO) planes in file. Most games 2, speed and offset. Max 10&lt;br /&gt;
|-&lt;br /&gt;
|6||[[UINT16LE]]||Number of unmasked tiles&lt;br /&gt;
|-&lt;br /&gt;
|8||[[UINT32LE]][10]||Pointers to tileinfo planes in &amp;lt;tt&amp;gt;MAPTHEAD&amp;lt;/tt&amp;gt; file&lt;br /&gt;
|-&lt;br /&gt;
|48||[[UINT16LE]][10]||Size of TILFINFO planes data.&lt;br /&gt;
|-&lt;br /&gt;
|68||[[char]][10][8]||TILEINFO plane names&lt;br /&gt;
|-&lt;br /&gt;
|148||[[UINT16LE]]||Number of masked tileinfo (TILEINFOM) planes in file. Usually 7. Max 10&lt;br /&gt;
|-&lt;br /&gt;
|150||[[UINT16LE]]||Number of masked tiles&lt;br /&gt;
|-&lt;br /&gt;
|152||[[UINT16LE]][10]||Pointers to TILEINFOM planes in file&lt;br /&gt;
|-&lt;br /&gt;
|192||[[UINT16LE]][10]||Size of TILFINFOM planes data.&lt;br /&gt;
|-&lt;br /&gt;
|212||[[char]][10][8]||TILFINFOM plane names&lt;br /&gt;
|-&lt;br /&gt;
|292||[[UINT16LE]]||RLEW flag, default $ABCD&lt;br /&gt;
|-&lt;br /&gt;
|294||[[UINT32LE]][100]||Pointers to level headers in &amp;lt;tt&amp;gt;MAPTEMP&amp;lt;/tt&amp;gt;. 100 pointers, null values are -1 ($FFFFFFFF)&lt;br /&gt;
|-&lt;br /&gt;
|694||[[UINT32LE]][100]||Level header sizes &amp;lt;tt&amp;gt;MAPTEMP&amp;lt;/tt&amp;gt;. Older games Huffman Compressed headers and used this. Older games have $26 here, the (uncompressed) header size and don&#039;t use it&lt;br /&gt;
|-&lt;br /&gt;
|1094||[[UINT16LE]]||Number of ICON rows TED5 sets aside from masked tiles to display icons. For most games this is 5&lt;br /&gt;
|-&lt;br /&gt;
|1096||[[char]][x]||Optional TILEINFOM and TILEINFO data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Tedinfo ===&lt;br /&gt;
&lt;br /&gt;
This file is used by TED5 to store various details of the level format. Important here is the number of planes in each level, and the number of icons. Icons (used for sprites) are taken from the foreground tiles. The known values are:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Offset!!Type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0||[[UINT16LE]]||Level TED opens in (last edited)&lt;br /&gt;
|-&lt;br /&gt;
|2||[[UINT16LE]]||Screen view, close (1) or distant (2)&lt;br /&gt;
|-&lt;br /&gt;
|colspan=3|...&lt;br /&gt;
|-&lt;br /&gt;
|8||[[UINT16LE]]||Number of tile planes in levels (usually 2, fore and back)&lt;br /&gt;
|-&lt;br /&gt;
|colspan=3|...&lt;br /&gt;
|-&lt;br /&gt;
|35||[[BYTE]]||Planes editable/visible in TED; +1 view icon, +2 view fore, +4 view back, +16 edit icon, +32 edit fore, +64 edit back&lt;br /&gt;
|-&lt;br /&gt;
|36||[[UINT16LE]]||h loc in level&lt;br /&gt;
|-&lt;br /&gt;
|38||[[UINT16LE]]||v loc in level&lt;br /&gt;
|-&lt;br /&gt;
|colspan=3|...&lt;br /&gt;
|-&lt;br /&gt;
|119||[[char]][64]||Import map path&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Backup files ==&lt;br /&gt;
&lt;br /&gt;
TED5 backs up all its files when levels are saved or carmackized or TED5 is exited. The old files are saved as &amp;lt;tt&amp;gt;*.BAK&amp;lt;/tt&amp;gt; files and a simple renaming will suffice to undo the latest change. Only one backup is made so it is wise to save these files occasionally.&lt;br /&gt;
&lt;br /&gt;
== Setting up TED5 ==&lt;br /&gt;
&lt;br /&gt;
For uncompressed games, such as [[Bio Menace]], all that is required is to copy the file &amp;lt;tt&amp;gt;TED5.EXE&amp;lt;/tt&amp;gt; into the games directory. For compressed games the situation is slightly more complex.&lt;br /&gt;
&lt;br /&gt;
Some games, such as [[Commander Keen 4-6]] have a Ted setup utility to either extract or create the necessary files. If this is the case then a two step process is required. The first involves copying TED5 and the setup utility and running the setup to obtain the required files. The second step involves using a patching utility (Such as [[CKPatch]]) to patch the modified files back into the executable.&lt;br /&gt;
&lt;br /&gt;
Finally, some games, such as [[Catacomb 3-D]], have no utilities at present. While it is not impossible to modify the levels in these games, it takes a bit more work, since the required files must be extracted manually and the executables illegally modified. It has already been mentioned how the graphics files can be located in an executable, but other files will need to be hard coded until somebody automates the procedure.&lt;br /&gt;
&lt;br /&gt;
== Modifying levels ==&lt;br /&gt;
&lt;br /&gt;
If TED5 is setup correctly then it should run (Dosbox may be required for this.) and go to the first level in the game, usually a world map. There are a number of commands and actions that can be used, which will not be covered here. After the desired changes have been made the user must select &#039;Carmackize maps&#039; from the file menu to produce a modified &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MAPHEAD&amp;lt;/tt&amp;gt; file. For compressed games such as Keen this file will then need to be patched into the executable.&lt;br /&gt;
&lt;br /&gt;
A level can be completely replaced with one from another GAMEMAPS file by using the &#039;Import levels&#039; command under the file menu. (You will need to specify a patch to a valid GAMEMAPS file.) This allows a person to copy levels between backups, etc.&lt;br /&gt;
&lt;br /&gt;
The program Instant Carma! skips Carmack compression by doing the very minimal amount of work. It takes a fraction of the time of TED5 and can be used while TED5 is running and is thus very useful. Sadly it is only available for Commander Keen 4-6.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- TODO: Perhaps write in full how to use TED5? Or just a link to the plumbing the depths of keen article? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Other utilities ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;CKPatch:&amp;lt;/b&amp;gt; A set of utilities that allow Keen 4-6 executables to be modified temporarily and legally by patching a copy of the executable into memory and modifying that. This is vital for using new levels in Keen 4-6 There are several versions available, with the latest having the most features. http://www.bipship.com/CKPatch &lt;br /&gt;
* &amp;lt;b&amp;gt;Fixmhead:&amp;lt;/b&amp;gt; This converts the &amp;lt;tt&amp;gt;MAPTHEAD&amp;lt;/tt&amp;gt; file to &amp;lt;tt&amp;gt;MAPHEAD&amp;lt;/tt&amp;gt;. It is not really required for anything, but is included with a lot of TED5 packs.&lt;br /&gt;
* &amp;lt;b&amp;gt;Galaxymk:&amp;lt;/b&amp;gt; This pack contains everything needed to set Commander Keen 4-6 games up for editing with TED5, including the setups and patchers. http://keenmodding.org/search.php?search_author=The_Fosti&amp;amp;sid=92cde18022face91063ec52109b6c2ec&lt;br /&gt;
* &amp;lt;b&amp;gt;Instant Carma!:&amp;lt;/b&amp;gt; by CK Guy externalizes the carmackization of Keen 4-6 maps, saving time and improving efficiency. http://www.keenmodding.org/viewtopic.php?t=997&lt;br /&gt;
* &amp;lt;b&amp;gt;Tedsetup:&amp;lt;/b&amp;gt; A program that sets up certain games to be editable by TED5, automatically extracting or creating required files, Often comes with TED5&lt;br /&gt;
&lt;br /&gt;
== Supported Games ==&lt;br /&gt;
&lt;br /&gt;
See the infobox above for a list of games that have been successfully edited with TED5, although many of those games have dedicated editors that are more user friendly.&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
TED5 has been released as open source freeware. TED5 and its source code can be downloaded from [http://www.3drealms.com/downloads.html#rott 3D Realms]. It can be used to edit the levels of Bio Menace and to create new levels for Rise of the Triad. It is also possible to edit the levels of Commander Keen 4-6, but this is a bit harder to [http://www.keenmodding.org/viewtopic.php?t=899 set up].&lt;br /&gt;
&lt;br /&gt;
[[Category:id Software]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=8818</id>
		<title>GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=GameMaps_Format&amp;diff=8818"/>
		<updated>2019-08-29T21:15:12Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Map data (GAMEMAPS) */ level headers are *NEVER* RLEW-compressed, but they can be Huffman-compressed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Viewport = &#039;&#039;Varies by game&#039;&#039;&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Bio Menace}}&lt;br /&gt;
   {{Game|Blake Stone}}&lt;br /&gt;
   {{Game|Catacomb 3-D}}&lt;br /&gt;
   {{Game|Catacomb Abyss}}&lt;br /&gt;
   {{Game|Commander Keen}}&lt;br /&gt;
   {{Game|Corridor 7 Alien Invasion}}&lt;br /&gt;
   {{Game|Dangerous Dave 3}}&lt;br /&gt;
   {{Game|Dangerous Dave 4}}&lt;br /&gt;
   {{Game|Noah&#039;s Ark 3D}}&lt;br /&gt;
   {{Game|Operation Body Count}}&lt;br /&gt;
   {{Game|Spear of Destiny}}&lt;br /&gt;
   {{Game|Wolfenstein 3-D}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;GameMaps Format&#039;&#039;&#039; stores levels in a number of [[:Category:id Software]] games. The filenames and compression varies somewhat across different games but all files stored in this format were produced by the [[TED5]] level editor.&lt;br /&gt;
&lt;br /&gt;
There are three main varieties of the file format: uncompressed, [[Carmack compression|carmackized]], and [[Huffman Compression|Huffman compressed]]. Each variation has its own file naming scheme and pattern of external/internal files.&lt;br /&gt;
&lt;br /&gt;
There are two main components to the format.  The game maps proper, which contain the actual level data, and the map headers, which contain both the location of each level&#039;s data within the game maps file, and the tile info for the game.&lt;br /&gt;
&lt;br /&gt;
== Structure of uncompressed data ==&lt;br /&gt;
&lt;br /&gt;
The uncompressed format is used by several games including [[Bio Menace]] and [[Wolfenstein 3-D]].  In this format map data is stored in &amp;lt;tt&amp;gt;MAPTEMP.xxx&amp;lt;/tt&amp;gt; and map headers in &amp;lt;tt&amp;gt;MAPTHEAD.xxx&amp;lt;/tt&amp;gt;.  This is the working format saved by [[TED5]] when maps are being edited and can be directly accessed and edited by this utility, allowing changes to be made to the game.&lt;br /&gt;
&lt;br /&gt;
Note that filenames differ and that Wolfenstein 3-D uses &amp;lt;tt&amp;gt;GAMEMAPS.WLx&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;MAPHEAD.WLx&amp;lt;/tt&amp;gt; files to store data (except for v1.0, which uses &amp;lt;tt&amp;gt;MAPTEMP.WLx&amp;lt;/tt&amp;gt; in place of &amp;lt;tt&amp;gt;GAMEMAPS.WLx&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The main indicator of this format being used is that in the unaltered game the map header file is external.&lt;br /&gt;
&lt;br /&gt;
Only the latest Id Software games lacked compression, when file size was no longer an issue.&lt;br /&gt;
&lt;br /&gt;
=== Map headers (MAPHEAD) ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || [[UINT16LE]] || magic || Magic word signalling [[RLEW compression]]&lt;br /&gt;
|-&lt;br /&gt;
| 2 || [[UINT32LE]][400] || ptr || 100 pointers to start of level 0-99 data in the game maps file&lt;br /&gt;
|-&lt;br /&gt;
| 402 || {{TODO|Unknown}} || tileinfo || Tileinfo data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The map header file (MAPHEAD) is of varying length and contains three main types of data. The first is the magic word or flag used for RLEW compression, which is always $ABCD.  The second is 100 level pointers which give the location of the start of level data in the GAMEMAPS file, relative to the start of that file.  A value greater than 0 indicates no level (generally 0, but occasionally -1 (xFFFFFFFF) is used).  The third is the tileinfo data, which contains tile properties for each tile used in level creation. (These are masked and unmasked and either 8x8, 16x16 or 32x32.)&lt;br /&gt;
&lt;br /&gt;
Many programs treat the tileinfo as a separate file from the MAPHEAD and it is possible to modify a game in this manner.  Indeed, some games such as Wolfenstein 3-D do not have any tileinfo data at all in the map header file (giving a total file length of 402 bytes.) However TED5 works with any tileinfo data in the MAPHEAD.&lt;br /&gt;
&lt;br /&gt;
=== Map data (GAMEMAPS) ===&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file consists of the string &amp;quot;TED5v1.0&amp;quot; and a number of RLEW compressed chunks of varying length.  Each level in the file will have from two to four chunks (usually four) depending on the game, with all levels in a given game having the same number of chunks.  These are the level header and 1-3 planes (foreground, background and sprite/info.)  The chunks are in no particular order and it is possible to read through the entire file decompressing chunks as they&#039;re found.&lt;br /&gt;
&lt;br /&gt;
Chunks are ordered by the MAPHEAD file, which will point to the GAMEMAPS level header chunks which in turn contain pointers to the other GAMEMAPS chunks used by that level.&lt;br /&gt;
&lt;br /&gt;
All level data is in the form of [[UINT16LE]] values (or in the case of pointers, [[UINT32LE]].)&lt;br /&gt;
&lt;br /&gt;
==== Level headers ====&lt;br /&gt;
&lt;br /&gt;
The header for each level inside the GAMEMAPS file (which is pointed to by MAPHEAD) is 38 bytes long and &#039;&#039;never&#039;&#039; RLEW compressed.  If the GAMEMAPS file is using Huffman compression, the level header itself is Huffman-compressed.  In that case, the size of the compressed level header can be found in the MAPHEAD file.  Since the uncompressed level header always has a size of 38 bytes, that size is not stored at the beginning of the compressed data.  The header is sometimes followed by a signature &amp;quot;!ID!&amp;quot; string, which would give the header a total size of 42 bytes, but that string is not part of the actual level header.&lt;br /&gt;
&lt;br /&gt;
For the offsets to level planes, a value of 0 indicates the plane does not exist.&lt;br /&gt;
&lt;br /&gt;
Plane 0 is background using unmasked tiles, plane 1 is foreground and uses masked tiles, and plane 2 is sprite/info.  Levels must contain a background plane and usually an infoplane.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset !! Type !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || UINT32LE || offPlane0 || Offset in GAMEMAPS to beginning of compressed plane 0 data (or 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || UINT32LE || offPlane1 || Offset in GAMEMAPS to beginning of compressed plane 1 data (or 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 8 || UINT32LE || offPlane2 || Offset in GAMEMAPS to beginning of compressed plane 2 data (or 0 if plane is not present)&lt;br /&gt;
|-&lt;br /&gt;
| 12 || UINT16LE || lenPlane0 || Length of compressed plane 0 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 14 || UINT16LE || lenPlane1 || Length of compressed plane 1 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || UINT16LE || lenPlane2 || Length of compressed plane 2 data (in bytes)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || UINT16LE || width || Width of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || UINT16LE || height || Height of level (in tiles)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || char[16] || name || Internal name for level (used only by editor, not displayed in-game. null-terminated)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D, a 4-byte signature string (&amp;quot;!ID!&amp;quot;) will normally be present directly after the level name. The signature does not appear to be used anywhere, but is useful for distinguishing between v1.0 files (the signature string is missing), and files for v1.1 and later (includes the signature string).&lt;br /&gt;
&lt;br /&gt;
== Carmack compression ==&lt;br /&gt;
&lt;br /&gt;
[[Carmack compression]] is the method used to compress later &#039;&#039;id Software&#039;&#039; games, when file size was still a concern.  It is the most efficient and complex compression method and was created specifically to work with the 16-bit word structure of the GameMaps file.  The compression is detailed on its [[Carmack compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Carmackized game maps files are external &amp;lt;tt&amp;gt;GAMEMAPS.xxx&amp;lt;/tt&amp;gt; files and the map header is stored internally in the executable.  The map header must be extracted and the game maps decompressed before TED5 can access them.  TED5 itself can produce carmackized files and external &amp;lt;tt&amp;gt;MAPHEAD.xxx&amp;lt;/tt&amp;gt; files. Carmackization does not replace the RLEW compression used in uncompressed data, but compresses this data, that is, the data is doubly compressed.&lt;br /&gt;
&lt;br /&gt;
Note that for Wolfenstein 3D v1.0, map files are not carmackized, only RLEW compression is applied.&lt;br /&gt;
&lt;br /&gt;
== Huffman compression ==&lt;br /&gt;
&lt;br /&gt;
[[Huffman Compression]] was probably used by earlier versions of TED5 (but possibly not TED5 at all) before carmackization was introduced.  It uses the same method to compress its data as is used by &#039;&#039;id Software&#039;&#039; games to compress their graphics and sounds.  Again this compression method works with RLEW compressed data and has its [[Huffman Compression|own page.]]&lt;br /&gt;
&lt;br /&gt;
Huffman compression is easily detected since it works on the bit level and thus disrupts the word structure of the game data.  This is easily seen in a hex editor.  Compressed data will not contain the string $00 $00 or indeed even $00 very often. (In contrast, even carmackized data contains both strings hundreds of times.)&lt;br /&gt;
&lt;br /&gt;
There will be two internal files for this format: the map header and the Huffman dictionary (which is always the first dictionary in the executable.)  The map header format is also slightly different, being 502 bytes long, the extra 100 bytes being the length of the compressed level headers in the game maps data, which occur immediately after the normal level header offsets and before the tileinfo. Each entry is one octet indicating the decompressed header length in bytes or zero if the level does not exist. (These can be ignored when decompressing since Huffman data can be read until the decompressed level header&#039;s fixed size is reached, but if they are omitted when writing the MAPHEAD, the game may experience a buffer overflow when reading the maps.)&lt;br /&gt;
&lt;br /&gt;
== Location of internal files ==&lt;br /&gt;
&lt;br /&gt;
The GAMEMAPS file itself is always external, but in the case of compression, the MAPHEAD is stored internally in the main .exe file.  Executables are themselves compressed with either with LZEXE or PKLite.  Once the .exe has been decompressed it is a trivial task to find the MAPHEAD as it will start with the UINT16LE value $ABCD (i.e. the byte $CD followed by the byte $AB.)  For level editing purposes only the first 402 (or 502) bytes of the file need to be extracted, though it is possible to read the MAPHEAD file to calculate its length.&lt;br /&gt;
&lt;br /&gt;
The following table lists the offsets of the MAPHEAD file for various games, relative to the start of the decompressed game .exe file.&lt;br /&gt;
&lt;br /&gt;
{{TODO|TODO: Add all known versions of all games}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Game !! Version !! Location !! Filename !! Offset !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bio Menace]] || Freeware || External || &amp;lt;tt&amp;gt;MAPHEAD.BM[123]&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]]: Aliens of Gold || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.BS1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Blake Stone]] 2: Planet Strike || All || External || &amp;lt;tt&amp;gt;MAPHEAD.VSI&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb 3-D]] (3) || 1.00 || Internal || &amp;lt;tt&amp;gt;CAT3D.EXE&amp;lt;/tt&amp;gt; || $1C570 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Abyss]] (4) || 1.13 || Internal || &amp;lt;tt&amp;gt;CATABYSS.EXE&amp;lt;/tt&amp;gt; || $1C510 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Armageddon]] (5) || 1.01a || Internal || &amp;lt;tt&amp;gt;CATARMA.EXE&amp;lt;/tt&amp;gt; || $1D900 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Catacomb Apocalypse]] (6) || 1.00b || Internal || &amp;lt;tt&amp;gt;CATAPOC.EXE&amp;lt;/tt&amp;gt; || $1DD50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=3| [[Corridor 7 Alien Invasion]] || Demo || External || &amp;lt;tt&amp;gt;MAPHEAD.DMO&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|| CD || Internal || &amp;lt;tt&amp;gt;CORR7CD.EXE&amp;lt;/tt&amp;gt; || $30D50 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
| Floppy || Internal || &amp;lt;tt&amp;gt;C7.EXE&amp;lt;/tt&amp;gt; || $24BF0 || File is not compressed&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Commander Keen 4-6|Keen 4]] || Special Demo || ? || ? || ? || File is PKLite compressed&lt;br /&gt;
|-&lt;br /&gt;
| 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN4E.EXE&amp;lt;/tt&amp;gt; || $24830 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 5]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN5E.EXE&amp;lt;/tt&amp;gt; || $25990 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen 4-6|Keen 6]] || 1.4 EGA || Internal || &amp;lt;tt&amp;gt;KEEN6.EXE&amp;lt;/tt&amp;gt; || $25080 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Commander Keen Dreams]] || 1.13 || Internal || ? || $1FA50 || After UNLZEXE&lt;br /&gt;
|-&lt;br /&gt;
| [[Noah&#039;s Ark 3D]] || All || External || ? || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Operation Body Count]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.BC&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Spear of Destiny]] || All || External || &amp;lt;tt&amp;gt;MAPHEAD.SOD&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=2| [[Wolfenstein 3-D]] || Shareware || External || &amp;lt;tt&amp;gt;MAPHEAD.WL1&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|-&lt;br /&gt;
| Registered || External || &amp;lt;tt&amp;gt;MAPHEAD.WL6&amp;lt;/tt&amp;gt; || - ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
* [[TED5]] can edit the &amp;lt;tt&amp;gt;GAMEMAPS&amp;lt;/tt&amp;gt; format of any games that use it.  It is the original editor used to create these files.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by Andrew Durdin (adurdin).  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Talk:GameMaps_Format&amp;diff=8817</id>
		<title>Talk:GameMaps Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Talk:GameMaps_Format&amp;diff=8817"/>
		<updated>2019-08-29T20:43:24Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* InfoPlane values */ reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The values in that table are also good for Keen Dreams, except for the !ID! tag.&lt;br /&gt;
&lt;br /&gt;
== Cleaning this mess up ==&lt;br /&gt;
&lt;br /&gt;
I think this page should be merged together with the [[Keen Dreams level Format]] and the [[TED5]] page to get a clean documentation of the general file format. A lot of the stuff in here is only partially correct. For example, Bio Menace (and the first version of Wolf3D) uses the uncompressed form (MAPTEMP) of the format, not the carmackized version as is implied at the end of this article and in the TED5 article (it says that the MAPTEMP file is not used by the games).&lt;br /&gt;
&lt;br /&gt;
I also noticed that this article claims that the MAPHEAD file is 402 bytes long, giving it space for 256 level entries (which makes no sense at all, there are exactly 100 level offsets), but the MAPHEAD also stores the TileInfo data, giving a much larger size. You can see this in Bio Menace, where the files are external, but also in every Keen game. The TileInfo data in the exe starts directly after the MAPHEAD data (add 100 bytes in between for games that use the Huffman-compressed version, like Keen Dreams and Dave 3 &amp;amp; 4). --[[User:K1n9 Duk3|K1n9 Duk3]] 21:06, 11 February 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
: You&#039;re welcome to clean it up, but just remember that all this stuff is work in progress so it&#039;s only a &amp;quot;mess&amp;quot; because nobody has had the time to finish it off yet.  If you&#039;re able to do so, then that&#039;s great!  Also don&#039;t immediately assume something is wrong because it doesn&#039;t fit what you have seen - there are many versions of games around the place so make sure you consider something carefully before deleting it (I learned that the hard way!)  I don&#039;t think this page should be merged with [[TED5]] though, that page should be solely about the editor and perhaps some files that are not used elsewhere.  If it&#039;s used in a game it should be on one of the &amp;quot;xyz Format&amp;quot; pages (so by all means move some stuff *off* TED5.) -- [[User:Malvineous|Malvineous]] 12:36, 12 February 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
:: Yes, several points are worth noting. There should be a single article for all the TED5 formats with perhaps sections explaining the different compressions used (None-Biomenace, Huffman-Dreams,Dave3\4, Carmack-Keen) and especially a note about the tileinfo, for Keen only the 402 MAPHEAD was extracted and patched, seperate from the tileinfo, nobody really realized the two were connected and that TED could be used to edit tile properties, this is thus something of great interest to modders. I have a lot of data on what format of MAPs various games use. TED5 is a program and should be kept separate though. --[[User:Levellass|Endian? What are you on about?]] 03:46, 14 February 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Wolfenstein-3D maps ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;About Wolfenstein-3D (6 episodes version): after decompressing the planes, I noticed that --1-- Each plane starts with 0x0020, --2-- The third plane is always empty (except for the 0x0020), --3-- Decompressed planes are always longer than necessary: assuming every map is 64x64 tiles and a tile is stored on 2 bytes, a plane should be 8192 bytes long (8194 bytes if you count the 0x0020 signature). Am I missing something here? When displayed, the map makes sense to me but I&#039;m just not sure if I did anything wrong...&amp;quot; -&amp;gt; Scratch that, I&#039;m an idiot, the first UINT32LE is the size (in bytes) of the decompressed data, I thought it was a part of the RLEW-compressed chunk and had to compute the decompressed chunk size by myself... Anyway, the wiki page states that &amp;quot;The header for each level that is pointed to by MAPHEAD is 42 bytes long and RLEW compressed&amp;quot;, unless I misunderstand what the sentence means, it doesn&#039;t apply to Wolfenstein-3D (the RLEW compression I mean).&lt;br /&gt;
--[[User:Ilovemyq3map2|Ilovemyq3map2]] ([[User talk:Ilovemyq3map2|talk]]) 16:09, 14 October 2013 (GMT)&lt;br /&gt;
&lt;br /&gt;
== InfoPlane values ==&lt;br /&gt;
So, it&#039;d be real nice to have a list of what the values in InfoPlane map to.  Not sure where to put them, as they&#039;re a per-game thing.  Additionally, some item IDs are things that appear in certain difficulty levels only - ID 47 in Keen 4 is a Lick that only appears in Hard (and perhaps Medium)  Having a list somewhere might help with this.  Any thoughts? [[User:Szevvy|Szevvy]] ([[User talk:Szevvy|talk]])&lt;br /&gt;
&lt;br /&gt;
:For many games using this format, you can just use the first couple of tiles from the TILE16M tileset as icons for the InfoPlane entries. Things that only spawn on certain difficulty settings usually have the number 2 or 3 somewhere in the icon graphic, representing normal and hard difficulty levels respectively. That should work for Keen 4-6 (not all versions, though), Keen Dreams, BioMenace, Dave 3 &amp;amp; 4 and the Catacomb 3D series. Wolf3D-based games usually don&#039;t have any TILE16M tiles, so a list or a table would be more helpful for those games.&lt;br /&gt;
:I&#039;d say that a detailed table of InfoPlane values should be a separate page for each game, since there are some very game-specific quirks, especially in the Gamer&#039;s Edge/JAM games (Dave 3 &amp;amp; 4, the Catacomb trilogy and the Blake Stone series). How the game interprets the various InfoPlane values doesn&#039;t really have anything to do with the GAMEMAPS format itself. --[[User:K1n9 Duk3|K1n9 Duk3]] ([[User talk:K1n9 Duk3|talk]]) 20:43, 29 August 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Location of data in exes ==&lt;br /&gt;
On thing to note when filling out the location of data in exes - UNP and unpklite decompress exe&#039;s slightly differently, so any PKLITE&#039;d values need to have the decompression tool marked in the table.[[User:Szevvy|Szevvy]] ([[User talk:Szevvy|talk]])&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Dark_Ages_Map_Format&amp;diff=8794</id>
		<title>Dark Ages Map Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Dark_Ages_Map_Format&amp;diff=8794"/>
		<updated>2019-08-08T22:40:32Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added tile mapping table and tile attributes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 1&lt;br /&gt;
 | Tile size = 16&amp;amp;times;16&lt;br /&gt;
 | Viewport = 240&amp;amp;times;144&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Dark Ages}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This format is used by [[Dark Ages]] to store game levels.  It is stored as &amp;lt;tt&amp;gt;file05.da[123]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Signature ==&lt;br /&gt;
&lt;br /&gt;
There is no header or signature in the file.  Each level is 1152 bytes long, so the file must be a multiple of this size.  Since the game has 10 levels, all the files are 11,520 bytes long.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
All levels in the episode are stored in the same file, one after the other.  Each level is 128 cells wide and 9 cells high.  Each cell occupies one byte in the map file, so each level takes up 1152 bytes (128 &amp;amp;times; 9).&lt;br /&gt;
&lt;br /&gt;
=== Map codes ===&lt;br /&gt;
&lt;br /&gt;
Map code 0 maps to the first image in the first tileset, 1 maps to the second image in the first tileset. Map code 50 maps to the first image in the second tileset, etc. This is true for all 256 map codes, except for map codes 100 through 143 inclusive. Those map codes must be mapped back to images manually, via a lookup table.  Lookup tables are available in those level editors/viewers that include source code.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tile code !! Suggested icon !! Background !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 100 || 150 || from right     || green gem (increases firepower)&lt;br /&gt;
|-&lt;br /&gt;
| 101 || 158 || from right     || gold coin&lt;br /&gt;
|-&lt;br /&gt;
| 102 || 168 || from right     || green monster&lt;br /&gt;
|-&lt;br /&gt;
| 103 || 174 || from right     || fly/moth&lt;br /&gt;
|-&lt;br /&gt;
| 104 || 184 || from above     || lava&lt;br /&gt;
|-&lt;br /&gt;
| 105 || 188 || from above     || slime&lt;br /&gt;
|-&lt;br /&gt;
| 106 || 192 || from right     || stalagtite&lt;br /&gt;
|-&lt;br /&gt;
| 107 || 198 || from right     || spikes (ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 108 || 200 || from above     || red dude&lt;br /&gt;
|-&lt;br /&gt;
| 109 || 230 || from right     || boulder&lt;br /&gt;
|-&lt;br /&gt;
| 110 || 234 || from above     || door&lt;br /&gt;
|-&lt;br /&gt;
| 111 || 236 || from right     || spider (ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 112 || 239 || from right     || spider (ground)&lt;br /&gt;
|-&lt;br /&gt;
| 113 || 242 || from right     || frog (jumps left)&lt;br /&gt;
|-&lt;br /&gt;
| 114 || 246 || from right     || frog (jumps right)&lt;br /&gt;
|-&lt;br /&gt;
| 115 || 250 || from below     || cobwebs (top-left corner)&lt;br /&gt;
|-&lt;br /&gt;
| 116 || 251 || from below     || cobwebs (top-right corner)&lt;br /&gt;
|-&lt;br /&gt;
| 117 || 252 || from above     || cobwebs (bottom-left corner)&lt;br /&gt;
|-&lt;br /&gt;
| 118 || 253 || from above     || cobwebs (bottom-right corner)&lt;br /&gt;
|-&lt;br /&gt;
| 119 || 254 || from right     || wizard &amp;lt;br&amp;gt;(this also replaces the tile below it with the tile to the right of that one, probably a bug)&lt;br /&gt;
|-&lt;br /&gt;
| 120 || 154 || from left      || item: key&lt;br /&gt;
|-&lt;br /&gt;
| 121 || 155 || from left      || item: ankh&lt;br /&gt;
|-&lt;br /&gt;
| 122 || 156 || from left      || item: shield&lt;br /&gt;
|-&lt;br /&gt;
| 123 || 157 || from left      || item: apple&lt;br /&gt;
|-&lt;br /&gt;
| 124 || 262 || 29             || falling brick&lt;br /&gt;
|-&lt;br /&gt;
| 125 || 264 || from below     || leaky pipe&lt;br /&gt;
|-&lt;br /&gt;
| 126 || 258 || from above     || handrail, left&lt;br /&gt;
|-&lt;br /&gt;
| 127 || 259 || from above     || handrail, middle&lt;br /&gt;
|-&lt;br /&gt;
| 128 || 260 || from above     || handrail, right&lt;br /&gt;
|-&lt;br /&gt;
| 129 || 273 || from left      || large column, bottom&lt;br /&gt;
|-&lt;br /&gt;
| 130 || 274 || from left      || large colump, middle&lt;br /&gt;
|-&lt;br /&gt;
| 131 || 275 || from left      || large column, top&lt;br /&gt;
|-&lt;br /&gt;
| 132 ||  10 || 81             || hidden passage&lt;br /&gt;
|-&lt;br /&gt;
| 133 || 280 || from right     || hand with scroll 1&lt;br /&gt;
|-&lt;br /&gt;
| 134 || 281 || from left      || hand with scroll 2&lt;br /&gt;
|-&lt;br /&gt;
| 135 || 282 || from left      || power up statue 1&lt;br /&gt;
|-&lt;br /&gt;
| 136 || 283 || from left      || power up statue 2&lt;br /&gt;
|-&lt;br /&gt;
| 137 || 285 || from right     || small column (2 tiles high)&amp;lt;br&amp;gt;(also replaces tile above it with the tile to the right of that one)&lt;br /&gt;
|-&lt;br /&gt;
| 138 || 286 || from right     || water fountain (middle)&lt;br /&gt;
|-&lt;br /&gt;
| 139 || 290 || from right     || water fountain (top, moving up &amp;amp; down)&lt;br /&gt;
|-&lt;br /&gt;
| 140 || 182 || from left      || shootable button&lt;br /&gt;
|-&lt;br /&gt;
| 141 || 296 || from above     || bone claw&lt;br /&gt;
|-&lt;br /&gt;
| 142 || 180 || from right     || heart (full heal)&lt;br /&gt;
|-&lt;br /&gt;
| 143 || 300 || from above     || Garth (boss monster)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These tile numbers are to be applied to the combined tileset loaded from the files &amp;lt;tt&amp;gt;FILE06.DA?&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;FILE12.DA?&amp;lt;/tt&amp;gt;. Tiles 0 to 49 are loaded from &amp;lt;tt&amp;gt;FILE06.DA?&amp;lt;/tt&amp;gt;, tiles 50 to 99 from &amp;lt;tt&amp;gt;FILE07.DA?&amp;lt;/tt&amp;gt; and so on. The final tileset file, &amp;lt;tt&amp;gt;FILE12.DA?&amp;lt;/tt&amp;gt;, only contains 2 full tiles, leadin to a total of 302 tiles. The game tries tries to load 400 image bytes (the equvalent of 2.5 tiles) from the final tileset file for some reason. That file is only 384 bytes in size.&lt;br /&gt;
&lt;br /&gt;
Tile attributes are hard-coded as well:&lt;br /&gt;
&lt;br /&gt;
* Tiles 0 to 39 are fully blocking for all game objects.&lt;br /&gt;
* Tiles 30 to 49 are fully blocking for the enemies, but the player can stand on (or in) them and can also walk and shoot through these tiles.&lt;br /&gt;
* Tile 29 hurts the player when the player jumps into it from below.&lt;br /&gt;
* Tiles 50 and above don&#039;t block anything.&lt;br /&gt;
* Tiles 50 to 80 are animated in three frames, consisting of the base tile and the two following tiles.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Frenkel|Frenkel]]. The tile mapping table and tile attributes were reverse engineered by [[User:K1n9_Duk3|K1n9_Duk3]]  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem/Mods&amp;diff=8569</id>
		<title>Duke Nukem/Mods</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem/Mods&amp;diff=8569"/>
		<updated>2019-05-15T22:13:34Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: fixed links and added notes on suspicious file dates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;font-size: 90%; border:1px solid gray; border-collapse: collapse; text-align: center; width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Title&lt;br /&gt;
! Download(s)&lt;br /&gt;
! Release date&lt;br /&gt;
! Modder(s)&lt;br /&gt;
! # of levels&lt;br /&gt;
! Protagonist&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Duke&#039;s Next Adventure (DN_LS1)&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip 1.0]&lt;br /&gt;
| 1993&lt;br /&gt;
| Larry Shanker&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| DN_LS2&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1993&lt;br /&gt;
| Larry Shanker&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| Rambo Levels (DN_WW1)&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1994&lt;br /&gt;
| William Witkowski&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| DN_DB1&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1994&lt;br /&gt;
| David Bollinger&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| DN_DB2&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1994&lt;br /&gt;
| David Bollinger&lt;br /&gt;
| 7&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| Wartime II&lt;br /&gt;
| [http://ettingrinder.youfailit.net/dukenukem1-addons.html final]&lt;br /&gt;
| 1995&lt;br /&gt;
| Jim S. Hart&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Neil McRae&#039;s first levels&lt;br /&gt;
| [http://www.stuntsillusion.com/games.html final]&lt;br /&gt;
| 1999&lt;br /&gt;
| Neil McRae&lt;br /&gt;
| 30&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Neil McRae&#039;s second levels&lt;br /&gt;
| [http://www.stuntsillusion.com/games.html final]&lt;br /&gt;
| 1999&lt;br /&gt;
| Neil McRae&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Shifted&#039;s First DN1 Level&lt;br /&gt;
| [http://dosclassics.com/duke/dl.php final]&lt;br /&gt;
| 2005&lt;br /&gt;
| The Shifted One&lt;br /&gt;
| 1&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Single level&lt;br /&gt;
|-&lt;br /&gt;
| The Returning&lt;br /&gt;
| [https://drive.google.com/file/d/0B3MDAZU7IeLBZE9YQXgxYWwyUzg/view 2017 Edition]&lt;br /&gt;
| 2010&lt;br /&gt;
| (_DNV_)&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level pack + partial graphics mod&lt;br /&gt;
|-&lt;br /&gt;
| Pieter Simoons&#039; levels&lt;br /&gt;
| [http://crystalshard.net/?p=8&amp;amp;s=51 final]&lt;br /&gt;
| 2012?&lt;br /&gt;
| Pieter Simoons (Radiant)&lt;br /&gt;
| 3&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Dr. Protons Revenge&lt;br /&gt;
| [http://k1n9duk3.shikadi.net/files/mods/DNPRInstall.zip final?]&lt;br /&gt;
| 2003/2005&lt;br /&gt;
| NicksSoftware&lt;br /&gt;
| 10?&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level pack + partial graphics mod&amp;lt;br&amp;gt; some levels (dated 1995-01-29 to 1995-01-31) stolen from earlier level packs?&lt;br /&gt;
|-&lt;br /&gt;
| Proton&#039;s Master Plan&lt;br /&gt;
| [http://k1n9duk3.shikadi.net/files/mods/DNPMPInstall.zip final?]&lt;br /&gt;
| 2006&lt;br /&gt;
| NicksSoftware&lt;br /&gt;
| 10?&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level pack + partial graphics mod&amp;lt;br&amp;gt; levels (all dated 1998-01-03) stolen from earlier level packs?&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mods by game]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem/Mods&amp;diff=8568</id>
		<title>Duke Nukem/Mods</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Duke_Nukem/Mods&amp;diff=8568"/>
		<updated>2019-05-15T22:02:35Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Added &amp;quot;Dr. Protons Revenge&amp;quot; and &amp;quot;Proton&amp;#039;s Master Plan&amp;quot;. I had old zips of them (dated 2011-04-01) on my HDD and uploaded them to my website for now.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|class=&amp;quot;wikitable sortable&amp;quot; border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;font-size: 90%; border:1px solid gray; border-collapse: collapse; text-align: center; width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Title&lt;br /&gt;
! Download(s)&lt;br /&gt;
! Release date&lt;br /&gt;
! Modder(s)&lt;br /&gt;
! # of levels&lt;br /&gt;
! Protagonist&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Duke&#039;s Next Adventure (DN_LS1)&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip 1.0]&lt;br /&gt;
| 1993&lt;br /&gt;
| Larry Shanker&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| DN_LS2&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1993&lt;br /&gt;
| Larry Shanker&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| Rambo Levels (DN_WW1)&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1994&lt;br /&gt;
| William Witkowski&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| DN_DB1&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1994&lt;br /&gt;
| David Bollinger&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| DN_DB2&lt;br /&gt;
| [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn1edit20.zip final]&lt;br /&gt;
| 1994&lt;br /&gt;
| David Bollinger&lt;br /&gt;
| 7&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack, included with DukeEdit&lt;br /&gt;
|-&lt;br /&gt;
| Wartime II&lt;br /&gt;
| [http://ettingrinder.youfailit.net/dukenukem1-addons.html final]&lt;br /&gt;
| 1995&lt;br /&gt;
| Jim S. Hart&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Neil McRae&#039;s first levels&lt;br /&gt;
| [http://www.stuntsillusion.com/games.html final]&lt;br /&gt;
| 1999&lt;br /&gt;
| Neil McRae&lt;br /&gt;
| 30&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Neil McRae&#039;s second levels&lt;br /&gt;
| [http://www.stuntsillusion.com/games.html final]&lt;br /&gt;
| 1999&lt;br /&gt;
| Neil McRae&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Shifted&#039;s First DN1 Level&lt;br /&gt;
| [http://dosclassics.com/duke/dl.php final]&lt;br /&gt;
| 2005&lt;br /&gt;
| The Shifted One&lt;br /&gt;
| 1&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Single level&lt;br /&gt;
|-&lt;br /&gt;
| The Returning&lt;br /&gt;
| [https://drive.google.com/file/d/0B3MDAZU7IeLBZE9YQXgxYWwyUzg/view 2017 Edition]&lt;br /&gt;
| 2010&lt;br /&gt;
| (_DNV_)&lt;br /&gt;
| 10&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level pack + partial graphics mod&lt;br /&gt;
|-&lt;br /&gt;
| Pieter Simoons&#039; levels&lt;br /&gt;
| [http://crystalshard.net/?p=8&amp;amp;s=51 final]&lt;br /&gt;
| 2012?&lt;br /&gt;
| Pieter Simoons (Radiant)&lt;br /&gt;
| 3&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level Pack&lt;br /&gt;
|-&lt;br /&gt;
| Dr. Protons Revenge&lt;br /&gt;
| [https://k1n9duk3.shikadi.net/files/mods/DNPRInstall.zip final?]&lt;br /&gt;
| 2003/2005&lt;br /&gt;
| NicksSoftware&lt;br /&gt;
| 10?&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level pack + partial graphics mod&lt;br /&gt;
|-&lt;br /&gt;
| Proton&#039;s Master Plan&lt;br /&gt;
| [https://k1n9duk3.shikadi.net/files/mods/DNPMPInstall.zip final?]&lt;br /&gt;
| 2006&lt;br /&gt;
| NicksSoftware&lt;br /&gt;
| 10?&lt;br /&gt;
| Duke Nukem&lt;br /&gt;
| Level pack + partial graphics mod&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mods by game]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Major_Stryker&amp;diff=8467</id>
		<title>Major Stryker</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Major_Stryker&amp;diff=8467"/>
		<updated>2019-04-15T04:55:30Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* File formats */ changed color for the Save Game Format entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Game Infobox&lt;br /&gt;
 | Levels = No&lt;br /&gt;
 | Tiles = Edit&lt;br /&gt;
 | Sprites = Edit&lt;br /&gt;
 | Fullscreen = Edit&lt;br /&gt;
 | Sound = No&lt;br /&gt;
 | Music = Edit&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;Major Stryker&#039;&#039;&#039; is an EGA top down shooter, similar to the later VGA games [[Kiloblaster]] and [[Raptor]].  Its file formats are very similar (in some cases identical) to [[Cosmo&#039;s Cosmic Adventures]] and [[Duke Nukem II]], both of which were produced around the same time by the same developers.&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 = Edit&lt;br /&gt;
| mus = Edit&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;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows GUI&lt;br /&gt;
| grp = Edit&lt;br /&gt;
| map = No&lt;br /&gt;
| gfx = View&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;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot;/&amp;gt;&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the major file formats used in the game.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Format !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;VOLUME?.MS?&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[CMP Format]]&lt;br /&gt;
| Group files containing most of the game&#039;s data files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;DOSTEXT2.DR1&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[B800 Text]]&lt;br /&gt;
| Text screen displayed at exit&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;TITLEDR.DR1&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;CREDITS.DR1&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;CHOOSE.DR1&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;ENDLEVEL.DR1&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;GOODLUCK.DR1&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&amp;lt;tt&amp;gt;MISSION.DR1&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[Raw EGA data#Planar EGA data|Full-screen planar EGA]]&lt;br /&gt;
| 320 x 200 pixel fullscreen images&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;*.DR?&amp;lt;/tt&amp;gt; (see format page)&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[Major Stryker Tileset Format]]&lt;br /&gt;
| Tileset graphics&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;WORLDAL?.DR?&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[Major Stryker Level Format]]&lt;br /&gt;
| Level files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;DRSOUND*.SND&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[Inverse Frequency Sound format]]&lt;br /&gt;
| PC Speaker sound effects&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;*.VOC&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[VOC Format]]&lt;br /&gt;
| Digitised sound effects&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;*.IMF&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[IMF Format]]&lt;br /&gt;
| Background music&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;*.MS?&amp;lt;/tt&amp;gt; (see format page)&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[Major Stryker Text Format]]&lt;br /&gt;
| In-game texts&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;CONFIG.MS&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #FFCCCC;&amp;quot; | [[Major Stryker Config Format]]&lt;br /&gt;
| Game configuration&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;HS.MS?&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[HS Format (Major Stryker)|HS Format]]&lt;br /&gt;
| High scores&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;SR?.MS&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | [[Major Stryker Save Game Format]]&lt;br /&gt;
| Save game slots&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Apogee]]&lt;br /&gt;
[[Category:Overhead]]&lt;br /&gt;
[[Category:Space Invaders]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=HS_Format_(Major_Stryker)&amp;diff=8466</id>
		<title>HS Format (Major Stryker)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=HS_Format_(Major_Stryker)&amp;diff=8466"/>
		<updated>2019-04-15T04:52:01Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: clarification on checksum algorithm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Playerdata Infobox&lt;br /&gt;
 | Config = Yes&lt;br /&gt;
 | Storing = Scores&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Major Stryker}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Major Stryker high score format&#039;&#039;&#039; is used to store the top ten scores in [[Major Stryker]].&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
The file begins with a single byte checksum in order to prevent tampering. The checksum is generated by summing most of the bytes in the high score file into a byte value, and throwing away the overflow. The first byte (the checksum itself) and the last two bytes of the file are excluded from this sum. The same algorithm is used to calculate the checksum of the [[Major Stryker Save Game Format]].&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;
| BYTE || checksum || Checksum of the file.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Data ===&lt;br /&gt;
&lt;br /&gt;
The data consists of a list of ten scores.&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;
| CHAR[...] || score || Player&#039;s score. Space (0x20) terminating.&lt;br /&gt;
|-&lt;br /&gt;
| CHAR[...] || name  || Player&#039;s name. \r\n (0x0D, 0x0A) terminating. Maximum 12 characters.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Footer ===&lt;br /&gt;
&lt;br /&gt;
The list contains an eleventh score which is really just an unnecessarily long end of file marker.&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;
| CHAR[5] || score || Always &amp;quot;1000&amp;quot;. Space (0x20) terminating.&lt;br /&gt;
|-&lt;br /&gt;
| CHAR[2] || name  || Always &amp;quot;..&amp;quot;. \r\n (0x0D, 0x0A) terminating.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
This FreeBASIC program will generate a new high score file with whatever names and scores you like, and prefix the proper checksum header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;freebasic&amp;quot;&amp;gt;&lt;br /&gt;
&#039; Major Stryker High Score Generator.&lt;br /&gt;
&#039; ------------------------------------------&lt;br /&gt;
&#039; This program generates a high score file &lt;br /&gt;
&#039; with the proper checksum value.&lt;br /&gt;
&lt;br /&gt;
&#039; Declare work variables.&lt;br /&gt;
Dim Table As String&lt;br /&gt;
Dim File As String&lt;br /&gt;
Dim Checksum As Byte&lt;br /&gt;
&lt;br /&gt;
&#039; Change this file path to the location of your Major Stryker high score file.&lt;br /&gt;
File = &amp;quot;D:\Documents\Games\Stryker\HS.MS1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039; Generate the high score list.&lt;br /&gt;
&#039; Change any of the scores and names to the value you desire, &lt;br /&gt;
&#039; but keep your scores less than 7 digits and your names &lt;br /&gt;
&#039; less that 12 characters long.&lt;br /&gt;
Table = &amp;quot;&amp;quot;&lt;br /&gt;
Table = Table + &amp;quot;50000    Hudson   &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;45000 Hicks D.    &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;40000 Vasquez J.  &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;35000 Bishop L.   &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;30000 Apone A.    &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;25000 Spunkmeyer  &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;20000 Dietrich C. &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;15000 Wierzbowski &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;10000 Berk C.     &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;5000 Ripley E.   &amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
Table = Table + &amp;quot;1000 ..&amp;quot; + Chr(13) + Chr(10)&lt;br /&gt;
&lt;br /&gt;
&#039; Generate the checksum.&lt;br /&gt;
&#039; The checksum simply adds the ASCII value of each character in the high &lt;br /&gt;
&#039; score file to a byte value, while throwing away the overflow.&lt;br /&gt;
&lt;br /&gt;
&#039; The checksum value is salted with 233 to make it harder to reverse &lt;br /&gt;
&#039; engineer. But that didn&#039;t stop me! ;-)&lt;br /&gt;
Checksum = 233&lt;br /&gt;
&lt;br /&gt;
&#039; Sum up each character in the file.&lt;br /&gt;
Dim X As UShort&lt;br /&gt;
For X = 1 To Len(Table)&lt;br /&gt;
    Checksum = Checksum + Asc(Mid(Table, X, 1))    &lt;br /&gt;
Next X&lt;br /&gt;
&lt;br /&gt;
&#039; Attach the checksum to the front of the high score list.&lt;br /&gt;
Table = Chr(Checksum) + Table&lt;br /&gt;
&lt;br /&gt;
&#039; Delete the high score file if it already exists.&lt;br /&gt;
Kill File&lt;br /&gt;
&lt;br /&gt;
&#039; Open the high score file, store the new list, and save it.&lt;br /&gt;
Open File For Binary As #1&lt;br /&gt;
Put #1, , Table&lt;br /&gt;
Close #1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This high score format was reverse engineered by [[User:TheAlmightyGuru|TheAlmightyGuru]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Major_Stryker_Save_Game_Format&amp;diff=8465</id>
		<title>Major Stryker Save Game Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Major_Stryker_Save_Game_Format&amp;diff=8465"/>
		<updated>2019-04-15T04:48:59Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added missing info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Playerdata Infobox&lt;br /&gt;
 | Config = Yes&lt;br /&gt;
 | Storing = Saves&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Major Stryker}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Major Stryker save game format&#039;&#039;&#039; is used to store a saved game [[Major Stryker]], up to 10 in total. Each save will be named &#039;SR*.MS&#039;, with the asterisk replaced for letter A-J for save slot 0-9 respectively, though there is also a letter N used to hold the list of names corresponding to each save slot file.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
The file begins with a single byte checksum in order to prevent tampering. The checksum is generated by summing most of the bytes in the save game file into a byte value, and throwing away the overflow. The first byte (the checksum itself) and the last two bytes of the file are excluded from this sum. The same algorithm is used to calculate the checksum of the [[HS Format (Major Stryker)]].&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;
| [[BYTE]] || checksum || Checksum of the file.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Data ===&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;
| [[INT16LE]] || Fire power level || 0x01: Single shot forward&amp;lt;br /&amp;gt;0x02: Double shot forward&amp;lt;br /&amp;gt;0x03: Tripe shot forward&amp;lt;br /&amp;gt;0x04: Triple shot forward cone&amp;lt;br /&amp;gt;0x05: Triple shot forward cone + rear single&amp;lt;br /&amp;gt;0x06: Triple shot forward cone + rear single + side single&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Lives || Count&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] || Shield level || 0x00: No shield&amp;lt;br /&amp;gt;0x01: Side shields&amp;lt;br /&amp;gt;0x02: Spinning shields&amp;lt;br /&amp;gt;0x03: Bubble&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Burst level || Level is minus 1. (0x00-0x07 represents 1-8 respectively.)&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Zap bombs || Count&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] || Level || 0x00-0x23 for level 1-36 respectively. (0x00-0x0B for Lava planet, 0x0C-0x17 for Arctic planet, and 0x18-0x23 for Desert planet.)&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]] || Skill || 01: Beginner&amp;lt;br /&amp;gt;02: Novice&amp;lt;br /&amp;gt;03: Expert&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Enemies total || Number of enemies encountered in all previous levels combined&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Enemies killed || Number of enemies killed in all previous levels combined&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Men total || Number of cryogenic tubes encountered in all previous levels combined&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || Men saved || Number of captured humans freed in all previous levels combined&lt;br /&gt;
|-&lt;br /&gt;
| CHAR[...] || Score || Player&#039;s score as an ASCII string, EOF terminated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Save slot names file format ==&lt;br /&gt;
&lt;br /&gt;
=== Data ===&lt;br /&gt;
&lt;br /&gt;
Each save slot is represented in the save slot names file by up to 24 bytes sequentially. There is no header or footer. Data is per-slot, with each following slot concatenated to its previous slot.&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;
| CHAR || Slot number || Number is in ASCII (0x30-0x39 representing slots 0-9 respectively), space (0x20) terminating.&lt;br /&gt;
|-&lt;br /&gt;
| CHAR[0-22] || Slot name || Save slot name up to 20 characters, CRLF (0x0D,0x0A) terminating.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This save game format was reverse engineered by [[User:Adambean|Adambean]] and [[User:K1n9_Duk3|K1n9_Duk3]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Crunched_Screen_Image&amp;diff=8384</id>
		<title>Crunched Screen Image</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Crunched_Screen_Image&amp;diff=8384"/>
		<updated>2019-03-05T22:58:18Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: somebody please rename this page to &amp;quot;Crunched Screen Image&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A special format is used internally by [[Super ZZT]] to draw the title screen and ending screen graphics. The format assumes a 80x25 display window.&lt;br /&gt;
&lt;br /&gt;
The same format is also used to store compressed text screens in various other titles by Epic Megagames, including [[Jill of the Jungle]], [[Kiloblaster]] and [[Xargon]] where the hardware configuration screens (and sometimes ending screens) are stored in this format. Some menu programs also use this format to store text-based menu, ordering info and ending screens.&lt;br /&gt;
&lt;br /&gt;
The [[Xargon]] source code refers to this data format as &amp;quot;TheDraw C Crunched Screen Image&amp;quot; in &amp;lt;tt&amp;gt;CFG_WIN.H&amp;lt;/tt&amp;gt;. [[Kiloblaster]]&#039;s source code uses the same name in &amp;lt;tt&amp;gt;BEGIN.H&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
There is no header information for this format. It is read as a stream of bytes until the Y-position goes off the bottom (row 25). The &amp;lt;tt&amp;gt;uncrunch&amp;lt;/tt&amp;gt; algorithm found in the [[Xargon]] and [[Kiloblaster]] source code takes the length of the compressed block as a parameter and stops decompressing once all bytes have been processed.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;uncrunch&amp;lt;/tt&amp;gt; decompression starts with the text attributes set to 0 (black text on black background, not blinking). The text usually appears at the top left corner of the text screen.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Value!!Description&lt;br /&gt;
|-&lt;br /&gt;
|00-0F||Set the foreground color of following output to this value.&lt;br /&gt;
|-&lt;br /&gt;
|10-17||Set the background color of following output to the lower 4 bits of this value.&lt;br /&gt;
|-&lt;br /&gt;
|18||Go to the beginning of the following text line.&lt;br /&gt;
|-&lt;br /&gt;
|19||Read one more byte &#039;&#039;n&#039;&#039;, and output a space character &#039;&#039;n&#039;&#039;+1 times.&lt;br /&gt;
|-&lt;br /&gt;
|1A||Read two more bytes &#039;&#039;n&#039;&#039; and &#039;&#039;char&#039;&#039;, and output &#039;&#039;char&#039;&#039; for &#039;&#039;n&#039;&#039;+1 times.&lt;br /&gt;
|-&lt;br /&gt;
|1B||Toggle blinking text on/off&lt;br /&gt;
|-&lt;br /&gt;
|1C-1F||Undefined (&amp;lt;tt&amp;gt;uncrunch&amp;lt;/tt&amp;gt; just skips these)&lt;br /&gt;
|-&lt;br /&gt;
|20-FF||Output this character exactly.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Location ==&lt;br /&gt;
&lt;br /&gt;
These graphics cannot be found or used outside the game executable. They are referenced directly by the code and compiled into the game engine itself.&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=8265</id>
		<title>Jill of the Jungle Map Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Jill_of_the_Jungle_Map_Format&amp;diff=8265"/>
		<updated>2018-11-17T06:49:37Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Savegame data */ added correct max. health for Jill&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 2&lt;br /&gt;
 | Tile size = 16&amp;amp;times;16&lt;br /&gt;
 | Viewport = 232&amp;amp;times;160&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Jill of the Jungle}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Jill of the Jungle map format&#039;&#039;&#039; is the format used to describe the levels played during the game.  The maps contain two layers - a background layer and an &amp;quot;object&amp;quot; layer.  The background layer is a grid of 16x16 pixel tiles, 128 tiles wide and 64 tiles high.  The object layer is made up of an arbitrary list of objects, with X and Y offsets in pixels.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The main map file starts off with the background layer, then immediately following it is the foreground layer, the savegame data block and the string stack.&lt;br /&gt;
&lt;br /&gt;
=== Background layer ===&lt;br /&gt;
&lt;br /&gt;
The background layer is quite simple.  It is an array of 8,192 16-bit values (128 tiles wide by 64 tiles high == 8192 tiles total.)  Each 16-bit value is a code, such as 0xC0D3.  The formula &amp;lt;b&amp;gt;((x * MAP_HEIGHT) + y) * 2&amp;lt;/b&amp;gt; (where MAP_HEIGHT is 64) will provide the offset (in bytes) into the map file where that grid&#039;s 16-bit code is located.&lt;br /&gt;
&lt;br /&gt;
Once the code is found, its lower 14 bits are isolated (e.g. &amp;lt;b&amp;gt;code &amp;amp; 0x3FFF&amp;lt;/b&amp;gt;) which provides an ID that is listed in the tile mapping table (see below.)  The tile mapping table then provides an index into the graphics file for the image that should be displayed at that grid location.  The upper two bits are only used during gameplay to record information about which tiles are on screen at any given time.&amp;lt;ref&amp;gt;[https://github.com/Malvineous/xargon/blob/master/src/include/xargon.h#L23 xargon.h lines 23-30]&amp;lt;/ref&amp;gt;  The official games all seem to have these upper two bits set in the map file, so it&#039;s probably a good idea to do the same when writing out modified maps.&lt;br /&gt;
&lt;br /&gt;
For example, if the 16-bit code is 0xC0D3, then isolating the lower three nybbles will provide the number 0x00D3.  At the entry for ID 0x00D3 in the tile mapping table, the value might be iTileset as 0x12 and iTile as 0x34.  This means that in the graphics file, tileset number 0x12 should be accessed, and tile number 0x34 within that tileset should be drawn at the grid coordinate.&lt;br /&gt;
&lt;br /&gt;
It is also important to note that these values are stored little-endian, like the [[SHA Format|SHA format]]. This means that for example the value 0xC0D3 is stored as the two bytes D3-C0, not as C0-D3.&lt;br /&gt;
&lt;br /&gt;
==== Tile mapping table ====&lt;br /&gt;
&lt;br /&gt;
There is a separate file in the game directory that contains mappings between tile codes in the background layer and the game&#039;s graphics.  In [[Jill of the Jungle]] this is called &amp;lt;tt&amp;gt;JILL.DMA&amp;lt;/tt&amp;gt; and in [[Xargon]] it is &amp;lt;tt&amp;gt;TILES.XR&amp;lt;i&amp;gt;x&amp;lt;/i&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This file is arranged as an array of entries, one after the other.  Each entry is in the following format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] iMapCode || ID used in map file&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] iTile || Index into the tileset for the image to use&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] iTileset || Index of tileset containing this tile&#039;s image (ignore upper two bits - see below)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT16LE]] iFlags || Flags for this tile (can stand on, can hurt player, etc.)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT8]] iLength || Length of tile name&lt;br /&gt;
|-&lt;br /&gt;
| [[char]] cName[iLength] || &amp;lt;tt&amp;gt;iLength&amp;lt;/tt&amp;gt; characters for the tile name.  This string is &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; NULL-terminated.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that only the lower six bits of &amp;lt;tt&amp;gt;iTileset&amp;lt;/tt&amp;gt; refer to the tile number.  The purpose of the upper unknown bits is unknown.  To get a valid tileset index use &amp;lt;code&amp;gt;iTileset &amp;amp; 0x3F&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;iFlags&amp;lt;/tt&amp;gt; is broken up as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Bit!!Hex!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
||-||0x0000||&amp;lt;i&amp;gt;&amp;lt;zero&amp;gt;&amp;lt;/i&amp;gt;||Default solid block&lt;br /&gt;
|-&lt;br /&gt;
|1||0x0001||F_PLAYERTHRU||Blocks you can walk, jump or fall through (background tiles, the path on the overhead map, etc.)&lt;br /&gt;
|-&lt;br /&gt;
|2||0x0002||F_STAIR, F_NOTSTAIR (Xargon)||Blocks that you can stand on (can also jump up through when combined with F_PLAYERTHRU)&lt;br /&gt;
|-&lt;br /&gt;
|3||0x0004||F_VINE, F_NOTVINE (Xargon)||Can climb this block - usually combined with F_PLAYERTHRU (giving 0x0005)&lt;br /&gt;
|-&lt;br /&gt;
|4||0x0008||F_MSGTOUCH||Activates game-specific code when touched&lt;br /&gt;
|-&lt;br /&gt;
|5||0x0010||F_MSGDRAW|| Regular blocks have just one shape, f_msgdraw triggers &amp;lt;tt&amp;gt;msg_block(msg_draw)&amp;lt;/tt&amp;gt; for animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|6||0x0020||F_MSGUPDATE|| game-specific code (through &amp;lt;tt&amp;gt;msg_block(msg_update)&amp;lt;/tt&amp;gt;) at every frame. For animated blocks.&lt;br /&gt;
|-&lt;br /&gt;
|7||0x0040||F_INSIDE||This block contains text inside it&lt;br /&gt;
|-&lt;br /&gt;
|8||0x0080||F_FRONT|| object property : Foreground object&lt;br /&gt;
|-&lt;br /&gt;
|9||0x0100||F_TRIGGER||Unknown&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_BACK || object property: Background object (e.g. torches)&lt;br /&gt;
|-&lt;br /&gt;
|10||0x0200||F_TINYTHRU|| (likely PlayerThru when player is in &#039;mini&#039; mode, unused in Xargon)&lt;br /&gt;
|-&lt;br /&gt;
|11||0x0400||F_ALWAYS|| object property : &amp;quot;Always updates object&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|12||0x0800||F_KILLABLE|| object property : monster can be killed with regular weapon.&lt;br /&gt;
|-&lt;br /&gt;
|13||0x1000||F_FIREBALL|| object property : object is a fireball&lt;br /&gt;
|-&lt;br /&gt;
|14||0x2000||F_WATER|| A water tile. regular player will sink, the S.U.B. and aquatic monster can swim through it, but not out of it&lt;br /&gt;
|-&lt;br /&gt;
|14||0x4000||F_NOT_WATER|| (Xargon) Not a water tile.&lt;br /&gt;
|-&lt;br /&gt;
|15||0x4000||F_WEAPON|| object property : object is a regular weapon&lt;br /&gt;
|-&lt;br /&gt;
|16||0x8000||(unused)||(unused)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the same &amp;quot;flag set&amp;quot; is used for both blocks and objects. Some properties only apply to blocks, some only apply to objects, some to both (&amp;lt;tt&amp;gt;f_msgtouch&amp;lt;/tt&amp;gt;), and some flags have a different meaning for blocks and tile (e.g. 0x200 and 0x2000).&lt;br /&gt;
&lt;br /&gt;
=== Object layer ===&lt;br /&gt;
&lt;br /&gt;
The object layer is drawn in front of the background layer, and contains all the interactive elements of the map, such as points and enemies.&lt;br /&gt;
&lt;br /&gt;
The object data starts straight after the background layer data, so that&#039;s at offset 16,384 bytes into the map file (8,192 tiles * two bytes per tile.)  The first two bytes in the object layer are a 16-bit integer ([[UINT16LE]]) that stores the number of objects in the map, and this is followed by the data for each object, one after the other.&lt;br /&gt;
&lt;br /&gt;
Each object is 31 bytes long, and is stored in the following structure:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT8 iType||Object type (e.g. a &amp;quot;point item&amp;quot;, or an enemy.)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iX||X-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iY||Y-coordinate of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iXD|| object horizontal speed&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iYD|| object vertical speed&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iWidth||Width of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iHeight||Height of object&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iState||Object sub-type (e.g. what type of &amp;quot;point item&amp;quot;), or current &amp;quot;State&amp;quot; (running, jumping, etc)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iSubState||&amp;lt;i&amp;gt;object-specific semantic&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iStateCount||&amp;lt;i&amp;gt;object-specific semantic, typically a frame counter&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iCounter||Various uses. Often used to link doors or switches to obstacles.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iFlags|| internally used for rendering.&lt;br /&gt;
|-&lt;br /&gt;
|UINT32 lPointer||Used internally as a pointer.  If this value is 0, there is no entry for this object in the string stack (see below.)  Any non-zero value means there is an entry for this object in the string stack.&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iInfo1||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|UINT16 iZapHold||&amp;lt;i&amp;gt;Unknown&amp;lt;/i&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At the present time it is assumed (perhaps hoped) that objects can be mapped to images in the same way as the tiles in the background layer can be mapped to images, but as yet there is no known way of doing this.&lt;br /&gt;
&lt;br /&gt;
=== Savegame data ===&lt;br /&gt;
&lt;br /&gt;
Saved games are &amp;quot;snapshots&amp;quot; of the current level state, which is why some spare room exists in the map format to allow special data to be saved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;vertical-align: top; width: 50%;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Jill&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Jill of the Jungle, this section is 70 bytes long.&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;
| [[INT16LE]] || level || Level number, displayed in the status screen&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || health || Player health, 0..8, 0=dead, 8=full&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || inventoryLength || Number of items in the inventory&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]][16] || inventory || Space for up to 16 inventory items, only the first &amp;lt;tt&amp;gt;inventoryLength&amp;lt;/tt&amp;gt; entries are valid.  (Note that used items such as keys are not removed from this stack, but items are rearranged to override the key value, according to the amount of items displayed in the inventory)&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] || score || Player score&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][28] || pad || Padding, set to zero&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!InvItemNumber!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0|| Morph: Jill&lt;br /&gt;
|-&lt;br /&gt;
|1|| Key: Red Key&lt;br /&gt;
|-&lt;br /&gt;
|2|| Weapon: Knive&lt;br /&gt;
|-&lt;br /&gt;
|3|| Key: Crystal Rock&lt;br /&gt;
|-&lt;br /&gt;
|4|| Morph: Frog&lt;br /&gt;
|-&lt;br /&gt;
|5|| Morph: Fire bird&lt;br /&gt;
|-&lt;br /&gt;
|6|| Bag of coins (?)&lt;br /&gt;
|-&lt;br /&gt;
|7|| Morph: Fish&lt;br /&gt;
|-&lt;br /&gt;
|8|| Weapon: Blade&lt;br /&gt;
|-&lt;br /&gt;
|9|| Bonus: High Jump&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;vertical-align: top;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Xargon&#039;&#039;&#039;&amp;lt;ref&amp;gt;[https://github.com/Malvineous/xargon/blob/master/src/include/xargon.h#L69 xargon.h line 69]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Xargon, this section is 97 bytes long.&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;
| [[INT16LE]] || level || Level number, displayed in the status screen&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || health || Player health, 0..5, 0=dead, 5=full&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || emeralds || Number of emeralds&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || inventoryLength || Number of items in the inventory&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]][30] || inventory || Space for up to 30 inventory items, only the first &amp;lt;tt&amp;gt;inventoryLength&amp;lt;/tt&amp;gt; entries are valid&lt;br /&gt;
|-&lt;br /&gt;
| [[INT16LE]] || ouched || Player highlight state, set to zero, used during gameplay only.  Makes player flash red/blue/etc. depending on current state.&lt;br /&gt;
|-&lt;br /&gt;
| [[BYTE]][22] || pad || Padding, set to zero&lt;br /&gt;
|-&lt;br /&gt;
| [[UINT32LE]] || score || Player score&lt;br /&gt;
|-&lt;br /&gt;
| [[INT8]] || fruit || Number of fruit items (collecting 16 fruits gets one health bar)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Inventory item !! Name !! Description (from source code)&amp;lt;ref&amp;gt;[https://github.com/Malvineous/xargon/blob/master/src/include/xargon.h#L80 xargon.h line 80]&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0 || inv_hero || Hero, as in a life? NADA&lt;br /&gt;
|-&lt;br /&gt;
| 1 || inv_mapkey || Opens doors on MAP&lt;br /&gt;
|-&lt;br /&gt;
| 2 || inv_epic || For EPIC bonus&lt;br /&gt;
|-&lt;br /&gt;
| 3 || inv_fire || Fireballs&lt;br /&gt;
|-&lt;br /&gt;
| 4 || inv_laser || Extra laser bullets&lt;br /&gt;
|-&lt;br /&gt;
| 5 || inv_bird || Hero turns into bumblebee&lt;br /&gt;
|-&lt;br /&gt;
| 6 || inv_fish || Underwater bubble&lt;br /&gt;
|-&lt;br /&gt;
| 7 || inv_rock || Rock to throw&lt;br /&gt;
|-&lt;br /&gt;
| 8 || inv_jump || High jump&lt;br /&gt;
|-&lt;br /&gt;
| 9 ||  inv_invin || Invincibility&lt;br /&gt;
|-&lt;br /&gt;
| 10 || inv_icon1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 11 || inv_icon2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 12 || inv_icon3 ||&lt;br /&gt;
|-&lt;br /&gt;
| 13 || inv_key0 || Keys open doors&lt;br /&gt;
|-&lt;br /&gt;
| 14 || inv_key1 ||&lt;br /&gt;
|-&lt;br /&gt;
| 15 || inv_key2 ||&lt;br /&gt;
|-&lt;br /&gt;
| 16 || inv_key3 ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== String stack ===&lt;br /&gt;
&lt;br /&gt;
The Strings Stack is just a bunch of arbitrary strings (can be either text or file references). Each entry starts with an unsigned short integer defining the length of the incoming string. Note that the string is always followed by a null byte (so if &amp;quot;length of next entry&amp;quot; is 12, you only have the string size and should not forget to read an extra byte to reach the next entry). The string stack&#039;s entries are used for iType[20] (&amp;quot;write text&amp;quot;), 21 (&amp;quot;write text in big&amp;quot;) and 12 (&amp;quot;checkpoints&amp;quot;) and can contain music filenames, demo filenames, next level filenames or arbitrary text content.&lt;br /&gt;
&lt;br /&gt;
In Xargon and Jill, the checkpoint type contains a string:&lt;br /&gt;
&lt;br /&gt;
* If the first character of this string is &#039;*&#039; then the rest of the string is taken to be the filename of the music file to play in that level.&lt;br /&gt;
* If the first character is &#039;#&#039; then the string is also a music file, but it is only played if there is no song currently playing, or the level number is between 1 and 32 inclusive.  This is probably used for the main menu/credits/etc. so as not to interrupt the theme song when displaying those &amp;quot;levels&amp;quot;, and it is used for the map level so the theme music keeps playing (rather than starting from the beginning again) when starting a game.&lt;br /&gt;
* The first character of the string can also be &#039;&amp;amp;&#039; which, in Xargon, forces the song to be &amp;lt;tt&amp;gt;song_33.xr1&amp;lt;/tt&amp;gt; and in Jill does not change the song. The rest of the string as a macro filename, to be read and played back as a demo.  This is used in the ending sequences.&lt;br /&gt;
&lt;br /&gt;
== Object iTypes ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a list of objects used in Jill maps.  A brief Xargon list is available [https://github.com/Malvineous/xargon/blob/master/src/include/x_obj.h in the source code].&lt;br /&gt;
&lt;br /&gt;
iXD and iYD defines both speed and direction of items and ennemies. Positive values goes to right and down while values under zero move the object left and up.&lt;br /&gt;
lPointer referes to a segment of memory and is likely used to store entries from the string stack, that&#039;s why the gap between two consecutive pointers equals 65536 (this is the maximum size in byte of a string in the stack)&lt;br /&gt;
Playable objects must be the first entry in the list to avoid a weird &amp;quot;scroll to first entity&amp;quot; bug in Jill&lt;br /&gt;
&lt;br /&gt;
=== Functional ===&lt;br /&gt;
&lt;br /&gt;
*iType[0]	&#039;&#039;(PLAYER)&#039;&#039;	Playable: Jill (level)&lt;br /&gt;
:ObjectInfo1 (sometimes &#039;-1&#039;): usage unknown&lt;br /&gt;
*iType[23]	&#039;&#039;(TINY)&#039;&#039;	Playable: Jill (map overview in Jill3)		&lt;br /&gt;
*iType[54]	&#039;&#039;(JILLFISH)&#039;&#039;	Playable: Fish (never used in maps - if player dies, restart as Jill)&lt;br /&gt;
*iType[56]	&#039;&#039;(JILLBIRD)&#039;&#039;	Playable: Firebird (never used in maps - if player dies, restart as Jill)&lt;br /&gt;
*iType[57]	&#039;&#039;(JILLFROG)&#039;&#039;	Playable: Frog (never used in maps - if player dies, restart as Jill)&lt;br /&gt;
*iType[12]	&#039;&#039;(CHECKPT)&#039;&#039;	Trigger: Checkpoint&lt;br /&gt;
:iXD (&#039;&amp;gt; 0&#039;): X position of start in new map&lt;br /&gt;
:iYD (&#039;&amp;gt; 0&#039;): Y position of start in new map&lt;br /&gt;
:iState: If set to 1, the level is reset to it&#039;s initial state if player dies. If set to 0, the level&#039;s state is unchanged if player dies.&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): checkpoint/level number&lt;br /&gt;
:iPointer: pointer&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Always lock access to previous checkpoint when the player reaches a new checkpoint. This item reads an entry from the string stack: a single-character code and a filename. If the code is &amp;quot;*&amp;quot;, it means &amp;quot;load and play this song from the beginning&amp;quot;. If the code is &amp;quot;#&amp;quot;, it means &amp;quot;keep on playing this song&amp;quot;. If the code is &amp;quot;!&amp;quot;, then there&#039;s no filename and it means &amp;quot;load previous map&amp;quot;. If there&#039;s no code, then the filename is the next level to load.&lt;br /&gt;
*iType[15]	&#039;&#039;(PAD)&#039;&#039;	Trigger: Touch Trigger&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): target tag&lt;br /&gt;
*iType[32]	&#039;&#039;(SWITCH)&#039;&#039;	Trigger: Switch&lt;br /&gt;
:iState (usually &#039;0&#039;): switch position, if target is off, set to &#039;1&#039;&lt;br /&gt;
:iXD (usually &#039;0&#039;): set to &#039;0&#039; when triggering two objects with different start states (one bridge &#039;off&#039; and a wall &#039;on&#039; for example)		&lt;br /&gt;
*iType[52]	&#039;&#039;(BUTTON)&#039;&#039;	Trigger: Press Button&lt;br /&gt;
:iXD (set to &#039;1&#039; to face right, &#039;-1&#039; to face left): direction&lt;br /&gt;
:iState (set to &#039;1&#039; if target is off)&lt;br /&gt;
:iSubState: usage unknown, rarely used&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): target tag		&lt;br /&gt;
*iType[24]	&#039;&#039;(DOOR)&#039;&#039;	Misc: Locked Door&lt;br /&gt;
:iYD (usually &#039;0&#039;, set to &#039;1&#039; for crystal): required key type&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag&lt;br /&gt;
*iType[25]	&#039;&#039;(FALLDOOR)&#039;&#039;	Misc: Collapsing ceiling&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag&lt;br /&gt;
*iType[26]	&#039;&#039;(BRIDGER)&#039;&#039;	Misc: Toggle Wall&lt;br /&gt;
:iXD (set to 1 for horizontal/floor)&lt;br /&gt;
:iYD (set to 1 for vertical/wall)&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If set as wall, must be placed on top of the wall, if set as floor, must be placed on the far left of the floor. By default, these walls are &amp;quot;off&amp;quot;, use &amp;quot;ELEVMID&amp;quot; tiles for wall and &amp;quot;BRIDGE&amp;quot; for floor. Walls and bridges cannot go through two different types of tiles.&lt;br /&gt;
*iType[44]	&#039;&#039;(KNIGHT)&#039;&#039;	Misc: Knight&lt;br /&gt;
:iState (set to &#039;1&#039; for start on, &#039;0&#039; for start off): initial state&lt;br /&gt;
:iStateCount (set to &#039;6&#039; for &#039;none shall pass&#039;)&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag (toggle when triggered)&lt;br /&gt;
*iType[61]	&#039;&#039;(ELEV)&#039;&#039;	Misc: Lift&lt;br /&gt;
:iCounter (usually &#039;0&#039;): if set to &#039;-1&#039;, do not return to initial state&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; When going up, the elevator will travel until the player hits a solid tile. When going down, the elevator will erase &amp;quot;ELEVMID&amp;quot; tiles, replacing them with the tile directly above. &amp;quot;ELEVBOT&amp;quot; tiles look the same as &amp;quot;ELEVMID&amp;quot; tiles, but an elevator will not travel through it.&lt;br /&gt;
&lt;br /&gt;
=== Items &amp;amp; Bonus ===&lt;br /&gt;
&lt;br /&gt;
*iType[1]	&#039;&#039;(APPLE)&#039;&#039;	Bonus: Apple&lt;br /&gt;
*iType[28]	&#039;&#039;(TOKEN)&#039;&#039;	Bonus: Pickup Item &amp;amp; morphing icons&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): item type (can be anything from 0 to 9 and matches the inventory item number)		&lt;br /&gt;
*iType[2]	&#039;&#039;(KNIFE)&#039;&#039;	Weapon: Knife&lt;br /&gt;
*iType[14]	&#039;&#039;(KEY)&#039;&#039;	Key: Old Red Key&lt;br /&gt;
*iType[33]	&#039;&#039;(GEM)&#039;&#039;	Key: Crystal&lt;br /&gt;
:iCounter (rarely set to &#039;1&#039;): usage unknown&lt;br /&gt;
&lt;br /&gt;
=== Monsters ===	&lt;br /&gt;
&lt;br /&gt;
*iType[4]	&#039;&#039;(BIGANT)&#039;&#039;	Green bug&lt;br /&gt;
:iXD (usually &#039;2&#039;): movement speed&lt;br /&gt;
*iType[7]	&#039;&#039;(DEMON)&#039;&#039;	Devil&lt;br /&gt;
*iType[8]	&#039;&#039;(BUNNY)&#039;&#039;	Bunny&lt;br /&gt;
*iType[9]	&#039;&#039;(INCHWORM)&#039;&#039;	Worm&lt;br /&gt;
:iXD (usually &#039;2&#039;): movement speed&lt;br /&gt;
*iType[11]	&#039;&#039;(BOBSLUG)&#039;&#039;	Giant Slug&lt;br /&gt;
:iXD (usually &#039;2&#039;): movement speed&lt;br /&gt;
*iType[17]	&#039;&#039;(FATSO)&#039;&#039;	Lizard Man&lt;br /&gt;
:iXD (usually &#039;2&#039;): movement speed		&lt;br /&gt;
*iType[22]	&#039;&#039;(FROG)&#039;&#039;	Frog&lt;br /&gt;
*iType[29]	&#039;&#039;(ANT)&#039;&#039;	Giant Ant&lt;br /&gt;
:iXD (usually &#039;3&#039;): movement speed&lt;br /&gt;
*iType[30]	&#039;&#039;(PHOENIX)&#039;&#039;	Phoenix&lt;br /&gt;
:iXD (usually &#039;3&#039;): movement speed&lt;br /&gt;
*iType[39]	&#039;&#039;(SNAKE)&#039;&#039;	Invincible Snake&lt;br /&gt;
:iXD (usually &#039;2&#039;): movement speed&lt;br /&gt;
*iType[43]	&#039;&#039;(BAT)&#039;&#039;	Giant Bat&lt;br /&gt;
*iType[45]	&#039;&#039;(BEENEST)&#039;&#039;	Hive&lt;br /&gt;
*iType[46]	&#039;&#039;(BEESWARM)&#039;&#039;	Bees&lt;br /&gt;
*iType[47]	&#039;&#039;(CRAB)&#039;&#039;	Crab&lt;br /&gt;
*iType[48]	&#039;&#039;(CROC)&#039;&#039;	Gator&lt;br /&gt;
:iXD (usually &#039;2&#039;): movement speed	&lt;br /&gt;
*iType[53]	&#039;&#039;(PAC)&#039;&#039;	Ghost&lt;br /&gt;
:iXD (usually &#039;2&#039;): initial direction&lt;br /&gt;
:iCounter (usually &#039;2&#039;): movement speed&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Ghosts move along the same tile type&lt;br /&gt;
*iType[59]	&#039;&#039;(JELLYFISH)&#039;&#039;	Jellyfish&lt;br /&gt;
*iType[60]	&#039;&#039;(BADFISH)&#039;&#039;	Eels&lt;br /&gt;
&lt;br /&gt;
=== Traps ===&lt;br /&gt;
&lt;br /&gt;
*iType[35]	&#039;&#039;(BOULDER)&#039;&#039;	Rolling Stone&lt;br /&gt;
*iType[38]	&#039;&#039;(STALAG)&#039;&#039;	Falling Spike&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag (fall when triggered)&lt;br /&gt;
*iType[41]	&#039;&#039;(BOLL)&#039;&#039;	Boucing Ball&lt;br /&gt;
:iCounter (usually &#039;4&#039;): ball type (0-small, 3-red, 4-green)&lt;br /&gt;
*iType[65]	&#039;&#039;(VINECLIMB)&#039;&#039;	Sparks&lt;br /&gt;
:iYD (usually &#039;2&#039;): movement speed&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; Sparks move along the same tile type&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&lt;br /&gt;
*iType[13]	&#039;&#039;(PAUL)&#039;&#039;	Misc: Prince&lt;br /&gt;
:iState (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): object animation frame&lt;br /&gt;
*iType[19]	&#039;&#039;(CLOUD)&#039;&#039;	Misc: Cloud&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): usage unknown&lt;br /&gt;
:iXD (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): movement speed&lt;br /&gt;
*iType[20]	&#039;&#039;(TEXT6)&#039;&#039;	Misc: Write text (small capital letters)&lt;br /&gt;
:iXD (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): CGA color index number&lt;br /&gt;
:iYD (usually &#039;-1&#039; for transparent): background color&lt;br /&gt;
:lPointer: pointer&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; This item reads an entry from the string stack&lt;br /&gt;
*iType[21]	&#039;&#039;(TEXT8)&#039;&#039;	Misc: Write text (big letters)&lt;br /&gt;
:iXD (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): CGA color index number&lt;br /&gt;
:iYD (usually &#039;-1&#039; for transparent): background color&lt;br /&gt;
:lPointer: pointer&lt;br /&gt;
:&#039;&#039;&#039;NOTE:&#039;&#039;&#039; This item reads an entry from the string stack&lt;br /&gt;
*iType[40]	&#039;&#039;(SEAROCK)&#039;&#039;	Misc: Underwater Rock&lt;br /&gt;
*iType[42]	&#039;&#039;(MEGA)&#039;&#039;	Misc: Huge letter&lt;br /&gt;
:iXD (&#039;&amp;gt;= 0&#039;): letter type (0-M, 1-E, 2-G, 3-A, 4-S)&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag (fall when triggered)&lt;br /&gt;
*iType[49]	&#039;&#039;(EPIC)&#039;&#039;	Misc: Epic Logo&lt;br /&gt;
*iType[51]	&#039;&#039;(SKULL)&#039;&#039;	Misc: Big Skull&lt;br /&gt;
:iCounter (&#039;&amp;gt;= 0&#039;): self tag (laugh with red gloomy eyes when triggered)&lt;br /&gt;
*iType[64]	&#039;&#039;(EYE)&#039;&#039;	Misc: Eye&lt;br /&gt;
*iType[66]	&#039;&#039;(FLAG)&#039;&#039;	Misc: Flag&lt;br /&gt;
*iType[67]	&#039;&#039;(MAPDEMO)&#039;&#039;	Misc: &amp;quot;Demo&amp;quot;/&amp;quot;Map&amp;quot; sign&lt;br /&gt;
:iXD (sign type, &#039;&amp;gt;= 0&#039;): set to &#039;1&#039; for &amp;quot;map&amp;quot;, &#039;0&#039; for &amp;quot;demo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Untested ===&lt;br /&gt;
&lt;br /&gt;
*iType[3]	? (buggy/unusable)&lt;br /&gt;
*iType[5]	? (buggy/unusable)&lt;br /&gt;
*iType[10]	? (buggy/unusable)&lt;br /&gt;
*iType[16]	? (buggy/unusable)&lt;br /&gt;
*iType[27]	? (buggy/unusable)&lt;br /&gt;
*iType[34]	? (buggy/unusable)&lt;br /&gt;
*iType[50]	? (buggy/unusable)&lt;br /&gt;
*iType[55]	? (buggy/unusable)&lt;br /&gt;
*iType[6]	Buggy: harmless firebird&lt;br /&gt;
*iType[18]	Saves: Demon attack&lt;br /&gt;
:iSpeedX (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): Horizontal speed&lt;br /&gt;
:iSpeedY (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): Vertical speed&lt;br /&gt;
*iType[31]	Saves: flame attack&lt;br /&gt;
*iType[36]	Saves: Particle&lt;br /&gt;
:iState (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): color&lt;br /&gt;
:iSpeedX (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): velocity X&lt;br /&gt;
:iSpeedY (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): velocity Y&lt;br /&gt;
:iFlag (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;16384&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): Unknow&lt;br /&gt;
:iCounter (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): Unknow&lt;br /&gt;
*iType[37]	Saves: Pain effect&lt;br /&gt;
*iType[58]	Saves: Bubbles&lt;br /&gt;
:iFlag (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&#039;16384&#039;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;): Unknow&lt;br /&gt;
*iType[62]	Saves: Player attack (fireball)&lt;br /&gt;
*iType[63]	Saves: Player attack (fish)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Malvineous|Malvineous]], [[User:Ilovemyq3map2|Ilovemyq3map2]] and [[User:SaxxonPike|SaxxonPike]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Talk:Bio_Menace/Cheats&amp;diff=7888</id>
		<title>Talk:Bio Menace/Cheats</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Talk:Bio_Menace/Cheats&amp;diff=7888"/>
		<updated>2018-08-01T23:01:21Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added signature&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When you use Super Plasma Bolt &amp;quot;cheat&amp;quot;, you also lose a lifebar with that. Is it bug? --[[User:Szemigi|Szemigi]] ([[User talk:Szemigi|talk]]) 21:42, 1 August 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
: It&#039;s not a bug. That&#039;s exactly how the Super Plasma Bolt is supposed to work. Just read the BM-HINT.TXT file that comes with the freeware release. All the &amp;lt;tt&amp;gt;SECRET BATTLE MOVES&amp;lt;/tt&amp;gt; are described in there. --[[User:K1n9 Duk3|K1n9 Duk3]] ([[User talk:K1n9 Duk3|talk]]) 23:01, 1 August 2018 (UTC)&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Talk:Bio_Menace/Cheats&amp;diff=7887</id>
		<title>Talk:Bio Menace/Cheats</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Talk:Bio_Menace/Cheats&amp;diff=7887"/>
		<updated>2018-08-01T22:57:05Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: RTFM&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When you use Super Plasma Bolt &amp;quot;cheat&amp;quot;, you also lose a lifebar with that. Is it bug? --[[User:Szemigi|Szemigi]] ([[User talk:Szemigi|talk]]) 21:42, 1 August 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
: It&#039;s not a bug. That&#039;s exactly how the Super Plasma Bolt is supposed to work. Just read the BM-HINT.TXT file that comes with the freeware release. All the &amp;lt;tt&amp;gt;SECRET BATTLE MOVES&amp;lt;/tt&amp;gt; are described in there.&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=SAV_Format_(Hocus_Pocus)&amp;diff=7386</id>
		<title>SAV Format (Hocus Pocus)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=SAV_Format_(Hocus_Pocus)&amp;diff=7386"/>
		<updated>2017-11-25T00:13:18Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Added complete C struct with all the data fields and fixed the info in the savegame part.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&lt;br /&gt;
{{Playerdata Infobox&lt;br /&gt;
 | Config = Yes&lt;br /&gt;
 | Savegame = Yes&lt;br /&gt;
 | Storing = Sound, Scores&lt;br /&gt;
 | Where = Start&lt;br /&gt;
 | Elements = Level, Difficulty, Score&lt;br /&gt;
 | Games =&lt;br /&gt;
   {{Game|Hocus Pocus}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Information from the shareware episode:&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
The file HOCUS.SAV stores the following data structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
typedef struct {&lt;br /&gt;
	Uint16 soundOn, musicOn;&lt;br /&gt;
	Uint16 controlMode;&lt;br /&gt;
	Uint16 gamespeed;&lt;br /&gt;
	Uint16 joyLoX, joyMiX, joyHiX;&lt;br /&gt;
	Uint16 joyLoY, joyMiY, joyHiY;&lt;br /&gt;
	Uint16 joyFireButton;&lt;br /&gt;
	Uint8 controlKeys[8];&lt;br /&gt;
	//saved games:&lt;br /&gt;
	Sint16 sg_episodes[9];&lt;br /&gt;
	Sint16 sg_levels[9];&lt;br /&gt;
	Sint16 sg_skill[9];&lt;br /&gt;
	char sg_names[9][26];	//9 entries, 26 chars each (25 chars + terminating 0)&lt;br /&gt;
	Uint8 unused[10];	//only used by setup (first 9 bytes set to 1)&lt;br /&gt;
	Sint32 sg_scores[9];&lt;br /&gt;
	//high scores:&lt;br /&gt;
	char hs_names[4][5][26];	//4*5 entries, 26 chars each (25 chars + terminating 0)&lt;br /&gt;
	Sint32 hs_scores[4][5];&lt;br /&gt;
	//sound setup:&lt;br /&gt;
	Sint16 soundCard;&lt;br /&gt;
	Uint16 numVoices;&lt;br /&gt;
	Uint16 mixBits;&lt;br /&gt;
	Sint16 musicCard;&lt;br /&gt;
	Uint16 midiPort;&lt;br /&gt;
	//settings for setup tool:&lt;br /&gt;
	Uint16 soundCardIndex;&lt;br /&gt;
	Uint16 numVoicesIndex;&lt;br /&gt;
	Uint16 mixingQualityIndex;&lt;br /&gt;
	Uint16 musicCardIndex;&lt;br /&gt;
	Uint16 midiPortIndex;&lt;br /&gt;
	//more sound settings:&lt;br /&gt;
	Uint16 soundVolume;&lt;br /&gt;
	Uint16 musicVolume;&lt;br /&gt;
	Uint16 usesGravis;&lt;br /&gt;
} TGameConfig;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Save Game part ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Offset!!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x1E||SINT16LE episode[9]||episode, also indicating whether the each savegame can be loaded. -1 = empty. 0 = first episode. 1 = second episode etc.&lt;br /&gt;
|-&lt;br /&gt;
|0x30||INT16LE level[9]||saved level of each savegame. 0 = first level. 1 = second level etc.&lt;br /&gt;
|-&lt;br /&gt;
|0x42||INT16LE difficulty[9]||difficulty of each savegame 0 = easy, 1 = moderate, 2 = hard, 3 = godmode&lt;br /&gt;
|-&lt;br /&gt;
|0x54||ASCIZ [9][26]||name of each savegame with trailing zero. (maximum 25 characters + trailing zero)&lt;br /&gt;
|-&lt;br /&gt;
|0x13E||BYTE unused[10]||some rubbish 9 times 1 and 1 time zero. Never used by the game.&amp;lt;br&amp;gt;Note: The 0 might just be padding, so that the scores start at an even address.&lt;br /&gt;
|-&lt;br /&gt;
|0x148||INT32LE score[9]||score of each savegame.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
Small sample program(C++) to show information about the savegames: (start like this: &#039;&#039;&#039;app HOCUS.SAV&#039;&#039;&#039;)&lt;br /&gt;
&#039;&#039;int assumed to be 32 bit, short to be 16 bit. Only for little endian machines.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
 #include &amp;lt;fstream&amp;gt;&lt;br /&gt;
 using namespace std;&lt;br /&gt;
 &lt;br /&gt;
 int main(int argc, char* argv[]) {&lt;br /&gt;
    if(argc != 2) return 1;&lt;br /&gt;
 &lt;br /&gt;
    ifstream input(argv[1]);&lt;br /&gt;
    input.seekg(0x1E,ios::beg);&lt;br /&gt;
    short signed int episode[9];&lt;br /&gt;
    input.read(reinterpret_cast&amp;lt;char*&amp;gt;(&amp;amp;episode),2*9);&lt;br /&gt;
    short level[9];&lt;br /&gt;
    input.read(reinterpret_cast&amp;lt;char*&amp;gt;(&amp;amp;level),2*9);&lt;br /&gt;
    short difficulty[9];&lt;br /&gt;
    input.read(reinterpret_cast&amp;lt;char*&amp;gt;(&amp;amp;difficulty),2*9);&lt;br /&gt;
    char name[9][26];&lt;br /&gt;
    input.read(&amp;amp;name[0][0],9*26);&lt;br /&gt;
 &lt;br /&gt;
    input.seekg(0x148,ios::beg);&lt;br /&gt;
    int score[9];&lt;br /&gt;
    input.read(reinterpret_cast&amp;lt;char*&amp;gt;(&amp;amp;score),4*9);&lt;br /&gt;
 &lt;br /&gt;
    for(int i = 0;i &amp;lt; 9;i++) {&lt;br /&gt;
       cout &amp;lt;&amp;lt; &amp;quot;save &amp;quot; &amp;lt;&amp;lt; i+1 &amp;lt;&amp;lt; &amp;quot; episode &amp;quot; &amp;lt;&amp;lt; episode[i]&lt;br /&gt;
            &amp;lt;&amp;lt; &amp;quot; level &amp;quot; &amp;lt;&amp;lt; level[i] &amp;lt;&amp;lt; &amp;quot; difficulty &amp;quot; &amp;lt;&amp;lt; difficulty[i]&lt;br /&gt;
            &amp;lt;&amp;lt; &amp;quot; name: &amp;quot;&amp;lt;&amp;lt; name[i] &amp;lt;&amp;lt; &amp;quot; score &amp;quot; &amp;lt;&amp;lt; score[i] &amp;lt;&amp;lt; endl;&lt;br /&gt;
      }&lt;br /&gt;
    return 0;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Highscore part ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Offset!!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|0x16C||ASCIZ Name1[5][26]||Names of the people with highscores for episode 1&lt;br /&gt;
|-&lt;br /&gt;
|0x1EE||ASCIZ Name2[5][26]||Names of the people with highscores for episode 2&lt;br /&gt;
|-&lt;br /&gt;
|0x270||ASCIZ Name3[5][26]||Names of the people with highscores for episode 3&lt;br /&gt;
|-&lt;br /&gt;
|0x2F2||ASCIZ Name4[5][26]||Names of the people with highscores for episode 4&lt;br /&gt;
|-&lt;br /&gt;
|0x374||INT32LE Score[4][5]||Highscores themselves. Listed by episode.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Sound Configuration ===&lt;br /&gt;
&lt;br /&gt;
Stored at the bottom of the file. (less interesting as setup.exe can change those)&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Qbix|Qbix]].  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&amp;diff=7385</id>
		<title>Cosmo Level Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&amp;diff=7385"/>
		<updated>2017-11-23T22:37:12Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added ALL supported actor types&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Tile size = 8&amp;amp;times;8&lt;br /&gt;
 | Viewport = 304&amp;amp;times;144&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Cosmo&#039;s Cosmic Adventures}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
The file is in this basic layout:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iMapWidth||Map width in tiles&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iActorSize||Number of UINT16 values in the actor block&lt;br /&gt;
|-&lt;br /&gt;
|ACTORDATA actorData[]||Variable-length array of all the actors in the level&lt;br /&gt;
|-&lt;br /&gt;
|BYTE bgLayer[65528]||The map data for the background layer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The &amp;quot;view window&amp;quot; in the game is 304x144 Pixels, so the minimal map width would be 38. However, the game will &#039;&#039;only&#039;&#039; recognize the values 32, 64, 128, 256, 512, 1024 and 2048. Any other value will not be handled by the game at all, thus leaving a vital variable uninitialized. However, the values 32 and 2048 should never be used in a level, since the width or height of the level would be smaller than the viewport.&lt;br /&gt;
&lt;br /&gt;
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20). Since the game loads the entire actorData array into a block of 65535 bytes, the iActorSize value must be less than 32766. Larger values would lead to memory corruption.&lt;br /&gt;
&lt;br /&gt;
The map data found in the original level files is actually sized 65528 Bytes or 32764 Words, but the game will read it a block of up to 65535 bytes. Each Word entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).&lt;br /&gt;
&lt;br /&gt;
=== Level Flags ===&lt;br /&gt;
&lt;br /&gt;
The structure of the bits in the iFlags value is as follows:&lt;br /&gt;
&lt;br /&gt;
 [ mmmmm | ppp | yxr | bbbbb ]&lt;br /&gt;
 &lt;br /&gt;
 m: music index&lt;br /&gt;
 p: palette animation type&lt;br /&gt;
 y: y-scrolling backdrop&lt;br /&gt;
 x: x-scrolling backdrop&lt;br /&gt;
 r: rain&lt;br /&gt;
 b: backdrop index&lt;br /&gt;
&lt;br /&gt;
Assuming the iFlags value was read as a UINT16LE, the value can be split like this:&lt;br /&gt;
&lt;br /&gt;
 rain      = (iFlags &amp;amp; 0x20) != 0;&lt;br /&gt;
 backdrop  = iFlags &amp;amp; 0x1F;&lt;br /&gt;
 scrollX   = (iFlags &amp;amp; 0x40) != 0;&lt;br /&gt;
 scrollY   = (iFlags &amp;amp; 0x80) != 0;&lt;br /&gt;
 animation = (iFlags &amp;gt;&amp;gt; 8) &amp;amp; 7;&lt;br /&gt;
 music     = (iflags &amp;gt;&amp;gt; 11) &amp;amp; 0x1F;&lt;br /&gt;
&lt;br /&gt;
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is &amp;lt;tt&amp;gt;BDBLANK.MNI&amp;lt;/tt&amp;gt;, for music it&#039;s &amp;lt;tt&amp;gt;MCAVES.MNI&amp;lt;/tt&amp;gt;. Note that some backdrop files are not used by the games.  The complete list is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: left;&amp;quot;&lt;br /&gt;
! Backdrop&amp;lt;br/&amp;gt;value !! Filename&lt;br /&gt;
|-&lt;br /&gt;
| 0 || bdblank.mni&lt;br /&gt;
|-&lt;br /&gt;
| 1 || bdpipe.mni&lt;br /&gt;
|-&lt;br /&gt;
| 2 || bdredsky.mni&lt;br /&gt;
|-&lt;br /&gt;
| 3 || bdrocktk.mni&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bdjungle.mni&lt;br /&gt;
|-&lt;br /&gt;
| 5 || bdstar.mni&lt;br /&gt;
|-&lt;br /&gt;
| 6 || bdwierd.mni&lt;br /&gt;
|-&lt;br /&gt;
| 7 || bdcave.mni&lt;br /&gt;
|-&lt;br /&gt;
| 8 || bdice.mni&lt;br /&gt;
|-&lt;br /&gt;
| 9 || bdshrum.mni&lt;br /&gt;
|-&lt;br /&gt;
| 10 || bdtechms.mni&lt;br /&gt;
|-&lt;br /&gt;
| 11 || bdnewsky.mni&lt;br /&gt;
|-&lt;br /&gt;
| 12 || bdstar2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 13 || bdstar3.mni&lt;br /&gt;
|-&lt;br /&gt;
| 14 || bdforest.mni&lt;br /&gt;
|-&lt;br /&gt;
| 15 || bdmountn.mni&lt;br /&gt;
|-&lt;br /&gt;
| 16 || bdguts.mni&lt;br /&gt;
|-&lt;br /&gt;
| 17 || bdbrktec.mni&lt;br /&gt;
|-&lt;br /&gt;
| 18 || bdclouds.mni&lt;br /&gt;
|-&lt;br /&gt;
| 19 || bdfutcty.mni&lt;br /&gt;
|-&lt;br /&gt;
| 20 || bdice2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 21 || bdcliff.mni&lt;br /&gt;
|-&lt;br /&gt;
| 22 || bdspooky.mni&lt;br /&gt;
|-&lt;br /&gt;
| 23 || bdcrystl.mni&lt;br /&gt;
|-&lt;br /&gt;
| 24 || bdcircut.mni&lt;br /&gt;
|-&lt;br /&gt;
| 25 || bdcircpc.mni&lt;br /&gt;
|-&lt;br /&gt;
| 26-31 || &#039;&#039;Unused&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: left;&amp;quot;&lt;br /&gt;
! Music&amp;lt;br/&amp;gt;value !! Filename&lt;br /&gt;
|-&lt;br /&gt;
| 0 || mcaves.mni&lt;br /&gt;
|-&lt;br /&gt;
| 1 || mscarry.mni&lt;br /&gt;
|-&lt;br /&gt;
| 2 || mboss.mni&lt;br /&gt;
|-&lt;br /&gt;
| 3 || mrunaway.mni&lt;br /&gt;
|-&lt;br /&gt;
| 4 || mcircus.mni&lt;br /&gt;
|-&lt;br /&gt;
| 5 || mtekwrd.mni&lt;br /&gt;
|-&lt;br /&gt;
| 6 || measylev.mni&lt;br /&gt;
|-&lt;br /&gt;
| 7 || mrockit.mni&lt;br /&gt;
|-&lt;br /&gt;
| 8 || mhappy.mni&lt;br /&gt;
|-&lt;br /&gt;
| 9 || mdevo.mni&lt;br /&gt;
|-&lt;br /&gt;
| 10 || mdadoda.mni&lt;br /&gt;
|-&lt;br /&gt;
| 11 || mbells.mni&lt;br /&gt;
|-&lt;br /&gt;
| 12 || mdrums.mni&lt;br /&gt;
|-&lt;br /&gt;
| 13 || mbanjo.mni&lt;br /&gt;
|-&lt;br /&gt;
| 14 || measy2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 15 || mteck2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 16 || mteck3.mni&lt;br /&gt;
|-&lt;br /&gt;
| 17 || mteck4.mni&lt;br /&gt;
|-&lt;br /&gt;
| 18 || mzztop.mni&lt;br /&gt;
|-&lt;br /&gt;
| 19-31 || &#039;&#039;Unused&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: left;&amp;quot;&lt;br /&gt;
! Animation&amp;lt;br/&amp;gt;value !! Use !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || most levels || no palette changes&lt;br /&gt;
|-&lt;br /&gt;
| 1 || A4 || random lightning (with thunder soundeffect)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || C8-C10 || cycling: red -&amp;gt; yellow -&amp;gt; white&lt;br /&gt;
|-&lt;br /&gt;
| 3 || A7 || cycling: red -&amp;gt; green -&amp;gt; blue&lt;br /&gt;
|-&lt;br /&gt;
| 4 || A8, B3, B4, B7 || cycling: black -&amp;gt; grey -&amp;gt; white&lt;br /&gt;
|-&lt;br /&gt;
| 5 || C6, C7 || flashing: red -&amp;gt; magenta -&amp;gt; white&lt;br /&gt;
|-&lt;br /&gt;
| 6 || C1 || replace dark magenta with black,&amp;lt;br/&amp;gt;no animation unless triggered by a bomb actor.&amp;lt;br/&amp;gt;(ONLY PRESENT IN COSMO3.EXE.)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || None || no palette changes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Background Layer ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;bgLayer&amp;lt;/tt&amp;gt; block contains the grid/cell data:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iMapData[32764]||Actual map data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;element&amp;quot; in &amp;lt;tt&amp;gt;iMapData&amp;lt;/tt&amp;gt; refers to the foreground and/or background tile used in a single grid cell.  The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:&lt;br /&gt;
&lt;br /&gt;
 int iIndex = (y * iMapWidth) + x;&lt;br /&gt;
 iMapData[iIndex] = &amp;lt;new value to set at x,y&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height using this formula:&lt;br /&gt;
&lt;br /&gt;
 int iMapHeight = 32768 / iMapWidth - 1;&lt;br /&gt;
&lt;br /&gt;
Since the width of the map is always a power of 2 (min. 64), you can see that each of the original level files is &amp;quot;missing&amp;quot; 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line (hence the -1 in the formula). However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. For editing a level, you should make sure the last line is visible, so that it&#039;s possible to place actors in that line or remove them from there. Using a buffer of at least 65536 bytes for the level tiles is highly recommended for this.&lt;br /&gt;
&lt;br /&gt;
==== Mapping cell values to tiles ====&lt;br /&gt;
&lt;br /&gt;
The method of mapping elements in the &amp;lt;tt&amp;gt;iMapData&amp;lt;/tt&amp;gt; structure into tiles is fairly straightforward.  Each cell value is a pixel index into the tilemap.  Imagine the tileset laid out left to right all on the one row.  Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.)  Assuming the solid/unmasked tileset graphics are layed out as an 8 pixel wide column, the cell value is essentially a pixel y-coordinate into the solid/unmasked tileset.&lt;br /&gt;
&lt;br /&gt;
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.)  The game interprets any value smaller than 16000 as an index into the solid/unmasked tileset. Any other value will be treated as an index into the masked tileset (the offset 16000 is subtracted, of course). The cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.&lt;br /&gt;
&lt;br /&gt;
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.)  However, since the masked tiles consist of five planes, the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.)  The following formula can be used to convert the values into tile numbers once they stray into the masked tile area:&lt;br /&gt;
&lt;br /&gt;
 #define COSMO_TS_SOLID_NUMTILES   2000 // 40x25&lt;br /&gt;
 #define COSMO_TS_MASKED_NUMTILES  1000 // 40x4&lt;br /&gt;
 &lt;br /&gt;
 tile = cell_value / 8&lt;br /&gt;
 if (tile &amp;gt; COSMO_TS_SOLID_NUMTILES) {&lt;br /&gt;
   // Once we&#039;re in the masked tileset it counts up in multiples of five planes&lt;br /&gt;
   tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;&lt;br /&gt;
 }&lt;br /&gt;
 // Now &#039;tile&#039; will be between 0 and 2999 inclusive&lt;br /&gt;
&lt;br /&gt;
As an example of a few tile values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Cell value !! Tile number !! Tileset !! Index !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || N/A || N/A || See through to map backdrop&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8&lt;br /&gt;
|-&lt;br /&gt;
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again&lt;br /&gt;
|-&lt;br /&gt;
| 15992 || 1999 || Solid || 1999 || Last solid tile&lt;br /&gt;
|-&lt;br /&gt;
| 16000 || 2000 || Masked || 0 || First masked tile&lt;br /&gt;
|-&lt;br /&gt;
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40&lt;br /&gt;
|-&lt;br /&gt;
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again&lt;br /&gt;
|-&lt;br /&gt;
| 55960 || 2999 || Masked || 999 || Last masked tile&lt;br /&gt;
|-&lt;br /&gt;
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction.  (Although obviously out of range tiles will not be drawn correctly by the engine!)&lt;br /&gt;
&lt;br /&gt;
Another thing to keep in mind is that the game will simply draw the background for any cell value smaller than 80. The first ten tiles in the tileset are never drawn in the game, but they should be drawn by a level editor.&lt;br /&gt;
&lt;br /&gt;
==== Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* The first ten tiles in the solid tileset is used as transparent tiles.  The game does not draw these tile, so any cells with this as the background cell will be where the map backdrop shows through.  If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.&lt;br /&gt;
&lt;br /&gt;
* The solid tiles #1 to #8 are used to define a path, along which the platforms move in the game. The path should be laid out in a loop and should never lead to a non-direction tile. If tile #0 is part of the path, the platform will stop moving once it reaches that cell. Any tile larger than #8 will lead to the game reading memory beyond an array boundary, which will result in undefined behavior.&lt;br /&gt;
&lt;br /&gt;
=== Actor data ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;actorData&amp;lt;/tt&amp;gt; block is in the following format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iType||Type of actor&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iX||X-coordinate of actor (in tile units)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iY||Y-coordinate of actor (in tile units)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;tt&amp;gt;iActorSize&amp;lt;/tt&amp;gt; value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:&lt;br /&gt;
&lt;br /&gt;
 iNumActors = iActorSize / 3&lt;br /&gt;
&lt;br /&gt;
This is exactly how the game treats this value.&lt;br /&gt;
&lt;br /&gt;
==== Mapping Actor Types to image indices ====&lt;br /&gt;
&lt;br /&gt;
For the ActorTypes from 31 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:&lt;br /&gt;
&lt;br /&gt;
 ImageIndex = ActorType - 31&lt;br /&gt;
&lt;br /&gt;
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will be &amp;quot;empty&amp;quot;. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).&lt;br /&gt;
&lt;br /&gt;
==== List of Actor Types ====&lt;br /&gt;
&lt;br /&gt;
This is a list of all the actor types that are actually used by the game. Any value not listed here will be ignored by the game.&lt;br /&gt;
&lt;br /&gt;
Limitations:&lt;br /&gt;
* Using more than 10 platforms or more than 10 mud fountains (total) in a level will lead to memory corruption.&lt;br /&gt;
* There can be up to 199 lights in a level (if there are more, the game will ignore the rest).&lt;br /&gt;
* There can be up to 410 actors in a level. Anything with a type value of 31 and above counts as an actor, but invalid/unused types will not take up an actor slot. The game will stop parsing the &amp;lt;tt&amp;gt;actorData&amp;lt;/tt&amp;gt; array immediately after spawning actor #410, ignoring any other data that might be left in the unparsed part of the array, such as platforms, mud fountains, ligths and even Cosmo. &lt;br /&gt;
 &lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Actor&amp;lt;br&amp;gt;Sprite !! X !! Y !! Description&lt;br /&gt;
|-&lt;br /&gt;
|  0 || N/A || x || y || Cosmo (Starting position, facing right)&lt;br /&gt;
|-&lt;br /&gt;
|  1 || N/A || x || y || moving platform (fixed path)&lt;br /&gt;
|-&lt;br /&gt;
|  2 || 79 || x-1 || y-1 || mud fountain 1 (small)&lt;br /&gt;
|-&lt;br /&gt;
|  3 || 79 || x-1 || y-1 || mud fountain 2 (medium)&lt;br /&gt;
|-&lt;br /&gt;
|  4 || 79 || x-1 || y-1 || mud fountain 3 (large)&lt;br /&gt;
|-&lt;br /&gt;
|  5 || 79 || x-1 || y-1 || mud fountain 4 (huge)&lt;br /&gt;
|-&lt;br /&gt;
|  6 || N/A || x || y || light shining down (left side)&lt;br /&gt;
|-&lt;br /&gt;
|  7 || N/A || x || y || light shining down (middle)&lt;br /&gt;
|-&lt;br /&gt;
|  8 ||	N/A || x || y || light shining down (right side)&lt;br /&gt;
|}&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Actor&amp;lt;br&amp;gt;Sprite !! X !! Y !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 ||	0 || x || y || CRATE: empty&lt;br /&gt;
|-&lt;br /&gt;
| 32 ||	1 || x || y || BONUS:	Star	(200)&lt;br /&gt;
|-&lt;br /&gt;
| 33 || 2 || x || y || PLAT:	Floor Spring&lt;br /&gt;
|-&lt;br /&gt;
| 34 || 3 || x || y || HAZARD:	Extending Arrow Spear (from right to left)&lt;br /&gt;
|-&lt;br /&gt;
| 35 || 4 || x-4 || y || HAZARD:	Extending Arrow Spear (from left to right)&lt;br /&gt;
|-&lt;br /&gt;
| 36 || 5 || x || y || HAZARD:	Plasma Fireball (from right to left)&lt;br /&gt;
|-&lt;br /&gt;
| 37 || 5 || x-1 || y || HAZARD:	Plasma Fireball (from left to right)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || 7 || x || y+1 || Blue Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 8 || x || y+1 || Red Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 40 || 9 || x || y+1 || Green Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 41 || 10 || x || y+1 || Yellow Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 42 || 11 || x || y || Blue Door&lt;br /&gt;
|-&lt;br /&gt;
| 43 || 12 || x || y || Red Door&lt;br /&gt;
|-&lt;br /&gt;
| 44 || 13 || x || y || Green Door&lt;br /&gt;
|-&lt;br /&gt;
| 45 || 14 || x || y || Yellow Door&lt;br /&gt;
|-&lt;br /&gt;
| 47 || 16 || x || y || OBJECT:	Blue Mobile Trampoline Car&lt;br /&gt;
|-&lt;br /&gt;
| 48 || 17 || x || y || HAZARD:	Non-Retracting Spikes&lt;br /&gt;
|-&lt;br /&gt;
| 49 || 18 || x || y || HAZARD:	Retracting Spikes&lt;br /&gt;
|-&lt;br /&gt;
| 51 || 20 || x || y || HAZARD:	Big Saw Blade (moving up/down)&lt;br /&gt;
|-&lt;br /&gt;
| 53 || 20 || x || y || HAZARD: Big Saw Blade (moving left/right)&lt;br /&gt;
|-&lt;br /&gt;
| 55 || 24 || x || y || HAZARD: Activated Bomb&lt;br /&gt;
|-&lt;br /&gt;
| 56 || 25 || x || y || HAZARD:	Green Pruny Cabbage Ball (takes 1 hit)&lt;br /&gt;
|-&lt;br /&gt;
| 59 || 28 || x || y || BONUS:	Power Up	(health/12800)&lt;br /&gt;
|-&lt;br /&gt;
| 60 || 29/28 || x || y || BARREL:	Power Up	(health/12800)&lt;br /&gt;
|-&lt;br /&gt;
| 62 || 0/32 || x || y || CRATE:	Green Tomato&lt;br /&gt;
|-&lt;br /&gt;
| 63 || 32 || x || y || BONUS:	Green Tomato (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 64 || 0/33 || x || y || CRATE:	Tomato		(200)&lt;br /&gt;
|-&lt;br /&gt;
| 65 || 33 || x || y || BONUS:	Tomato (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 66 || 0/36 || x || y || CRATE:	Yellow/Cyan Fruit&lt;br /&gt;
|-&lt;br /&gt;
| 67 || 36 || x || y || BONUS:	Yellow/Cyan Fruit (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 68 || 0/38 || x || y || CRATE:	Cyan Fruit&lt;br /&gt;
|-&lt;br /&gt;
| 69 || 38 || x || y || BONUS:	Cyan fruit (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 70 || 39 || x || y || OBJECT:	Exit Sign (ends level on touch)&lt;br /&gt;
|-&lt;br /&gt;
| 71 || 41 || x || y || HAZARD:	Spear (not moving)&lt;br /&gt;
|-&lt;br /&gt;
| 72 || 41 || x || y || HAZARD:	Spear (coming down from ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 73 || 43 || x || y+1 || HAZARD:	Leaking Green Acid&lt;br /&gt;
|-&lt;br /&gt;
| 74 || 43 || x || y+1 || HAZARD:	Dripping Green Acid&lt;br /&gt;
|-&lt;br /&gt;
| 75 || 44 || x || y || ENEMY:	Plasma Energy Sprites (Blue Flame-like creatures)&lt;br /&gt;
|-&lt;br /&gt;
| 76 || 45 || x || y || HAZARD:	&amp;quot;Two Tons&amp;quot; Weight going down &amp;amp; up&lt;br /&gt;
|-&lt;br /&gt;
| 77 || 46 || x || y || ENEMY:	Jumping Bulletheads&lt;br /&gt;
|-&lt;br /&gt;
| 78 || 47 || x || y || ENEMY:	Stone Heads (Only drops when Cosmo is close by)&lt;br /&gt;
|-&lt;br /&gt;
| 79 || 49 || x || y+1 || HAZARD:	Big Yellow Spike on ceiling&lt;br /&gt;
|-&lt;br /&gt;
| 80 || 49 || x || y+1 || HAZARD:	Big Yellow Spike on ceiling (falling down)&lt;br /&gt;
|-&lt;br /&gt;
| 81 || 49i || x || y || HAZARD:	Big Yellow Spike on ground&lt;br /&gt;
|-&lt;br /&gt;
| 82 || 51 || x || y || ENEMY:	Ghost&lt;br /&gt;
|-&lt;br /&gt;
| 83 || 0/135 || x || y || CRATE:	Green thing&lt;br /&gt;
|-&lt;br /&gt;
| 84 || 0/136 || x || y || CRATE:	Blue thing&lt;br /&gt;
|-&lt;br /&gt;
| 85 || 54 || x || y || ENEMY:	Angry Moon (blue floating characters)&lt;br /&gt;
|-&lt;br /&gt;
| 86 || 55 || x || y || ENEMY:	Small Red Plant&lt;br /&gt;
|-&lt;br /&gt;
| 87 || 29/57 || x || y || BARREL:	Bomb	(100)&lt;br /&gt;
|-&lt;br /&gt;
| 88 || 57 || x || y || BONUS:	Bomb	(100)&lt;br /&gt;
|-&lt;br /&gt;
| 89 || 29/2 || x || y || BARREL:	Floor Spring&lt;br /&gt;
|-&lt;br /&gt;
| 90 || 60 || x || y || OBJECT: switch (1) (Activates moving platform(s))&lt;br /&gt;
|-&lt;br /&gt;
| 92 || 60 || x || y || OBJECT: switch (2) (Activates Question Mark Block Wall Generator)&lt;br /&gt;
|-&lt;br /&gt;
| 93 || 62 || x || y || OBJECT: Question Mark Block (Generates a wall when activated by switch)&lt;br /&gt;
|-&lt;br /&gt;
| 94 || 63 || x || y || HAZARD: Ground Claw Spikes&lt;br /&gt;
|-&lt;br /&gt;
| 95 || 64 || x || y || OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)&lt;br /&gt;
|-&lt;br /&gt;
| 96 || 65 || x || y || ENEMY:	Mini Ghost (jumps)&lt;br /&gt;
|-&lt;br /&gt;
| 97 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving South West)&lt;br /&gt;
|-&lt;br /&gt;
| 98 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving South East)&lt;br /&gt;
|-&lt;br /&gt;
| 99 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving South)&lt;br /&gt;
|-&lt;br /&gt;
|100 || 69 || x || y || CREATURE:	Green Roamer Worm&lt;br /&gt;
|-&lt;br /&gt;
|101 || 70 || x || y || PIPE TRANSIT DIRECTION:	Arrow Up&lt;br /&gt;
|-&lt;br /&gt;
|102 || 71 || x || y || PIPE TRANSIT DIRECTION:	Arrow Down&lt;br /&gt;
|-&lt;br /&gt;
|103 || 72 || x || y || PIPE TRANSIT DIRECTION:	Arrow Left&lt;br /&gt;
|-&lt;br /&gt;
|104 || 73 || x || y || PIPE TRANSIT DIRECTION:	Arrow Right&lt;br /&gt;
|-&lt;br /&gt;
|105 || 75 || x || y || ENEMY:	Egg Head (cracks when player is near)&lt;br /&gt;
|-&lt;br /&gt;
|106 || 75 || x || y || ENEMY:	Egg Head (cracks when pounced)&lt;br /&gt;
|-&lt;br /&gt;
|109 || 78 || x || y || ENEMY:	Robotic Spike on ground&lt;br /&gt;
|-&lt;br /&gt;
|111 || 80 || x || y+2 || ENEMY:	Robotic Spike on ceiling&lt;br /&gt;
|-&lt;br /&gt;
|112 || 0/82 || x || y || CRATE:	Burger&lt;br /&gt;
|-&lt;br /&gt;
|113 || 82 || x || y || BONUS:	Burger&lt;br /&gt;
|-&lt;br /&gt;
|114 || 83 || x || y ||	ENEMY:	Blue/Red Clam Plant on ground&lt;br /&gt;
|-&lt;br /&gt;
|115 || 83i || x || y+2 || ENEMY:	Blue/Red Clam Plant on ceiling&lt;br /&gt;
|-&lt;br /&gt;
|116 || 85 || x || y+2 || BONUS:	Purple Grapes	(800)&lt;br /&gt;
|-&lt;br /&gt;
|117 || 86 || x || y || ENEMY:	Blue Ball&lt;br /&gt;
|-&lt;br /&gt;
|118 || 87 || x || y || HAZARD:	Spikes (on left wall)&lt;br /&gt;
|-&lt;br /&gt;
|119 || 88 || x || y || HAZARD:	Retracting Spikes (on left wall)&lt;br /&gt;
|-&lt;br /&gt;
|120 || 89 || x-3 || y || ENEMY:	Spikes (on right wall)&lt;br /&gt;
|-&lt;br /&gt;
|121 || 90 || x || y || ENEMY:	Robot with Blue Vertical Electric Arc&lt;br /&gt;
|-&lt;br /&gt;
|122 || 91 || x || y || PLAT:	Blue Platform (splits open when standing on top)&lt;br /&gt;
|-&lt;br /&gt;
|123 || 92 || x || y || ENEMY:	Spark&lt;br /&gt;
|-&lt;br /&gt;
|124 || 0/94 || x || y || CRATE:	Cyan Dancing Mushroom	(400)&lt;br /&gt;
|-&lt;br /&gt;
|125 || 94 || x || y || BONUS:	Cyan Dancing Mushroom	(400)&lt;br /&gt;
|-&lt;br /&gt;
|126 || 95 || x || y || DECO:	Pink Eye Plant&lt;br /&gt;
|-&lt;br /&gt;
|127 || 95i || x || y+1 || DECO:	Pink Eye Plant (hanging upside down)&lt;br /&gt;
|-&lt;br /&gt;
|131 || 29/251 || x || y || BARREL:	Cabbage Monster (see type 282)&lt;br /&gt;
|-&lt;br /&gt;
|132 || 101 || x || y || ENEMY:	Big Red Jumper (NOT IMPLEMENTED IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|133 || 102 || x || y || ENEMY:	BOSS (Purple Alien in Spike-bottomed ship) (NOT IMPLEMENTED IN COSMO2!)&lt;br /&gt;
|-&lt;br /&gt;
|135 || 105 || x-1 || y+2 || PNEUMATIC PIPES:	Exit&lt;br /&gt;
|-&lt;br /&gt;
|136 || 105 || x-1 || y+2 || PNEUMATIC PIPES:	Entrance&lt;br /&gt;
|-&lt;br /&gt;
|137 || 106 || x || y || ENEMY:	Suction-Cup-Legged Alien&lt;br /&gt;
|-&lt;br /&gt;
|138 || 108 || x || y || OBJECT: Teleporter A&lt;br /&gt;
|-&lt;br /&gt;
|139 || 108 || x || y || OBJECT: Teleporter B&lt;br /&gt;
|-&lt;br /&gt;
|140 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving West)&lt;br /&gt;
|-&lt;br /&gt;
|141 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving East)&lt;br /&gt;
|-&lt;br /&gt;
|142 || 112 || x-3 || y || ENEMY:	Cyan Spitting Plant (on left wall)&lt;br /&gt;
|-&lt;br /&gt;
|143 || 111 || x || y || ENEMY:	Cyan Spitting Plant (on right wall)&lt;br /&gt;
|-&lt;br /&gt;
|144 || 113 || x || y || ENEMY:	Blue Turret Alien&lt;br /&gt;
|-&lt;br /&gt;
|145 || 114 || x || y || PLAT:	Hoverboard&lt;br /&gt;
|-&lt;br /&gt;
|146 || 0/138 || x || y || CRATE:	pile of green balls&lt;br /&gt;
|-&lt;br /&gt;
|147 || 0/139 || x || y || CRATE:	blue/yellow fruit&lt;br /&gt;
|-&lt;br /&gt;
|148 || 29/140 || x || y || BARREL:	Saxophone-like thing&lt;br /&gt;
|-&lt;br /&gt;
|149 || 118 || x || y || ENEMY:	Red Chomper Alien&lt;br /&gt;
|-&lt;br /&gt;
|150 || 0/137 || x || y || CRATE:	Salad&lt;br /&gt;
|-&lt;br /&gt;
|151 || 60 || x || y || switch (3) (Activates lights, if actors 6,7, &amp;amp; 8 are present in level.)&lt;br /&gt;
|-&lt;br /&gt;
|152 || 60 || x || y || switch (4) (Deactivates Actors 153 &amp;amp; 154; Energy Beams)&lt;br /&gt;
|-&lt;br /&gt;
|153 || 122 || x || y || HAZARD: Vertical Energy Beam (Deactivated by Switch)&lt;br /&gt;
|-&lt;br /&gt;
|154 || 123 || x || y || HAZARD: Horizontal Energy Beam (Deactivated by Switch)&lt;br /&gt;
|-&lt;br /&gt;
|155 || 124 || x || y || ENEMY:	Pink slug/Worm (Turns to bubbling goo when jumped upon)&lt;br /&gt;
|-&lt;br /&gt;
|156 || 125 || x || y || HINT GLOBE #0:	&amp;quot;These hint globes will help you along your journey. Press the up key to reread them.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|157 || 126 || x || y || ENEMY:	Silver Robot (pushes player around)&lt;br /&gt;
|-&lt;br /&gt;
|158 || 127 || x || y || ENEMY:	Security Robot (shoots flashing bullet, can act as moving floor spring)&lt;br /&gt;
|-&lt;br /&gt;
|159 || 128 || x || y || HAZARD: Bubbling pink goo (see type 155)&lt;br /&gt;
|-&lt;br /&gt;
|160 || 129 || x || y || PLAT/HAZARD:	Dragonfly&lt;br /&gt;
|-&lt;br /&gt;
|161 || 130 || x || y || Slug Box (explodes and spawns a slug, can only be destroyed safely with bombs)&lt;br /&gt;
|-&lt;br /&gt;
|165 || 134 || x || y || BONUS:	Bottle with red liquid&lt;br /&gt;
|-&lt;br /&gt;
|166 || 135 || x || y || BONUS:	Green thing&lt;br /&gt;
|-&lt;br /&gt;
|167 || 136 || x || y || BONUS:	Blue thing&lt;br /&gt;
|-&lt;br /&gt;
|168 || 137 || x || y || BONUS:	Salad?&lt;br /&gt;
|-&lt;br /&gt;
|169 || 138 || x || y || BONUS:	Pile of green balls&lt;br /&gt;
|-&lt;br /&gt;
|170 || 139 || x || y || BONUS:	Blue/yellow fruit&lt;br /&gt;
|-&lt;br /&gt;
|171 || 140 || x || y || BONUS:	Saxophone-like thing&lt;br /&gt;
|-&lt;br /&gt;
|172 || 141 || x || y+2 || BONUS:	blue thing&lt;br /&gt;
|-&lt;br /&gt;
|173 || 29/134 || x || y || BARREL: Bottle with red liquid&lt;br /&gt;
|-&lt;br /&gt;
|174 || 143 || x || y || DECO/BONUS:	Satellite (can be destroyed with bombs, spawns a hamburger)&lt;br /&gt;
|-&lt;br /&gt;
|176 || 145 || x || y || ENEMY:	Green Ivy Plant&lt;br /&gt;
|-&lt;br /&gt;
|177 || 146 || x || y+2 || BONUS:	5 Yellow Grapes	(800)&lt;br /&gt;
|-&lt;br /&gt;
|178 || 147 || x || y || BONUS:	Headdress-like object&lt;br /&gt;
|-&lt;br /&gt;
|179 || 0/147 || x || y || CRATE:	with item 178&lt;br /&gt;
|-&lt;br /&gt;
|180 || 149 || x-4 || y || EXIT:	Jaws &amp;amp; Tongue (facing left)&lt;br /&gt;
|-&lt;br /&gt;
|181 || 150 || x || y || EXIT:	invisible exit marker (go right to exit)&lt;br /&gt;
|-&lt;br /&gt;
|182 || 151 || x || y || HAZARD: small flame&lt;br /&gt;
|-&lt;br /&gt;
|183 || 152 || x || y || ENEMY:	Big Red Plant (spitting Blue Balls/catapult)&lt;br /&gt;
|-&lt;br /&gt;
|184 || 153 || x || y || BONUS:	Red/green gem&lt;br /&gt;
|-&lt;br /&gt;
|185 || 154 || x || y || BONUS:	Blue Crystal (on ground)&lt;br /&gt;
|-&lt;br /&gt;
|186 || 155 || x || y || BONUS:	Red Crystal (on ground)&lt;br /&gt;
|-&lt;br /&gt;
|187 || 29/153 || x || y || BARREL:	Red/Green Gem&lt;br /&gt;
|-&lt;br /&gt;
|188 || 29/154 || x || y || BARREL:	Blue Crystal&lt;br /&gt;
|-&lt;br /&gt;
|189 || 29/155 || x || y || BARREL:	Red Crystal&lt;br /&gt;
|-&lt;br /&gt;
|190 || 32 || x || y || BONUS:	Green Tomato (floating)&lt;br /&gt;
|-&lt;br /&gt;
|191 || 34 || x || y || BONUS:	Tomato (floating)&lt;br /&gt;
|-&lt;br /&gt;
|192 || 36 || x || y || BONUS:	Yellow/Cyan Fruit (floating)	(200)&lt;br /&gt;
|-&lt;br /&gt;
|193 || 162 || x || y || HAZARD:	Clamp Trap&lt;br /&gt;
|-&lt;br /&gt;
|194 || 163 || x || y || PLAT:	Blue Cube (falls down when you walk off)&lt;br /&gt;
|-&lt;br /&gt;
|195 || 164 || x || y || TRIGGER:	&amp;quot;What&#039;s happening? Is Cosmo falling to his doom?&amp;quot; (ONLY IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|196 || 164 || x || y || TRIGGER:	&amp;quot;Is there no end to this pit? An what danger awaits below?!&amp;quot; (ONLY IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|197 || 164 || x || y || TRIGGER:	Win game (ONLY IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|198 || 0/168 || x || y || CRATE:	Root		(400)&lt;br /&gt;
|-&lt;br /&gt;
|199 || 168 || x || y || BONUS:	Root&lt;br /&gt;
|-&lt;br /&gt;
|200 || 0/170 || x || y || CRATE:	4 Brown Berries	(400)&lt;br /&gt;
|-&lt;br /&gt;
|201 || 170 || x || y || BONUS:	4 Brown Berries&lt;br /&gt;
|-&lt;br /&gt;
|202 || 0/172 || x || y || CRATE:	Potato-like vegetable&lt;br /&gt;
|-&lt;br /&gt;
|203 || 172 || x || y || BONUS:	Potato-like vegetable&lt;br /&gt;
|-&lt;br /&gt;
|204 || 29/174 || x || y || BARREL:	Green Gem&lt;br /&gt;
|-&lt;br /&gt;
|205 || 174 || x || y || BONUS:	Green Gem&lt;br /&gt;
|-&lt;br /&gt;
|206 || 29/176 || x || y || BARREL: Diamond		(3200)&lt;br /&gt;
|-&lt;br /&gt;
|207 || 176 || x || y || BONUS:	Diamond&lt;br /&gt;
|-&lt;br /&gt;
|208 || 177 || x || y || MESSAGE: Floating score effect (100)&lt;br /&gt;
|-&lt;br /&gt;
|209 || 178 || x || y || MESSAGE: Floating score effect (200)&lt;br /&gt;
|-&lt;br /&gt;
|210 || 179 || x || y || MESSAGE: Floating score effect (400)&lt;br /&gt;
|-&lt;br /&gt;
|211 || 180 || x || y || MESSAGE: Floating score effect (800)&lt;br /&gt;
|-&lt;br /&gt;
|212 || 181 || x || y || MESSAGE: Floating score effect (1600)&lt;br /&gt;
|-&lt;br /&gt;
|213 || 182 || x || y || MESSAGE: Floating score effect (3200)&lt;br /&gt;
|-&lt;br /&gt;
|214 || 183 || x || y || MESSAGE: Floating score effect (6400)&lt;br /&gt;
|-&lt;br /&gt;
|215 || 184 || x || y || MESSAGE: Floating score effect (12800)&lt;br /&gt;
|-&lt;br /&gt;
|217 || 186 || x || y || EXIT:	Alien-Eating Space Plant (Exits the current level)&lt;br /&gt;
|-&lt;br /&gt;
|218 || 187 || x || y || ENEMY:	Blue Bird&lt;br /&gt;
|-&lt;br /&gt;
|219 || 188 || x || y || OBJECT:	Rocket&lt;br /&gt;
|-&lt;br /&gt;
|220 || 189 || x || y || BONUS:	Invincibility Cube&lt;br /&gt;
|-&lt;br /&gt;
|221 || 192 || x || y || PLAT:	Destructible Pedestal 1 (14 tiles high)&lt;br /&gt;
|-&lt;br /&gt;
|222 || 192 || x || y || PLAT:	Destructible Pedestal 2 (20 tiles high)&lt;br /&gt;
|-&lt;br /&gt;
|223 || 192 || x || y || PLAT:	Destructible Pedestal 3 (26 tiles high)&lt;br /&gt;
|-&lt;br /&gt;
|224 || 29/194 || x || y || BARREL:	Diamond 2&lt;br /&gt;
|-&lt;br /&gt;
|225 || 194 || x || y || BONUS:	Diamond 2 (falling)&lt;br /&gt;
|-&lt;br /&gt;
|226 || 29/196 || x || y || BARREL:	Red Berry&lt;br /&gt;
|-&lt;br /&gt;
|227 || 196 || x || y || BONUS:	Red Berry (falling)&lt;br /&gt;
|-&lt;br /&gt;
|228 || 29/198 || x || y || BARREL:	Crystal		(800)&lt;br /&gt;
|-&lt;br /&gt;
|229 || 198 || x || y || BONUS:	Crystal (falling)&lt;br /&gt;
|-&lt;br /&gt;
|230 || 29/200 || x || y || BARREL:	Blue Gem&lt;br /&gt;
|-&lt;br /&gt;
|231 || 200 || x || y || BONUS:	Blue Gem (falling)&lt;br /&gt;
|-&lt;br /&gt;
|232 || 201 || x || y || Invincibility Shield (automatically makes player invincible when it becomes visible)&lt;br /&gt;
|-&lt;br /&gt;
|233 || 202 || x || y+2 || DECO:	Rocket Exhaust&lt;br /&gt;
|-&lt;br /&gt;
|234 || 108 || x || y || EXIT:	Teleporter&lt;br /&gt;
|-&lt;br /&gt;
|235 || 125 || x || y || HINT GLOBE #1:	&amp;quot;Bump head into switch above!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|236 || 125 || x || y || HINT GLOBE #2:	&amp;quot;The ice in this cave is very, very slippery.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|237 || 125 || x || y || HINT GLOBE #3:	&amp;quot;Use this shield for temporary invincibility.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|238 || 125 || x || y || HINT GLOBE #4:	&amp;quot;You found a secret area!!! Good Job!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|239 || 125 || x || y || HINT GLOBE #5:	&amp;quot;In hight places look up to find bonus objects.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|240 || 125 || x || y || HINT GLOBE #6:	&amp;quot;Out of Order...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|241 || 125 || x || y || HINT GLOBE #7:	&amp;quot;This might be a good time to save your game!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|242 || 125 || x || y || HINT GLOBE #8:	&amp;quot;Press your up key to use the transporter.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|243 || 125 || x || y || HINT GLOBE #9:	&amp;quot;(1) FOR...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|244 || 194 || x || y || BONUS:	Diamond 2&lt;br /&gt;
|-&lt;br /&gt;
|245 || 196 || x || y || BONUS:	Red Berry&lt;br /&gt;
|-&lt;br /&gt;
|246 || 198 || x || y || BONUS:	Crystal&lt;br /&gt;
|-&lt;br /&gt;
|247 || 200 || x || y || BONUS:	Blue Gem	(800)&lt;br /&gt;
|-&lt;br /&gt;
|248 || 2i || x || y || PLAT:	Ceiling Spring&lt;br /&gt;
|-&lt;br /&gt;
|249 || 29/220 || x || y || BARREL:	Headphones&lt;br /&gt;
|-&lt;br /&gt;
|250 || 220 || x || y || BONUS:	Headphones&lt;br /&gt;
|-&lt;br /&gt;
|251 || 220 || x || y || BONUS:	Headphones (falling)&lt;br /&gt;
|-&lt;br /&gt;
|252 || 221 || x || y || OBJECT:	Frozen Duke NukUm (IMPLEMENTED ONLY IN COSMO2!)&lt;br /&gt;
|-&lt;br /&gt;
|254 || 223 || x || y || BONUS:	3 Bananas	(800)&lt;br /&gt;
|-&lt;br /&gt;
|255 || 0/226 || x || y || CRATE:	Alien Raisin&lt;br /&gt;
|-&lt;br /&gt;
|256 || 226 || x || y || BONUS:	Alien Raisin	(400)&lt;br /&gt;
|-&lt;br /&gt;
|257 || 226 || x || y || BONUS:	Alien Raisin (falling)	(400)&lt;br /&gt;
|-&lt;br /&gt;
|258 || 0/229 || x || y || CRATE:	Brown Pear&lt;br /&gt;
|-&lt;br /&gt;
|259 || 229 || x || y || BONUS:	Brown Pear&lt;br /&gt;
|-&lt;br /&gt;
|260 || 229 || x || y || BONUS:	Brown Pear (falling)&lt;br /&gt;
|-&lt;br /&gt;
|261 || 0/232 || x || y || CRATE:	Alien Chili Pepper&lt;br /&gt;
|-&lt;br /&gt;
|262 || 232 || x || y || BONUS:	Alien Chili Pepper (400)&lt;br /&gt;
|-&lt;br /&gt;
|263 || 232 || x || y || BONUS:	Alien Chili Pepper (falling) (400)&lt;br /&gt;
|-&lt;br /&gt;
|264 || 233 || x-1 || y || HAZARD:	Flame (&amp;lt;-)&lt;br /&gt;
|-&lt;br /&gt;
|265 || 234 || x || y || DANGER:	Flame (-&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|266 || 235 || x || y || MESSAGE: &amp;quot;OUCH!&amp;quot; (Speech bubble)&lt;br /&gt;
|-&lt;br /&gt;
|267 || 237 || x || y+1 || HAZARD:	Leaking Red acid&lt;br /&gt;
|-&lt;br /&gt;
|268 || 237 || x || y+1 || HAZARD:	Dripping Red Acid&lt;br /&gt;
|-&lt;br /&gt;
|269 || 125 || x || y || HINT GLOBE #10:	&amp;quot;(2) EXTRA...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|270 || 125 || x || y || HINT GLOBE #11:	&amp;quot;(3) POINTS,...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|271 || 125 || x || y || HINT GLOBE #12:	&amp;quot;(4) DESTROY...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|272 || 125 || x || y || HINT GLOBE #13:	&amp;quot;(5) HINT...&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|273 || 125 || x || y || HINT GLOBE #14:	&amp;quot;(6) GLOBES!!!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|274 || 125 || x || y || HINT GLOBE #15:	&amp;quot;The Clam Plants won&#039;t hurt you if their mouths are closed.&amp;quot;+Clam Sprite&lt;br /&gt;
|-&lt;br /&gt;
|275 || 244 || x || y || MESSAGE: &amp;quot;WHOA!&amp;quot; (Speech bubble)&lt;br /&gt;
|-&lt;br /&gt;
|276 || 245 || x || y || MESSAGE: &amp;quot;UMPH!&amp;quot; (Speech bubble)&lt;br /&gt;
|-&lt;br /&gt;
|277 || 246 || x || y || MESSAGE: &amp;quot;WOW! 50,000 POINTS!&amp;quot; (Speech bubble)&lt;br /&gt;
|-&lt;br /&gt;
|278 || 247 || x || y || EXIT:	Big Mouth (facing up) (ends the level ONLY IN COSMO2!)&lt;br /&gt;
|-&lt;br /&gt;
|279 || 248 || x || y || DECO:	Normal Smoke Rising&lt;br /&gt;
|-&lt;br /&gt;
|280 || 249 || x || y || DECO:	Big Smoke rising&lt;br /&gt;
|-&lt;br /&gt;
|281 || 250 || x || y || EXIT:	Exits the level when Cosmo is below the position&lt;br /&gt;
|-&lt;br /&gt;
|282 || 25 || x || y || ENEMY:	Green Pruny Cabbage Ball (takes 2 hits)&lt;br /&gt;
|- &lt;br /&gt;
|283 || 155 || x || y+1 || BONUS:	Red Crystal on ceiling&lt;br /&gt;
|-&lt;br /&gt;
|284 || 125 || x || y || HINT GLOBE #16:	&amp;quot;Collect the STARS to advance to BONUS STAGES.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|285 || 125 || x || y || HINT GLOBE #17:	&amp;quot;Some creatures require more than one pounce to defeat!&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|286 || 125 || x || y || HINT GLOBE #18:	&amp;quot;Cosmo can climb wall&#039;s with his suction hands.&amp;quot;+CosmoWallSprite&lt;br /&gt;
|-&lt;br /&gt;
|287 || 125 || x || y || HINT GLOBE #19:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|288 || 125 || x || y || HINT GLOBE #20:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|289 || 125 || x || y || HINT GLOBE #21:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|290 || 125 || x || y || HINT GLOBE #22:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|291 || 125 || x || y || HINT GLOBE #23:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|292 || 125 || x || y || HINT GLOBE #24:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|293 || 125 || x || y || HINT GLOBE #25:	(unused)&lt;br /&gt;
|-&lt;br /&gt;
|294 || 28 || x || y || BONUS:	Power Up Module (falling)	(health/12800)&lt;br /&gt;
|-&lt;br /&gt;
|295 || 1 || x || y || BONUS:	Star (falling)	(200)&lt;br /&gt;
|-&lt;br /&gt;
|296 || 265 || x || y+3 || EXIT:	Game is won when Cosmo is above this position&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The unused hint globes will animate and can be blown up, but they will not show a message.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/ Dave Bollinger].  Most of this info came from the [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps.  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&amp;diff=7384</id>
		<title>Cosmo Level Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&amp;diff=7384"/>
		<updated>2017-11-23T01:44:35Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: new info &amp;amp; some new actor types -- will finish this later.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Map Infobox&lt;br /&gt;
 | Type = 2D tile-based&lt;br /&gt;
 | Layers = 3&lt;br /&gt;
 | Tile size = 8&amp;amp;times;8&lt;br /&gt;
 | Viewport = 304&amp;amp;times;144&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Cosmo&#039;s Cosmic Adventures}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
The file is in this basic layout:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iMapWidth||Map width in tiles&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iActorSize||Number of UINT16 values in the actor block&lt;br /&gt;
|-&lt;br /&gt;
|ACTORDATA actorData[]||Variable-length array of all the actors in the level&lt;br /&gt;
|-&lt;br /&gt;
|BYTE bgLayer[65528]||The map data for the background layer&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The &amp;quot;view window&amp;quot; in the game is 304x144 Pixels, so the minimal map width would be 38. However, the game will &#039;&#039;only&#039;&#039; recognize the values 32, 64, 128, 256, 512, 1024 and 2048. Any other value will not be handled by the game at all, thus leaving a vital variable uninitialized. However, the values 32 and 2048 should never be used in a level, since the width or height of the level would be smaller than the viewport.&lt;br /&gt;
&lt;br /&gt;
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20). Since the game loads the entire actorData array into a block of 65535 bytes, the iActorSize value must be less than 32766. Larger values would lead to memory corruption.&lt;br /&gt;
&lt;br /&gt;
The map data found in the original level files is actually sized 65528 Bytes or 32764 Words, but the game will read it a block of up to 65535 bytes. Each Word entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).&lt;br /&gt;
&lt;br /&gt;
=== Level Flags ===&lt;br /&gt;
&lt;br /&gt;
The structure of the bits in the iFlags value is as follows:&lt;br /&gt;
&lt;br /&gt;
 [ mmmmm | ppp | yxr | bbbbb ]&lt;br /&gt;
 &lt;br /&gt;
 m: music index&lt;br /&gt;
 p: palette animation type&lt;br /&gt;
 y: y-scrolling backdrop&lt;br /&gt;
 x: x-scrolling backdrop&lt;br /&gt;
 r: rain&lt;br /&gt;
 b: backdrop index&lt;br /&gt;
&lt;br /&gt;
Assuming the iFlags value was read as a UINT16LE, the value can be split like this:&lt;br /&gt;
&lt;br /&gt;
 rain      = (iFlags &amp;amp; 0x20) != 0;&lt;br /&gt;
 backdrop  = iFlags &amp;amp; 0x1F;&lt;br /&gt;
 scrollX   = (iFlags &amp;amp; 0x40) != 0;&lt;br /&gt;
 scrollY   = (iFlags &amp;amp; 0x80) != 0;&lt;br /&gt;
 animation = (iFlags &amp;gt;&amp;gt; 8) &amp;amp; 7;&lt;br /&gt;
 music     = (iflags &amp;gt;&amp;gt; 11) &amp;amp; 0x1F;&lt;br /&gt;
&lt;br /&gt;
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is &amp;lt;tt&amp;gt;BDBLANK.MNI&amp;lt;/tt&amp;gt;, for music it&#039;s &amp;lt;tt&amp;gt;MCAVES.MNI&amp;lt;/tt&amp;gt;. Note that some backdrop files are not used by the games.  The complete list is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: left;&amp;quot;&lt;br /&gt;
! Backdrop&amp;lt;br/&amp;gt;value !! Filename&lt;br /&gt;
|-&lt;br /&gt;
| 0 || bdblank.mni&lt;br /&gt;
|-&lt;br /&gt;
| 1 || bdpipe.mni&lt;br /&gt;
|-&lt;br /&gt;
| 2 || bdredsky.mni&lt;br /&gt;
|-&lt;br /&gt;
| 3 || bdrocktk.mni&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bdjungle.mni&lt;br /&gt;
|-&lt;br /&gt;
| 5 || bdstar.mni&lt;br /&gt;
|-&lt;br /&gt;
| 6 || bdwierd.mni&lt;br /&gt;
|-&lt;br /&gt;
| 7 || bdcave.mni&lt;br /&gt;
|-&lt;br /&gt;
| 8 || bdice.mni&lt;br /&gt;
|-&lt;br /&gt;
| 9 || bdshrum.mni&lt;br /&gt;
|-&lt;br /&gt;
| 10 || bdtechms.mni&lt;br /&gt;
|-&lt;br /&gt;
| 11 || bdnewsky.mni&lt;br /&gt;
|-&lt;br /&gt;
| 12 || bdstar2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 13 || bdstar3.mni&lt;br /&gt;
|-&lt;br /&gt;
| 14 || bdforest.mni&lt;br /&gt;
|-&lt;br /&gt;
| 15 || bdmountn.mni&lt;br /&gt;
|-&lt;br /&gt;
| 16 || bdguts.mni&lt;br /&gt;
|-&lt;br /&gt;
| 17 || bdbrktec.mni&lt;br /&gt;
|-&lt;br /&gt;
| 18 || bdclouds.mni&lt;br /&gt;
|-&lt;br /&gt;
| 19 || bdfutcty.mni&lt;br /&gt;
|-&lt;br /&gt;
| 20 || bdice2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 21 || bdcliff.mni&lt;br /&gt;
|-&lt;br /&gt;
| 22 || bdspooky.mni&lt;br /&gt;
|-&lt;br /&gt;
| 23 || bdcrystl.mni&lt;br /&gt;
|-&lt;br /&gt;
| 24 || bdcircut.mni&lt;br /&gt;
|-&lt;br /&gt;
| 25 || bdcircpc.mni&lt;br /&gt;
|-&lt;br /&gt;
| 26-31 || &#039;&#039;Unused&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: left;&amp;quot;&lt;br /&gt;
! Music&amp;lt;br/&amp;gt;value !! Filename&lt;br /&gt;
|-&lt;br /&gt;
| 0 || mcaves.mni&lt;br /&gt;
|-&lt;br /&gt;
| 1 || mscarry.mni&lt;br /&gt;
|-&lt;br /&gt;
| 2 || mboss.mni&lt;br /&gt;
|-&lt;br /&gt;
| 3 || mrunaway.mni&lt;br /&gt;
|-&lt;br /&gt;
| 4 || mcircus.mni&lt;br /&gt;
|-&lt;br /&gt;
| 5 || mtekwrd.mni&lt;br /&gt;
|-&lt;br /&gt;
| 6 || measylev.mni&lt;br /&gt;
|-&lt;br /&gt;
| 7 || mrockit.mni&lt;br /&gt;
|-&lt;br /&gt;
| 8 || mhappy.mni&lt;br /&gt;
|-&lt;br /&gt;
| 9 || mdevo.mni&lt;br /&gt;
|-&lt;br /&gt;
| 10 || mdadoda.mni&lt;br /&gt;
|-&lt;br /&gt;
| 11 || mbells.mni&lt;br /&gt;
|-&lt;br /&gt;
| 12 || mdrums.mni&lt;br /&gt;
|-&lt;br /&gt;
| 13 || mbanjo.mni&lt;br /&gt;
|-&lt;br /&gt;
| 14 || measy2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 15 || mteck2.mni&lt;br /&gt;
|-&lt;br /&gt;
| 16 || mteck3.mni&lt;br /&gt;
|-&lt;br /&gt;
| 17 || mteck4.mni&lt;br /&gt;
|-&lt;br /&gt;
| 18 || mzztop.mni&lt;br /&gt;
|-&lt;br /&gt;
| 19-31 || &#039;&#039;Unused&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: left;&amp;quot;&lt;br /&gt;
! Animation&amp;lt;br/&amp;gt;value !! Use !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || most levels || no palette changes&lt;br /&gt;
|-&lt;br /&gt;
| 1 || A4 || random lightning (with thunder soundeffect)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || C8-C10 || cycling: red -&amp;gt; yellow -&amp;gt; white&lt;br /&gt;
|-&lt;br /&gt;
| 3 || A7 || cycling: red -&amp;gt; green -&amp;gt; blue&lt;br /&gt;
|-&lt;br /&gt;
| 4 || A8, B3, B4, B7 || cycling: black -&amp;gt; grey -&amp;gt; white&lt;br /&gt;
|-&lt;br /&gt;
| 5 || C6, C7 || flashing: red -&amp;gt; magenta -&amp;gt; white&lt;br /&gt;
|-&lt;br /&gt;
| 6 || C1 || replace dark magenta with black,&amp;lt;br/&amp;gt;no animation unless triggered by a bomb actor.&amp;lt;br/&amp;gt;(ONLY PRESENT IN COSMO3.EXE.)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || None || no palette changes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Background Layer ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;bgLayer&amp;lt;/tt&amp;gt; block contains the grid/cell data:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iMapData[32764]||Actual map data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each &amp;quot;element&amp;quot; in &amp;lt;tt&amp;gt;iMapData&amp;lt;/tt&amp;gt; refers to the foreground and/or background tile used in a single grid cell.  The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:&lt;br /&gt;
&lt;br /&gt;
 int iIndex = (y * iMapWidth) + x;&lt;br /&gt;
 iMapData[iIndex] = &amp;lt;new value to set at x,y&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height using this formula:&lt;br /&gt;
&lt;br /&gt;
 int iMapHeight = 32768 / iMapWidth - 1;&lt;br /&gt;
&lt;br /&gt;
Since the width of the map is always a power of 2 (min. 64), you can see that each of the original level files is &amp;quot;missing&amp;quot; 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line (hence the -1 in the formula). However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. For editing a level, you should make sure the last line is visible, so that it&#039;s possible to place actors in that line or remove them from there. Using a buffer of at least 65536 bytes for the level tiles is highly recommended for this.&lt;br /&gt;
&lt;br /&gt;
==== Mapping cell values to tiles ====&lt;br /&gt;
&lt;br /&gt;
The method of mapping elements in the &amp;lt;tt&amp;gt;iMapData&amp;lt;/tt&amp;gt; structure into tiles is fairly straightforward.  Each cell value is a pixel index into the tilemap.  Imagine the tileset laid out left to right all on the one row.  Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.)  Assuming the solid/unmasked tileset graphics are layed out as an 8 pixel wide column, the cell value is essentially a pixel y-coordinate into the solid/unmasked tileset.&lt;br /&gt;
&lt;br /&gt;
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.)  The game interprets any value smaller than 16000 as an index into the solid/unmasked tileset. Any other value will be treated as an index into the masked tileset (the offset 16000 is subtracted, of course). The cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.&lt;br /&gt;
&lt;br /&gt;
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.)  However, since the masked tiles consist of five planes, the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.)  The following formula can be used to convert the values into tile numbers once they stray into the masked tile area:&lt;br /&gt;
&lt;br /&gt;
 #define COSMO_TS_SOLID_NUMTILES   2000 // 40x25&lt;br /&gt;
 #define COSMO_TS_MASKED_NUMTILES  1000 // 40x4&lt;br /&gt;
 &lt;br /&gt;
 tile = cell_value / 8&lt;br /&gt;
 if (tile &amp;gt; COSMO_TS_SOLID_NUMTILES) {&lt;br /&gt;
   // Once we&#039;re in the masked tileset it counts up in multiples of five planes&lt;br /&gt;
   tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;&lt;br /&gt;
 }&lt;br /&gt;
 // Now &#039;tile&#039; will be between 0 and 2999 inclusive&lt;br /&gt;
&lt;br /&gt;
As an example of a few tile values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Cell value !! Tile number !! Tileset !! Index !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || N/A || N/A || See through to map backdrop&lt;br /&gt;
|-&lt;br /&gt;
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8&lt;br /&gt;
|-&lt;br /&gt;
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again&lt;br /&gt;
|-&lt;br /&gt;
| 15992 || 1999 || Solid || 1999 || Last solid tile&lt;br /&gt;
|-&lt;br /&gt;
| 16000 || 2000 || Masked || 0 || First masked tile&lt;br /&gt;
|-&lt;br /&gt;
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40&lt;br /&gt;
|-&lt;br /&gt;
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again&lt;br /&gt;
|-&lt;br /&gt;
| 55960 || 2999 || Masked || 999 || Last masked tile&lt;br /&gt;
|-&lt;br /&gt;
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction.  (Although obviously out of range tiles will not be drawn correctly by the engine!)&lt;br /&gt;
&lt;br /&gt;
Another thing to keep in mind is that the game will simply draw the background for any cell value smaller than 80. The first ten tiles in the tileset are never drawn in the game, but they should be drawn by a level editor.&lt;br /&gt;
&lt;br /&gt;
==== Gotchas ====&lt;br /&gt;
&lt;br /&gt;
* The first ten tiles in the solid tileset is used as transparent tiles.  The game does not draw these tile, so any cells with this as the background cell will be where the map backdrop shows through.  If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.&lt;br /&gt;
&lt;br /&gt;
* The solid tiles #1 to #8 are used to define a path, along which the platforms move in the game. The path should be laid out in a loop and should never lead to a non-direction tile. If tile #0 is part of the path, the platform will stop moving once it reaches that cell. Any tile larger than #8 will lead to the game reading memory beyond an array boundary, which will result in undefined behavior.&lt;br /&gt;
&lt;br /&gt;
=== Actor data ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;actorData&amp;lt;/tt&amp;gt; block is in the following format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Data type!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iType||Type of actor&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iX||X-coordinate of actor (in tile units)&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE iY||Y-coordinate of actor (in tile units)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;tt&amp;gt;iActorSize&amp;lt;/tt&amp;gt; value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:&lt;br /&gt;
&lt;br /&gt;
 iNumActors = iActorSize / 3&lt;br /&gt;
&lt;br /&gt;
This is exactly how the game treats this value.&lt;br /&gt;
&lt;br /&gt;
==== Mapping Actor Types to image indices ====&lt;br /&gt;
&lt;br /&gt;
For the ActorTypes from 31 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:&lt;br /&gt;
&lt;br /&gt;
 ImageIndex = ActorType - 31&lt;br /&gt;
&lt;br /&gt;
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will be &amp;quot;empty&amp;quot;. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).&lt;br /&gt;
&lt;br /&gt;
==== List of Actor Types ====&lt;br /&gt;
&lt;br /&gt;
This is a list of all the actor types that are actually used by the game. Any value not listed here will be ignored by the game.&lt;br /&gt;
&lt;br /&gt;
Limitations:&lt;br /&gt;
* Using more than 10 platforms or more than 10 mud fountains (total) in a level will lead to memory corruption.&lt;br /&gt;
* There can be up to 199 lights in a level (if there are more, the game will ignore the rest).&lt;br /&gt;
* There can be up to 410 actors in a level. Anything with a type value of 31 and above counts as an actor, but invalid/unused types will not take up an actor slot. The game will stop parsing the &amp;lt;tt&amp;gt;actorData&amp;lt;/tt&amp;gt; array once after spawning actor #410, ignoring any other data that might be left in the unparsed part of the array, such as platforms, mud fountains, ligths and even Cosmo. &lt;br /&gt;
 &lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Actor&amp;lt;br&amp;gt;Sprite !! X !! Y !! Description&lt;br /&gt;
|-&lt;br /&gt;
|  0 || N/A || x || y || Cosmo (Starting position facing right)&lt;br /&gt;
|-&lt;br /&gt;
|  1 || N/A || x || y || moving platform (fixed path)&lt;br /&gt;
|-&lt;br /&gt;
|  2 || 79 || x-1 || y-1 || mud fountain 1 (small)&lt;br /&gt;
|-&lt;br /&gt;
|  3 || 79 || x-1 || y-1 || mud fountain 2 (medium)&lt;br /&gt;
|-&lt;br /&gt;
|  4 || 79 || x-1 || y-1 || mud fountain 3 (large)&lt;br /&gt;
|-&lt;br /&gt;
|  5 || 79 || x-1 || y-1 || mud fountain 4 (huge)&lt;br /&gt;
|-&lt;br /&gt;
|  6 || N/A || x || y || light shining down (left side)&lt;br /&gt;
|-&lt;br /&gt;
|  7 || N/A || x || y || light shining down (middle)&lt;br /&gt;
|-&lt;br /&gt;
|  8 ||	N/A || x || y || light shining down (right side)&lt;br /&gt;
|}&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Type !! Actor&amp;lt;br&amp;gt;Sprite !! X !! Y !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 31 ||	0 || x || y || CRATE: empty&lt;br /&gt;
|-&lt;br /&gt;
| 32 ||	1 || x || y || BONUS:	Star	(200)&lt;br /&gt;
|-&lt;br /&gt;
| 33 || 2 || x || y || PLAT:	Floor Spring&lt;br /&gt;
|-&lt;br /&gt;
| 34 || 3 || x || y || HAZARD:	Extending Arrow Spear (from right to left)&lt;br /&gt;
|-&lt;br /&gt;
| 35 || 4 || x-4 || y || HAZARD:	Extending Arrow Spear (from left to right)&lt;br /&gt;
|-&lt;br /&gt;
| 36 || 5 || x || y || HAZARD:	Plasma Fireball (from right to left)&lt;br /&gt;
|-&lt;br /&gt;
| 37 || 5 || x-1 || y || HAZARD:	Plasma Fireball (from left to right)&lt;br /&gt;
|-&lt;br /&gt;
| 38 || 7 || x || y+1 || Blue Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 39 || 8 || x || y+1 || Red Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 40 || 9 || x || y+1 || Green Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 41 || 10 || x || y+1 || Yellow Switch (on ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 42 || 11 || x || y || Blue Door&lt;br /&gt;
|-&lt;br /&gt;
| 43 || 12 || x || y || Red Door&lt;br /&gt;
|-&lt;br /&gt;
| 44 || 13 || x || y || Green Door&lt;br /&gt;
|-&lt;br /&gt;
| 45 || 14 || x || y || Yellow Door&lt;br /&gt;
|-&lt;br /&gt;
| 47 || 16 || x || y || OBJECT:	Blue Mobile Trampoline Car&lt;br /&gt;
|-&lt;br /&gt;
| 48 || 17 || x || y || HAZARD:	Non-Retracting Spikes&lt;br /&gt;
|-&lt;br /&gt;
| 49 || 18 || x || y || HAZARD:	Retracting Spikes&lt;br /&gt;
|-&lt;br /&gt;
| 51 || 20 || x || y || HAZARD:	Big Saw Blade (moving up/down)&lt;br /&gt;
|-&lt;br /&gt;
| 53 || 20 || x || y || HAZARD: Big Saw Blade (moving left/right)&lt;br /&gt;
|-&lt;br /&gt;
| 55 || 24 || x || y || HAZARD: Activated Bomb&lt;br /&gt;
|-&lt;br /&gt;
| 56 || 25 || x || y || HAZARD:	Green Pruny Cabbage Ball&lt;br /&gt;
|-&lt;br /&gt;
| 59 || 28 || x || y || BONUS:	Power Up	(health/12800)&lt;br /&gt;
|-&lt;br /&gt;
| 60 || 29/28 || x || y || BARREL:	Power Up	(health/12800)&lt;br /&gt;
|-&lt;br /&gt;
| 62 || 0/32 || x || y || CRATE:	Green Tomato&lt;br /&gt;
|-&lt;br /&gt;
| 63 || 32 || x || y || BONUS:	Green Tomato (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 64 || 0/33 || x || y || CRATE:	Tomato		(200)&lt;br /&gt;
|-&lt;br /&gt;
| 65 || 33 || x || y || BONUS:	Tomato (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 66 || 0/36 || x || y || CRATE:	Yellow/Cyan Fruit&lt;br /&gt;
|-&lt;br /&gt;
| 67 || 36 || x || y || BONUS:	Yellow/Cyan Fruit (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 68 || 0/38 || x || y || CRATE:	Cyan Fruit&lt;br /&gt;
|-&lt;br /&gt;
| 69 || 38 || x || y || BONUS:	Cyan fruit (falling)&lt;br /&gt;
|-&lt;br /&gt;
| 70 || 39 || x || y || OBJECT:	Exit Sign (ends level on touch)&lt;br /&gt;
|-&lt;br /&gt;
| 71 || 41 || x || y || HAZARD:	Spear (not moving)&lt;br /&gt;
|-&lt;br /&gt;
| 72 || 41 || x || y || HAZARD:	Spear (coming down from ceiling)&lt;br /&gt;
|-&lt;br /&gt;
| 73 || 43 || x || y+1 || HAZARD:	Leaking Green Acid&lt;br /&gt;
|-&lt;br /&gt;
| 74 || 43 || x || y+1 || HAZARD:	Dripping Green Acid&lt;br /&gt;
|-&lt;br /&gt;
| 75 || 44 || x || y || ENEMY:	Plasma Energy Sprites (Blue Flame-like creatures)&lt;br /&gt;
|-&lt;br /&gt;
| 76 || 45 || x || y || HAZARD:	&amp;quot;Two Tons&amp;quot; Weight going down &amp;amp; up&lt;br /&gt;
|-&lt;br /&gt;
| 77 || 46 || x || y || ENEMY:	Jumping Bulletheads&lt;br /&gt;
|-&lt;br /&gt;
| 78 || 47 || x || y || ENEMY:	Stone Heads (Only drops when Cosmo is close by)&lt;br /&gt;
|-&lt;br /&gt;
| 79 || 49 || x || y+1 || HAZARD:	Big Yellow Spike on ceiling&lt;br /&gt;
|-&lt;br /&gt;
| 80 || 49 || x || y+1 || HAZARD:	Big Yellow Spike on ceiling (falling down)&lt;br /&gt;
|-&lt;br /&gt;
| 81 || 49i || x || y || HAZARD:	Big Yellow Spike on ground&lt;br /&gt;
|-&lt;br /&gt;
| 82 || 51 || x || y || ENEMY:	Ghost&lt;br /&gt;
|-&lt;br /&gt;
| 83 || 0/135 || x || y || CRATE:	Green thing&lt;br /&gt;
|-&lt;br /&gt;
| 84 || 0/136 || x || y || CRATE:	Blue thing&lt;br /&gt;
|-&lt;br /&gt;
| 85 || 54 || x || y || ENEMY:	Angry Moon (blue floating characters)&lt;br /&gt;
|-&lt;br /&gt;
| 86 || 55 || x || y || ENEMY:	Small Red Plant&lt;br /&gt;
|-&lt;br /&gt;
| 87 || 29/57 || x || y || BARREL:	Bomb	(100)&lt;br /&gt;
|-&lt;br /&gt;
| 88 || 57 || x || y || BONUS:	Bomb	(100)&lt;br /&gt;
|-&lt;br /&gt;
| 89 || 29/2 || x || y || BARREL:	Floor Spring&lt;br /&gt;
|-&lt;br /&gt;
| 90 || 60 || x || y || OBJECT: switch (1) (Activates moving platform(s))&lt;br /&gt;
|-&lt;br /&gt;
| 92 || 60 || x || y || OBJECT: switch (2) (Activates Question Mark Block Wall Generator)&lt;br /&gt;
|-&lt;br /&gt;
| 93 || 62 || x || y || OBJECT: Question Mark Block (Generates a wall when activated by switch)&lt;br /&gt;
|-&lt;br /&gt;
| 94 || 63 || x || y || HAZARD: Ground Claw Spikes&lt;br /&gt;
|-&lt;br /&gt;
| 95 || 64 || x || y || OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)&lt;br /&gt;
|-&lt;br /&gt;
| 96 || 65 || x || y || ENEMY:	Mini Ghost (jumps)&lt;br /&gt;
|-&lt;br /&gt;
| 97 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving South West)&lt;br /&gt;
|-&lt;br /&gt;
| 98 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving South East)&lt;br /&gt;
|-&lt;br /&gt;
| 99 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving South)&lt;br /&gt;
|-&lt;br /&gt;
|100 || 69 || x || y || CREATURE:	Green Roamer Worm&lt;br /&gt;
|-&lt;br /&gt;
|101 || 70 || x || y || PIPE TRANSIT DIRECTION:	Arrow Up&lt;br /&gt;
|-&lt;br /&gt;
|102 || 71 || x || y || PIPE TRANSIT DIRECTION:	Arrow Down&lt;br /&gt;
|-&lt;br /&gt;
|103 || 72 || x || y || PIPE TRANSIT DIRECTION:	Arrow Left&lt;br /&gt;
|-&lt;br /&gt;
|104 || 73 || x || y || PIPE TRANSIT DIRECTION:	Arrow Right&lt;br /&gt;
|-&lt;br /&gt;
|105 || 75 || x || y || ENEMY:	Egg Head (cracks when player is near)&lt;br /&gt;
|-&lt;br /&gt;
|106 || 75 || x || y || ENEMY:	Egg Head (cracks when pounced)&lt;br /&gt;
|-&lt;br /&gt;
|109 || 78 || x || y || ENEMY:	Robotic Spike on ground&lt;br /&gt;
|-&lt;br /&gt;
|111 || 80 || x || y+2 || ENEMY:	Robotic Spike on ceiling&lt;br /&gt;
|-&lt;br /&gt;
|112 || 0/82 || x || y || CRATE:	Burger&lt;br /&gt;
|-&lt;br /&gt;
|113 || 82 || x || y || BONUS:	Burger&lt;br /&gt;
|-&lt;br /&gt;
|114 || 83 || x || y ||	ENEMY:	Blue/Red Clam Plant on ground&lt;br /&gt;
|-&lt;br /&gt;
|115 || 83i || x || y+2 || ENEMY:	Blue/Red Clam Plant on ceiling&lt;br /&gt;
|-&lt;br /&gt;
|116 || 85 || x || y+2 || BONUS:	Purple Grapes	(800)&lt;br /&gt;
|-&lt;br /&gt;
|117 || 86 || x || y || ENEMY:	Blue Ball&lt;br /&gt;
|-&lt;br /&gt;
|118 || 87 || x || y || HAZARD:	Spikes (on left wall)&lt;br /&gt;
|-&lt;br /&gt;
|119 || 88 || x || y || HAZARD:	Retracting Spikes (on left wall)&lt;br /&gt;
|-&lt;br /&gt;
|120 || 89 || x-3 || y || ENEMY:	Spikes (on right wall)&lt;br /&gt;
|-&lt;br /&gt;
|121 || 90 || x || y || ENEMY:	Robot with Blue Vertical Electric Arc&lt;br /&gt;
|-&lt;br /&gt;
|122 || 91 || x || y || PLAT:	Blue Platform (splits open when standing on top)&lt;br /&gt;
|-&lt;br /&gt;
|123 || 92 || x || y || ENEMY:	Spark&lt;br /&gt;
|-&lt;br /&gt;
|124 || 0/94 || x || y || CRATE:	Cyan Dancing Mushroom	(400)&lt;br /&gt;
|-&lt;br /&gt;
|125 || 94 || x || y || BONUS:	Cyan Dancing Mushroom	(400)&lt;br /&gt;
|-&lt;br /&gt;
|126 || 95 || x || y || DECO:	Pink Eye Plant&lt;br /&gt;
|-&lt;br /&gt;
|127 || 95i || x || y+1 || DECO:	Pink Eye Plant (hanging upside down)&lt;br /&gt;
|-&lt;br /&gt;
|131 || 29/251 || x || y || BARREL:	Cabbage Monster (see type 282)&lt;br /&gt;
|-&lt;br /&gt;
|132 || 101 || x || y || ENEMY:	Big Red Jumper (NOT IMPLEMENTED IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|133 || 102 || x || y || ENEMY:	BOSS (Purple Alien in Spike-bottomed ship) (NOT IMPLEMENTED IN COSMO2!)&lt;br /&gt;
|-&lt;br /&gt;
|135 || 105 || x-1 || y+2 || PNEUMATIC PIPES:	Exit&lt;br /&gt;
|-&lt;br /&gt;
|136 || 105 || x-1 || y+2 || PNEUMATIC PIPES:	Entrance&lt;br /&gt;
|-&lt;br /&gt;
|137 || 106 || x || y || ENEMY:	Suction-Cup-Legged Alien&lt;br /&gt;
|-&lt;br /&gt;
|138 || 108 || x || y || OBJECT: Teleporter A&lt;br /&gt;
|-&lt;br /&gt;
|139 || 108 || x || y || OBJECT: Teleporter B&lt;br /&gt;
|-&lt;br /&gt;
|140 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving West)&lt;br /&gt;
|-&lt;br /&gt;
|141 || 68 || x || y || HAZARD:	Flashing ball projectile (Moving East)&lt;br /&gt;
|-&lt;br /&gt;
|142 || 112 || x-3 || y || ENEMY:	Cyan Spitting Plant (on left wall)&lt;br /&gt;
|-&lt;br /&gt;
|143 || 111 || x || y || ENEMY:	Cyan Spitting Plant (on right wall)&lt;br /&gt;
|-&lt;br /&gt;
|144 || 113 || x || y || ENEMY:	Blue Turret Alien&lt;br /&gt;
|-&lt;br /&gt;
|145 || 114 || x || y || PLAT:	Hoverboard&lt;br /&gt;
|-&lt;br /&gt;
|146 || 0/138 || x || y || CRATE:	pile of green balls&lt;br /&gt;
|-&lt;br /&gt;
|147 || 0/139 || x || y || CRATE:	blue/yellow fruit&lt;br /&gt;
|-&lt;br /&gt;
|148 || 29/140 || x || y || BARREL:	Saxophone-like thing&lt;br /&gt;
|-&lt;br /&gt;
|149 || 118 || x || y || ENEMY:	Red Chomper Alien&lt;br /&gt;
|-&lt;br /&gt;
|150 || 0/137 || x || y || CRATE:	Salad&lt;br /&gt;
|-&lt;br /&gt;
|151 || 60 || x || y || switch (3) (Activates lights, if actors 6,7, &amp;amp; 8 are present in level.)&lt;br /&gt;
|-&lt;br /&gt;
|152 || 60 || x || y || switch (4) (Deactivates Actors 153 &amp;amp; 154; Energy Beams)&lt;br /&gt;
|-&lt;br /&gt;
|153 || 122 || x || y || HAZARD: Vertical Energy Beam (Deactivated by Switch)&lt;br /&gt;
|-&lt;br /&gt;
|154 || 123 || x || y || HAZARD: Horizontal Energy Beam (Deactivated by Switch)&lt;br /&gt;
|-&lt;br /&gt;
|155 || 124 || x || y || ENEMY:	Pink slug/Worm (Turns to bubbling goo when jumped upon)&lt;br /&gt;
|-&lt;br /&gt;
|156 || 125 || x || y || HINT GLOBE #0:	&amp;quot;These hint globes will help you along your journey. Press the up key to reread them.&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|157 || 126 || x || y || ENEMY:	Silver Robot (pushes player around)&lt;br /&gt;
|-&lt;br /&gt;
|158 || 127 || x || y || ENEMY:	Security Robot (shoots flashing bullet, can act as moving floor spring)&lt;br /&gt;
|-&lt;br /&gt;
|159 || 128 || x || y || HAZARD: Bubbling pink goo (see type 155)&lt;br /&gt;
|-&lt;br /&gt;
|160 || 129 || x || y || PLAT/HAZARD:	Dragonfly&lt;br /&gt;
|-&lt;br /&gt;
|161 || 130 || x || y || Slug Box (explodes and spawns a slug, can only be destroyed safely with bombs)&lt;br /&gt;
|-&lt;br /&gt;
|165 || 134 || x || y || BONUS:	Bottle with red liquid&lt;br /&gt;
|-&lt;br /&gt;
|166 || 135 || x || y || BONUS:	Green thing&lt;br /&gt;
|-&lt;br /&gt;
|167 || 136 || x || y || BONUS:	Blue thing&lt;br /&gt;
|-&lt;br /&gt;
|168 || 137 || x || y || BONUS:	Salad?&lt;br /&gt;
|-&lt;br /&gt;
|169 || 138 || x || y || BONUS:	Pile of green balls&lt;br /&gt;
|-&lt;br /&gt;
|170 || 139 || x || y || BONUS:	Blue/yellow fruit&lt;br /&gt;
|-&lt;br /&gt;
|171 || 140 || x || y || BONUS:	Saxophone-like thing&lt;br /&gt;
|-&lt;br /&gt;
|172 || 141 || x || y+2 || BONUS:	blue thing&lt;br /&gt;
|-&lt;br /&gt;
|173 || 29/134 || x || y || BARREL: Bottle with red liquid&lt;br /&gt;
|-&lt;br /&gt;
|174 || 143 || x || y || DECO/BONUS:	Satellite (can be destroyed with bombs, spawns a hamburger)&lt;br /&gt;
|-&lt;br /&gt;
|176 || 145 || x || y || ENEMY:	Green Ivy Plant&lt;br /&gt;
|-&lt;br /&gt;
|177 || 146 || x || y+2 || BONUS:	5 Yellow Grapes	(800)&lt;br /&gt;
|-&lt;br /&gt;
|178 || 147 || x || y || BONUS:	Headdress-like object&lt;br /&gt;
|-&lt;br /&gt;
|179 || 0/147 || x || y || CRATE:	with item 178&lt;br /&gt;
|-&lt;br /&gt;
|180 || 149 || x-4 || y || EXIT:	Jaws &amp;amp; Tongue (facing left)&lt;br /&gt;
|-&lt;br /&gt;
|181 || 150 || x || y || invisible exit marker (go right to exit)&lt;br /&gt;
|-&lt;br /&gt;
|182 || 151 || x || y || HAZARD: small flame&lt;br /&gt;
|-&lt;br /&gt;
|183 || 152 || x || y || ENEMY:	Big Red Plant (spitting Blue Balls/catapult)&lt;br /&gt;
|-&lt;br /&gt;
|184 || 153 || x || y || BONUS:	Red/green gem&lt;br /&gt;
|-&lt;br /&gt;
|185 || 154 || x || y || BONUS:	Blue Crystal (on ground)&lt;br /&gt;
|-&lt;br /&gt;
|186 || 155 || x || y || BONUS:	Red Crystal (on ground)&lt;br /&gt;
|-&lt;br /&gt;
|187 || 29/153 || x || y || BARREL:	Red/Green Gem&lt;br /&gt;
|-&lt;br /&gt;
|188 || 29/154 || x || y || BARREL:	Blue Crystal&lt;br /&gt;
|-&lt;br /&gt;
|189 || 29/155 || x || y || BARREL:	Red Crystal&lt;br /&gt;
|-&lt;br /&gt;
|190 || 32 || x || y || BONUS:	Green Tomato (floating)&lt;br /&gt;
|-&lt;br /&gt;
|191 || 34 || x || y || BONUS:	Tomato (floating)&lt;br /&gt;
|-&lt;br /&gt;
|192 || 36 || x || y || BONUS:	Yellow/Cyan Fruit (floating)	(200)&lt;br /&gt;
|-&lt;br /&gt;
|193 || 162 || x || y || HAZARD:	Clamp Trap&lt;br /&gt;
|-&lt;br /&gt;
|194 || 163 || x || y || PLAT:	Blue Cube (falls down when you walk off)&lt;br /&gt;
|-&lt;br /&gt;
|195 || 164 || x || y || TRIGGER:	&amp;quot;What&#039;s happening? Is Cosmo falling to his doom?&amp;quot; (ONLY IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|196 || 164 || x || y || TRIGGER:	&amp;quot;Is there no end to this pit? An what danger awaits below?!&amp;quot; (ONLY IN COSMO1!)&lt;br /&gt;
|-&lt;br /&gt;
|197 || 164 || x || y || TRIGGER:	Win game (ONLY IN COSMO1!)&lt;br /&gt;
|}&lt;br /&gt;
 198	CRATE:	Root		(400)&lt;br /&gt;
 199	BONUS:	Root&lt;br /&gt;
 200	CRATE:	4 Brown Berries	(400)&lt;br /&gt;
 201	BONUS:	4 Brown Berries&lt;br /&gt;
 &lt;br /&gt;
 203	BONUS:	Potato-like vegetable&lt;br /&gt;
 204	BARREL:	Green Gem&lt;br /&gt;
 205	BONUS:	Green Gem&lt;br /&gt;
 206	BARREL: Diamond		(3200)&lt;br /&gt;
 207	BONUS:	Diamond&lt;br /&gt;
 208	MESSAGE: Floating score effect (100)&lt;br /&gt;
 209	MESSAGE: Floating score effect (200)&lt;br /&gt;
 210	MESSAGE: Floating score effect (400)&lt;br /&gt;
 211	MESSAGE: Floating score effect (800)&lt;br /&gt;
 212	MESSAGE: Floating score effect (1600)&lt;br /&gt;
 213	MESSAGE: Floating score effect (3200)&lt;br /&gt;
 214	MESSAGE: Floating score effect (6400)&lt;br /&gt;
 215	MESSAGE: Floating score effect (12800)&lt;br /&gt;
 &lt;br /&gt;
 217	ENEMY:	Alien-Eating Space Plant (Exits the current level)&lt;br /&gt;
 218	ENEMY:	Blue Bird&lt;br /&gt;
 219	OBJECT:	Rocket&lt;br /&gt;
 220	BONUS:	Invincibility Cube&lt;br /&gt;
 221	PLAT:	Destructible Pedestal 1 (14 tiles high)&lt;br /&gt;
 222	PLAT:	Destructible Pedestal 2 (20 tiles high)&lt;br /&gt;
 223	PLAT:	Destructible Pedestal 3 (26 tiles high)&lt;br /&gt;
 224	BARREL:	Diamond 2&lt;br /&gt;
 225	BONUS:	Diamond 2 (falling)&lt;br /&gt;
 226	BARREL:	Red Berry&lt;br /&gt;
 227	BONUS:	Red Berry (falling)&lt;br /&gt;
 228	BARREL:	Crystal		(800)&lt;br /&gt;
 229	BONUS:	Crystal (falling)&lt;br /&gt;
 230	BARREL:	Blue Gem&lt;br /&gt;
 231	BONUS:	Blue Gem (falling)&lt;br /&gt;
 &lt;br /&gt;
 233	DECO:	Rocket Exhaust&lt;br /&gt;
 234	EXIT:	Teleporter&lt;br /&gt;
 235	HINT:	&amp;quot;Bump head into switch above!&amp;quot;&lt;br /&gt;
 236	HINT:	&amp;quot;The ice in this cave is very, very slippery.&amp;quot;&lt;br /&gt;
 237	HINT:	&amp;quot;Use this shield for temporary invincibility.&amp;quot;&lt;br /&gt;
 238	HINT:	&amp;quot;You found a secret area!!! Good Job!&amp;quot;&lt;br /&gt;
 239	HINT:	&amp;quot;In hight places look up to find bonus objects.&amp;quot;&lt;br /&gt;
 240	HINT:	&amp;quot;Out of Order...&amp;quot;&lt;br /&gt;
 241	HINT:	&amp;quot;This might be a good time to save your game!&amp;quot;&lt;br /&gt;
 242	HINT:	&amp;quot;Press your up key to use the transporter.&amp;quot;&lt;br /&gt;
 243	HINT:	&amp;quot;(1) FOR...&amp;quot;&lt;br /&gt;
 244	BONUS:	Diamond 2&lt;br /&gt;
 245	BONUS:	Red Berry&lt;br /&gt;
 246	BONUS:	Crystal&lt;br /&gt;
 247	BONUS:	Blue Gem	(800)&lt;br /&gt;
 248	PLAT:	Ceiling Spring&lt;br /&gt;
 249	BARREL:	Headphones&lt;br /&gt;
 250	BONUS:	Headphones&lt;br /&gt;
 251	BONUS:	Headphones (falling)&lt;br /&gt;
 252	OBJECT:	Frozen Duke NukUm&lt;br /&gt;
 &lt;br /&gt;
 254	BONUS:	3 Bananas	(800)&lt;br /&gt;
 255	CRATE:	Alien Raisin&lt;br /&gt;
 256	BONUS:	Alien Raisin	(400)&lt;br /&gt;
 &lt;br /&gt;
 258	CRATE:	Brown Pear&lt;br /&gt;
 259	BONUS:	Brown Pear&lt;br /&gt;
 &lt;br /&gt;
 261	CRATE:	Alien Chili Pepper&lt;br /&gt;
 262	BONUS:	Alien Chili Pepper (400)&lt;br /&gt;
 &lt;br /&gt;
 264	DANGER:	Flame (&amp;lt;-)&lt;br /&gt;
 265	DANGER:	Flame (-&amp;gt;)&lt;br /&gt;
 266	MESSAGE: &amp;quot;OUCH!&amp;quot; (Speech bubble)&lt;br /&gt;
 267	HAZARD:	Leaking Red acid&lt;br /&gt;
 268	HAZARD:	Dripping Red Acid&lt;br /&gt;
 269	HINT:	&amp;quot;(2) EXTRA...&amp;quot;&lt;br /&gt;
 270	HINT:	&amp;quot;(3) POINTS,...&amp;quot;&lt;br /&gt;
 271	HINT:	&amp;quot;(4) DESTROY...&amp;quot;&lt;br /&gt;
 272	HINT:	&amp;quot;(5) HINT...&amp;quot;&lt;br /&gt;
 273	HINT:	&amp;quot;(6) GLOBES!!!&amp;quot;&lt;br /&gt;
 274	HINT:	&amp;quot;The Clam Plants won&#039;t hurt you if their mouths are closed.&amp;quot;+Clam Sprite&lt;br /&gt;
 275	MESSAGE: &amp;quot;WHOA!&amp;quot; (Speech bubble)&lt;br /&gt;
 276	MESSAGE: &amp;quot;UMPH!&amp;quot; (Speech bubble)&lt;br /&gt;
 277	MESSAGE: &amp;quot;WOW! 50,000 POINTS!&amp;quot; (Speech bubble)&lt;br /&gt;
 278	DECO:	Big Mouth (end of E1/start of E2)&lt;br /&gt;
 279	DECO:	Normal Smoke Rising&lt;br /&gt;
 280	DECO:	Big Smoke rising&lt;br /&gt;
 281	EXIT: 	Horizontal Exit Marker (Invisible)&lt;br /&gt;
 &lt;br /&gt;
 283	BONUS:	Red Crystal on ceiling&lt;br /&gt;
 284	HINT:	&amp;quot;Collect the STARS to advance to BONUS STAGES.&amp;quot;&lt;br /&gt;
 285	HINT:	&amp;quot;Some creatures require more than one pounce to defeat!&amp;quot;&lt;br /&gt;
 286	HINT:	&amp;quot;Cosmo can climb wall&#039;s with his suction hands.&amp;quot;+CosmoWallSprite&lt;br /&gt;
 &lt;br /&gt;
 294	BONUS:	Power Up Module (falling)	(health/12800)&lt;br /&gt;
 295	BONUS:	Star (falling)	(200)&lt;br /&gt;
 296	end of episode 2 trigger?&lt;br /&gt;
&lt;br /&gt;
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don&#039;t work in those episodes.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/ Dave Bollinger].  Most of this info came from the [http://archive.shikadi.net/sites/www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps.  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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Space_Chase&amp;diff=7354</id>
		<title>Space Chase</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Space_Chase&amp;diff=7354"/>
		<updated>2017-11-09T01:32:39Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: added PC speaker sound&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;Space Chase&#039;&#039;&#039; is a platformer written by Safari Software, before they were bought out by [[:Category:Epic Megagames|Epic Megagames]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://k1n9duk3.shikadi.net/files/sspextract.zip SSP extractor]&lt;br /&gt;
| Platform = Win32&lt;br /&gt;
| grp = Extract&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;
{{FileFormatTool&lt;br /&gt;
| Name = [https://pckf.com/viewtopic.php?p=86016#p86016 Stormer]&lt;br /&gt;
| Platform = Win32&lt;br /&gt;
| grp = Extract&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;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mobygames.com/game/space-chase-part-one-city-under-siege MobyGames]&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.ssp&lt;br /&gt;
 | Format = [[SSP Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing game graphics and levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pcx&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game graphics and tiles&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.ume&amp;lt;br/&amp;gt;*.umf&lt;br /&gt;
 | Format = [[Space Chase Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.uma&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Unknown&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = STORM.SSZ&lt;br /&gt;
 | Format = [[Inverse Frequency Sound format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = PC speaker sound effects&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.xmi&lt;br /&gt;
 | Format = [[XMI Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Epic Megagames]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Space_Chase&amp;diff=7353</id>
		<title>Space Chase</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Space_Chase&amp;diff=7353"/>
		<updated>2017-11-09T01:16:01Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: /* Tools */ both tools are Win32 executables&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;Space Chase&#039;&#039;&#039; is a platformer written by Safari Software, before they were bought out by [[:Category:Epic Megagames|Epic Megagames]].&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://k1n9duk3.shikadi.net/files/sspextract.zip SSP extractor]&lt;br /&gt;
| Platform = Win32&lt;br /&gt;
| grp = Extract&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;
{{FileFormatTool&lt;br /&gt;
| Name = [https://pckf.com/viewtopic.php?p=86016#p86016 Stormer]&lt;br /&gt;
| Platform = Win32&lt;br /&gt;
| grp = Extract&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;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.mobygames.com/game/space-chase-part-one-city-under-siege MobyGames]&lt;br /&gt;
&lt;br /&gt;
{{BeginGameFileList}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.ssp&lt;br /&gt;
 | Format = [[SSP Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Archive storing game graphics and levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.pcx&lt;br /&gt;
 | Format = [[PCX Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Game graphics and tiles&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.ume&amp;lt;br/&amp;gt;*.umf&lt;br /&gt;
 | Format = [[Space Chase Level Format]]&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Game levels&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.uma&lt;br /&gt;
 | Format = ?&lt;br /&gt;
 | KnownFormat = No&lt;br /&gt;
 | Desc = Unknown&lt;br /&gt;
}}&lt;br /&gt;
{{GameFile&lt;br /&gt;
 | Name = *.xmi&lt;br /&gt;
 | Format = [[XMI Format]]&lt;br /&gt;
 | KnownFormat = Yes&lt;br /&gt;
 | Desc = Background music&lt;br /&gt;
}}&lt;br /&gt;
{{EndGameFileList}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Epic Megagames]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=SSP_Format&amp;diff=7352</id>
		<title>SSP Format</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=SSP_Format&amp;diff=7352"/>
		<updated>2017-11-09T01:14:21Z</updated>

		<summary type="html">&lt;p&gt;K1n9 Duk3: Created page with &amp;quot;{{Archive Infobox  | MaxFiles = 200  | FAT = Beginning  | Names = Yes, 8.3  | Metadata = None  | Subdirectories = N  | Compressed = N  | Encrypted = N  | Hidden = Y  | Games =...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = 200&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = Yes, 8.3&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = N&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = Y&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|Space Chase}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;SSP format&#039;&#039;&#039; is how most files in the game [[Space Chase]] by Safari Software are stored. Different versions of the game may use different versions of this format, and the earliest known demo version does not use this format at all.&lt;br /&gt;
&lt;br /&gt;
Files that the game expects to find inside the SSP archive must be stored in that archive. The game does not appear to support external files as an alternative.&lt;br /&gt;
&lt;br /&gt;
== File format ==&lt;br /&gt;
&lt;br /&gt;
=== Signature ===&lt;br /&gt;
&lt;br /&gt;
There is no known signature for this format.  And to make things worse, there are at least three known versions of the SSP format.  And not one of them stores a version number (or anything similar) to identify which version of the format is used.&lt;br /&gt;
&lt;br /&gt;
The only thing that all (known) versions of this format have in common is that they all start with a [[UINT16LE]] that defines how many file entries are used in this file. This value is followed directly by an array of [[UINT32LE]] values that store the size of each file.&lt;br /&gt;
&lt;br /&gt;
This information can be used to calculate the total size of the File Allocation Table (FAT), assuming that the SSP archive has no unused bytes at the end of the file or between the files, and also assuming that there are no overlapping files.  Simply sum up the size values of all the &#039;&#039;used&#039;&#039; file entries and subtract the sum from the total size of the SSP file.&lt;br /&gt;
&lt;br /&gt;
Based on the size of the FAT, you can read the actual file entries as described below.&lt;br /&gt;
&lt;br /&gt;
=== FAT Structure ===&lt;br /&gt;
&lt;br /&gt;
All known files in the SSP format use the following layout:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Type!!Name!!Description&lt;br /&gt;
|-&lt;br /&gt;
|UINT16LE||iCount||Number of file entries used&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE[]||iSizes||Size of each sub-file&lt;br /&gt;
|-&lt;br /&gt;
|CHAR[][]||cNames||NULL-terminated name of each sub-file (fixed-length entries, usually padded with NULLs)&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[]||padding1||usually NULLs&lt;br /&gt;
|-&lt;br /&gt;
|UINT32LE[]||iOffsets||Offset of each sub-file (relative to the beginning of the sub-file data!)&lt;br /&gt;
|-&lt;br /&gt;
|BYTE[]||padding2||usually NULLs&lt;br /&gt;
|-&lt;br /&gt;
||BYTE[]||data||Beginning of the sub-file data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The number of file entries in each array, the length of the file names, and the length of the padding in between the blocks of data varies depending on the version of the game.  Known versions of the SSP format are as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!FAT size!!Max. Entries!!Names Start!!Name Length!!Offsets Start!!Description&lt;br /&gt;
|-&lt;br /&gt;
|9478||128||514||64||8834||used in v4.00 of Episode 1&lt;br /&gt;
|-&lt;br /&gt;
|2334||100||402||13||1802||used in v2.14D of Episode 1&lt;br /&gt;
|-&lt;br /&gt;
|4534||200||802||13||3602||used in v2.00D and v2.02D of Episode 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The FAT size is also the offset of the beginning of the sub-file data. This value needs to be added to each value in the &amp;lt;tt&amp;gt;iOffsets&amp;lt;/tt&amp;gt; array to get the actual offset within the SSP file.&lt;br /&gt;
&lt;br /&gt;
=== Safety Checks ===&lt;br /&gt;
&lt;br /&gt;
* The number of &#039;&#039;used&#039;&#039; file entries should not exceed the maximum allowed by the current version of the SSP format. More than 200 file entries are not allowed in any known version of the format.&lt;br /&gt;
&lt;br /&gt;
* Offset and Size of any &#039;&#039;used&#039;&#039; file entry should never exceed the size of the SSP file minus the FAT size.&lt;br /&gt;
&lt;br /&gt;
While the following is true for all known archives that shipped with the games, these restrictions are not part of the file format per se. The the game will most likely still be able to read these files even if the following conditions are not met.&lt;br /&gt;
&lt;br /&gt;
* The data for the sub-files is usually stored in the same order as the entries in the FAT, so all used entries in the &amp;lt;tt&amp;gt;iOffsets&amp;lt;/tt&amp;gt; array should be in ascending order.&lt;br /&gt;
&lt;br /&gt;
* Unused entries, as well as the padding between the blocks, are usually set to NULLs.&lt;br /&gt;
&lt;br /&gt;
* File names should fit the 8.3 naming scheme.&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=game}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://k1n9duk3.shikadi.net/files/sspextract.zip SSP extractor]&lt;br /&gt;
| Platform = Win32&lt;br /&gt;
| grp = Extract&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;
{{FileFormatTool&lt;br /&gt;
| Name = [https://pckf.com/viewtopic.php?p=86016#p86016 Stormer]&lt;br /&gt;
| Platform = Win32&lt;br /&gt;
| grp = Extract&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;/div&gt;</summary>
		<author><name>K1n9 Duk3</name></author>
	</entry>
</feed>