The Caesar palette formats, .256 and .P32
Caesar's pictures and sprites are all indices; the colours live in eight .256 files and six .P32 files. The .256 file is nothing but the VGA palette registers' contents, and the executable hands it to the BIOS untouched. The only subtle thing about either format is how the six-bit values are widened to eight, which is a convention of whoever draws the picture rather than anything in the file.
Used by Caesar
.256: a whole VGA palette
In the executable the generic file loader reads the whole file into a buffer, and the palette routine passes that buffer untouched to the BIOS (INT 10h, function 1012h: set a block of DAC registers, 256 of them). So the file is the DAC block. In a non-VGA video mode the same routine programs only entries 0 to 15.
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| 0 | 768 | u8[256][3] | colours | Red, green, blue for each of 256 entries, each channel a six-bit VGA DAC value from 0 to 63. No header and no transform. |
.P32: thirty-two colours
Each nibble n is a DAC value of n × 4, so 15 means 60, not 63. That comes from captures of the running game: the map and Forum screens hold EMAP2.P32 and FORUM32.P32 in the DAC as exactly n × 4, in all 32 entries each.
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| 0 | 64 | u16[32] | colours | Little-endian words, one per colour. Bits 0 to 3 are red, bits 8 to 11 are blue, bits 12 to 15 are green; bits 4 to 7 are unused. Note that green sits in the high nibble, above blue. |
Widening to eight bits
A DAC value is six bits (0 to 63). To show one on an eight-bit display, screenshot tools disagree: some write v << 2, some (v << 2) | (v >> 4). The game never does either, so a comparison with a capture should be made at six bits. The tools here use the second form.
Which file is which
All eight US-build .256 files are 768 bytes with every byte in 0 to 63; a byte above 63 is rejected.
- SHADE.256
- The city palette, and the interface palette. All 256 entries equal the DAC of every city-view capture. SHADE.P32 is its first 20 entries.
- NEWFORUM.256
- The Forum. All 256 entries equal the Forum capture's DAC.
- WAR2.256, TEMPLE.256, TITLE3.256, ROME1.256, IMPRLOGO.256
- The battle screen, the ratings screen, the title screen, the ROME1 and ROME2 pictures, and the intro pictures.
- PANEL1.256 and PANEL1.P32
- The bottom panel. The first 32 entries of the .256 are exactly the .P32's nibbles times 4, and the picture renders to the same DAC value at all 64,000 pixels through either.
- EMAP2.P32, FORUM32.P32, LOSEPIC.P32, WINPIC.P32
- The map of the Empire, the Forum's 32 colours, and the two end-of-game pictures.