Deathtrack Palette Format
| Format type | Palette |
|---|---|
| Hardware | EGA |
| Colour depth | 4-bit (IRGB) |
| Number of colours | 16 |
| Games |
Palettes are stored as PAL: containers in PALS.BLK (two palettes) and in the activisi logo file (one palette). Each palette has an EGA: chunk and a CGA: chunk; the game reads the one that matches the video adapter. Both leaves are stored without compression. The container is the resource chunk format.
File format
PAL:EGA:
| Data type | Name | Description |
|---|---|---|
| UINT16LE[64] | words | 64 palette words (128 bytes) |
On loading, the game transforms each word to (lo & 0x0F) | ((hi >> 4) << 8) and stores words 0–31 and words 32–63 in two separate tables.
- Words 0–15 are the 16 EGA colours. The low nibble is a 4-bit IRGB value (intensity, red, green, blue); the colour 6 is brown, as on a real EGA. Values 8–15 are programmed as the intensified attribute codes 0x10–0x17 in the 200-line mode.
- Words 16–31 (and 48–63) provide logical colours 16–31, which the renderer uses as 2×2 ordered dither pairs: the high and low bytes select the even/odd column, the two tables select the even/odd row.
The first 16 colours are activated through the BIOS attribute registers (INT 10h AX=1000h). Standard EGA colours are #000000, #0000AA, #00AA00, #00AAAA, #AA0000, #AA00AA, #AA5500, #AAAAAA, #555555, #5555FF, #55FF55, #55FFFF, #FF5555, #FF55FF, #FFFF55, #FFFFFF for indices 0–15.
PAL:CGA:
162 bytes, read only by the CGA driver (2fd2:0004) and ignored on EGA. The CGA path dithers the game's colours into 2-bit CGA pixel patterns. The tables fill the same colour-table slots as the words of PAL:EGA:.
| Data type | Name | Description |
|---|---|---|
| UINT8 | unknown1 | Stored per palette; its use has not been documented |
| UINT8 | unknown2 | Stored per palette; its use has not been documented |
| UINT16LE[32] | table1 | 16 words for even rows, then 16 words for odd rows (the slots of EGA words 0–31). The low byte of each word holds two 2-bit pixel patterns |
| UINT16LE[32] | table2 | Same layout (the slots of EGA words 32–63) |
| UINT16LE[16] | pixelBytes | Pixel bytes, one word per colour |
Selecting a palette copies its three tables over the active ones. How each table is used by the drawing routines is described in the port's CGA driver source.
Source code
From re-deathtrack, the open-source browser port:
src/viewer/decode.js–palettes()src/formats.js–EGAcolour tablesrc/game/cgadrv.js– CGA palette reader2fd2:0004docs/re/resources.md– loader1ff8:3b7a, EGA driver29f6:225band29f6:22c9
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!)