-
Notifications
You must be signed in to change notification settings - Fork 19
/
strike_commander_palette_format.txt
50 lines (38 loc) · 1.28 KB
/
strike_commander_palette_format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Strike Commander Palette Format :
=====================================
By Fabien Sanglard
January 21st, 2014
Palettes can be found in four difference formats in SC:
In IFF files, within PALT, BLWH or CMAP chunk.
Here is the example of PALETTE.IFF
FORM
1798
PALT
INFO
14
PALT
772
BLWH
772
RANG
94
TABL
8
FORM
86
BILD
INFO
20
TABL
46
PALETTE.IFF contains the 3D engine palette (PALT) with the colors and also a black and white version in BLWH
(when a player suffers too many G's the vision turns to greyscale).
Palette can also be found out of IFF files. For example in GAMEFLOW.TRE, entry ..\\..\\DATA\\GAMEFLOW\\MAINMENU.PAK is a PAK with three entries. The two first ones are RLEShapes for the menu
and the third one is a 388 bytes blog of data.
After inspection it turned out that palette in SC can ocassionally be stored in full but they are also often just "patches" for the current VGA palette.
Format:
2 bytes: Little Endian offset where to start updating the VGA palette
2 bytes: Num of colors to update
Followed by Num Of Colors bytes * 3 bytes.
The colors are stored as follow: R, G and B.
If you want to convert the color to GPU RGB 888, remember to multiply by 254/63.0f since colors channel were stored on 7 bits, the way VGA was expecting them.