By Ben Owen, 16/08/2009
Revision 1
-------------------------------
All graphics in Dune II are palette based, ie. when the game engine comes to draw a graphic it 'looks up' what colour each pixel should be from a colour table. The .PAL files contain such colour tables.
The format of a .PAL file is nice and simple. It is just an array of 256 RGB colour values:
Palette[256] {
byte R;
byte B;
byte G;
}
00000000:00 00 00 2a 00 2a 00 2a 2a 00 2a 00 15 3f 15 3f ...*.*.**.*..?.?
00000000:RR BB GG RR BB GG RR BB GG RR BB GG RR BB GG RR ...*.*.**.*..?.?
Only the first 6 bits of each number are used, giving 262144 possible colours.
Most images in Dune II are drawn using IBM.PAL.However, due to the 256 colour restriction, some images are drawn using alternative palettes better suited to their content:
File | Palette |
---|---|
WESTWOOD.WSA | WESTWOOD.PAL |
INTRO*.WSA | INTRO.PAL |
MENTATM.CPS | BENE.PAL |
VIRGIN.CPS | Self-contained palette within .CPS file. |
IBM.PAL WESTWOOD.PAL