Zone 66 Tileset Format
This file format is used by Zone 66 to store tiles used for drawing maps, among other things.
There is no signature, however careful processing of the header can be used to check whether the file is valid (e.g. no tiles are stored past the end of the file, the first tile's offset is always zero, etc.)
Each tileset begins with the following header.
|UINT32LE count||Number of images in the file|
|UINT32LE offset[count]||Array of file offsets|
|BYTE data||Start of first tile's image data|
Each offset is relative to the start of the first tile's data, so the first tile will always have an offset of zero even though it starts some distance into the file.
The image data is encoded in a type of RLE. Each byte read should perform one of the following actions:
|0xFF||End of image data|
|0xFE||Jump to the start of the next row|
|0xFD||Read next byte, then move right that many pixels|
Any pixels skipped over by one of the above jumps should be left black (value 0x00).
If the byte read isn't in the table above, it is a length of data to read. That many bytes should be read in from the file and each byte treated as the value of the next pixel.
This file format was reverse engineered by john_doe. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)