1 |
27 |
unneback |
/*
|
2 |
|
|
* Copyright (c) 1999 Greg Haerr <greg@censoft.com>
|
3 |
|
|
*
|
4 |
|
|
* 8bpp (256 color) standard palette definition
|
5 |
|
|
*/
|
6 |
|
|
#include "device.h"
|
7 |
|
|
|
8 |
|
|
/*
|
9 |
|
|
* Special palette for supporting 48 Windows colors and a 216 color
|
10 |
|
|
* uniform color distribution.
|
11 |
|
|
* Note: the first 20 colors are used internally as system colors.
|
12 |
|
|
*/
|
13 |
|
|
MWPALENTRY mwstdpal8[256] = {
|
14 |
|
|
/* 16 EGA colors, arranged for direct predefined palette indexing*/
|
15 |
|
|
RGBDEF( 0 , 0 , 0 ), /* black*/
|
16 |
|
|
RGBDEF( 0 , 0 , 128 ), /* blue*/
|
17 |
|
|
RGBDEF( 0 , 128, 0 ), /* green*/
|
18 |
|
|
RGBDEF( 0 , 128, 128 ), /* cyan*/ /* COLOR_BACKGROUND*/
|
19 |
|
|
RGBDEF( 128, 0 , 0 ), /* red*/ /* COLOR_ACTIVECAPTION A*/
|
20 |
|
|
RGBDEF( 128, 0 , 128 ), /* magenta*/ /* COLOR_ACTIVECAPTION B*/
|
21 |
|
|
RGBDEF( 128, 64 , 0 ), /* adjusted brown*/
|
22 |
|
|
RGBDEF( 192, 192, 192 ), /* ltgray*/
|
23 |
|
|
RGBDEF( 128, 128, 128 ), /* gray*/
|
24 |
|
|
RGBDEF( 0 , 0 , 255 ), /* ltblue*/
|
25 |
|
|
RGBDEF( 0 , 255, 0 ), /* ltgreen*/
|
26 |
|
|
RGBDEF( 0 , 255, 255 ), /* ltcyan*/
|
27 |
|
|
RGBDEF( 255, 0 , 0 ), /* ltred*/
|
28 |
|
|
RGBDEF( 255, 0 , 255 ), /* ltmagenta*/
|
29 |
|
|
RGBDEF( 255, 255, 0 ), /* yellow*/
|
30 |
|
|
RGBDEF( 255, 255, 255 ), /* white*/
|
31 |
|
|
|
32 |
|
|
/* 32 basic windows colors (first 8 are most important)*/
|
33 |
|
|
RGBDEF( 32 , 32 , 32 ), /* DKGRAY_BRUSH*/
|
34 |
|
|
RGBDEF( 128, 128, 0 ), /* non-adjusted brown*/
|
35 |
|
|
RGBDEF( 223, 223, 223 ), /* COLOR_3DLIGHT B*/
|
36 |
|
|
RGBDEF( 160, 160, 160 ), /* COLOR_3DLIGHT C*/
|
37 |
|
|
|
38 |
|
|
RGBDEF( 234, 230, 221 ), /* COLOR_BTNHIGHLIGHT A*/
|
39 |
|
|
RGBDEF( 213, 204, 187 ), /* COLOR_BTNFACE A*/
|
40 |
|
|
RGBDEF( 162, 141, 104 ), /* COLOR_BTNSHADOW A*/
|
41 |
|
|
RGBDEF( 0 , 64 , 128 ), /* COLOR_INACTIVECAPTION C*/
|
42 |
|
|
/*RGBDEF( 0 , 0 , 64 ),*/
|
43 |
|
|
/*RGBDEF( 0 , 64 , 0 ),*/
|
44 |
|
|
/*RGBDEF( 0 , 64 , 64 ),*/
|
45 |
|
|
/*RGBDEF( 0 , 128, 64 ),*/
|
46 |
|
|
RGBDEF( 0 , 128, 255 ),
|
47 |
|
|
RGBDEF( 0 , 255, 128 ),
|
48 |
|
|
RGBDEF( 64 , 0 , 0 ),
|
49 |
|
|
RGBDEF( 64 , 0 , 64 ),
|
50 |
|
|
RGBDEF( 64 , 0 , 128 ),
|
51 |
|
|
RGBDEF( 64 , 128, 128 ),
|
52 |
|
|
RGBDEF( 128, 0 , 64 ),
|
53 |
|
|
RGBDEF( 128, 0 , 255 ),
|
54 |
|
|
RGBDEF( 128, 64 , 64 ),
|
55 |
|
|
RGBDEF( 128, 128, 64 ),
|
56 |
|
|
RGBDEF( 128, 128, 192 ),
|
57 |
|
|
RGBDEF( 128, 128, 255 ),
|
58 |
|
|
RGBDEF( 128, 255, 0 ),
|
59 |
|
|
RGBDEF( 128, 255, 255 ),
|
60 |
|
|
RGBDEF( 164, 200, 240 ),
|
61 |
|
|
RGBDEF( 192, 220, 192 ),
|
62 |
|
|
RGBDEF( 255, 0 , 128 ),
|
63 |
|
|
RGBDEF( 255, 128, 0 ),
|
64 |
|
|
RGBDEF( 255, 128, 192 ),
|
65 |
|
|
RGBDEF( 255, 128, 255 ),
|
66 |
|
|
RGBDEF( 255, 128, 128 ),
|
67 |
|
|
RGBDEF( 255, 255, 128 ),
|
68 |
|
|
RGBDEF( 255, 251, 240 ),
|
69 |
|
|
RGBDEF( 255, 255, 232 ),
|
70 |
|
|
|
71 |
|
|
/* 216 colors spread uniformly across rgb spectrum*/
|
72 |
|
|
/* 8 colors removed that are duplicated above*/
|
73 |
|
|
/*RGBDEF( 0x00, 0x00, 0x00 ),*/
|
74 |
|
|
RGBDEF( 0x00, 0x00, 0x33 ),
|
75 |
|
|
RGBDEF( 0x00, 0x00, 0x66 ),
|
76 |
|
|
RGBDEF( 0x00, 0x00, 0x99 ),
|
77 |
|
|
RGBDEF( 0x00, 0x00, 0xcc ),
|
78 |
|
|
/*RGBDEF( 0x00, 0x00, 0xff ),*/
|
79 |
|
|
RGBDEF( 0x33, 0x00, 0x00 ),
|
80 |
|
|
RGBDEF( 0x33, 0x00, 0x33 ),
|
81 |
|
|
RGBDEF( 0x33, 0x00, 0x66 ),
|
82 |
|
|
RGBDEF( 0x33, 0x00, 0x99 ),
|
83 |
|
|
RGBDEF( 0x33, 0x00, 0xcc ),
|
84 |
|
|
RGBDEF( 0x33, 0x00, 0xff ),
|
85 |
|
|
RGBDEF( 0x66, 0x00, 0x00 ),
|
86 |
|
|
RGBDEF( 0x66, 0x00, 0x33 ),
|
87 |
|
|
RGBDEF( 0x66, 0x00, 0x66 ),
|
88 |
|
|
RGBDEF( 0x66, 0x00, 0x99 ),
|
89 |
|
|
RGBDEF( 0x66, 0x00, 0xcc ),
|
90 |
|
|
RGBDEF( 0x66, 0x00, 0xff ),
|
91 |
|
|
RGBDEF( 0x99, 0x00, 0x00 ),
|
92 |
|
|
RGBDEF( 0x99, 0x00, 0x33 ),
|
93 |
|
|
RGBDEF( 0x99, 0x00, 0x66 ),
|
94 |
|
|
RGBDEF( 0x99, 0x00, 0x99 ),
|
95 |
|
|
RGBDEF( 0x99, 0x00, 0xcc ),
|
96 |
|
|
RGBDEF( 0x99, 0x00, 0xff ),
|
97 |
|
|
RGBDEF( 0xcc, 0x00, 0x00 ),
|
98 |
|
|
RGBDEF( 0xcc, 0x00, 0x33 ),
|
99 |
|
|
RGBDEF( 0xcc, 0x00, 0x66 ),
|
100 |
|
|
RGBDEF( 0xcc, 0x00, 0x99 ),
|
101 |
|
|
RGBDEF( 0xcc, 0x00, 0xcc ),
|
102 |
|
|
RGBDEF( 0xcc, 0x00, 0xff ),
|
103 |
|
|
/*RGBDEF( 0xff, 0x00, 0x00 ),*/
|
104 |
|
|
RGBDEF( 0xff, 0x00, 0x33 ),
|
105 |
|
|
RGBDEF( 0xff, 0x00, 0x66 ),
|
106 |
|
|
RGBDEF( 0xff, 0x00, 0x99 ),
|
107 |
|
|
RGBDEF( 0xff, 0x00, 0xcc ),
|
108 |
|
|
/*RGBDEF( 0xff, 0x00, 0xff ),*/
|
109 |
|
|
RGBDEF( 0x00, 0x33, 0x00 ),
|
110 |
|
|
RGBDEF( 0x00, 0x33, 0x33 ),
|
111 |
|
|
RGBDEF( 0x00, 0x33, 0x66 ),
|
112 |
|
|
RGBDEF( 0x00, 0x33, 0x99 ),
|
113 |
|
|
RGBDEF( 0x00, 0x33, 0xcc ),
|
114 |
|
|
RGBDEF( 0x00, 0x33, 0xff ),
|
115 |
|
|
RGBDEF( 0x33, 0x33, 0x00 ),
|
116 |
|
|
RGBDEF( 0x33, 0x33, 0x33 ),
|
117 |
|
|
RGBDEF( 0x33, 0x33, 0x66 ),
|
118 |
|
|
RGBDEF( 0x33, 0x33, 0x99 ),
|
119 |
|
|
RGBDEF( 0x33, 0x33, 0xcc ),
|
120 |
|
|
RGBDEF( 0x33, 0x33, 0xff ),
|
121 |
|
|
RGBDEF( 0x66, 0x33, 0x00 ),
|
122 |
|
|
RGBDEF( 0x66, 0x33, 0x33 ),
|
123 |
|
|
RGBDEF( 0x66, 0x33, 0x66 ),
|
124 |
|
|
RGBDEF( 0x66, 0x33, 0x99 ),
|
125 |
|
|
RGBDEF( 0x66, 0x33, 0xcc ),
|
126 |
|
|
RGBDEF( 0x66, 0x33, 0xff ),
|
127 |
|
|
RGBDEF( 0x99, 0x33, 0x00 ),
|
128 |
|
|
RGBDEF( 0x99, 0x33, 0x33 ),
|
129 |
|
|
RGBDEF( 0x99, 0x33, 0x66 ),
|
130 |
|
|
RGBDEF( 0x99, 0x33, 0x99 ),
|
131 |
|
|
RGBDEF( 0x99, 0x33, 0xcc ),
|
132 |
|
|
RGBDEF( 0x99, 0x33, 0xff ),
|
133 |
|
|
RGBDEF( 0xcc, 0x33, 0x00 ),
|
134 |
|
|
RGBDEF( 0xcc, 0x33, 0x33 ),
|
135 |
|
|
RGBDEF( 0xcc, 0x33, 0x66 ),
|
136 |
|
|
RGBDEF( 0xcc, 0x33, 0x99 ),
|
137 |
|
|
RGBDEF( 0xcc, 0x33, 0xcc ),
|
138 |
|
|
RGBDEF( 0xcc, 0x33, 0xff ),
|
139 |
|
|
RGBDEF( 0xff, 0x33, 0x00 ),
|
140 |
|
|
RGBDEF( 0xff, 0x33, 0x33 ),
|
141 |
|
|
RGBDEF( 0xff, 0x33, 0x66 ),
|
142 |
|
|
RGBDEF( 0xff, 0x33, 0x99 ),
|
143 |
|
|
RGBDEF( 0xff, 0x33, 0xcc ),
|
144 |
|
|
RGBDEF( 0xff, 0x33, 0xff ),
|
145 |
|
|
RGBDEF( 0x00, 0x66, 0x00 ),
|
146 |
|
|
RGBDEF( 0x00, 0x66, 0x33 ),
|
147 |
|
|
RGBDEF( 0x00, 0x66, 0x66 ),
|
148 |
|
|
RGBDEF( 0x00, 0x66, 0x99 ),
|
149 |
|
|
RGBDEF( 0x00, 0x66, 0xcc ),
|
150 |
|
|
RGBDEF( 0x00, 0x66, 0xff ),
|
151 |
|
|
RGBDEF( 0x33, 0x66, 0x00 ),
|
152 |
|
|
RGBDEF( 0x33, 0x66, 0x33 ),
|
153 |
|
|
RGBDEF( 0x33, 0x66, 0x66 ),
|
154 |
|
|
RGBDEF( 0x33, 0x66, 0x99 ),
|
155 |
|
|
RGBDEF( 0x33, 0x66, 0xcc ),
|
156 |
|
|
RGBDEF( 0x33, 0x66, 0xff ),
|
157 |
|
|
RGBDEF( 0x66, 0x66, 0x00 ),
|
158 |
|
|
RGBDEF( 0x66, 0x66, 0x33 ),
|
159 |
|
|
RGBDEF( 0x66, 0x66, 0x66 ),
|
160 |
|
|
RGBDEF( 0x66, 0x66, 0x99 ),
|
161 |
|
|
RGBDEF( 0x66, 0x66, 0xcc ),
|
162 |
|
|
RGBDEF( 0x66, 0x66, 0xff ),
|
163 |
|
|
RGBDEF( 0x99, 0x66, 0x00 ),
|
164 |
|
|
RGBDEF( 0x99, 0x66, 0x33 ),
|
165 |
|
|
RGBDEF( 0x99, 0x66, 0x66 ),
|
166 |
|
|
RGBDEF( 0x99, 0x66, 0x99 ),
|
167 |
|
|
RGBDEF( 0x99, 0x66, 0xcc ),
|
168 |
|
|
RGBDEF( 0x99, 0x66, 0xff ),
|
169 |
|
|
RGBDEF( 0xcc, 0x66, 0x00 ),
|
170 |
|
|
RGBDEF( 0xcc, 0x66, 0x33 ),
|
171 |
|
|
RGBDEF( 0xcc, 0x66, 0x66 ),
|
172 |
|
|
RGBDEF( 0xcc, 0x66, 0x99 ),
|
173 |
|
|
RGBDEF( 0xcc, 0x66, 0xcc ),
|
174 |
|
|
RGBDEF( 0xcc, 0x66, 0xff ),
|
175 |
|
|
RGBDEF( 0xff, 0x66, 0x00 ),
|
176 |
|
|
RGBDEF( 0xff, 0x66, 0x33 ),
|
177 |
|
|
RGBDEF( 0xff, 0x66, 0x66 ),
|
178 |
|
|
RGBDEF( 0xff, 0x66, 0x99 ),
|
179 |
|
|
RGBDEF( 0xff, 0x66, 0xcc ),
|
180 |
|
|
RGBDEF( 0xff, 0x66, 0xff ),
|
181 |
|
|
RGBDEF( 0x00, 0x99, 0x00 ),
|
182 |
|
|
RGBDEF( 0x00, 0x99, 0x33 ),
|
183 |
|
|
RGBDEF( 0x00, 0x99, 0x66 ),
|
184 |
|
|
RGBDEF( 0x00, 0x99, 0x99 ),
|
185 |
|
|
RGBDEF( 0x00, 0x99, 0xcc ),
|
186 |
|
|
RGBDEF( 0x00, 0x99, 0xff ),
|
187 |
|
|
RGBDEF( 0x33, 0x99, 0x00 ),
|
188 |
|
|
RGBDEF( 0x33, 0x99, 0x33 ),
|
189 |
|
|
RGBDEF( 0x33, 0x99, 0x66 ),
|
190 |
|
|
RGBDEF( 0x33, 0x99, 0x99 ),
|
191 |
|
|
RGBDEF( 0x33, 0x99, 0xcc ),
|
192 |
|
|
RGBDEF( 0x33, 0x99, 0xff ),
|
193 |
|
|
RGBDEF( 0x66, 0x99, 0x00 ),
|
194 |
|
|
RGBDEF( 0x66, 0x99, 0x33 ),
|
195 |
|
|
RGBDEF( 0x66, 0x99, 0x66 ),
|
196 |
|
|
RGBDEF( 0x66, 0x99, 0x99 ),
|
197 |
|
|
RGBDEF( 0x66, 0x99, 0xcc ),
|
198 |
|
|
RGBDEF( 0x66, 0x99, 0xff ),
|
199 |
|
|
RGBDEF( 0x99, 0x99, 0x00 ),
|
200 |
|
|
RGBDEF( 0x99, 0x99, 0x33 ),
|
201 |
|
|
RGBDEF( 0x99, 0x99, 0x66 ),
|
202 |
|
|
RGBDEF( 0x99, 0x99, 0x99 ),
|
203 |
|
|
RGBDEF( 0x99, 0x99, 0xcc ),
|
204 |
|
|
RGBDEF( 0x99, 0x99, 0xff ),
|
205 |
|
|
RGBDEF( 0xcc, 0x99, 0x00 ),
|
206 |
|
|
RGBDEF( 0xcc, 0x99, 0x33 ),
|
207 |
|
|
RGBDEF( 0xcc, 0x99, 0x66 ),
|
208 |
|
|
RGBDEF( 0xcc, 0x99, 0x99 ),
|
209 |
|
|
RGBDEF( 0xcc, 0x99, 0xcc ),
|
210 |
|
|
RGBDEF( 0xcc, 0x99, 0xff ),
|
211 |
|
|
RGBDEF( 0xff, 0x99, 0x00 ),
|
212 |
|
|
RGBDEF( 0xff, 0x99, 0x33 ),
|
213 |
|
|
RGBDEF( 0xff, 0x99, 0x66 ),
|
214 |
|
|
RGBDEF( 0xff, 0x99, 0x99 ),
|
215 |
|
|
RGBDEF( 0xff, 0x99, 0xcc ),
|
216 |
|
|
RGBDEF( 0xff, 0x99, 0xff ),
|
217 |
|
|
RGBDEF( 0x00, 0xcc, 0x00 ),
|
218 |
|
|
RGBDEF( 0x00, 0xcc, 0x33 ),
|
219 |
|
|
RGBDEF( 0x00, 0xcc, 0x66 ),
|
220 |
|
|
RGBDEF( 0x00, 0xcc, 0x99 ),
|
221 |
|
|
RGBDEF( 0x00, 0xcc, 0xcc ),
|
222 |
|
|
RGBDEF( 0x00, 0xcc, 0xff ),
|
223 |
|
|
RGBDEF( 0x33, 0xcc, 0x00 ),
|
224 |
|
|
RGBDEF( 0x33, 0xcc, 0x33 ),
|
225 |
|
|
RGBDEF( 0x33, 0xcc, 0x66 ),
|
226 |
|
|
RGBDEF( 0x33, 0xcc, 0x99 ),
|
227 |
|
|
RGBDEF( 0x33, 0xcc, 0xcc ),
|
228 |
|
|
RGBDEF( 0x33, 0xcc, 0xff ),
|
229 |
|
|
RGBDEF( 0x66, 0xcc, 0x00 ),
|
230 |
|
|
RGBDEF( 0x66, 0xcc, 0x33 ),
|
231 |
|
|
RGBDEF( 0x66, 0xcc, 0x66 ),
|
232 |
|
|
RGBDEF( 0x66, 0xcc, 0x99 ),
|
233 |
|
|
RGBDEF( 0x66, 0xcc, 0xcc ),
|
234 |
|
|
RGBDEF( 0x66, 0xcc, 0xff ),
|
235 |
|
|
RGBDEF( 0x99, 0xcc, 0x00 ),
|
236 |
|
|
RGBDEF( 0x99, 0xcc, 0x33 ),
|
237 |
|
|
RGBDEF( 0x99, 0xcc, 0x66 ),
|
238 |
|
|
RGBDEF( 0x99, 0xcc, 0x99 ),
|
239 |
|
|
RGBDEF( 0x99, 0xcc, 0xcc ),
|
240 |
|
|
RGBDEF( 0x99, 0xcc, 0xff ),
|
241 |
|
|
RGBDEF( 0xcc, 0xcc, 0x00 ),
|
242 |
|
|
RGBDEF( 0xcc, 0xcc, 0x33 ),
|
243 |
|
|
RGBDEF( 0xcc, 0xcc, 0x66 ),
|
244 |
|
|
RGBDEF( 0xcc, 0xcc, 0x99 ),
|
245 |
|
|
RGBDEF( 0xcc, 0xcc, 0xcc ),
|
246 |
|
|
RGBDEF( 0xcc, 0xcc, 0xff ),
|
247 |
|
|
RGBDEF( 0xff, 0xcc, 0x00 ),
|
248 |
|
|
RGBDEF( 0xff, 0xcc, 0x33 ),
|
249 |
|
|
RGBDEF( 0xff, 0xcc, 0x66 ),
|
250 |
|
|
RGBDEF( 0xff, 0xcc, 0x99 ),
|
251 |
|
|
RGBDEF( 0xff, 0xcc, 0xcc ),
|
252 |
|
|
RGBDEF( 0xff, 0xcc, 0xff ),
|
253 |
|
|
/*RGBDEF( 0x00, 0xff, 0x00 ),*/
|
254 |
|
|
RGBDEF( 0x00, 0xff, 0x33 ),
|
255 |
|
|
RGBDEF( 0x00, 0xff, 0x66 ),
|
256 |
|
|
RGBDEF( 0x00, 0xff, 0x99 ),
|
257 |
|
|
RGBDEF( 0x00, 0xff, 0xcc ),
|
258 |
|
|
/*RGBDEF( 0x00, 0xff, 0xff ),*/
|
259 |
|
|
RGBDEF( 0x33, 0xff, 0x00 ),
|
260 |
|
|
RGBDEF( 0x33, 0xff, 0x33 ),
|
261 |
|
|
RGBDEF( 0x33, 0xff, 0x66 ),
|
262 |
|
|
RGBDEF( 0x33, 0xff, 0x99 ),
|
263 |
|
|
RGBDEF( 0x33, 0xff, 0xcc ),
|
264 |
|
|
RGBDEF( 0x33, 0xff, 0xff ),
|
265 |
|
|
RGBDEF( 0x66, 0xff, 0x00 ),
|
266 |
|
|
RGBDEF( 0x66, 0xff, 0x33 ),
|
267 |
|
|
RGBDEF( 0x66, 0xff, 0x66 ),
|
268 |
|
|
RGBDEF( 0x66, 0xff, 0x99 ),
|
269 |
|
|
RGBDEF( 0x66, 0xff, 0xcc ),
|
270 |
|
|
RGBDEF( 0x66, 0xff, 0xff ),
|
271 |
|
|
RGBDEF( 0x99, 0xff, 0x00 ),
|
272 |
|
|
RGBDEF( 0x99, 0xff, 0x33 ),
|
273 |
|
|
RGBDEF( 0x99, 0xff, 0x66 ),
|
274 |
|
|
RGBDEF( 0x99, 0xff, 0x99 ),
|
275 |
|
|
RGBDEF( 0x99, 0xff, 0xcc ),
|
276 |
|
|
RGBDEF( 0x99, 0xff, 0xff ),
|
277 |
|
|
RGBDEF( 0xcc, 0xff, 0x00 ),
|
278 |
|
|
RGBDEF( 0xcc, 0xff, 0x33 ),
|
279 |
|
|
RGBDEF( 0xcc, 0xff, 0x66 ),
|
280 |
|
|
RGBDEF( 0xcc, 0xff, 0x99 ),
|
281 |
|
|
RGBDEF( 0xcc, 0xff, 0xcc ),
|
282 |
|
|
RGBDEF( 0xcc, 0xff, 0xff ),
|
283 |
|
|
/*RGBDEF( 0xff, 0xff, 0x00 ),*/
|
284 |
|
|
RGBDEF( 0xff, 0xff, 0x33 ),
|
285 |
|
|
RGBDEF( 0xff, 0xff, 0x66 ),
|
286 |
|
|
RGBDEF( 0xff, 0xff, 0x99 ),
|
287 |
|
|
RGBDEF( 0xff, 0xff, 0xcc ),
|
288 |
|
|
/*RGBDEF( 0xff, 0xff, 0xff )*/
|
289 |
|
|
};
|
290 |
|
|
|
291 |
|
|
#if TEST
|
292 |
|
|
main()
|
293 |
|
|
{
|
294 |
|
|
int c;
|
295 |
|
|
|
296 |
|
|
DPRINTF("%d\n", ((int)&stdpalette[1]) - (int)&stdpalette[0]);
|
297 |
|
|
|
298 |
|
|
c = FindNearestColor(stdpalette, 224, 224, 224);
|
299 |
|
|
DPRINTF("%d = %02x %02x %02x\n", c, stdpalette[c].r, stdpalette[c].g,
|
300 |
|
|
stdpalette[c].b);
|
301 |
|
|
}
|
302 |
|
|
#endif
|