1 |
786 |
skrzyp |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// palette.c
|
4 |
|
|
//
|
5 |
|
|
// Provide default palettes
|
6 |
|
|
//
|
7 |
|
|
//==========================================================================
|
8 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
// -------------------------------------------
|
10 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
// Copyright (C) 2008 Free Software Foundation, Inc.
|
12 |
|
|
//
|
13 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
// the terms of the GNU General Public License as published by the Free
|
15 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
// version.
|
17 |
|
|
//
|
18 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
// for more details.
|
22 |
|
|
//
|
23 |
|
|
// You should have received a copy of the GNU General Public License
|
24 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
//
|
27 |
|
|
// As a special exception, if other files instantiate templates or use
|
28 |
|
|
// macros or inline functions from this file, or you compile this file
|
29 |
|
|
// and link it with other works to produce a work based on this file,
|
30 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
// the GNU General Public License. However the source code for this file
|
32 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
// General Public License v2.
|
34 |
|
|
//
|
35 |
|
|
// This exception does not invalidate any other reasons why a work based
|
36 |
|
|
// on this file might be covered by the GNU General Public License.
|
37 |
|
|
// -------------------------------------------
|
38 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
//==========================================================================
|
40 |
|
|
//###DESCRIPTIONBEGIN####
|
41 |
|
|
//
|
42 |
|
|
// Author(s): bartv
|
43 |
|
|
// Date: 2005-03-29
|
44 |
|
|
//
|
45 |
|
|
//###DESCRIPTIONEND####
|
46 |
|
|
//========================================================================
|
47 |
|
|
|
48 |
|
|
#include <cyg/io/framebuf.h>
|
49 |
|
|
|
50 |
|
|
// These figures were taken from a real VGA card. The VGA palette
|
51 |
|
|
// registers only use six bits so the values were shifted by two,
|
52 |
|
|
// then 0xFC was converted to 0xFF to get maximum brightness.
|
53 |
|
|
|
54 |
|
|
const cyg_uint8 cyg_fb_palette_ega[16 * 3] = {
|
55 |
|
|
0x00, 0x00, 0x00, // 0 black
|
56 |
|
|
0x00, 0x00, 0xa8, // 1 blue
|
57 |
|
|
0x00, 0xa8, 0x00, // 2 green
|
58 |
|
|
0x00, 0xa8, 0xa8, // 3 cyan
|
59 |
|
|
0xa8, 0x00, 0x00, // 4 red
|
60 |
|
|
0xa8, 0x00, 0xa8, // 5 magenta
|
61 |
|
|
0xa8, 0x54, 0x00, // 6 brown
|
62 |
|
|
0xa8, 0xa8, 0xa8, // 7 light grey
|
63 |
|
|
0x54, 0x54, 0x54, // 8 dark grey
|
64 |
|
|
0x54, 0x54, 0xff, // 9 light blue
|
65 |
|
|
0x54, 0xff, 0x54, // 10 light green
|
66 |
|
|
0x54, 0xff, 0xff, // 11 light cyan
|
67 |
|
|
0xff, 0x54, 0x54, // 12 light red
|
68 |
|
|
0xff, 0x54, 0xff, // 13 light magenta
|
69 |
|
|
0xff, 0xff, 0x54, // 14 yellow
|
70 |
|
|
0xff, 0xff, 0xff // 15 white
|
71 |
|
|
};
|
72 |
|
|
|
73 |
|
|
const cyg_uint8 cyg_fb_palette_vga[256 * 3] = {
|
74 |
|
|
0x00, 0x00, 0x00, // 0 black
|
75 |
|
|
0x00, 0x00, 0xa8, // 1 blue
|
76 |
|
|
0x00, 0xa8, 0x00, // 2 green
|
77 |
|
|
0x00, 0xa8, 0xa8, // 3 cyan
|
78 |
|
|
0xa8, 0x00, 0x00, // 4 red
|
79 |
|
|
0xa8, 0x00, 0xa8, // 5 magenta
|
80 |
|
|
0xa8, 0x54, 0x00, // 6 brown
|
81 |
|
|
0xa8, 0xa8, 0xa8, // 7 light grey
|
82 |
|
|
0x54, 0x54, 0x54, // 8 dark grey
|
83 |
|
|
0x54, 0x54, 0xff, // 9 light blue
|
84 |
|
|
0x54, 0xff, 0x54, // 10 light green
|
85 |
|
|
0x54, 0xff, 0xff, // 11 light cyan
|
86 |
|
|
0xff, 0x54, 0x54, // 12 light red
|
87 |
|
|
0xff, 0x54, 0xff, // 13 light magenta
|
88 |
|
|
0xff, 0xff, 0x54, // 14 yellow
|
89 |
|
|
0xff, 0xff, 0xff, // 15 white
|
90 |
|
|
0x00, 0x00, 0x00, // 16
|
91 |
|
|
0x14, 0x14, 0x14, // 17
|
92 |
|
|
0x20, 0x20, 0x20, // 18
|
93 |
|
|
0x2c, 0x2c, 0x2c, // 19
|
94 |
|
|
0x38, 0x38, 0x38, // 20
|
95 |
|
|
0x44, 0x44, 0x44, // 21
|
96 |
|
|
0x50, 0x50, 0x50, // 22
|
97 |
|
|
0x60, 0x60, 0x60, // 23
|
98 |
|
|
0x70, 0x70, 0x70, // 24
|
99 |
|
|
0x80, 0x80, 0x80, // 25
|
100 |
|
|
0x90, 0x90, 0x90, // 26
|
101 |
|
|
0xa0, 0xa0, 0xa0, // 27
|
102 |
|
|
0xb4, 0xb4, 0xb4, // 28
|
103 |
|
|
0xc8, 0xc8, 0xc8, // 29
|
104 |
|
|
0xe0, 0xe0, 0xe0, // 30
|
105 |
|
|
0xff, 0xff, 0xff, // 31
|
106 |
|
|
0x00, 0x00, 0xff, // 32
|
107 |
|
|
0x40, 0x00, 0xff, // 33
|
108 |
|
|
0x7c, 0x00, 0xff, // 34
|
109 |
|
|
0xbc, 0x00, 0xff, // 35
|
110 |
|
|
0xff, 0x00, 0xff, // 36
|
111 |
|
|
0xff, 0x00, 0xbc, // 37
|
112 |
|
|
0xff, 0x00, 0x7c, // 38
|
113 |
|
|
0xff, 0x00, 0x40, // 39
|
114 |
|
|
0xff, 0x00, 0x00, // 40
|
115 |
|
|
0xff, 0x40, 0x00, // 41
|
116 |
|
|
0xff, 0x7c, 0x00, // 42
|
117 |
|
|
0xff, 0xbc, 0x00, // 43
|
118 |
|
|
0xff, 0xff, 0x00, // 44
|
119 |
|
|
0xbc, 0xff, 0x00, // 45
|
120 |
|
|
0x7c, 0xff, 0x00, // 46
|
121 |
|
|
0x40, 0xff, 0x00, // 47
|
122 |
|
|
0x00, 0xff, 0x00, // 48
|
123 |
|
|
0x00, 0xff, 0x40, // 49
|
124 |
|
|
0x00, 0xff, 0x7c, // 50
|
125 |
|
|
0x00, 0xff, 0xbc, // 51
|
126 |
|
|
0x00, 0xff, 0xff, // 52
|
127 |
|
|
0x00, 0xbc, 0xff, // 53
|
128 |
|
|
0x00, 0x7c, 0xff, // 54
|
129 |
|
|
0x00, 0x40, 0xff, // 55
|
130 |
|
|
0x7c, 0x7c, 0xff, // 56
|
131 |
|
|
0x9c, 0x7c, 0xff, // 57
|
132 |
|
|
0xbc, 0x7c, 0xff, // 58
|
133 |
|
|
0xdc, 0x7c, 0xff, // 59
|
134 |
|
|
0xff, 0x7c, 0xff, // 60
|
135 |
|
|
0xff, 0x7c, 0xdc, // 61
|
136 |
|
|
0xff, 0x7c, 0xbc, // 62
|
137 |
|
|
0xff, 0x7c, 0x9c, // 63
|
138 |
|
|
0xff, 0x7c, 0x7c, // 64
|
139 |
|
|
0xff, 0x9c, 0x7c, // 65
|
140 |
|
|
0xff, 0xbc, 0x7c, // 66
|
141 |
|
|
0xff, 0xdc, 0x7c, // 67
|
142 |
|
|
0xff, 0xff, 0x7c, // 68
|
143 |
|
|
0xdc, 0xff, 0x7c, // 69
|
144 |
|
|
0xbc, 0xff, 0x7c, // 70
|
145 |
|
|
0x9c, 0xff, 0x7c, // 71
|
146 |
|
|
0x7c, 0xff, 0x7c, // 72
|
147 |
|
|
0x7c, 0xff, 0x9c, // 73
|
148 |
|
|
0x7c, 0xff, 0xbc, // 74
|
149 |
|
|
0x7c, 0xff, 0xdc, // 75
|
150 |
|
|
0x7c, 0xff, 0xff, // 76
|
151 |
|
|
0x7c, 0xdc, 0xff, // 77
|
152 |
|
|
0x7c, 0xbc, 0xff, // 78
|
153 |
|
|
0x7c, 0x9c, 0xff, // 79
|
154 |
|
|
0xb4, 0xb4, 0xff, // 80
|
155 |
|
|
0xc4, 0xb4, 0xff, // 81
|
156 |
|
|
0xd8, 0xb4, 0xff, // 82
|
157 |
|
|
0xe8, 0xb4, 0xff, // 83
|
158 |
|
|
0xff, 0xb4, 0xff, // 84
|
159 |
|
|
0xff, 0xb4, 0xe8, // 85
|
160 |
|
|
0xff, 0xb4, 0xd8, // 86
|
161 |
|
|
0xff, 0xb4, 0xc4, // 87
|
162 |
|
|
0xff, 0xb4, 0xb4, // 88
|
163 |
|
|
0xff, 0xc4, 0xb4, // 89
|
164 |
|
|
0xff, 0xd8, 0xb4, // 90
|
165 |
|
|
0xff, 0xe8, 0xb4, // 91
|
166 |
|
|
0xff, 0xff, 0xb4, // 92
|
167 |
|
|
0xe8, 0xff, 0xb4, // 93
|
168 |
|
|
0xd8, 0xff, 0xb4, // 94
|
169 |
|
|
0xc4, 0xff, 0xb4, // 95
|
170 |
|
|
0xb4, 0xff, 0xb4, // 96
|
171 |
|
|
0xb4, 0xff, 0xc4, // 97
|
172 |
|
|
0xb4, 0xff, 0xd8, // 98
|
173 |
|
|
0xb4, 0xff, 0xe8, // 99
|
174 |
|
|
0xb4, 0xff, 0xff, // 100
|
175 |
|
|
0xb4, 0xe8, 0xff, // 101
|
176 |
|
|
0xb4, 0xd8, 0xff, // 102
|
177 |
|
|
0xb4, 0xc4, 0xff, // 103
|
178 |
|
|
0x00, 0x00, 0x70, // 104
|
179 |
|
|
0x1c, 0x00, 0x70, // 105
|
180 |
|
|
0x38, 0x00, 0x70, // 106
|
181 |
|
|
0x54, 0x00, 0x70, // 107
|
182 |
|
|
0x70, 0x00, 0x70, // 108
|
183 |
|
|
0x70, 0x00, 0x54, // 109
|
184 |
|
|
0x70, 0x00, 0x38, // 110
|
185 |
|
|
0x70, 0x00, 0x1c, // 111
|
186 |
|
|
0x70, 0x00, 0x00, // 112
|
187 |
|
|
0x70, 0x1c, 0x00, // 113
|
188 |
|
|
0x70, 0x38, 0x00, // 114
|
189 |
|
|
0x70, 0x54, 0x00, // 115
|
190 |
|
|
0x70, 0x70, 0x00, // 116
|
191 |
|
|
0x54, 0x70, 0x00, // 117
|
192 |
|
|
0x38, 0x70, 0x00, // 118
|
193 |
|
|
0x1c, 0x70, 0x00, // 119
|
194 |
|
|
0x00, 0x70, 0x00, // 120
|
195 |
|
|
0x00, 0x70, 0x1c, // 121
|
196 |
|
|
0x00, 0x70, 0x38, // 122
|
197 |
|
|
0x00, 0x70, 0x54, // 123
|
198 |
|
|
0x00, 0x70, 0x70, // 124
|
199 |
|
|
0x00, 0x54, 0x70, // 125
|
200 |
|
|
0x00, 0x38, 0x70, // 126
|
201 |
|
|
0x00, 0x1c, 0x70, // 127
|
202 |
|
|
0x38, 0x38, 0x70, // 128
|
203 |
|
|
0x44, 0x38, 0x70, // 129
|
204 |
|
|
0x54, 0x38, 0x70, // 130
|
205 |
|
|
0x60, 0x38, 0x70, // 131
|
206 |
|
|
0x70, 0x38, 0x70, // 132
|
207 |
|
|
0x70, 0x38, 0x60, // 133
|
208 |
|
|
0x70, 0x38, 0x54, // 134
|
209 |
|
|
0x70, 0x38, 0x44, // 135
|
210 |
|
|
0x70, 0x38, 0x38, // 136
|
211 |
|
|
0x70, 0x44, 0x38, // 137
|
212 |
|
|
0x70, 0x54, 0x38, // 138
|
213 |
|
|
0x70, 0x60, 0x38, // 139
|
214 |
|
|
0x70, 0x70, 0x38, // 140
|
215 |
|
|
0x60, 0x70, 0x38, // 141
|
216 |
|
|
0x54, 0x70, 0x38, // 142
|
217 |
|
|
0x44, 0x70, 0x38, // 143
|
218 |
|
|
0x38, 0x70, 0x38, // 144
|
219 |
|
|
0x38, 0x70, 0x44, // 145
|
220 |
|
|
0x38, 0x70, 0x54, // 146
|
221 |
|
|
0x38, 0x70, 0x60, // 147
|
222 |
|
|
0x38, 0x70, 0x70, // 148
|
223 |
|
|
0x38, 0x60, 0x70, // 149
|
224 |
|
|
0x38, 0x54, 0x70, // 150
|
225 |
|
|
0x38, 0x44, 0x70, // 151
|
226 |
|
|
0x50, 0x50, 0x70, // 152
|
227 |
|
|
0x58, 0x50, 0x70, // 153
|
228 |
|
|
0x60, 0x50, 0x70, // 154
|
229 |
|
|
0x68, 0x50, 0x70, // 155
|
230 |
|
|
0x70, 0x50, 0x70, // 156
|
231 |
|
|
0x70, 0x50, 0x68, // 157
|
232 |
|
|
0x70, 0x50, 0x60, // 158
|
233 |
|
|
0x70, 0x50, 0x58, // 159
|
234 |
|
|
0x70, 0x50, 0x50, // 160
|
235 |
|
|
0x70, 0x58, 0x50, // 161
|
236 |
|
|
0x70, 0x60, 0x50, // 162
|
237 |
|
|
0x70, 0x68, 0x50, // 163
|
238 |
|
|
0x70, 0x70, 0x50, // 164
|
239 |
|
|
0x68, 0x70, 0x50, // 165
|
240 |
|
|
0x60, 0x70, 0x50, // 166
|
241 |
|
|
0x58, 0x70, 0x50, // 167
|
242 |
|
|
0x50, 0x70, 0x50, // 168
|
243 |
|
|
0x50, 0x70, 0x58, // 169
|
244 |
|
|
0x50, 0x70, 0x60, // 170
|
245 |
|
|
0x50, 0x70, 0x68, // 171
|
246 |
|
|
0x50, 0x70, 0x70, // 172
|
247 |
|
|
0x50, 0x68, 0x70, // 173
|
248 |
|
|
0x50, 0x60, 0x70, // 174
|
249 |
|
|
0x50, 0x58, 0x70, // 175
|
250 |
|
|
0x00, 0x00, 0x40, // 176
|
251 |
|
|
0x10, 0x00, 0x40, // 177
|
252 |
|
|
0x20, 0x00, 0x40, // 178
|
253 |
|
|
0x30, 0x00, 0x40, // 179
|
254 |
|
|
0x40, 0x00, 0x40, // 180
|
255 |
|
|
0x40, 0x00, 0x30, // 181
|
256 |
|
|
0x40, 0x00, 0x20, // 182
|
257 |
|
|
0x40, 0x00, 0x10, // 183
|
258 |
|
|
0x40, 0x00, 0x00, // 184
|
259 |
|
|
0x40, 0x10, 0x00, // 185
|
260 |
|
|
0x40, 0x20, 0x00, // 186
|
261 |
|
|
0x40, 0x30, 0x00, // 187
|
262 |
|
|
0x40, 0x40, 0x00, // 188
|
263 |
|
|
0x30, 0x40, 0x00, // 189
|
264 |
|
|
0x20, 0x40, 0x00, // 190
|
265 |
|
|
0x10, 0x40, 0x00, // 191
|
266 |
|
|
0x00, 0x40, 0x00, // 192
|
267 |
|
|
0x00, 0x40, 0x10, // 193
|
268 |
|
|
0x00, 0x40, 0x20, // 194
|
269 |
|
|
0x00, 0x40, 0x30, // 195
|
270 |
|
|
0x00, 0x40, 0x40, // 196
|
271 |
|
|
0x00, 0x30, 0x40, // 197
|
272 |
|
|
0x00, 0x20, 0x40, // 198
|
273 |
|
|
0x00, 0x10, 0x40, // 199
|
274 |
|
|
0x20, 0x20, 0x40, // 200
|
275 |
|
|
0x28, 0x20, 0x40, // 201
|
276 |
|
|
0x30, 0x20, 0x40, // 202
|
277 |
|
|
0x38, 0x20, 0x40, // 203
|
278 |
|
|
0x40, 0x20, 0x40, // 204
|
279 |
|
|
0x40, 0x20, 0x38, // 205
|
280 |
|
|
0x40, 0x20, 0x30, // 206
|
281 |
|
|
0x40, 0x20, 0x28, // 207
|
282 |
|
|
0x40, 0x20, 0x20, // 208
|
283 |
|
|
0x40, 0x28, 0x20, // 209
|
284 |
|
|
0x40, 0x30, 0x20, // 210
|
285 |
|
|
0x40, 0x38, 0x20, // 211
|
286 |
|
|
0x40, 0x40, 0x20, // 212
|
287 |
|
|
0x38, 0x40, 0x20, // 213
|
288 |
|
|
0x30, 0x40, 0x20, // 214
|
289 |
|
|
0x28, 0x40, 0x20, // 215
|
290 |
|
|
0x20, 0x40, 0x20, // 216
|
291 |
|
|
0x20, 0x40, 0x28, // 217
|
292 |
|
|
0x20, 0x40, 0x30, // 218
|
293 |
|
|
0x20, 0x40, 0x38, // 219
|
294 |
|
|
0x20, 0x40, 0x40, // 220
|
295 |
|
|
0x20, 0x38, 0x40, // 221
|
296 |
|
|
0x20, 0x30, 0x40, // 222
|
297 |
|
|
0x20, 0x28, 0x40, // 223
|
298 |
|
|
0x2c, 0x2c, 0x40, // 224
|
299 |
|
|
0x30, 0x2c, 0x40, // 225
|
300 |
|
|
0x34, 0x2c, 0x40, // 226
|
301 |
|
|
0x3c, 0x2c, 0x40, // 227
|
302 |
|
|
0x40, 0x2c, 0x40, // 228
|
303 |
|
|
0x40, 0x2c, 0x3c, // 229
|
304 |
|
|
0x40, 0x2c, 0x34, // 230
|
305 |
|
|
0x40, 0x2c, 0x30, // 231
|
306 |
|
|
0x40, 0x2c, 0x2c, // 232
|
307 |
|
|
0x40, 0x30, 0x2c, // 233
|
308 |
|
|
0x40, 0x34, 0x2c, // 234
|
309 |
|
|
0x40, 0x3c, 0x2c, // 235
|
310 |
|
|
0x40, 0x40, 0x2c, // 236
|
311 |
|
|
0x3c, 0x40, 0x2c, // 237
|
312 |
|
|
0x34, 0x40, 0x2c, // 238
|
313 |
|
|
0x30, 0x40, 0x2c, // 239
|
314 |
|
|
0x2c, 0x40, 0x2c, // 240
|
315 |
|
|
0x2c, 0x40, 0x30, // 241
|
316 |
|
|
0x2c, 0x40, 0x34, // 242
|
317 |
|
|
0x2c, 0x40, 0x3c, // 243
|
318 |
|
|
0x2c, 0x40, 0x40, // 244
|
319 |
|
|
0x2c, 0x3c, 0x40, // 245
|
320 |
|
|
0x2c, 0x34, 0x40, // 246
|
321 |
|
|
0x2c, 0x30, 0x40, // 247
|
322 |
|
|
0x00, 0x00, 0x00, // 248
|
323 |
|
|
0x00, 0x00, 0x00, // 249
|
324 |
|
|
0x00, 0x00, 0x00, // 250
|
325 |
|
|
0x00, 0x00, 0x00, // 251
|
326 |
|
|
0x00, 0x00, 0x00, // 252
|
327 |
|
|
0x00, 0x00, 0x00, // 253
|
328 |
|
|
0x00, 0x00, 0x00, // 254
|
329 |
|
|
0x00, 0x00, 0x00 // 255
|
330 |
|
|
};
|