<?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=Eirik</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=Eirik"/>
	<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/wiki/Special:Contributions/Eirik"/>
	<updated>2026-05-15T05:43:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8776</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8776"/>
		<updated>2019-07-25T14:19:03Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 535 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If raw:&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 535 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
The game also operates with distinct &amp;quot;game screens&amp;quot;, each with an index.&lt;br /&gt;
&lt;br /&gt;
Game screens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: First level&lt;br /&gt;
1: Second level&lt;br /&gt;
...&lt;br /&gt;
36: Last level&lt;br /&gt;
37: Death screen&lt;br /&gt;
38: Menu, screen 3&lt;br /&gt;
39: Menu, screen 1&lt;br /&gt;
40: Menu, screen 2&lt;br /&gt;
41: Galaxy fall (between levels)&lt;br /&gt;
43: Intro level (demo)&lt;br /&gt;
44: Intro level part 2&lt;br /&gt;
45: Game complete&lt;br /&gt;
46: Game complete 2&lt;br /&gt;
47: Credits screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each screen have a screendata chunk, which is mapped as following (2 byte (LSB) index for each):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
19F0:940C     C6 00 C8 00 CA 00 CC 00 28 00 2A 00 2C 00 2E 00  ........(.*.,...&lt;br /&gt;
19F0:941C     30 00 32 00 34 00 4B 00 4D 00 4F 00 51 00 53 00  0.2.4.K.M.O.Q.S.&lt;br /&gt;
19F0:942C     55 00 72 00 74 00 76 00 78 00 7A 00 7C 00 7E 00  U.r.t.v.x.z.|.~.&lt;br /&gt;
19F0:943C     80 00 9C 00 9E 00 A0 00 A2 00 A4 00 A6 00 A8 00  ................&lt;br /&gt;
19F0:944C     AA 00 CE 00 D0 00 D2 00 D4 00 71 01 7D 01 86 01  ..........q.}...&lt;br /&gt;
19F0:945C     8C 01 92 01 7E 01 AF 01 B0 01 B1 01 B2 01 DA 00  ....~...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Screendata contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22: Index of next gamescreen&lt;br /&gt;
28: Type? (1: level)&lt;br /&gt;
41: Tilemap width&lt;br /&gt;
46..47: Chunk ID with tilemap&lt;br /&gt;
48..49: Chunk ID with tile definitions (pixels)&lt;br /&gt;
50..51: Chunk ID with metatile definitions (4 tiles)&lt;br /&gt;
67: N chunks of unknown type, length 14, terminated by FF FF&lt;br /&gt;
67+N*14+2: N chunks of palette data, length 3, terminated by FF FF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67 (unknown data):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID? (list terminates if this is FFFF)&lt;br /&gt;
2..13: Unknown data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67+N*14+2 (palette):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID (list terminates if this is FFFF)&lt;br /&gt;
2: First color index (multiply this with 3 and copy data to that destination, palette is 256*3 bytes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Palette setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1: Prepare array with 3x256 bytes&lt;br /&gt;
2: Load each chunk to its location (several chunks with different sizes may be written to the same index)&lt;br /&gt;
3: Set color 16, 32, 48, 64, ..., 240 to [0,0,0] (black)&lt;br /&gt;
4: Color 4 is special (transparent/background/...?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
...&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
...&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metatile format ==&lt;br /&gt;
&lt;br /&gt;
Each metatile consist of 2 x 2 tiles (16 x 16 pixels).&lt;br /&gt;
&lt;br /&gt;
Metatiles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Upper left tile&lt;br /&gt;
2..3: Upper right tile&lt;br /&gt;
4..5: Lower left tile&lt;br /&gt;
6..7: Lower right tile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each tile in this list is 16 bit LSB.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bit 4: Horizontal flip&lt;br /&gt;
Bit 5: Vertical flip&lt;br /&gt;
Bit 6..15: Tile index&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tilemap format ==&lt;br /&gt;
&lt;br /&gt;
Tilemap have 2 bytes (LSB) for each metatile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bit 0..8: Metatile index&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [https://github.com/stople/LostVikingsDataExtractor Lost Vikings data extractor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8770</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8770"/>
		<updated>2019-07-20T23:55:08Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 575 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If raw:&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
The game also operates with distinct &amp;quot;game screens&amp;quot;, each with an index.&lt;br /&gt;
&lt;br /&gt;
Game screens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: First level&lt;br /&gt;
1: Second level&lt;br /&gt;
...&lt;br /&gt;
36: Last level&lt;br /&gt;
37: Death screen&lt;br /&gt;
38: Menu, screen 3&lt;br /&gt;
39: Menu, screen 1&lt;br /&gt;
40: Menu, screen 2&lt;br /&gt;
41: Galaxy fall (between levels)&lt;br /&gt;
43: Intro level (demo)&lt;br /&gt;
44: Intro level part 2&lt;br /&gt;
45: Game complete&lt;br /&gt;
46: Game complete 2&lt;br /&gt;
47: Credits screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each screen have a screendata chunk, which is mapped as following (2 byte (LSB) index for each):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
19F0:940C     C6 00 C8 00 CA 00 CC 00 28 00 2A 00 2C 00 2E 00  ........(.*.,...&lt;br /&gt;
19F0:941C     30 00 32 00 34 00 4B 00 4D 00 4F 00 51 00 53 00  0.2.4.K.M.O.Q.S.&lt;br /&gt;
19F0:942C     55 00 72 00 74 00 76 00 78 00 7A 00 7C 00 7E 00  U.r.t.v.x.z.|.~.&lt;br /&gt;
19F0:943C     80 00 9C 00 9E 00 A0 00 A2 00 A4 00 A6 00 A8 00  ................&lt;br /&gt;
19F0:944C     AA 00 CE 00 D0 00 D2 00 D4 00 71 01 7D 01 86 01  ..........q.}...&lt;br /&gt;
19F0:945C     8C 01 92 01 7E 01 AF 01 B0 01 B1 01 B2 01 DA 00  ....~...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Screendata contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22: Index of next gamescreen&lt;br /&gt;
28: Type? (1: level)&lt;br /&gt;
41: Tilemap width&lt;br /&gt;
46..47: Chunk ID with tilemap&lt;br /&gt;
48..49: Chunk ID with tile definitions (pixels)&lt;br /&gt;
50..51: Chunk ID with metatile definitions (4 tiles)&lt;br /&gt;
67: N chunks of unknown type, length 14, terminated by FF FF&lt;br /&gt;
67+N*14+2: N chunks of palette data, length 3, terminated by FF FF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67 (unknown data):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID? (list terminates if this is FFFF)&lt;br /&gt;
2..13: Unknown data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67+N*14+2 (palette):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID (list terminates if this is FFFF)&lt;br /&gt;
2: First color index (multiply this with 3 and copy data to that destination, palette is 256*3 bytes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Palette setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1: Prepare array with 3x256 bytes&lt;br /&gt;
2: Load each chunk to its location (several chunks with different sizes may be written to the same index)&lt;br /&gt;
3: Set color 16, 32, 48, 64, ..., 240 to [0,0,0] (black)&lt;br /&gt;
4: Color 4 is special (transparent/background/...?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
...&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
...&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Metatile format ==&lt;br /&gt;
&lt;br /&gt;
Each metatile consist of 2 x 2 tiles (16 x 16 pixels).&lt;br /&gt;
&lt;br /&gt;
Metatiles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Upper left tile&lt;br /&gt;
2..3: Upper right tile&lt;br /&gt;
4..5: Lower left tile&lt;br /&gt;
6..7: Lower right tile&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each tile in this list is 16 bit LSB.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bit 4: Horizontal flip&lt;br /&gt;
Bit 5: Vertical flip&lt;br /&gt;
Bit 6..15: Tile index&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tilemap format ==&lt;br /&gt;
&lt;br /&gt;
Tilemap have 2 bytes (LSB) for each metatile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bit 0..8: Metatile index&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [https://github.com/stople/LostVikingsDataExtractor Lost Vikings data extractor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8769</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8769"/>
		<updated>2019-07-20T23:39:43Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 575 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If raw:&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
The game also operates with distinct &amp;quot;game screens&amp;quot;, each with an index.&lt;br /&gt;
&lt;br /&gt;
Game screens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: First level&lt;br /&gt;
1: Second level&lt;br /&gt;
...&lt;br /&gt;
36: Last level&lt;br /&gt;
37: Death screen&lt;br /&gt;
38: Menu, screen 3&lt;br /&gt;
39: Menu, screen 1&lt;br /&gt;
40: Menu, screen 2&lt;br /&gt;
41: Galaxy fall (between levels)&lt;br /&gt;
43: Intro level (demo)&lt;br /&gt;
44: Intro level part 2&lt;br /&gt;
45: Game complete&lt;br /&gt;
46: Game complete 2&lt;br /&gt;
47: Credits screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each screen have a screendata chunk, which is mapped as following (2 byte (LSB) index for each):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
19F0:940C     C6 00 C8 00 CA 00 CC 00 28 00 2A 00 2C 00 2E 00  ........(.*.,...&lt;br /&gt;
19F0:941C     30 00 32 00 34 00 4B 00 4D 00 4F 00 51 00 53 00  0.2.4.K.M.O.Q.S.&lt;br /&gt;
19F0:942C     55 00 72 00 74 00 76 00 78 00 7A 00 7C 00 7E 00  U.r.t.v.x.z.|.~.&lt;br /&gt;
19F0:943C     80 00 9C 00 9E 00 A0 00 A2 00 A4 00 A6 00 A8 00  ................&lt;br /&gt;
19F0:944C     AA 00 CE 00 D0 00 D2 00 D4 00 71 01 7D 01 86 01  ..........q.}...&lt;br /&gt;
19F0:945C     8C 01 92 01 7E 01 AF 01 B0 01 B1 01 B2 01 DA 00  ....~...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Screendata contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22: Index of next gamescreen&lt;br /&gt;
28: Type? (1: level)&lt;br /&gt;
46..47: Chunk ID with tilemap&lt;br /&gt;
48..49: Chunk ID with tile definitions (pixels)&lt;br /&gt;
50..51: Chunk ID with metatile definitions (4 tiles)&lt;br /&gt;
67: N chunks of unknown type, length 14, terminated by FF FF&lt;br /&gt;
67+N*14+2: N chunks of palette data, length 3, terminated by FF FF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67 (unknown data):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID? (list terminates if this is FFFF)&lt;br /&gt;
2..13: Unknown data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67+N*14+2 (palette):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID (list terminates if this is FFFF)&lt;br /&gt;
2: First color index (multiply this with 3 and copy data to that destination, palette is 256*3 bytes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Palette setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1: Prepare array with 3x256 bytes&lt;br /&gt;
2: Load each chunk to its location (several chunks with different sizes may be written to the same index)&lt;br /&gt;
3: Set color 16, 32, 48, 64, ..., 240 to [0,0,0] (black)&lt;br /&gt;
4: Color 4 is special (transparent/background/...?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
...&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
...&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [https://github.com/stople/LostVikingsDataExtractor Lost Vikings data extractor]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8697</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8697"/>
		<updated>2019-06-20T21:10:03Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 575 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If raw:&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
The game also operates with distinct &amp;quot;game screens&amp;quot;, each with an index.&lt;br /&gt;
&lt;br /&gt;
Game screens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: First level&lt;br /&gt;
1: Second level&lt;br /&gt;
...&lt;br /&gt;
36: Last level&lt;br /&gt;
37: Death screen&lt;br /&gt;
38: Menu, screen 3&lt;br /&gt;
39: Menu, screen 1&lt;br /&gt;
40: Menu, screen 2&lt;br /&gt;
41: Galaxy fall (between levels)&lt;br /&gt;
43: Intro level (demo)&lt;br /&gt;
44: Intro level part 2&lt;br /&gt;
45: Game complete&lt;br /&gt;
46: Game complete 2&lt;br /&gt;
47: Credits screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each screen have a screendata chunk, which is mapped as following (2 byte (LSB) index for each):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
19F0:940C     C6 00 C8 00 CA 00 CC 00 28 00 2A 00 2C 00 2E 00  ........(.*.,...&lt;br /&gt;
19F0:941C     30 00 32 00 34 00 4B 00 4D 00 4F 00 51 00 53 00  0.2.4.K.M.O.Q.S.&lt;br /&gt;
19F0:942C     55 00 72 00 74 00 76 00 78 00 7A 00 7C 00 7E 00  U.r.t.v.x.z.|.~.&lt;br /&gt;
19F0:943C     80 00 9C 00 9E 00 A0 00 A2 00 A4 00 A6 00 A8 00  ................&lt;br /&gt;
19F0:944C     AA 00 CE 00 D0 00 D2 00 D4 00 71 01 7D 01 86 01  ..........q.}...&lt;br /&gt;
19F0:945C     8C 01 92 01 7E 01 AF 01 B0 01 B1 01 B2 01 DA 00  ....~...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Screendata contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22: Index of next gamescreen&lt;br /&gt;
28: Type? (1: level)&lt;br /&gt;
46..47: Chunk ID with tilemap&lt;br /&gt;
48..49: Chunk ID with tile definitions (pixels)&lt;br /&gt;
50..51: Chunk ID with metatile definitions (4 tiles)&lt;br /&gt;
67: N chunks of unknown type, length 14, terminated by FF FF&lt;br /&gt;
67+N*14+2: N chunks of palette data, length 3, terminated by FF FF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67 (unknown data):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID? (list terminates if this is FFFF)&lt;br /&gt;
2..13: Unknown data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67+N*14+2 (palette):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID (list terminates if this is FFFF)&lt;br /&gt;
2: First color index (multiply this with 3 and copy data to that destination, palette is 256*3 bytes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Palette setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1: Prepare array with 3x256 bytes&lt;br /&gt;
2: Load each chunk to its location (several chunks with different sizes may be written to the same index)&lt;br /&gt;
3: Set color 16, 32, 48, 64, ..., 240 to [0,0,0] (black)&lt;br /&gt;
4: Color 4 is special (transparent/background/...?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
...&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
...&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8696</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8696"/>
		<updated>2019-06-20T21:04:47Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 575 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If raw:&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
The game also operates with distinct &amp;quot;game screens&amp;quot;, each with an index.&lt;br /&gt;
&lt;br /&gt;
Game screens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: First level&lt;br /&gt;
1: Second level&lt;br /&gt;
...&lt;br /&gt;
36: Last level&lt;br /&gt;
37: Death screen&lt;br /&gt;
38: Menu, screen 3&lt;br /&gt;
39: Menu, screen 1&lt;br /&gt;
40: Menu, screen 2&lt;br /&gt;
41: Galaxy fall (between levels)&lt;br /&gt;
43: Intro level (demo)&lt;br /&gt;
44: Intro level part 2&lt;br /&gt;
45: Game complete&lt;br /&gt;
46: Game complete 2&lt;br /&gt;
47: Credits screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each screen have a screendata chunk, which is mapped as following (2 byte (LSB) index for each):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
19F0:940C     C6 00 C8 00 CA 00 CC 00 28 00 2A 00 2C 00 2E 00  ........(.*.,...&lt;br /&gt;
19F0:941C     30 00 32 00 34 00 4B 00 4D 00 4F 00 51 00 53 00  0.2.4.K.M.O.Q.S.&lt;br /&gt;
19F0:942C     55 00 72 00 74 00 76 00 78 00 7A 00 7C 00 7E 00  U.r.t.v.x.z.|.~.&lt;br /&gt;
19F0:943C     80 00 9C 00 9E 00 A0 00 A2 00 A4 00 A6 00 A8 00  ................&lt;br /&gt;
19F0:944C     AA 00 CE 00 D0 00 D2 00 D4 00 71 01 7D 01 86 01  ..........q.}...&lt;br /&gt;
19F0:945C     8C 01 92 01 7E 01 AF 01 B0 01 B1 01 B2 01 DA 00  ....~...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Screendata contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22: Index of next gamescreen&lt;br /&gt;
28: Type? (1: level)&lt;br /&gt;
46..47: Chunk ID with tilemap&lt;br /&gt;
48..49: Chunk ID with tile definitions (pixels)&lt;br /&gt;
50..51: Chunk ID with metatile definitions (4 tiles)&lt;br /&gt;
67: N chunks of unknown type, length 14, terminated by FF FF&lt;br /&gt;
67+N*14+2: &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67 (unknown data):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID? (list terminates if this is FFFF)&lt;br /&gt;
2..13: Unknown data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Offset 67+N*14+2 (palette):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Chunk ID (list terminates if this is FFFF)&lt;br /&gt;
2: First color index (multiply this with 3 and copy data to that destination, palette is 256*3 bytes&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Palette setup:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1: Prepare array with 3x256 bytes&lt;br /&gt;
2: Load each chunk to its location (several chunks with different sizes may be written to the same index)&lt;br /&gt;
3: Set color 16, 32, 48, 64, ..., 240 to [0,0,0] (black)&lt;br /&gt;
4: Color 4 is special (transparent/background/...?)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
...&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
...&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8695</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8695"/>
		<updated>2019-06-20T19:02:31Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 575 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If raw:&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
The game also operates with distinct &amp;quot;game screens&amp;quot;, each with an index.&lt;br /&gt;
&lt;br /&gt;
Game screens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: First level&lt;br /&gt;
1: Second level&lt;br /&gt;
...&lt;br /&gt;
36: Last level&lt;br /&gt;
37: Death screen&lt;br /&gt;
38: Menu, screen 3&lt;br /&gt;
39: Menu, screen 1&lt;br /&gt;
40: Menu, screen 2&lt;br /&gt;
41: Galaxy fall (between levels)&lt;br /&gt;
43: Intro level (demo)&lt;br /&gt;
45: Game complete&lt;br /&gt;
46: Game complete 2&lt;br /&gt;
47: Credits screen&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each screen have a screendata chunk, which is mapped as following (2 byte (LSB) index for each):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
19F0:940C     C6 00 C8 00 CA 00 CC 00 28 00 2A 00 2C 00 2E 00  ........(.*.,...&lt;br /&gt;
19F0:941C     30 00 32 00 34 00 4B 00 4D 00 4F 00 51 00 53 00  0.2.4.K.M.O.Q.S.&lt;br /&gt;
19F0:942C     55 00 72 00 74 00 76 00 78 00 7A 00 7C 00 7E 00  U.r.t.v.x.z.|.~.&lt;br /&gt;
19F0:943C     80 00 9C 00 9E 00 A0 00 A2 00 A4 00 A6 00 A8 00  ................&lt;br /&gt;
19F0:944C     AA 00 CE 00 D0 00 D2 00 D4 00 71 01 7D 01 86 01  ..........q.}...&lt;br /&gt;
19F0:945C     8C 01 92 01 7E 01 AF 01 B0 01 B1 01 B2 01 DA 00  ....~...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Screendata contents:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
22: Index of next gamescreen&lt;br /&gt;
28: Type? (1: level)&lt;br /&gt;
46..47: Chunk ID with tilemap&lt;br /&gt;
48..49: Chunk ID with tile definitions (pixels)&lt;br /&gt;
50..51: Chunk ID with metatile definitions (4 tiles)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
...&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
...&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8661</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8661"/>
		<updated>2019-06-14T23:51:33Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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, except the filename itself.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains 32-bit pointers to compressed chunks. There are 575 chunks. Data follows, in order, immediately after the pointers.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
&lt;br /&gt;
4..7: Offset to start of next chunk (also indicates where the previous chunk stops)&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
If raw:&lt;br /&gt;
&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8626</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8626"/>
		<updated>2019-06-12T22:15:53Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains pointers to compressed chunks.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
&lt;br /&gt;
4..7: Offset to end of chunk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
If raw:&lt;br /&gt;
&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B) (tiles is 8 x 8)&lt;br /&gt;
&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 metatiles * 2 B). 52 unique metatiles (each metatile is 16 x 16 and consist of 4 tiles)&lt;br /&gt;
&lt;br /&gt;
387: Metatiles (4 tiles forms 1 metatile) (416 B = 52 * 8 B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8623</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8623"/>
		<updated>2019-06-12T20:33:54Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains pointers to compressed chunks.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
&lt;br /&gt;
4..7: Offset to end of chunk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
If raw:&lt;br /&gt;
&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
First image in menu (&amp;quot;Interplay (tm)&amp;quot; splashscreen):&lt;br /&gt;
&lt;br /&gt;
390: Pointers to the other chunk IDs (81 B)&lt;br /&gt;
&lt;br /&gt;
388: Tiles (9024 B = 141 tiles * 64 B)&lt;br /&gt;
&lt;br /&gt;
385: Palette (384 B = 80 colors * 3 B)&lt;br /&gt;
&lt;br /&gt;
386: Tilemap (560 B = 20 x 14 tiles (each 16 x 16 pixels) * 2 B)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8616</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8616"/>
		<updated>2019-06-08T20:52:39Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains pointers to compressed chunks.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
&lt;br /&gt;
4..7: Offset to end of chunk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
0..1: Uncompressed size (minus 1 - add 1 to this number)&lt;br /&gt;
&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
If raw:&lt;br /&gt;
&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Data overview ==&lt;br /&gt;
&lt;br /&gt;
There are 575 chunks of compressed data with various length.&lt;br /&gt;
&lt;br /&gt;
Known chunks:&lt;br /&gt;
&lt;br /&gt;
388: Tiles for first &amp;quot;Interplay (tm)&amp;quot; splashscreen in the menu&lt;br /&gt;
&lt;br /&gt;
394: Tiles for 2nd splashscreen in the menu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tile format ==&lt;br /&gt;
&lt;br /&gt;
Each tile is 8 x 8 pixels, with 256 colors (using a palette).&lt;br /&gt;
&lt;br /&gt;
Pixels are organised as following:&lt;br /&gt;
&lt;br /&gt;
0: Pos 0/0&lt;br /&gt;
&lt;br /&gt;
1: Pos 4/0&lt;br /&gt;
&lt;br /&gt;
2: Pos 0/1&lt;br /&gt;
&lt;br /&gt;
3: Pos 4/1&lt;br /&gt;
&lt;br /&gt;
4: Pos 0/2&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
14: Pos 0/7&lt;br /&gt;
&lt;br /&gt;
15: Pos 4/7&lt;br /&gt;
&lt;br /&gt;
16: Pos 1/0&lt;br /&gt;
&lt;br /&gt;
17: Pos 5/0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
62: Pos 3/7&lt;br /&gt;
&lt;br /&gt;
63: Pos 7/7&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://www.ctpax-x.org/?goto=files&amp;amp;show=148 Blizzard DATA unpacker]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = Yes&lt;br /&gt;
| canDecompress = Yes&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
| notes = partial support&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8602</id>
		<title>DAT Format (The Lost Vikings)</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=DAT_Format_(The_Lost_Vikings)&amp;diff=8602"/>
		<updated>2019-06-01T18:17:33Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;{{Archive Infobox  | MaxFiles = Unknown  | FAT = Beginning  | Names = No  | Metadata = None  | Subdirectories = N  | Compressed = Y  | Encrypted = N  | Hidden = N  | Games =...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Archive Infobox&lt;br /&gt;
 | MaxFiles = Unknown&lt;br /&gt;
 | FAT = Beginning&lt;br /&gt;
 | Names = No&lt;br /&gt;
 | Metadata = None&lt;br /&gt;
 | Subdirectories = N&lt;br /&gt;
 | Compressed = Y&lt;br /&gt;
 | Encrypted = N&lt;br /&gt;
 | Hidden = N&lt;br /&gt;
 | Games = &lt;br /&gt;
   {{Game|The Lost Vikings}}&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;DAT format&#039;&#039;&#039; is used by [[The Lost Vikings]] to store game data in &amp;lt;tt&amp;gt;DATA.DAT&amp;lt;/tt&amp;gt;.  This file contains pointers to data with LZ77-based compression.&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.&lt;br /&gt;
&lt;br /&gt;
=== File entry ===&lt;br /&gt;
&lt;br /&gt;
The beginning of the file contains pointers to compressed chunks.&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&lt;br /&gt;
0..3: Offset to start of chunk&lt;br /&gt;
&lt;br /&gt;
4..7: Offset to end of chunk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Compression ==&lt;br /&gt;
&lt;br /&gt;
Each chunk is LZ77-compressed. Window size is 4096 bytes.&lt;br /&gt;
&lt;br /&gt;
Chunk overview:&lt;br /&gt;
&lt;br /&gt;
0..1: Uncompressed size&lt;br /&gt;
&lt;br /&gt;
2: Bitmask of the next 8 elements (raw (1) or dictionary (0))&lt;br /&gt;
&lt;br /&gt;
3..x: 8 elements&lt;br /&gt;
&lt;br /&gt;
x: Bitmask of the next 8 elements&lt;br /&gt;
&lt;br /&gt;
x-y: 8 elements&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each element:&lt;br /&gt;
&lt;br /&gt;
If raw:&lt;br /&gt;
&lt;br /&gt;
0: Raw byte (append to output and to sliding window/dictionary)&lt;br /&gt;
&lt;br /&gt;
If dictionary:&lt;br /&gt;
&lt;br /&gt;
0..1: len+offset (4b len (3-18), 12b absolute window offset)&lt;br /&gt;
&lt;br /&gt;
Copy data, byte for byte, from window, to both output and window/dictionary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: Sliding window is 4096 bytes, and initialized to 0 before decompressing. When decompressing, offset starts on 0 and increments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
{{BeginFileFormatTools|Type=group}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Camoto]]&lt;br /&gt;
| Platform = Linux/Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [[Wombat]]&lt;br /&gt;
| Platform = Windows&lt;br /&gt;
| canExtract = No&lt;br /&gt;
| canDecompress = No&lt;br /&gt;
| canCreate = No&lt;br /&gt;
| canModify = No&lt;br /&gt;
| canCompress = No&lt;br /&gt;
| editHidden = No&lt;br /&gt;
| editMetadata = No&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 Eirik. 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>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=User_talk:Peter_Swinkels&amp;diff=5193</id>
		<title>User talk:Peter Swinkels</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=User_talk:Peter_Swinkels&amp;diff=5193"/>
		<updated>2014-04-17T17:57:32Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;Hello! :)  I see that you seek information regarding soundcards. In case you&amp;#039;ve missed it, here&amp;#039;s an excelent guide regarding SB: http://web.archive.org/web/20100425014332/htt...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hello! :)&lt;br /&gt;
&lt;br /&gt;
I see that you seek information regarding soundcards. In case you&#039;ve missed it, here&#039;s an excelent guide regarding SB:&lt;br /&gt;
http://web.archive.org/web/20100425014332/http://www.shipbrook.com/jeff/sb.html&lt;br /&gt;
&lt;br /&gt;
In addition, feel free to check out the standalone OPL player in the OpenTitus project (sourceforge). It uses a modified version of DosBox&#039; OPL emulator.&lt;br /&gt;
&lt;br /&gt;
Have a nice day! :)&lt;br /&gt;
&lt;br /&gt;
[[User:Eirik|Eirik]] ([[User talk:Eirik|talk]]) 17:57, 17 April 2014 (GMT)&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=LZW_Compression&amp;diff=5181</id>
		<title>LZW Compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=LZW_Compression&amp;diff=5181"/>
		<updated>2014-03-18T22:27:11Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LZW compression is a common form of compression used in some early games to compress data and by most early games to compress their executables. It is notable in being one of the first compression methods to not compress on the byte level (Along with [[Huffman Compression]]) and for its efficiency.&lt;br /&gt;
&lt;br /&gt;
The basic concept for LZW is universal, though the implementations differ. In essence it involves replacing data strings that have been encountered before with references to already decompressed data. (Known as a &#039;dictionary&#039;) This can be done in a number of ways, the two main approaches differing on whether the dictionary is separate or integrated&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Separate Dictionary Approach =&lt;br /&gt;
&lt;br /&gt;
In this approach the dictionary is separate from the data being decompressed, that is it is stored in a separate location in memory. In this it behaves more like one would expect a dictionary to work; when a codeword is found in the data, it is looked up in the dictionary and the corresponding string copied to output. (As an example dictionary entry 42 could represent the string &#039;life&#039;, thus whenever the code &#039;42&#039; is encountered the string &#039;life&#039; is added to the decompressed data.)&lt;br /&gt;
&lt;br /&gt;
The advantage of this method is that the efficiency of compression increases as the amount of data to compress increases. The following points differ between implementations:&lt;br /&gt;
&lt;br /&gt;
* The initial dictionary. Just how large the initial dictionary is varies. Some implementations start with no dictioanry at all, others set a number of entries, usually 255, covering all possible 1-byte values.&lt;br /&gt;
&lt;br /&gt;
* The maximum size of the dictionary. Many older implementations with less resources were forced to cap the dictionary at a certain size, usually a power of two entries long. (512, 1024...) Unlimited implementations are rare as modern methods (e.g. the DEFLATE algorithm.)  usually rely on several compression methods at once. Sometimes the dictionary is &#039;reset&#039; when it reaches too large a size.&lt;br /&gt;
&lt;br /&gt;
* Whether the codestream is made partly or entirely of codewords. Often the compressed data is made entirely of codewords, even non-repeating strings, which means that initially compression can sometimes be rather poor. Other implementations use codeowords only for repeating strings. Differences in how codewords vs literal are indicated and how dictionaries are built up may occur.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Decoding ==&lt;br /&gt;
&lt;br /&gt;
This is a general decoding algorithm for separate dictionary LZW. It will need to be altered slightly when dealing with different implementations. Notably it assumes that the codestream is composed entirely of codewords and that the dictionary can keep growing indefinitely.&lt;br /&gt;
&lt;br /&gt;
    Add all roots to the dictionary. Code 0 corresponds to $00, code 1 is $01, etc to $FF;&lt;br /&gt;
    Add error, clear, and end-mark flags to the dictionary as appropriate;&lt;br /&gt;
    FirstCode [as unknown length binary number] = the first code in the codestream;&lt;br /&gt;
    CurMatch [as byte array] = the dictionary entry for FirstCode;&lt;br /&gt;
    Output CurMatch;&lt;br /&gt;
    Loop until end of codestream {&lt;br /&gt;
        CurCode [as unknown length binary number] = next code in the codestream;&lt;br /&gt;
        TempMatch [as byte array] allocate;&lt;br /&gt;
        If there is an entry for CurCode in the dictionary {&lt;br /&gt;
            TempMatch = the dictionary entry for CurCode;&lt;br /&gt;
        } If not {&lt;br /&gt;
            TempMatch = CurMatch;&lt;br /&gt;
            Concatenate the first byte of CurMatch to the end of TempMatch;&lt;br /&gt;
        }&lt;br /&gt;
        Output TempMatch;&lt;br /&gt;
        NewDictEntry [as byte array] = CurMatch;&lt;br /&gt;
        Concatenate the first byte of TempMatch to the end of NewDictEntry;&lt;br /&gt;
        Try to add NewDictEntry to the dictionary for the first empty key;&lt;br /&gt;
        CurMatch = TempMatch;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== [[Commander Keen 1-3|Commander Keen 1-3 LZW]] ==&lt;br /&gt;
&lt;br /&gt;
In [[Commander Keen 1-3]] LZW is used to compress the &amp;lt;tt&amp;gt;EGALATCH&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;EGASPRIT&amp;lt;/tt&amp;gt; files in episode 1 (It can also be used in episodes 2 and 3, but isn&#039;t.) The game uses two error-checking methods in this implementation, firstly it reserves two dictionary values, $100 to indicate an error (This is written by the compression program and will make the executable abort.) and $101 to indicate the end of data. (If the program reaches the end of the data without encountering this it will also abort.) The compressed data is also prefixed with a dword giving the decompressed data size, so this can be compared with the output.&lt;br /&gt;
&lt;br /&gt;
This method is a typical separate dictionary approach. It starts with a dictionary of 256 9-bit codewords representing the 8-bit strings $00-$FF (Plus some special cases.) The dictionary is allowed to grow to 4096 entries. The following is the initial dictionary:&lt;br /&gt;
&lt;br /&gt;
        0000 - 00 (character)&lt;br /&gt;
        0001 - 01 (character)&lt;br /&gt;
            ...&lt;br /&gt;
        00FE - FE (character)&lt;br /&gt;
        00FF - FF (character)&lt;br /&gt;
        0100 - Reserved for errors...&lt;br /&gt;
        0101 - Reserved for end of compressed data...&lt;br /&gt;
        0102 - (not set)&lt;br /&gt;
        0103 - (not set)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It will be immediately noticed that 4096 entries cannot be represented by 9-bit codes but at the least by 12-bit codes. To further conserve space the length of the codewords is increased every time the dictionary grows too large. Thus when it reaches $01FF entries codewords become 10 bits long, at $03FF they are 11 bits and finally at $07FF 12 bits. At $0FFF entries the dictionary stops growing.&lt;br /&gt;
&lt;br /&gt;
The following data is taken from the EGALATCH file from Keen 1. Notice that the first six bytes are ignored. (The first four give the decompressed data size, the next two are the maximum number of bits the LZW decoder will use.) The first few steps of decompression follows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    0000  80 D3 01 00  0C 00 00 40 - A0 70 31 E9  F8 F8 78 38&lt;br /&gt;
    0010  08 08 00 07  FC 39 FF 04 - 5E 41 E1 30  B3 C4 5A 2F&lt;br /&gt;
&lt;br /&gt;
The first code word encountered is 000000000 (First 9 bits) and thus outputs the string $00 - the first dictionary entry. This has set us up to step 4 and now things work slightly differently.&lt;br /&gt;
&lt;br /&gt;
The second code word is the next 9 bits, 100000010, which would point to entry $102. Since this entry is NOT found in the dictionary yet, we will create this entry then output it. Entry $102 is created by taking the previous codeword&#039;s string adding to it the first byte of that string. In this case the previous code word&#039;s (0) string is $00. $00 + $00 is $00 $00. Entry $102 thus represents the string $00 $00&lt;br /&gt;
&lt;br /&gt;
The next code word is 100000011, which is entry $103, which again doesn&#039;t exist. Entry $103 is created just like with $102, except now since the previous codeword is $00 $00, entry $103 is $00 $00 $00.&lt;br /&gt;
&lt;br /&gt;
The next code word is again $103, this IS found in the dictionary and is outputted ($00 $00 $00) however we now create dictionary entry $104 just like $103. (It is $00 $00 $00 $00.) Note that the previous codeword is still $103.&lt;br /&gt;
&lt;br /&gt;
The next code word is $3B. It is outputted and entry $105 created ($00 $00 $00 $3B) Now, the previous codeword is $3B. This pattern continues.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Integrated Dictionary Approach =&lt;br /&gt;
&lt;br /&gt;
In this approach the dictionary is the decompressed data itself. The codewords do not represent an entry in the dictionary structure, but rather directions in the decompressed code as to where a repeated string is located. That is a repeat string may well be represented by a codeword that states &#039;copy seven bytes from byte 132 in the decompressed data&#039;&lt;br /&gt;
&lt;br /&gt;
The advantage of this approach is that it doesn&#039;t require a separate construct for the dictionary and can just use the already decompressed data. The downside is that it will always need some method to distinguish literals and codewords, and, since codewords are nearly always of a fixed length there is an inherent limit both to how long the copied string can be and where it can be read from. this means that eventually the compression efficiency will level off and stop improving.&lt;br /&gt;
&lt;br /&gt;
There This is often called the &#039;sliding window&#039; and it represents the data that can be &#039;reached&#039; by the codewords. It is named as such because it is of a fixed length and &#039;slides&#039; along the output stream as it gets longer. The following features differ between implementations:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Differentiating codewords from literals. There must be a way to tell codewords apart from data that is just to be read and outputted. Sometimes this is integrated into the codewords themselves, but more often the &#039;flag&#039; precedes a codeword. The flag may indicate only codewords or both codewords and literals. (&#039;Following data is made of two codewords and six literals&#039;, etc.)&lt;br /&gt;
&lt;br /&gt;
* Codeword format. Most implementations use codewords of a fixed format that must encode both the length of data to copy and the location to copy it from. Codewords are usually two or four bytes long.&lt;br /&gt;
&lt;br /&gt;
* Zero point location. Different implementations use different places in the output as zero. If the start of the code is used as zero only the first x bytes of the output can be used as a reference. Most implementations use a more complex, but seldom less effective &#039;sliding window&#039;; the zero point is the start of the data until the data becomes too long at which point it moves forward so that the most recent x bytes of output can be used. It is also possible for zero to be the most recent byte with all locations being &#039;x bytes from the end&#039;, which also produces a sliding window. Finally it may be possible to have both negative and positive locations.&lt;br /&gt;
&lt;br /&gt;
* Sliding window. The nature of this is dictated by the format of the codewords. Common sizes are 1KB, 2KB or 4KB. The window will always be present, but it may not &#039;slide&#039; if the implementation uses a fixed location as the zero point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LZEXE ==&lt;br /&gt;
&lt;br /&gt;
Many vintage executables are compressed with the program LZEXE, interesting in that the compressed file contains its own decompressor, meaning that it is in essence a self-extracting archive. However the unique feature of LZEXE executables is that they extract the compressed data to memory and run it. To the user this is indistinguishable from the decompressed executable, though it takes slightly longer to start up and takes up much less space.&lt;br /&gt;
&lt;br /&gt;
[[UNLZEXE]] can be used to extract the decompressed executables from this which will run perfectly with other game files. It can be obtained here: http://www.dosclassics.com/download/198 It is currently unknown specifically how the LZW compression is implemented in this case, but with the source code for decompression is available.&lt;br /&gt;
&lt;br /&gt;
The LZEXE compression is similar to the SoftDisk Library Approach described below, but it uses UINT16LE values instead of byte values to store the flag bits and the sliding window has a size of 8192 (0x2000) bytes. Also, the flag bits have different meanings (you could argue that they are in fact Huffman codes):&lt;br /&gt;
&lt;br /&gt;
    1 -&amp;gt; copy 1 literal byte&lt;br /&gt;
   10 -&amp;gt; next two bytes contain length and distance&lt;br /&gt;
 0000 -&amp;gt; length is 2, next byte contains distance &lt;br /&gt;
 1000 -&amp;gt; length is 3, next byte contains distance &lt;br /&gt;
 0100 -&amp;gt; length is 4, next byte contains distance &lt;br /&gt;
 1100 -&amp;gt; length is 5, next byte contains distance &lt;br /&gt;
&lt;br /&gt;
The real distance value is always a signed 16 bit integer (you can use unsigned but then you have to bitwise-and the resulting index value with 0xFFFF). If the length is given by the flag bits/Huffman code, the real distance is &amp;lt;tt&amp;gt;b | 0xFF00&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;b - 256&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; is the byte value read from the file. If the length value is not given, read the byte values &amp;lt;tt&amp;gt;b0&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b1&amp;lt;/tt&amp;gt; and calculate length and distance like this:&lt;br /&gt;
&lt;br /&gt;
 length = (b1 mod 8)+2&lt;br /&gt;
 distance = b0 + (b1/8)*256 - 8192&lt;br /&gt;
or&lt;br /&gt;
 length = (b1 &amp;amp; 0x07)+2&lt;br /&gt;
 distance = b0 | ((b1 &amp;amp; 0xF8)&amp;lt;&amp;lt;5) | 0xE000&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;tt&amp;gt;length&amp;lt;/tt&amp;gt; value calculated from &amp;lt;tt&amp;gt;b1&amp;lt;/tt&amp;gt; is 2, this indicates that another byte value &amp;lt;tt&amp;gt;b2&amp;lt;/tt&amp;gt; must be read. Depending in the value of b2, one of three things can happen:&lt;br /&gt;
 b2 = 0:&lt;br /&gt;
    end of compressed data - stop decompressing&lt;br /&gt;
 b2 = 1:&lt;br /&gt;
    end of segment&lt;br /&gt;
    (decompressor may write contents of buffer to output)&lt;br /&gt;
    set length to 0 or jump to the part where the decompressor reads the next flag bits/Huffman code&lt;br /&gt;
 otherwise:&lt;br /&gt;
    set length to b2+1&lt;br /&gt;
&lt;br /&gt;
Now the decompressor must only add &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; to the current buffer index (since &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; is negative, the index goes backwards) and copy &amp;lt;tt&amp;gt;length&amp;lt;/tt&amp;gt; bytes from there to the current index:&lt;br /&gt;
&lt;br /&gt;
 WHILE length &amp;gt; 0&lt;br /&gt;
    buffer[index] = buffer[index+distance]&lt;br /&gt;
    index = index + 1&lt;br /&gt;
    length = length - 1&lt;br /&gt;
 END WHILE&lt;br /&gt;
&lt;br /&gt;
Please refer to the UNLZEXE source code for further information.&lt;br /&gt;
&lt;br /&gt;
== SoftDisk Library Approach ==&lt;br /&gt;
&lt;br /&gt;
This is used as the first form of compression in the [[Softdisk Library Format]]. Flags are 1-byte long and divide the datastream into segments of eight &#039;values&#039; which can be either literals or codewords. Codewords are 2 bytes long, literals 1 byte. (Therefore there will be a flag byte every 8 to 16 bytes of data.) The value of each bit (In little endian) indicates whether a value will be a literal (1) or codeword (0) Thus a value of 199 (11000111 in binary) indicates three codewords, three literals and two codewords in that order. (Total of 13 bytes.)&lt;br /&gt;
&lt;br /&gt;
Literals are sequences that have never been seen in the datastream before, they cannot be compressed and are thus the same in the compressed and decompressed datastreams. (If the data is text they become quite obvious.) Any string less than 3 bytes long that has not been read before or cannot be pointed to (See below) will be stored as literals.&lt;br /&gt;
&lt;br /&gt;
Codewords are reference to data that has already been read. They are two bytes long, with the first 12 bits giving the location to read data from and the last 4 bits giving the length of data to read.&lt;br /&gt;
&lt;br /&gt;
The lower nybble (4 bits) of the second codeword byte holds the length of repeat data to read minus three. (This makes sense, the shortest sequence it makes sense to code is three bytes which can be given the value 0.) It will be immediately apparent that the maximum length of repeated data that can be stored as a codeword is 18 bytes.&lt;br /&gt;
&lt;br /&gt;
The high nybble of the second byte is multiplied by 16 then added to the first byte to give the location of the data to read in the &#039;sliding window&#039; minus 19. (This is due to the way the decompression is set up in memory.)&lt;br /&gt;
&lt;br /&gt;
It will be immediately obvious that the codewords can encode values between +-2048, or about 2KB. If the decompressed data is less than 2KB in size then zero is the start of the data, if it is larger than it is 2048 bytes from the data end.&lt;br /&gt;
&lt;br /&gt;
It will be noted that it is probable that the compressed datastream will not be perfectly divisible by flag bytes. In this case the unused bits are set to 0. The decompressor stops when the decompressed data size is equal to the value given in the chunk header. (If it runs out of data it will abort.)&lt;br /&gt;
&lt;br /&gt;
As a simple example the sentence &#039;I am Sam. Sam I am!&#039; will be compressed to:&lt;br /&gt;
&lt;br /&gt;
 FF				Flag byte, 8 literals follow&lt;br /&gt;
 49 20 61 6D 20 53 61 6D	&#039;I am Sam&#039; as literals&lt;br /&gt;
 2B				Flag byte, 2L, P, L, P, L 2Blanks ($2B = 43 = 00101011)&lt;br /&gt;
 2E 20				&#039; .&#039; as literals&lt;br /&gt;
 F2 F0				codeword, read 0 + 3 = 3 bytes from $FF2, or -14 + 19 = 5 in the data. This is &#039;Sam&#039;&lt;br /&gt;
 20				&#039; &#039; as literal&lt;br /&gt;
 ED F1				codeword, read 1 + 3 = 4 bytes from $FED or -19 + 19 = 1 in the data. This is &#039;I am&#039;&lt;br /&gt;
 21				&#039;!&#039; as literal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Source code =&lt;br /&gt;
&lt;br /&gt;
Some example code is available in various languages showing how to decompress (and in some cases compress) files using the Keen&#039;s LZW algorithm in its various implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Keen 1-3 Implementation ==&lt;br /&gt;
&lt;br /&gt;
These segments f code work with the Keen 1-3 implementation only and will not for example decompress LZEXE compressed executables.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== QuickBasic ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;qbasic&amp;quot;&amp;gt;&lt;br /&gt;
DECLARE FUNCTION READBITS% (FILE AS INTEGER, NUMBITS AS INTEGER)&lt;br /&gt;
DECLARE SUB LZWDECOMPRESS (INNAME AS STRING, OUTNAME AS STRING)&lt;br /&gt;
DECLARE SUB LZWOUTPUT (FILE AS INTEGER, DIC AS INTEGER, CHAR AS INTEGER)&lt;br /&gt;
&#039;&lt;br /&gt;
&#039; KEEN1 Compatible LZW Decompressor (Lempel-Ziv-Welch)&lt;br /&gt;
&#039; - by Napalm with thanks to Adurdin&#039;s work on ModKeen&lt;br /&gt;
&#039;&lt;br /&gt;
&#039; This source is Public Domain&lt;br /&gt;
&#039;&lt;br /&gt;
&#039;&lt;br /&gt;
&lt;br /&gt;
&#039; Allocate dictionary&lt;br /&gt;
DIM LZDIC(0 TO 4095) AS INTEGER&lt;br /&gt;
DIM LZCHR(0 TO 4095) AS INTEGER&lt;br /&gt;
&lt;br /&gt;
&#039; Test Function&lt;br /&gt;
LZWDECOMPRESS &amp;quot;EGALATCH.CK1&amp;quot;, &amp;quot;EGALATCH.DAT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SUB LZWDECOMPRESS (INNAME AS STRING, OUTNAME AS STRING)&lt;br /&gt;
        SHARED LZDIC() AS INTEGER, LZCHR() AS INTEGER&lt;br /&gt;
        DIM INFILE AS INTEGER, OUTFILE AS INTEGER, I AS INTEGER&lt;br /&gt;
        DIM BITLEN AS INTEGER, CURPOS AS INTEGER&lt;br /&gt;
        DIM CW AS INTEGER, PW AS INTEGER, C AS INTEGER, P AS INTEGER&lt;br /&gt;
        DIM CHECK AS INTEGER&lt;br /&gt;
&lt;br /&gt;
        &#039; Open files for input and output&lt;br /&gt;
        INFILE = FREEFILE&lt;br /&gt;
        OPEN INNAME FOR BINARY ACCESS READ AS INFILE&lt;br /&gt;
        OUTFILE = FREEFILE&lt;br /&gt;
        OPEN OUTNAME FOR BINARY ACCESS WRITE AS OUTFILE&lt;br /&gt;
        SEEK INFILE, 7&lt;br /&gt;
&lt;br /&gt;
       &lt;br /&gt;
        &#039; Fill dictionary with starting values&lt;br /&gt;
        FOR I = 0 TO 4095&lt;br /&gt;
                LZDIC(I) = -1&lt;br /&gt;
                IF I &amp;lt; 256 THEN&lt;br /&gt;
                        LZCHR(I) = I&lt;br /&gt;
                ELSE&lt;br /&gt;
                        LZCHR(I) = -1&lt;br /&gt;
                END IF&lt;br /&gt;
        NEXT I&lt;br /&gt;
&lt;br /&gt;
        &#039; Decompress input stream to output stream&lt;br /&gt;
        BITLEN = 9&lt;br /&gt;
        CURPOS = 258&lt;br /&gt;
        CW = READBITS(INFILE, BITLEN)&lt;br /&gt;
        LZWOUTPUT OUTFILE, LZDIC(CW), LZCHR(CW)&lt;br /&gt;
       &lt;br /&gt;
        WHILE CW &amp;lt;&amp;gt; &amp;amp;H100 AND CW &amp;lt;&amp;gt; &amp;amp;H101&lt;br /&gt;
                PW = CW&lt;br /&gt;
                CW = READBITS(INFILE, BITLEN)&lt;br /&gt;
                IF CW &amp;lt;&amp;gt; &amp;amp;H100 AND CW &amp;lt;&amp;gt; &amp;amp;H101 THEN&lt;br /&gt;
                        P = PW&lt;br /&gt;
                        CHECK = (LZCHR(CW) &amp;lt;&amp;gt; -1)&lt;br /&gt;
                       &lt;br /&gt;
                        IF CHECK THEN&lt;br /&gt;
                                TMP = CW&lt;br /&gt;
                        ELSE&lt;br /&gt;
                                TMP = PW&lt;br /&gt;
                        END IF&lt;br /&gt;
                        WHILE LZDIC(TMP) &amp;lt;&amp;gt; -1&lt;br /&gt;
                                TMP = LZDIC(TMP)&lt;br /&gt;
                        WEND&lt;br /&gt;
                        C = LZCHR(TMP)&lt;br /&gt;
                       &lt;br /&gt;
                        IF CHECK THEN&lt;br /&gt;
                                LZWOUTPUT OUTFILE, LZDIC(CW), LZCHR(CW)&lt;br /&gt;
                        ELSE&lt;br /&gt;
                                LZWOUTPUT OUTFILE, P, C&lt;br /&gt;
                        END IF&lt;br /&gt;
                       &lt;br /&gt;
                        IF CURPOS &amp;lt; 4096 THEN&lt;br /&gt;
                                LZDIC(CURPOS) = P&lt;br /&gt;
                                LZCHR(CURPOS) = C&lt;br /&gt;
                                CURPOS = CURPOS + 1&lt;br /&gt;
                                IF CURPOS = (2 ^ BITLEN - 1) AND BITLEN &amp;lt; 12 THEN&lt;br /&gt;
                                        BITLEN = BITLEN + 1&lt;br /&gt;
                                END IF&lt;br /&gt;
                        END IF&lt;br /&gt;
&lt;br /&gt;
                END IF&lt;br /&gt;
        WEND&lt;br /&gt;
       &lt;br /&gt;
        &#039; Close files&lt;br /&gt;
        CLOSE OUTFILE&lt;br /&gt;
        CLOSE INFILE&lt;br /&gt;
END SUB&lt;br /&gt;
&lt;br /&gt;
SUB LZWOUTPUT (FILE AS INTEGER, DIC AS INTEGER, CHAR AS INTEGER)&lt;br /&gt;
        SHARED LZDIC() AS INTEGER, LZCHR() AS INTEGER&lt;br /&gt;
        DIM LZSTK(0 TO 127) AS STRING * 1&lt;br /&gt;
        DIM X AS INTEGER, SP AS INTEGER&lt;br /&gt;
        DIM LDIC AS INTEGER, LCHAR AS INTEGER&lt;br /&gt;
&lt;br /&gt;
        LCHAR = CHAR&lt;br /&gt;
        LDIC = DIC&lt;br /&gt;
        SP = 0&lt;br /&gt;
        X = 1&lt;br /&gt;
&lt;br /&gt;
        DO&lt;br /&gt;
                IF SP &amp;gt;= 128 THEN&lt;br /&gt;
                        PRINT &amp;quot;LZW: Stack Overflow!&amp;quot;&lt;br /&gt;
                        END&lt;br /&gt;
                END IF&lt;br /&gt;
                LZSTK(SP) = CHR$(LCHAR)&lt;br /&gt;
                SP = SP + 1&lt;br /&gt;
                IF LDIC &amp;lt;&amp;gt; -1 THEN&lt;br /&gt;
                        LCHAR = LZCHR(LDIC)&lt;br /&gt;
                        LDIC = LZDIC(LDIC)&lt;br /&gt;
                ELSE&lt;br /&gt;
                        X = 0&lt;br /&gt;
                END IF&lt;br /&gt;
        LOOP WHILE X&lt;br /&gt;
       &lt;br /&gt;
        WHILE SP &amp;lt;&amp;gt; 0&lt;br /&gt;
                SP = SP - 1&lt;br /&gt;
                PUT FILE, , LZSTK(SP)&lt;br /&gt;
        WEND&lt;br /&gt;
END SUB&lt;br /&gt;
&lt;br /&gt;
FUNCTION READBITS% (FILE AS INTEGER, NUMBITS AS INTEGER)&lt;br /&gt;
        STATIC BITDAT AS STRING * 1, BITPOS AS INTEGER&lt;br /&gt;
        DIM BITVAL AS INTEGER, BIT AS INTEGER&lt;br /&gt;
&lt;br /&gt;
        BITVAL = 0&lt;br /&gt;
        FOR BIT = (NUMBITS - 1) TO 0 STEP -1&lt;br /&gt;
                IF BITPOS = 0 THEN&lt;br /&gt;
                        GET FILE, , BITDAT&lt;br /&gt;
                        BITPOS = 7&lt;br /&gt;
                ELSE&lt;br /&gt;
                        BITPOS = BITPOS - 1&lt;br /&gt;
                END IF&lt;br /&gt;
                IF ASC(BITDAT) AND 2 ^ BITPOS THEN&lt;br /&gt;
                        BITVAL = BITVAL OR 2 ^ BIT&lt;br /&gt;
                END IF&lt;br /&gt;
        NEXT BIT&lt;br /&gt;
&lt;br /&gt;
        READBITS% = BITVAL&lt;br /&gt;
END FUNCTION&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FreeBasic ===&lt;br /&gt;
&lt;br /&gt;
This code does not suffer from the 64K memory limit imposed by QuickBasic and so is less efficient, but runs faster. It can be compiled with FreeBasic compiler using the -lang=qb switch. Aside from memory concerns, all code here is compatible with QuickBasic.&lt;br /&gt;
&lt;br /&gt;
The code before the subroutine is used to make a string containing the bit expansion of all values from 0 to 255. The subroutine takes a filename, reads the entire file into memory then expands each bit of data to a byte using the aforesaid string as Basic cannot deal with bits directly. cw$ is codeword, pw$ is the previous codeword, lun is the lowest dictionary entry that is empty, p is the location in the compressed data stream and bl is the length of codes in bits (Starting at nine bits increasing to 12)&lt;br /&gt;
&lt;br /&gt;
The dictionary is set before decompression. The first 258 are the starting dictionary, the remainder are cleared. (It is vital to reset the dictionary for each file) An error occurs if entry 256 is found in the data, &#039;distrupt&#039; is printed when the newest dictionary entry is not the lowest possible entry (This shouldn&#039;t happen but is possible.) Decompression ends at encountering entry 257, or when there is no more data to read.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;qbasic&amp;quot;&amp;gt;&lt;br /&gt;
DECLARE SUB LZWDEC (lfn AS STRING)&lt;br /&gt;
&lt;br /&gt;
x$ = &amp;quot;&amp;quot;&lt;br /&gt;
FOR l = 0 TO 255&lt;br /&gt;
 IF (l AND 128) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 64) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 32) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 16) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 8) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 4) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 2) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
 IF (l AND 1) &amp;gt; 0 THEN x$ = x$ + &amp;quot;1&amp;quot; ELSE x$ = x$ + &amp;quot;0&amp;quot;&lt;br /&gt;
NEXT l&lt;br /&gt;
LZEDEC &amp;quot;EGALATCH.CK1&amp;quot;&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;_________________________________________________&lt;br /&gt;
SUB LZWDEC (lfn AS STRING) &#039; Decompress LZW data&lt;br /&gt;
&#039;_________________________________________________&lt;br /&gt;
DIM lzw(0 TO 4095) AS STRING&lt;br /&gt;
PRINT lfn; &amp;quot; is LZW compressed, decompressing...&amp;quot;;&lt;br /&gt;
OPEN folder + lfn FOR BINARY AS #9&lt;br /&gt;
y$ = SPACE$(LOF(9))&lt;br /&gt;
GET #9, 1, y$&lt;br /&gt;
CLOSE #9&lt;br /&gt;
z$ = &amp;quot;&amp;quot;&lt;br /&gt;
FOR l = 7 TO LEN(y$)&lt;br /&gt;
 z$ = z$ + MID$(x$, (ASC(MID$(y$, l, 1)) * 8) + 1, 8)&lt;br /&gt;
NEXT l&lt;br /&gt;
&lt;br /&gt;
bl = 9&lt;br /&gt;
lun = 258&lt;br /&gt;
p = 1&lt;br /&gt;
cw$ = &amp;quot;&amp;quot;&lt;br /&gt;
y$ = &amp;quot;&amp;quot;&lt;br /&gt;
FOR l = 0 TO 4095&lt;br /&gt;
 IF l &amp;lt; 256 THEN lzw(l) = CHR$(l) ELSE lzw(l) = &amp;quot;&amp;quot;&lt;br /&gt;
NEXT l&lt;br /&gt;
DO&lt;br /&gt;
 IF lun = 511 THEN bl = 10&lt;br /&gt;
 IF lun = 1023 THEN bl = 11&lt;br /&gt;
 IF lun = 2047 THEN bl = 12&lt;br /&gt;
 pw$ = cw$&lt;br /&gt;
 u$ = MID$(z$, p, bl)&lt;br /&gt;
 p = p + bl&lt;br /&gt;
 y = 0&lt;br /&gt;
 FOR l = 1 TO bl&lt;br /&gt;
  IF MID$(u$, bl - l + 1, 1) = &amp;quot;1&amp;quot; THEN y = y + (2 ^ (l - 1))&lt;br /&gt;
 NEXT l&lt;br /&gt;
 IF y = 256 THEN&lt;br /&gt;
  PRINT &amp;quot;LZW error in Keen data!&amp;quot;&lt;br /&gt;
  OPEN &amp;quot;ERROR.DAT&amp;quot; FOR OUTPUT AS #9&lt;br /&gt;
  PRINT #9, y$;&lt;br /&gt;
  CLOSE&lt;br /&gt;
  END&lt;br /&gt;
 END IF&lt;br /&gt;
 IF y = 257 THEN EXIT DO&lt;br /&gt;
 IF cw$ = &amp;quot;&amp;quot; THEN&lt;br /&gt;
  cw$ = lzw(y)&lt;br /&gt;
  y$ = y$ + cw$&lt;br /&gt;
 ELSE&lt;br /&gt;
  IF lun &amp;lt; 4096 THEN&lt;br /&gt;
   IF lzw(y) = &amp;quot;&amp;quot; THEN&lt;br /&gt;
    cw$ = pw$ + LEFT$(pw$, 1)&lt;br /&gt;
    lzw(y) = cw$&lt;br /&gt;
    y$ = y$ + cw$&lt;br /&gt;
    IF y &amp;lt;&amp;gt; lun THEN PRINT &amp;quot;Disrupt!&amp;quot;&lt;br /&gt;
    lun = y + 1&lt;br /&gt;
   ELSE&lt;br /&gt;
    cw$ = lzw(y)&lt;br /&gt;
    y$ = y$ + cw$&lt;br /&gt;
    lzw(lun) = pw$ + LEFT$(cw$, 1)&lt;br /&gt;
    lun = lun + 1&lt;br /&gt;
   END IF&lt;br /&gt;
  ELSE&lt;br /&gt;
   IF lzw(y) = &amp;quot;&amp;quot; THEN&lt;br /&gt;
    y$ = y$ + cw$&lt;br /&gt;
   ELSE&lt;br /&gt;
    cw$ = lzw(y)&lt;br /&gt;
    y$ = y$ + cw$&lt;br /&gt;
   END IF&lt;br /&gt;
  END IF&lt;br /&gt;
 END IF&lt;br /&gt;
LOOP WHILE p &amp;lt; LEN(z$)&lt;br /&gt;
IF y = 257 THEN PRINT &amp;quot;done&amp;quot; ELSE PRINT &amp;quot;out of data.&amp;quot;&lt;br /&gt;
OPEN folder + LEFT$(lfn, 4) + extq FOR OUTPUT AS #9&lt;br /&gt;
PRINT #9, y$;&lt;br /&gt;
CLOSE #9&lt;br /&gt;
END SUB&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Visual Basic .NET ===&lt;br /&gt;
&lt;br /&gt;
This implementation uses high-level elements such as lambdas, anonymous arrays, and strict types. It must be compiled for the Microsoft .NET Framework v4.5 in Visual Studio 2012. It has the advantages of running in non-DosBox Windows and using .NET streams for simple reusability. It can also be used for higher-bit LZW.&lt;br /&gt;
&lt;br /&gt;
==== Decompression ====&lt;br /&gt;
&lt;br /&gt;
Decompressing is very fast.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;    Sub DecompressLZW(Data As IO.Stream, MaxBits As Byte, Output As IO.Stream)&lt;br /&gt;
        &#039; This source is by Fleexy and is in the public domain. If used, please note it as such.&lt;br /&gt;
        Dim dict As New List(Of Byte())&lt;br /&gt;
        For x = 0 To 255&lt;br /&gt;
            dict.Add({x})&lt;br /&gt;
        Next&lt;br /&gt;
        dict.Add({})&lt;br /&gt;
        dict.Add(Nothing)&lt;br /&gt;
        Dim usebits As Byte = 9&lt;br /&gt;
        Dim bpos As Long&lt;br /&gt;
        Dim bits As New List(Of Byte)&lt;br /&gt;
        Do Until Data.Position = Data.Length&lt;br /&gt;
            Dim b, ub As Byte&lt;br /&gt;
            b = Data.ReadByte&lt;br /&gt;
            ub = b&lt;br /&gt;
            For x = 7 To 0 Step -1&lt;br /&gt;
                If ub - (2 ^ x) &amp;gt;= 0 Then&lt;br /&gt;
                    ub -= (2 ^ x)&lt;br /&gt;
                    bits.Add(1)&lt;br /&gt;
                Else&lt;br /&gt;
                    bits.Add(0)&lt;br /&gt;
                End If&lt;br /&gt;
            Next&lt;br /&gt;
        Loop&lt;br /&gt;
        Dim GetCode = Function() As UInteger&lt;br /&gt;
                          Dim u As UInteger&lt;br /&gt;
                          For x = usebits To 1 Step -1&lt;br /&gt;
                              If bits(bpos) = 1 Then u += (2 ^ (x - 1))&lt;br /&gt;
                              bpos += 1&lt;br /&gt;
                          Next&lt;br /&gt;
                          Return u&lt;br /&gt;
                      End Function&lt;br /&gt;
        Dim OutputCode = Sub(DecompData As Byte())&lt;br /&gt;
                             Dim n As UInteger = DecompData.Length&lt;br /&gt;
                             Output.Write(DecompData, 0, n)&lt;br /&gt;
                         End Sub&lt;br /&gt;
        Dim AddToDict = Sub(Entry As Byte())&lt;br /&gt;
                            If dict.Count &amp;lt; (2 ^ MaxBits) Then&lt;br /&gt;
                                dict.Add(Entry)&lt;br /&gt;
                                If dict.Count = (2 ^ usebits) - 1 Then usebits = Math.Min(usebits + 1, MaxBits)&lt;br /&gt;
                            End If&lt;br /&gt;
                        End Sub&lt;br /&gt;
        Dim fcode As UInteger = GetCode()&lt;br /&gt;
        Dim match As Byte() = dict(fcode)&lt;br /&gt;
        OutputCode(match)&lt;br /&gt;
        Do&lt;br /&gt;
            Dim ncode As UInteger = GetCode()&lt;br /&gt;
            If ncode = 257 Then Exit Do&lt;br /&gt;
            If ncode = 256 Then Throw New Exception&lt;br /&gt;
            Dim nmatch As Byte()&lt;br /&gt;
            If ncode &amp;lt; dict.Count Then&lt;br /&gt;
                nmatch = dict(ncode)&lt;br /&gt;
            Else&lt;br /&gt;
                nmatch = match.Concat({match(0)}).ToArray&lt;br /&gt;
            End If&lt;br /&gt;
            OutputCode(nmatch)&lt;br /&gt;
            AddToDict(match.Concat({nmatch(0)}).ToArray)&lt;br /&gt;
            match = nmatch&lt;br /&gt;
        Loop&lt;br /&gt;
    End Sub&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compression ====&lt;br /&gt;
&lt;br /&gt;
Compression is more difficult; consulting the dictionary for a byte array takes more time. The speed of this algorithm may be unacceptable.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;    Sub CompressLZW(Data As IO.Stream, MaxBits As Byte, Output As IO.Stream)&lt;br /&gt;
        &#039; This source is by Fleexy and is in the public domain.&lt;br /&gt;
        Dim bits As New List(Of Byte)&lt;br /&gt;
        Dim dict As New List(Of Byte())&lt;br /&gt;
        For x = 0 To 255&lt;br /&gt;
            dict.Add({x})&lt;br /&gt;
        Next&lt;br /&gt;
        dict.Add({})&lt;br /&gt;
        dict.Add({})&lt;br /&gt;
        Dim usebits As Byte = 9&lt;br /&gt;
        Dim PutCode = Sub(Code As UInteger)&lt;br /&gt;
                          For x = usebits To 1 Step -1&lt;br /&gt;
                              If Code - (2 ^ (x - 1)) &amp;gt;= 0 Then&lt;br /&gt;
                                  Code -= (2 ^ (x - 1))&lt;br /&gt;
                                  bits.Add(1)&lt;br /&gt;
                              Else&lt;br /&gt;
                                  bits.Add(0)&lt;br /&gt;
                              End If&lt;br /&gt;
                          Next&lt;br /&gt;
                      End Sub&lt;br /&gt;
        Dim AddToDict = Function(Entry As Byte()) As Boolean&lt;br /&gt;
                            If dict.Count &amp;lt; 2 ^ MaxBits Then&lt;br /&gt;
                                dict.Add(Entry)&lt;br /&gt;
                                If dict.Count = 2 ^ usebits Then usebits = Math.Min(usebits + 1, MaxBits)&lt;br /&gt;
                                Return True&lt;br /&gt;
                            Else&lt;br /&gt;
                                Return False&lt;br /&gt;
                            End If&lt;br /&gt;
                        End Function&lt;br /&gt;
        Dim FindCode = Function(Bytes As Byte()) As UInteger&lt;br /&gt;
                           For x = 1 To dict.Count&lt;br /&gt;
                               If dict(x - 1).Count = Bytes.Count Then&lt;br /&gt;
                                   If dict(x - 1).SequenceEqual(Bytes) Then Return x - 1&lt;br /&gt;
                               End If&lt;br /&gt;
                           Next&lt;br /&gt;
                           Throw New NotFiniteNumberException&lt;br /&gt;
                       End Function&lt;br /&gt;
        Dim DictContains = Function(Bytes As Byte()) As Boolean&lt;br /&gt;
                               For x = 1 To dict.Count&lt;br /&gt;
                                   If dict(x - 1).Length = Bytes.Length Then&lt;br /&gt;
                                       If dict(x - 1).SequenceEqual(Bytes) Then Return True&lt;br /&gt;
                                   End If&lt;br /&gt;
                               Next&lt;br /&gt;
                               Return False&lt;br /&gt;
                           End Function&lt;br /&gt;
        Dim match As Byte() = {}&lt;br /&gt;
        Do Until Data.Position = Data.Length&lt;br /&gt;
            Dim nbyte As Byte = Data.ReadByte&lt;br /&gt;
            Dim nmatch As Byte() = match.Concat({nbyte}).ToArray&lt;br /&gt;
            If DictContains(nmatch) Then&lt;br /&gt;
                match = nmatch&lt;br /&gt;
            Else&lt;br /&gt;
                PutCode(FindCode(match))&lt;br /&gt;
                AddToDict(nmatch)&lt;br /&gt;
                match = {nbyte}&lt;br /&gt;
            End If&lt;br /&gt;
        Loop&lt;br /&gt;
        PutCode(FindCode(match))&lt;br /&gt;
        PutCode(257)&lt;br /&gt;
        Do Until bits.LongCount Mod 8L = 0L&lt;br /&gt;
            bits.Add(0)&lt;br /&gt;
        Loop&lt;br /&gt;
        For x = 1 To CInt(bits.LongCount / 8L)&lt;br /&gt;
            Dim b As Byte = 0&lt;br /&gt;
            For y = 0 To 7&lt;br /&gt;
                b += bits((x - 1) * 8 + y) * (2 ^ (7 - y))&lt;br /&gt;
            Next&lt;br /&gt;
            Output.WriteByte(b)&lt;br /&gt;
        Next&lt;br /&gt;
    End Sub&amp;lt;/source&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Commander Keen 1-3]]&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:LZW Compression]]&lt;br /&gt;
[[Category:Compressed Files]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5179</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5179"/>
		<updated>2014-03-18T22:02:59Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1992.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://sourceforge.net/projects/opentitus/files/opentitus/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game. All files are compressed with [[Titus Interactive SQZ Compression]].&lt;br /&gt;
&lt;br /&gt;
More information: [http://ttf.mine.nu/techdocs.htm File format specifications]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;SPREXP.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;FONTS.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;LEVELx.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCEG)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;TITUS.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;TITRE.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;MENU.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;LEVELA.SQZ&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;FOX.COM&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Category:Titus_the_Fox&amp;diff=5178</id>
		<title>Category:Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Category:Titus_the_Fox&amp;diff=5178"/>
		<updated>2014-03-18T21:48:26Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;{{GameCategory}}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{GameCategory}}&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5177</id>
		<title>Titus Interactive SQZ Compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5177"/>
		<updated>2014-03-18T21:45:11Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Titus Interactive SQZ Compression is an implementation of [[Huffman Compression]] and [[LZW compression]]. It is present in [[Titus the Fox]] and [[The Blues Brothers]], developed by Titus Interactive.&lt;br /&gt;
&lt;br /&gt;
Check out [[The Blues Brothers Huffman Compression]] for similar information.&lt;br /&gt;
&lt;br /&gt;
= Specification =&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;
| BYTE[1] sizeH || bits 0..3: high nibble of uncompressed size, bits 4..7 unused&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[1] compression || 0x10: LZW is used, something else (0): Huffman+RLE is used&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE sizeL || low word of uncompressed size&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!If Huffman:&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE HuffmanTreeSize || Size of Huffman tree.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE[HuffmanTreeSize / 2] HuffmanTree || Huffman tree. A node is a leaf node when the most significant bit is set, otherwise it&#039;s an internal node.&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data. The most significant bit of a byte is processed first, then the second most significant bit etc.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!If LZW:&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== LZW decoding ==&lt;br /&gt;
&lt;br /&gt;
The bitstream consists of variable-length codewords; from here on, their&lt;br /&gt;
word size is named &#039;nbit&#039;. Initially, nbit == 9.&lt;br /&gt;
&lt;br /&gt;
LZW makes use of a dictionary; the codewords are used as indices to perform&lt;br /&gt;
lookups. This dictionary is not specified explicitly in the compressed stream&lt;br /&gt;
though, instead it is derived during decompression. Initially the dictionary&lt;br /&gt;
contains 258 entries. For entries 0..255, the value of each entry is simply&lt;br /&gt;
the ASCII binary form of its index: dict[i] = chr(i). The remaining two&lt;br /&gt;
entries, 0x100 and 0x101, have a special purpose and aren&#039;t used for lookups.&lt;br /&gt;
The dictionary has a maximum size of 0x1000 entries.&lt;br /&gt;
&lt;br /&gt;
The bitstream codewords can be divided in two categories. The first category&lt;br /&gt;
is formed by the two special values mentioned above, CLEAR_CODE (0x100) and&lt;br /&gt;
END_CODE (0x101). Whenever CLEAR_CODE is encountered, the decoder should&lt;br /&gt;
reset its state to the initial condition, that is, set nbit to 9 and reset&lt;br /&gt;
the dictionary to its initial 258 entries. END_CODE, as expected, marks the&lt;br /&gt;
end of the stream.&lt;br /&gt;
&lt;br /&gt;
The second category is formed by all other codeword values. For each&lt;br /&gt;
codeword, first a new entry is optionally added to the dictionary. No entry&lt;br /&gt;
is added immediately after a CLEAR_CODE, and neither when the dictionary is&lt;br /&gt;
full. Next, the codeword&#039;s value is used as an index in the dictionary: the&lt;br /&gt;
corresponding entry is output.&lt;br /&gt;
&lt;br /&gt;
The value of the new dictionary entry is the output generated by the previous&lt;br /&gt;
codeword, plus one more byte. This byte is normally the first byte of the&lt;br /&gt;
current codeword&#039;s output. However, sometimes the current codeword points to&lt;br /&gt;
a not-yet-existing dictionary entry. In this case, the extra byte&#039;s value is&lt;br /&gt;
the first byte of the previous output. So, if the previous codeword generated&lt;br /&gt;
an output of &#039;ABC&#039;, and the current codeword points beyond the dictionary,&lt;br /&gt;
the new dictionary entry would be &#039;ABCA&#039;.&lt;br /&gt;
&lt;br /&gt;
For this to work correctly, the input stream must fulfill a few conditions,&lt;br /&gt;
which all apply only when the current codeword points to a not-yet-existing&lt;br /&gt;
entry. First, the previous codeword can&#039;t be a CLEAR_CODE, as there is no&lt;br /&gt;
previous output in that case. Secondly, the dictionary cannot be full, as&lt;br /&gt;
otherwise there is no room to add a new entry, which is needed to lookup the&lt;br /&gt;
output. Finally, the current codeword must point to the to-be-added entry,&lt;br /&gt;
for the same reason. It is the responsibility of the compressor to make sure&lt;br /&gt;
these conditions hold, and they do for all LZW-encoded SQZ files in both&lt;br /&gt;
Moktar and Titus the Fox.&lt;br /&gt;
&lt;br /&gt;
If after adding an entry the number of elements in the dictionary is equal to&lt;br /&gt;
2^nbit, the value of nbit is incremented; unless nbit is equal to 12.&lt;br /&gt;
&lt;br /&gt;
The number of unused input bits following END_CODE is at least one and at&lt;br /&gt;
most eight, so sometimes an entirely unused input byte is present at the end.&lt;br /&gt;
&lt;br /&gt;
Regarding bit-order: consider the first three input bytes of a file, and&lt;br /&gt;
label the bits like this, with most-significant bits on the left in each byte:&lt;br /&gt;
	76543210 FEDCBA98 NMLKJIHG&lt;br /&gt;
then, the first two codewords (most-significant bit left) are:&lt;br /&gt;
	76543210F EDCBA98NM&lt;br /&gt;
&lt;br /&gt;
Constants:&lt;br /&gt;
	CLEAR_CODE	= 0x100 (0x101 for CDRUN.COM)&lt;br /&gt;
	END_CODE	= 0x101 (0x100 for CDRUN.COM)&lt;br /&gt;
	MAX_TABLE	= 0x1000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	int nbit&lt;br /&gt;
	stringarray dict&lt;br /&gt;
&lt;br /&gt;
	int prev := CLEAR_CODE&lt;br /&gt;
	while (prev != END_CODE) {&lt;br /&gt;
		if (prev == CLEAR_CODE) {&lt;br /&gt;
			nbit := 9&lt;br /&gt;
			dict := [chr(0)..chr(255), ?, ?] // 258 entries, ?=unused&lt;br /&gt;
		}&lt;br /&gt;
		int cw := next nbit-sized codeword&lt;br /&gt;
		if (cw != CLEAR_CODE &amp;amp;&amp;amp; cw != END_CODE) {&lt;br /&gt;
			int newbyte&lt;br /&gt;
			if (cw &amp;lt; num_elem(dict)) {&lt;br /&gt;
				newbyte := first_byte(dict[cw])&lt;br /&gt;
			} else {&lt;br /&gt;
				// Assumption 1: prev != CLEAR_CODE&lt;br /&gt;
				// Assumption 2: num_elem(dict) &amp;lt; MAX_TABLE&lt;br /&gt;
				// Assumption 3: cw == num_elem(dict)&lt;br /&gt;
				newbyte := first_byte(dict[prev])&lt;br /&gt;
			}&lt;br /&gt;
			if ((prev != CLEAR_CODE) &amp;amp;&amp;amp; (num_elem(dict) &amp;lt; MAX_TABLE)) {&lt;br /&gt;
				append dict[prev] ++ newbyte to dict&lt;br /&gt;
				if (num_elem(dict) == 2**nbit &amp;amp;&amp;amp; nbit &amp;lt; 12) {&lt;br /&gt;
					nbit++&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			output dict[cw]&lt;br /&gt;
		}&lt;br /&gt;
		prev := cw&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Huffman decoding ==&lt;br /&gt;
&lt;br /&gt;
In Huffman coding a fixed binary tree structure is used, with output&lt;br /&gt;
codewords stored at its leaves. The Huffman bitstream sequentially addresses&lt;br /&gt;
these leaf nodes. The tree is navigated node for node, starting at the root.&lt;br /&gt;
One bit is then read from the stream. This bit determines the next node to&lt;br /&gt;
visit: a bit value of 0 means visit the first (left) child, where a value of&lt;br /&gt;
1 means take the second (right) child. Whenever a leaf node is reached, its&lt;br /&gt;
value is output and the current node position is reset to the root.&lt;br /&gt;
&lt;br /&gt;
In most Huffman implementations the tree is stored efficiently in what is&lt;br /&gt;
known as &amp;quot;canonical&amp;quot; form. In the SQZ files however, this is not the case and&lt;br /&gt;
the tree is stored in a very straightforward fashion, making it easy to use.&lt;br /&gt;
The binary Huffman tree HT is stored as array of 16-bit words, where each word&lt;br /&gt;
represents a node; each node is either an internal node or a leaf node. The&lt;br /&gt;
value stored in the array for a node has two parts: bit 15 is set if it is a&lt;br /&gt;
leaf node, bits 0..14 contain the node&#039;s value. For leaf nodes this value is&lt;br /&gt;
a codeword, for internal nodes it is 2*(index of first child), or put another&lt;br /&gt;
way: the byte offset in the array of the first child. The second child of an&lt;br /&gt;
internal node is stored immediately after its first child.&lt;br /&gt;
&lt;br /&gt;
Bit order is such that for each byte, the most significant bit is processed&lt;br /&gt;
first.&lt;br /&gt;
&lt;br /&gt;
Pseudocode for reading codewords (Huffman decoding):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	int node := 0&lt;br /&gt;
	while (bool b := next bit) {&lt;br /&gt;
		if (b) {&lt;br /&gt;
			node++&lt;br /&gt;
		}&lt;br /&gt;
		if (HT[node] &amp;lt; 0x8000) {&lt;br /&gt;
			// internal node&lt;br /&gt;
			node := HT[node] / 2&lt;br /&gt;
		} else {&lt;br /&gt;
			// leaf node&lt;br /&gt;
			int cw := HT[node] &amp;amp; 0x7FFF&lt;br /&gt;
			process codeword cw&lt;br /&gt;
			node := 0&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This results in a sequence of RLE codewords. Each codeword &#039;cw&#039; is processed&lt;br /&gt;
in the following way:&lt;br /&gt;
&lt;br /&gt;
Let L == cw mod 256&lt;br /&gt;
Let H == cw div 256&lt;br /&gt;
&lt;br /&gt;
Codeword	What to do&lt;br /&gt;
H==0		last := L; output &#039;last&#039;&lt;br /&gt;
H!=0 &amp;amp;&amp;amp; L==0	read next codeword; output cw times &#039;last&#039;&lt;br /&gt;
H!=0 &amp;amp;&amp;amp; L==1	read next codeword; count := L*256;&lt;br /&gt;
		read next codeword; count += L;&lt;br /&gt;
		output count times &#039;last&#039;&lt;br /&gt;
H!=0 &amp;amp;&amp;amp; L&amp;gt;=2	output L times &#039;last&#039;&lt;br /&gt;
&lt;br /&gt;
This is easily implemented using a state machine: the following pseudocode&lt;br /&gt;
can be directly inserted in the loop above.&lt;br /&gt;
&lt;br /&gt;
The pseudocode uses three pre-existing variables:&lt;br /&gt;
	int state := 0&lt;br /&gt;
	byte last&lt;br /&gt;
	int count&lt;br /&gt;
&lt;br /&gt;
Pseudocode for processing a codeword cw (RLE decoding):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	byte L := cw &amp;amp; 255&lt;br /&gt;
	byte H := cw &amp;gt;&amp;gt; 8&lt;br /&gt;
	if (state == 0) {&lt;br /&gt;
		if (H == 0) {&lt;br /&gt;
			last := L&lt;br /&gt;
			output &#039;last&#039;&lt;br /&gt;
		} else if (L == 0) {&lt;br /&gt;
			state := 1&lt;br /&gt;
		} else if (L == 1) {&lt;br /&gt;
			state := 2&lt;br /&gt;
		} else {&lt;br /&gt;
			output L times &#039;last&#039;&lt;br /&gt;
		}&lt;br /&gt;
	} else if (state == 1) { // cw == repeat count&lt;br /&gt;
		output cw times &#039;last&#039;&lt;br /&gt;
		state := 0&lt;br /&gt;
	} else if (state == 2) { // L == high byte of &#039;count&#039;&lt;br /&gt;
		count := L*256&lt;br /&gt;
		state := 3&lt;br /&gt;
	} else if (state == 3) { // L == low byte of &#039;count&#039;&lt;br /&gt;
		count += L&lt;br /&gt;
		output count times &#039;last&#039;&lt;br /&gt;
		state := 0&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Implementations =&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs.htm#compress Pseudocode]&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs/unpack.pl Perl implementation]&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/opentitus/files/opentitus/0.3.0/OpenTitus_0.3.0.zip/download Source code in C (sqz.c)]&lt;br /&gt;
&lt;br /&gt;
[[The Blues Brothers Huffman Compression]] - QuickBASIC implementation (Huffman only)&lt;br /&gt;
&lt;br /&gt;
== UnSQZ ==&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/opentitus/files/tools/UnSQZ/ OpenTitus UnSQZ-tool] extracts SQZ-compressed files.&lt;br /&gt;
&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
SQZ information: [http://ttf.mine.nu/techdocs.htm Jesses].&lt;br /&gt;
&lt;br /&gt;
OpenTitus SQZ extractor: [[User:Eirik|Eirik]].&lt;br /&gt;
&lt;br /&gt;
QuickBasic implementation: [[User:Frenkel|Frenkel]].&lt;br /&gt;
&lt;br /&gt;
If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Compressed Files]]&lt;br /&gt;
[[Category:Huffman Compression]]&lt;br /&gt;
[[Category:LZW Compression]]&lt;br /&gt;
[[Category:Code examples]]&lt;br /&gt;
[[Category:Titus the Fox]]&lt;br /&gt;
[[Category:The Blues Brothers]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5176</id>
		<title>Titus Interactive SQZ Compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5176"/>
		<updated>2014-03-18T21:16:49Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Titus Interactive SQZ Compression is an implementation of [[Huffman Compression]] and [[LZW compression]]. It is present in [[Titus the Fox]] and [[The Blues Brothers]], developed by Titus Interactive.&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[1] sizeH || bits 0..3: high nibble of uncompressed size, bits 4..7 unused&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[1] compression || 0x10: LZW is used, something else (0): Huffman+RLE is used&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE sizeL || low word of uncompressed size&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!If Huffman:&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE HuffmanTreeSize || Size of Huffman tree.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE[HuffmanTreeSize / 2] HuffmanTree || Huffman tree. A node is a leaf node when the most significant bit is set, otherwise it&#039;s an internal node.&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data. The most significant bit of a byte is processed first, then the second most significant bit etc.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!If LZW:&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Extractor ==&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/opentitus/files/tools/UnSQZ/ OpenTitus UnSQZ-tool] extracts SQZ-compressed files.&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs.htm#compress Pseudocode]&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs/unpack.pl Perl implementation]&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/opentitus/files/opentitus/0.3.0/OpenTitus_0.3.0.zip/download Source code in C (sqz.c)]&lt;br /&gt;
&lt;br /&gt;
[[The Blues Brothers Huffman Compression]] - QuickBASIC implementation (Huffman only)&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
SQZ information: [http://ttf.mine.nu/techdocs.htm Jesses].&lt;br /&gt;
&lt;br /&gt;
OpenTitus SQZ extractor: [[User:Eirik|Eirik]].&lt;br /&gt;
&lt;br /&gt;
QuickBasic implementation: [[User:Frenkel|Frenkel]].&lt;br /&gt;
&lt;br /&gt;
If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Compressed Files]]&lt;br /&gt;
[[Category:Huffman Compression]]&lt;br /&gt;
[[Category:LZW Compression]]&lt;br /&gt;
[[Category:Titus the Fox]]&lt;br /&gt;
[[Category:The Blues Brothers]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5175</id>
		<title>Titus Interactive SQZ Compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5175"/>
		<updated>2014-03-18T20:58:07Z</updated>

		<summary type="html">&lt;p&gt;Eirik: /* Extractor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Titus Interactive SQZ Compression is an implementation of [[Huffman Compression]] and [[LZW compression]]. It is present in [[Titus the Fox]] and [[The Blues Brothers]], developed by Titus Interactive.&lt;br /&gt;
&lt;br /&gt;
== 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[1] sizeH || bits 0..3: high nibble of uncompressed size, bits 4..7 unused&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[1] compression || 0x10: LZW is used, something else (0): Huffman+RLE is used&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE sizeL || low word of uncompressed size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== If Huffman ==&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 HuffmanTreeSize || Size of Huffman tree.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE[HuffmanTreeSize / 2] HuffmanTree || Huffman tree. A node is a leaf node when the most significant bit is set, otherwise it&#039;s an internal node.&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data. The most significant bit of a byte is processed first, then the second most significant bit etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== If LZW ==&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[] compressedData || Compressed data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Extractor ==&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/opentitus/files/tools/UnSQZ/ OpenTitus UnSQZ-tool] extracts SQZ-compressed files.&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs.htm#compress Pseudocode]&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs/unpack.pl Perl implementation]&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/opentitus/files/opentitus/0.3.0/OpenTitus_0.3.0.zip/download Source code in C (sqz.c)]&lt;br /&gt;
&lt;br /&gt;
[[The Blues Brothers Huffman Compression]] - QuickBASIC implementation (Huffman only)&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
SQZ information: [http://ttf.mine.nu/techdocs.htm Jesses].&lt;br /&gt;
&lt;br /&gt;
OpenTitus SQZ extractor: [[User:Eirik|Eirik]].&lt;br /&gt;
&lt;br /&gt;
QuickBasic implementation: [[User:Frenkel|Frenkel]].&lt;br /&gt;
&lt;br /&gt;
If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Compressed Files]]&lt;br /&gt;
[[Category:Huffman Compression]]&lt;br /&gt;
[[Category:LZW Compression]]&lt;br /&gt;
[[Category:Titus the Fox]]&lt;br /&gt;
[[Category:The Blues Brothers]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5174</id>
		<title>The Blues Brothers</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5174"/>
		<updated>2014-03-18T20:57:00Z</updated>

		<summary type="html">&lt;p&gt;Eirik: /* File formats */&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;
{{NeedMoreInfo}}&lt;br /&gt;
&lt;br /&gt;
The Blues Brothers is a side scrolling platform game based on the movie of the same name.&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://sourceforge.net/projects/opentitus/files/blues_brothers/ Simple level viewer]&lt;br /&gt;
| Platform = SDL (Windows)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&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;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
Most of the data files are compressed using [[Titus Interactive SQZ Compression]].&lt;br /&gt;
&lt;br /&gt;
Alternative specification: [[The Blues Brothers Huffman Compression]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Filename!!Description&lt;br /&gt;
|-&lt;br /&gt;
|*.CK1 and *.CK2||Background tiles in [[LBM Format]]&lt;br /&gt;
|-&lt;br /&gt;
|DEMO?.BIN||Demo (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|The other *.BIN files||Tile attributes (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|*.SQL||Level data in [[The Blues Brothers Map Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQV||Sprites and foreground tiles in [[The Blues Brothers Sprite Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQZ||Full screen images in [[LBM Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers_Huffman_Compression&amp;diff=5173</id>
		<title>The Blues Brothers Huffman Compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers_Huffman_Compression&amp;diff=5173"/>
		<updated>2014-03-18T20:55:01Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[The Blues Brothers]] Huffman Compression is an implementation of [[Huffman Compression]].&lt;br /&gt;
&lt;br /&gt;
For more information, check out [[Titus Interactive SQZ Compression]].&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[2] unknown || Always zero?&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE decompressedSize || Size of decompressed data.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE HuffmanTreeSize || Size of Huffman tree.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE[HuffmanTreeSize / 2] HuffmanTree || Huffman tree. A node is a leaf node when the most significant bit is set, otherwise it&#039;s an internal node.&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data. The most significant bit of a byte is processed first, then the second most significant bit etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
Some example code is available in various languages showing how to decompress files using the Huffman algorithm.&lt;br /&gt;
&lt;br /&gt;
=== QuickBASIC ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;qbasic&amp;quot;&amp;gt;&lt;br /&gt;
CONST fileIn = &amp;quot;SPRITE.SQV&amp;quot;&lt;br /&gt;
CONST fileOut = &amp;quot;SPRITE.OUT&amp;quot;&lt;br /&gt;
&lt;br /&gt;
DIM unknown                 AS INTEGER&lt;br /&gt;
DIM decompressedSizeInteger AS INTEGER&lt;br /&gt;
DIM decompressedSize        AS LONG&lt;br /&gt;
DIM HuffmanTreeSize         AS INTEGER&lt;br /&gt;
DIM node                    AS INTEGER&lt;br /&gt;
DIM byteIn                  AS STRING * 1&lt;br /&gt;
DIM byteOut                 AS STRING * 1&lt;br /&gt;
DIM bitPosition             AS INTEGER&lt;br /&gt;
DIM bit                     AS INTEGER&lt;br /&gt;
DIM i                       AS LONG&lt;br /&gt;
&lt;br /&gt;
OPEN fileIn FOR BINARY AS #1&lt;br /&gt;
OPEN fileOut FOR BINARY AS #2&lt;br /&gt;
&lt;br /&gt;
GET #1, , unknown &#039;always zero?&lt;br /&gt;
GET #1, , decompressedSizeInteger&lt;br /&gt;
&#039;QBasic doesn&#039;t have unsigned integers, so we have to hack around it this way&lt;br /&gt;
decompressedSize = VAL(&amp;quot;&amp;amp;H&amp;quot; + HEX$(decompressedSizeInteger) + &amp;quot;&amp;amp;&amp;quot;)&lt;br /&gt;
GET #1, , HuffmanTreeSize&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DIM HuffmanTree(0 TO HuffmanTreeSize \ 2 - 1) AS INTEGER&lt;br /&gt;
&lt;br /&gt;
&#039;Load Huffman tree&lt;br /&gt;
FOR i = 0 TO HuffmanTreeSize \ 2 - 1&lt;br /&gt;
  GET #1, , HuffmanTree(i)&lt;br /&gt;
NEXT i&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
node = 0&lt;br /&gt;
bitPosition = 7&lt;br /&gt;
i = 0&lt;br /&gt;
DO WHILE i &amp;lt;&amp;gt; decompressedSize&lt;br /&gt;
  IF bitPosition = 7 THEN&lt;br /&gt;
    GET #1, , byteIn&lt;br /&gt;
  END IF&lt;br /&gt;
&lt;br /&gt;
  bit = (ASC(byteIn) AND (2 ^ bitPosition)) \ (2 ^ bitPosition)&lt;br /&gt;
  bitPosition = bitPosition - 1&lt;br /&gt;
  IF bitPosition &amp;lt; 0 THEN&lt;br /&gt;
    bitPosition = 7&lt;br /&gt;
  END IF&lt;br /&gt;
 &lt;br /&gt;
  IF bit = 1 THEN&lt;br /&gt;
    node = node + 1&lt;br /&gt;
  END IF&lt;br /&gt;
  IF HuffmanTree(node) AND &amp;amp;H8000 THEN&lt;br /&gt;
    byteOut = CHR$(HuffmanTree(node) AND &amp;amp;HFF)&lt;br /&gt;
    PUT #2, , byteOut&lt;br /&gt;
    i = i + 1&lt;br /&gt;
    node = 0&lt;br /&gt;
  ELSE&lt;br /&gt;
    node = HuffmanTree(node) \ 2&lt;br /&gt;
  END IF&lt;br /&gt;
LOOP&lt;br /&gt;
&lt;br /&gt;
CLOSE #1, #2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
This file format was reverse engineered by [[User:Frenkel|Frenkel]], who was inspired by [http://ttf.mine.nu/techdocs.htm Jesses].  If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Compressed Files]]&lt;br /&gt;
[[Category:Huffman Compression]]&lt;br /&gt;
[[Category:Code examples]]&lt;br /&gt;
[[Category:The Blues Brothers]]&lt;br /&gt;
[[Category:Quik the Thunder Rabbit]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5172</id>
		<title>Titus Interactive SQZ Compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_Interactive_SQZ_Compression&amp;diff=5172"/>
		<updated>2014-03-18T20:48:15Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;Titus Interactive SQZ Compression is an implementation of Huffman Compression and LZW compression. It is present in Titus the Fox and The Blues Brothers, devel...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Titus Interactive SQZ Compression is an implementation of [[Huffman Compression]] and [[LZW compression]]. It is present in [[Titus the Fox]] and [[The Blues Brothers]], developed by Titus Interactive.&lt;br /&gt;
&lt;br /&gt;
== 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[1] sizeH || bits 0..3: high nibble of uncompressed size, bits 4..7 unused&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[1] compression || 0x10: LZW is used, something else (0): Huffman+RLE is used&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE sizeL || low word of uncompressed size&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== If Huffman ==&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 HuffmanTreeSize || Size of Huffman tree.&lt;br /&gt;
|-&lt;br /&gt;
| UINT16LE[HuffmanTreeSize / 2] HuffmanTree || Huffman tree. A node is a leaf node when the most significant bit is set, otherwise it&#039;s an internal node.&lt;br /&gt;
|-&lt;br /&gt;
| BYTE[] compressedData || Compressed data. The most significant bit of a byte is processed first, then the second most significant bit etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== If LZW ==&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[] compressedData || Compressed data.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Extractor ==&lt;br /&gt;
&lt;br /&gt;
[https://sourceforge.net/projects/opentitus/files/tools/UnSQZ/ OpenTitus UnSQZ-tool] extracts SQZ files.&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs.htm#compress Pseudocode]&lt;br /&gt;
&lt;br /&gt;
[http://ttf.mine.nu/techdocs/unpack.pl Perl implementation]&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/projects/opentitus/files/opentitus/0.3.0/OpenTitus_0.3.0.zip/download Source code in C (sqz.c)]&lt;br /&gt;
&lt;br /&gt;
[[The Blues Brothers Huffman Compression]] - QuickBASIC implementation (Huffman only)&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
SQZ information: [http://ttf.mine.nu/techdocs.htm Jesses].&lt;br /&gt;
&lt;br /&gt;
OpenTitus SQZ extractor: [[User:Eirik|Eirik]].&lt;br /&gt;
&lt;br /&gt;
QuickBasic implementation: [[User:Frenkel|Frenkel]].&lt;br /&gt;
&lt;br /&gt;
If you find this information helpful in a project you&#039;re working on, please give credit where credit is due.  (A link back to this wiki would be nice too!)&lt;br /&gt;
&lt;br /&gt;
[[Category:File Formats]]&lt;br /&gt;
[[Category:Compressed Files]]&lt;br /&gt;
[[Category:Huffman Compression]]&lt;br /&gt;
[[Category:LZW Compression]]&lt;br /&gt;
[[Category:Titus the Fox]]&lt;br /&gt;
[[Category:The Blues Brothers]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5171</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5171"/>
		<updated>2014-03-18T18:44:08Z</updated>

		<summary type="html">&lt;p&gt;Eirik: /* Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1992.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the game ==&lt;br /&gt;
&lt;br /&gt;
Titus the Fox is not released as freeware.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://sourceforge.net/projects/opentitus/files/opentitus/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game. [http://ttf.mine.nu/techdocs.htm File format specifications]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;sprexp.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fonts.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levelx.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCE(F)G)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titus.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titre.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;menu.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fox.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5170</id>
		<title>The Blues Brothers</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5170"/>
		<updated>2014-03-18T18:41:47Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &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;
{{NeedMoreInfo}}&lt;br /&gt;
&lt;br /&gt;
The Blues Brothers is a side scrolling platform game based on the movie of the same name.&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://sourceforge.net/projects/opentitus/files/blues_brothers/ Simple level viewer]&lt;br /&gt;
| Platform = SDL (Windows)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&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;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
Most of the data files are compressed using [[The Blues Brothers Huffman Compression]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Filename!!Description&lt;br /&gt;
|-&lt;br /&gt;
|*.CK1 and *.CK2||Background tiles in [[LBM Format]]&lt;br /&gt;
|-&lt;br /&gt;
|DEMO?.BIN||Demo (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|The other *.BIN files||Tile attributes (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|*.SQL||Level data in [[The Blues Brothers Map Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQV||Sprites and foreground tiles in [[The Blues Brothers Sprite Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQZ||Full screen images in [[LBM Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5169</id>
		<title>The Blues Brothers</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5169"/>
		<updated>2014-03-18T18:40:57Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &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;
{{NeedMoreInfo}}&lt;br /&gt;
&lt;br /&gt;
The Blues Brothers is a side scrolling platform game based on the movie of the same name.&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://sourceforge.net/projects/opentitus/files/blues_brothers/ Simple level viewer)]&lt;br /&gt;
| Platform = SDL (WIndows)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&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;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
Most of the data files are compressed using [[The Blues Brothers Huffman Compression]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Filename!!Description&lt;br /&gt;
|-&lt;br /&gt;
|*.CK1 and *.CK2||Background tiles in [[LBM Format]]&lt;br /&gt;
|-&lt;br /&gt;
|DEMO?.BIN||Demo (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|The other *.BIN files||Tile attributes (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|*.SQL||Level data in [[The Blues Brothers Map Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQV||Sprites and foreground tiles in [[The Blues Brothers Sprite Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQZ||Full screen images in [[LBM Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5168</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5168"/>
		<updated>2014-03-18T18:38:36Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1992.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the game ==&lt;br /&gt;
&lt;br /&gt;
Titus the Fox is not released as freeware.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://opentitus.sourceforge.net/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game. [http://ttf.mine.nu/techdocs.htm File format specifications]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;sprexp.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fonts.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levelx.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCE(F)G)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titus.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titre.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;menu.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fox.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5167</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5167"/>
		<updated>2014-03-18T17:16:36Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1992.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the game ==&lt;br /&gt;
&lt;br /&gt;
Titus the Fox is not released as freeware.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://opentitus.sourceforge.net/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game. [http://ttf.mine.nu/techdocs.htm File format specifications]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;sprexp.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fonts.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levelx.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCE(F)G)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titus.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titre.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;menu.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fox.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5166</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5166"/>
		<updated>2014-03-18T17:07:23Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1992.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the game ==&lt;br /&gt;
&lt;br /&gt;
Titus the Fox is not released as freeware.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://opentitus.sourceforge.net/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game. [http://ttf.mine.nu/techdocs.htm File format specifications]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;sprexp.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fonts.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levelx.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCE(F)G)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titus.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titre.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;menu.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fox.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5165</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5165"/>
		<updated>2014-03-18T17:06:44Z</updated>

		<summary type="html">&lt;p&gt;Eirik: /* File formats */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1991.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the game ==&lt;br /&gt;
&lt;br /&gt;
Titus the Fox is not released as freeware.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://opentitus.sourceforge.net/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game. [http://ttf.mine.nu/techdocs.htm File format specifications]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;sprexp.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fonts.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levelx.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCE(F)G)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titus.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titre.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;menu.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fox.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5164</id>
		<title>Titus the Fox</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Titus_the_Fox&amp;diff=5164"/>
		<updated>2014-03-18T17:02:29Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;{{NeedMoreInfo}} {{Game Infobox  | Levels = Edit  | Tiles = Edit  | Sprites = Edit  | Fullscreen = No  | Sound = No  | Music = No  | Text = No  | Story = No  | Interface = No ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedMoreInfo}}&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;
&lt;br /&gt;
[[Titus the Fox]] is a platform game, published by Titus Interactive in 1991.&lt;br /&gt;
&lt;br /&gt;
== Obtaining the game ==&lt;br /&gt;
&lt;br /&gt;
Titus the Fox is not released as freeware.&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://ttf.mine.nu/download.htm Moktar the Fox&amp;lt;br/&amp;gt;(editor)]&lt;br /&gt;
| Platform = DOS&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Edit&lt;br /&gt;
| gfx = Edit&lt;br /&gt;
| mus = No&lt;br /&gt;
| sfx = No&lt;br /&gt;
| txt = No&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = No&lt;br /&gt;
}}&lt;br /&gt;
{{FileFormatTool&lt;br /&gt;
| Name = [http://opentitus.sourceforge.net/ OpenTitus&amp;lt;br/&amp;gt;(clone)]&lt;br /&gt;
| Platform = SDL 1.2 (Linux/Windows/Dingux)&lt;br /&gt;
| grp = Read&lt;br /&gt;
| map = Read&lt;br /&gt;
| gfx = Read&lt;br /&gt;
| mus = Read&lt;br /&gt;
| sfx = Read&lt;br /&gt;
| txt = Read&lt;br /&gt;
| sav = N/A&lt;br /&gt;
| exe = Read&lt;br /&gt;
}}&lt;br /&gt;
{{EndFileFormatTools}}&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
This section lists the file formats used in the game.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;sprexp.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed sprites&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fonts.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levelx.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed levels (0J123456789BCE(F)G)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titus.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed titus logo fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;titre.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed intro fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;menu.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed menu fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;levela.sqz&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed finish fullscreen image&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt&amp;gt;fox.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
| style=&amp;quot;background: #CCFFCC;&amp;quot; | SQZ compressed executable, music and SFX inside&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Titus Interactive]]&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=File:Titus_the_Fox.png&amp;diff=5163</id>
		<title>File:Titus the Fox.png</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=File:Titus_the_Fox.png&amp;diff=5163"/>
		<updated>2014-03-18T16:58:16Z</updated>

		<summary type="html">&lt;p&gt;Eirik: http://www.abandonia.com/en/games/53/Titus+the+Fox+-+To+Marrakech+and+Back.html&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.abandonia.com/en/games/53/Titus+the+Fox+-+To+Marrakech+and+Back.html&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=Category:Titus_Interactive&amp;diff=5162</id>
		<title>Category:Titus Interactive</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=Category:Titus_Interactive&amp;diff=5162"/>
		<updated>2014-03-18T16:52:08Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;Image:Titusinteractive.gif  This page lists all the games in the wiki that were published by Titus Interactive.  Category:Game Company&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Titusinteractive.gif]]&lt;br /&gt;
&lt;br /&gt;
This page lists all the games in the wiki that were published by [[wp:Titus Interactive|Titus Interactive]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Company]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=File:Titusinteractive.gif&amp;diff=5161</id>
		<title>File:Titusinteractive.gif</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=File:Titusinteractive.gif&amp;diff=5161"/>
		<updated>2014-03-18T16:51:27Z</updated>

		<summary type="html">&lt;p&gt;Eirik: http://en.wikipedia.org/wiki/File:Titusinteractive.gif&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://en.wikipedia.org/wiki/File:Titusinteractive.gif&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5157</id>
		<title>The Blues Brothers</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers&amp;diff=5157"/>
		<updated>2014-03-06T22:26:14Z</updated>

		<summary type="html">&lt;p&gt;Eirik: &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;
{{NoModdingInfo}}&lt;br /&gt;
&lt;br /&gt;
The Blues Brothers is a side scrolling platform game based on the movie of the same name.&lt;br /&gt;
&lt;br /&gt;
== File formats ==&lt;br /&gt;
&lt;br /&gt;
Most of the data files are compressed using [[The Blues Brothers Huffman Compression]].&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Filename!!Description&lt;br /&gt;
|-&lt;br /&gt;
|*.CK1 and *.CK2||Background tiles in [[LBM Format]]&lt;br /&gt;
|-&lt;br /&gt;
|DEMO?.BIN||Demo (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|The other *.BIN files||Tile attributes (uncompressed)&lt;br /&gt;
|-&lt;br /&gt;
|*.SQL||Level data in [[The Blues Brothers Map Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQV||Sprites and foreground tiles in [[The Blues Brothers Sprite Format]]&lt;br /&gt;
|-&lt;br /&gt;
|*.SQZ||Full screen images in [[LBM Format]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simple levelviewer available at http://sourceforge.net/projects/opentitus/files/blues_brothers/&lt;br /&gt;
&lt;br /&gt;
[[Category:Sidescroller]]&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
	<entry>
		<id>https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers_RLE_compression&amp;diff=5155</id>
		<title>The Blues Brothers RLE compression</title>
		<link rel="alternate" type="text/html" href="https://moddingwiki.shikadi.net/w/index.php?title=The_Blues_Brothers_RLE_compression&amp;diff=5155"/>
		<updated>2014-03-02T13:42:23Z</updated>

		<summary type="html">&lt;p&gt;Eirik: Created page with &amp;quot;The Blues Brothers RLE compression is a variant of RLE Compression. If the control byte is non-negative (0-127), it loads the same number of bytes + 1 (no compression). If...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Blues Brothers RLE compression is a variant of [[RLE Compression]]. If the control byte is non-negative (0-127), it loads the same number of bytes + 1 (no compression). If the control byte is negative (128-255) / ((-128)-(-1)), it repeats the next byte as many times as the negative number + 1.&lt;br /&gt;
&lt;br /&gt;
Pseudocode:&lt;br /&gt;
 1.) Stop if output size is 0x7D00&lt;br /&gt;
 2.) Get a byte&lt;br /&gt;
 3.) Is the value of this byte larger than 127? (0x80-0xFF - signed byte)&lt;br /&gt;
     -&amp;gt; If yes, then:&lt;br /&gt;
        -&amp;gt; Output the next byte [256 - Value + 1] times&lt;br /&gt;
        -&amp;gt; Move forward a byte and go to 1&lt;br /&gt;
     -&amp;gt; If no then:&lt;br /&gt;
        -&amp;gt; Output the next [Value + 1] bytes&lt;br /&gt;
        -&amp;gt; Move forward a byte and go to 1&lt;/div&gt;</summary>
		<author><name>Eirik</name></author>
	</entry>
</feed>