Skip to content

Palettes & Accent Ramps

The dungeon runs in 6-bitplane EHB: 32 hardware colour registers, with 32–63 generated by hardware as half-intensity copies. The copper list that installs them is built in bcdfp (LAB_00BD).

Eight 32-word palettes exist across the game files. Comparing them shows a fixed core — indices 0, 16, 17, 18, 20–25 are byte-identical in every variant — while only indices 19 and 26–31 change. Those six changing indices (26–31) are the accent ramp.

File Offset idx 19 idx 26–31 Character
bcdfp 0x004194 033b→0020 0b30 0c40 0d51 0e62 0f73 0f84 orange / fire
bcdfq 0x0002c6 033b 0b60 0c70 0c80 0d90 0eb0 0fc0 gold
bcdfu 0x0003ec 033b 0432 0542 0653 0764 0875 0986 brown
bcdfu 0x00042c 033b 0223 0334 0445 0647 0858 0968 blue-grey
bcdfu 0x00046c 033b 0332 0443 0654 0987 0ba8 0eeb stone / olive
bcdfu 0x0004ac 033b 0222 0333 0444 0555 0666 0777 neutral grey
bcdfu 0x0004ec 033b 0234 0345 0456 0678 089a 09ab blue
bcdft (decompressed) 0x01e886 0fd0 0332 0443 0654 0987 0ba8 0eeb stone / olive

The table above is a census of copies. The authoritative ramp table lives in the decompressed bcdft image at S_1 +0x27B00 and has 12 entries of 12 bytes (6 words = COLOR26–31, one per dungeon level). The five bcdfu records are entries 0–4 duplicated into the epilogue overlay.

SetDungeonPalette(index) (S_1 +0x26900) writes the chosen ramp into the copper list at $510(A5) + 0x6A (= COLOR26).

Per-level defaults (13 words at bcdft S_2 +0x39E):

0,0,0,0, 1,2,2,2,2,2,2,3,3

Overrides: a map-square flag bit 31 forces ramp 4, and bcdfs action opcodes 0x1E/0x1F set it from the action record’s byte 0x06.

Because the tileset file is also chosen per level, ramp and tileset correlate:

Tileset Ramp Levels
bcdfx 0 (tan) / 3 (grey) 1–4 / 12–13
bcdfy 1 (violet) 5
bcdfz 2 (bone/cream) 6–11

For extraction, indices 0–25 come from bcdfp 0x4194 and indices 26–31 from the stone/olive ramp. The full verified table (12-bit → RGB, ×17 per nibble):

Idx 12-bit RGB Idx 12-bit RGB
0 0x000 0,0,0 16 0x720 119,34,0
1 0xC86 204,136,102 17 0x952 153,85,34
2 0xF00 255,0,0 18 0xA53 170,85,51
3 0xB00 187,0,0 19 0x020 (varies)
4 0xD80 221,136,0 20 0x222 34,34,34
5 0xFE0 255,238,0 21 0x444 68,68,68
6 0x0F0 0,255,0 22 0x666 102,102,102
7 0x0B0 0,187,0 23 0x999 153,153,153
8 0x040 0,68,0 24 0xCCC 204,204,204
9 0x0DD 0,221,221 25 0xFFF 255,255,255
10 0x00F 0,0,255 26 0x332 accent 1
11 0x07C 0,119,204 27 0x443 accent 2
12 0xFD9 255,221,153 28 0x654 accent 3
13 0xEB8 238,187,136 29 0x987 accent 4
14 0xF0F 255,0,255 30 0xBA8 accent 5
15 0xE09 238,0,153 31 0xEEB accent 6

Only maps that actually use indices 26–31 are sensitive to the ramp choice: map 7 (47% of pixels), map 8 (31%), map 6 (3%), map 11 (0.5%), map 4 (0.3%).

Offset Size Used by
0x0266 16 × 16-bit Raven logo (4bpp)
0x0286 32 × 16-bit Title + Logo (6bpp)
0x02C6 32 × 16-bit Plot text / intro (gold ramp)

There is no separate “monster palette”. Monsters and walls necessarily share one EHB palette. The old bcdfu file offset 0x2C6 claim was wrong — that offset lands inside the library-name strings.