Every picture in a WAD is made of palette indexes, so the colours come from one lump,
PLAYPAL. The engine darkens colours for distance and light level with
COLORMAP, which maps each index to another. None of these lumps has a
header: each is a fixed number of tables, one after another.
PLAYPAL
Palettes of 256 colours, 768 bytes each: red, green and blue, one byte each, 0 to 255.
Doom’s PLAYPAL has 14 palettes, 10,752 bytes. The game shows palette 0
normally and switches the whole screen to another for effects:
| Palettes | Shown |
|---|---|
| 0 | Normally |
| 1 to 8 | Redder and redder while the player is hurt, or has just taken the berserk pack |
| 9 to 12 | A yellowish flash on picking something up |
| 13 | Green, while the radiation suit is worn |
The Doom source names these STARTREDPALS (1), STARTBONUSPALS
(9) and RADIATIONPAL (13). Other games have their own sets; Hexen’s
PLAYPAL has more palettes for its effects. A PWAD that includes a
PLAYPAL replaces the game’s colours everywhere.
0Palette 0 colour 0 red, green, blue, then colours 1 to 255768 bytes768Palette 1768 bytes…Palettes 2 to 139216 bytes
COLORMAP
Tables of 256 bytes: for each palette index, the index to draw instead. Doom’s has 34
tables, 8704 bytes. Tables 0 to 31 go from full brightness to darkest, and the engine
picks one for each wall column and floor span from the light level and the distance.
Table 32 turns everything to whites and greys, for the invulnerability power-up; table
33 is all black. Hexen adds a FOGMAP of the same kind, for fog.
Translucency tables
Heretic and Hexen draw some things see-through with TINTTAB, and Strife
with XLATAB: 65,536 bytes, a table of 256 rows of 256 palette indexes that
gives, for two colours, the colour of one seen through the other. The explorer draws
the table as a 256 × 256 picture. Doom has no translucency.
ENDOOM
The text screen shown when the game quits to DOS: a copy of the PC’s 80 × 25 colour text-mode screen, 4000 bytes. Each of the 2000 cells, row by row, is two bytes: a character of code page 437, then its attribute.
| Bits of the attribute | Meaning |
|---|---|
| 0 to 3 | The character’s colour, 0 to 15 |
| 4 to 6 | The background colour, 0 to 7 |
| 7 | Blinking |
0Cell 048 1F: “H”, white (15) on blue (1)2 bytes2Cell 149 1F: “I”, the same colours2 bytes4Cells 2 to 1999 the rest of the screen3996 bytes
The colours are the PC’s 16 text colours: black, blue, green, cyan, red, magenta, brown,
light grey, then their bright forms. Heretic’s screen is ENDTEXT and
Strife’s ENDSTRF, in the same format. The explorer draws the screen with
the IBM PC’s 8 × 8 font and gives its text.