-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpal.html
164 lines (164 loc) · 4.91 KB
/
pal.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<html>
<head>
<title>PAL File Format</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div style="width: 1200px; margin: auto;">
<h1>.PAL Format</h1>
<p>This document describes the raw data format of the color palette (PAL) file. The same format was used for both Fallout and Fallout 2, giving all PAL files complete compatibility with both game engines. </p>
<h3>Technical Information</h3>
<p>PAL files contain a palette used when rendering FRM frame data. Additionally, they contain a table for transforming RGB values into an index in the palette (speculated as being used for extracting fonts), and also several tables concatenated beyond the main file data whose uses are not clear. </p>
<h3>Required Fields</h3>
<p>As referenced below, the Palette area (<code>0x00000000</code> - <code>0x000002FF</code>) and the RBG Conversion Table area (<code>0x00000300</code> - <code>0x000082FF</code>) are required elements in PAL files. </p>
<h3>.exe-Generated Data</h3>
<p>The purpose of the .exe-Generated Data is not clear. When loading PAL files, if these tables don't exist FALLOUT2.exe and MAPPER2.exe will generate them. </p>
<p>Also note that values contained in custom PAL files provided for individual FRM files are subject to certain changes in the game and mapper engines. </p>
<h3>PAL data</h3>
<table style="text-align:center" cellspacing="0" cellpadding="5" border="1">
<tbody><tr>
<th>Offset
</th><th>Size
</th><th>Type
</th><th>Value
</th><th colspan="2">Description
</th></tr>
<tr>
<td>0x00000000
</td><td>1
</td><td>unsigned byte
</td><td> 0..63
</td><td>Red000
</td><td rowspan="10"><b>Palette</b>
<p><b>Colors in the palette are in the range 0..63</b>. The first element (index 0) is always considered transparent (actual color is ignored). If the value of one color component is not in the range 0..63, in a special table the index is marked as unused, and all components of the color are set to 0.
</p><p>Elements from 229 to 254 are used as 'animation colors' and Fallout sets their values itself. 229 to 232 are animated green (for radioactive waste), 238 to 247 are orange, red and yellow (for fires), and the rest are bright blue (computer screens).
</p><p>Since normal RGB goes from 0..255, using palette colors (0..63) directly to draw the image will make it very dark. The easiest way to get correct colors is to multiply the value by 4, so that a palette entry of "1,2,3" actually becomes "4,8,12" in RGB.
</p>
</td></tr>
<tr>
<td>0x00000001
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Green000
</td></tr>
<tr>
<td>0x00000002
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Blue000
</td></tr>
<tr>
<td>0x00000003
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Red001
</td></tr>
<tr>
<td>0x00000004
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Green001
</td></tr>
<tr>
<td>0x00000005
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Blue001
</td></tr>
<tr>
<td>...
</td><td>...
</td><td>...
</td><td>...
</td><td>...
</td></tr>
<tr>
<td>0x000002FD
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Red255
</td></tr>
<tr>
<td>0x000002FE
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Green255
</td></tr>
<tr>
<td>0x000002FF
</td><td>1
</td><td>--"--
</td><td>--"--
</td><td>Blue255
</td></tr>
<tr>
<td>0x00000300
</td><td>1
</td><td>unsigned byte
</td><td>0..255
</td><td>Element00000
</td><td rowspan="3"><b>RGB Conversion Table</b>
<p>Table for converting RGB values => index in the palette.
</p>
</td></tr>
<tr>
<td>...
</td><td>...
</td><td>...
</td><td>...
</td><td>...
</td></tr>
<tr>
<td>0x000082FF
</td><td>1
</td><td>unsigned byte
</td><td>0..255
</td><td>Element32767
</td></tr>
<tr>
<td colspan="6" style="text-align: center;">
<p><b>.exe-Generated Data</b>
</p>
</td></tr>
<tr>
<td>0x00008300
</td><td>4
</td><td>char[4]
</td><td>'NEWC'
</td><td>
</td><td>Tag for the availability of additional tables.?
</td></tr>
<tr>
<td>0x00008304
</td><td>65536
</td><td>byte[65536]
</td><td>
</td><td>
</td><td>Additional table 1
</td></tr>
<tr>
<td>0x00018304
</td><td>65536
</td><td>byte[65536]
</td><td>
</td><td>
</td><td>Additional table 2
</td></tr>
<tr>
<td>0x00028304
</td><td>65536
</td><td>byte[65536]
</td><td>
</td><td>
</td><td>Additional table 3
</td></tr></tbody></table>
<h2>History</h2>
2020-01-18 - Ported from <a href="https://falloutmods.fandom.com/wiki/PAL_File_Format">https://falloutmods.fandom.com/wiki/PAL_File_Formatt</a>
</div>