Deathtrack Bitmap Format

From ModdingWiki
Jump to navigation Jump to search
Deathtrack Bitmap Format
There is no example of an image in this format — upload one!
Format typeImage
HardwareEGA, CGA
Colour depth4-bit (EGA)
Minimum size (pixels)Unknown
Maximum size (pixels)Unknown
PaletteShared
Plane count1
Transparent pixels?Palette-based
Hitmap pixels?No
Games

Sprites, car parts, menu graphics and panels in Deathtrack are stored as frame sets in .BMP files. These are not Windows bitmaps. The same BMP: container also appears five times in BITMAPS.BLK (78 frames in total) and once in PALS.BLK (three mouse-pointer frames). The 92 shipped files contain 179 frames altogether, counting the SCR screens separately.

The container is the resource chunk format. Colours are indices into a palette; the image data itself has no palette.

File format

A BMP: container holds two leaf chunks:

BMP:INF:

Not compressed. N is the number of frames.

Data type Name Description
UINT16LE count Number of frames N
UINT16LE[N] widths Width of each frame in pixels (all shipped widths are even)
UINT16LE[N] heights Height of each frame in pixels

The widths are not interleaved with the heights: all widths come first, then all heights. The chunk length is therefore 2 + 4×N bytes.

BMP:BIN:

The chunk has the compression envelope. The decoded data is the pixel data of all frames, one after the other, with no padding between frames.

  • 4 bits per pixel, two pixels per byte, high nibble first.
  • Rows are stored top to bottom with width / 2 bytes per row.
  • Frame i occupies width[i] / 2 × height[i] bytes.
  • Colour 0–15 is the logical EGA colour; there is no separate transparency mask in the file. Colour 0 is transparent: the game's EGA conversion builds a one-bit mask for each frame as the NOR of the four bit planes, so exactly the pixels with colour 0 let the background through. (Full-screen pictures in the screen format are drawn opaque.)

The game converts the data into EGA bit planes in video-memory scratch space, producing a 10-byte frame record per frame (segment, plane offset, mask offset, width, height). That in-memory record is not part of the file.

Source code

From re-deathtrack, the open-source browser port:

Credits

This file format was reverse engineered by VorticonCmdr. 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!)