blob: 17a6ca69b3e51912dcfe1b8ea20260af90fe8ac5 [file] [log] [blame]
Kevin O'Connor1f2c3072009-05-06 23:35:59 -04001// Tables used by VGA bios
2//
3// Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net>
4// Copyright (C) 2001-2008 the LGPL VGABios developers Team
5//
6// This file may be distributed under the terms of the GNU LGPLv3 license.
7
Kevin O'Connor5727c292009-05-16 17:29:32 -04008#include "vgatables.h" // struct VideoParamTableEntry_s
9#include "biosvar.h" // GET_GLOBAL
Kevin O'Connor1f2c3072009-05-06 23:35:59 -040010
Kevin O'Connor1f2c3072009-05-06 23:35:59 -040011
Kevin O'Connor5727c292009-05-16 17:29:32 -040012/****************************************************************
13 * Video parameter table
14 ****************************************************************/
Kevin O'Connor1f2c3072009-05-06 23:35:59 -040015
Kevin O'Connor815e4472011-12-21 09:05:32 -050016struct VideoSavePointer_s video_save_pointer_table VAR16;
17
Kevin O'Connor5727c292009-05-16 17:29:32 -040018struct VideoParam_s video_param_table[] VAR16 = {
Kevin O'Connor1f2c3072009-05-06 23:35:59 -040019 // index=0x00 no mode defined
20 {},
21 // index=0x01 no mode defined
22 {},
23 // index=0x02 no mode defined
24 {},
25 // index=0x03 no mode defined
26 {},
27 // index=0x04 vga mode 0x04
28 { 40, 24, 8, 0x0800, /* tw, th-1, ch, slength */
29 { 0x09, 0x03, 0x00, 0x02 }, /* sequ_regs */
30 0x63, /* miscreg */
31 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
32 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
33 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2,
34 0xff }, /* crtc_regs */
35 { 0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,
36 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
37 0x01, 0x00, 0x03, 0x00 }, /* actl_regs */
38 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff }, /* grdc_regs */
39 },
40 /* index=0x05 vga mode 0x05 */
41 { 40, 24, 8, 0x0800, /* tw, th-1, ch, slength */
42 { 0x09, 0x03, 0x00, 0x02 }, /* sequ_regs */
43 0x63, /* miscreg */
44 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
45 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
46 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2,
47 0xff }, /* crtc_regs */
48 { 0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,
49 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
50 0x01, 0x00, 0x03, 0x00 }, /* actl_regs */
51 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff }, /* grdc_regs */
52 },
53 /* index=0x06 vga mode 0x06 */
54 { 80, 24, 8, 0x1000, /* tw, th-1, ch, slength */
55 { 0x01, 0x01, 0x00, 0x06 }, /* sequ_regs */
56 0x63, /* miscreg */
57 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
58 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xc2,
60 0xff }, /* crtc_regs */
61 { 0x00, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
62 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
63 0x01, 0x00, 0x01, 0x00 }, /* actl_regs */
64 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0xff }, /* grdc_regs */
65 },
66 /* index=0x07 vga mode 0x07 */
67 { 80, 24, 16, 0x1000, /* tw, th-1, ch, slength */
68 { 0x00, 0x03, 0x00, 0x02 }, /* sequ_regs */
69 0x66, /* miscreg */
70 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
71 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
72 0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3,
73 0xff }, /* crtc_regs */
74 { 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
75 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
76 0x0e, 0x00, 0x0f, 0x08 }, /* actl_regs */
77 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff }, /* grdc_regs */
78 },
79 /* index=0x08 no mode defined */
80 {},
81 /* index=0x09 no mode defined */
82 {},
83 /* index=0x0a no mode defined */
84 {},
85 /* index=0x0b no mode defined */
86 {},
87 /* index=0x0c no mode defined */
88 {},
89 /* index=0x0d vga mode 0x0d */
90 { 40, 24, 8, 0x2000, /* tw, th-1, ch, slength */
91 { 0x09, 0x0f, 0x00, 0x06 }, /* sequ_regs */
92 0x63, /* miscreg */
93 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
94 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
95 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xe3,
96 0xff }, /* crtc_regs */
97 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
98 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
99 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
100 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
101 },
102 /* index=0x0e vga mode 0x0e */
103 { 80, 24, 8, 0x4000, /* tw, th-1, ch, slength */
104 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
105 0x63, /* miscreg */
106 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
107 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108 0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xe3,
109 0xff }, /* crtc_regs */
110 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
111 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
112 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
113 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
114 },
115 /* index=0x0f no mode defined */
116 {},
117 /* index=0x10 no mode defined */
118 {},
119 /* index=0x11 vga mode 0x0f */
120 { 80, 24, 14, 0x8000, /* tw, th-1, ch, slength */
121 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
122 0xa3, /* miscreg */
123 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
124 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
125 0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3,
126 0xff }, /* crtc_regs */
127 { 0x00, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
128 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
129 0x01, 0x00, 0x01, 0x00 }, /* actl_regs */
130 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
131 },
132 /* index=0x12 vga mode 0x10 */
133 { 80, 24, 14, 0x8000, /* tw, th-1, ch, slength */
134 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
135 0xa3, /* miscreg */
136 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
137 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
138 0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3,
139 0xff }, /* crtc_regs */
140 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
141 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
142 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
143 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
144 },
145 /* index=0x13 no mode defined */
146 {},
147 /* index=0x14 no mode defined */
148 {},
149 /* index=0x15 no mode defined */
150 {},
151 /* index=0x16 no mode defined */
152 {},
153 /* index=0x17 vga mode 0x01 */
154 { 40, 24, 16, 0x0800, /* tw, th-1, ch, slength */
155 { 0x08, 0x03, 0x00, 0x02 }, /* sequ_regs */
156 0x67, /* miscreg */
157 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0xa0, 0xbf, 0x1f,
158 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
159 0x9c, 0x8e, 0x8f, 0x14, 0x1f, 0x96, 0xb9, 0xa3,
160 0xff }, /* crtc_regs */
161 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
162 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
163 0x0c, 0x00, 0x0f, 0x08 }, /* actl_regs */
164 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff }, /* grdc_regs */
165 },
166 /* index=0x18 vga mode 0x03 */
167 { 80, 24, 16, 0x1000, /* tw, th-1, ch, slength */
168 { 0x00, 0x03, 0x00, 0x02 }, /* sequ_regs */
169 0x67, /* miscreg */
170 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
171 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
172 0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
173 0xff }, /* crtc_regs */
174 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
175 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
176 0x0c, 0x00, 0x0f, 0x08 }, /* actl_regs */
177 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff }, /* grdc_regs */
178 },
179 /* index=0x19 vga mode 0x07 */
180 { 80, 24, 16, 0x1000, /* tw, th-1, ch, slength */
181 { 0x00, 0x03, 0x00, 0x02 }, /* sequ_regs */
182 0x66, /* miscreg */
183 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
184 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
185 0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3,
186 0xff }, /* crtc_regs */
187 { 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
188 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
189 0x0e, 0x00, 0x0f, 0x08 }, /* actl_regs */
190 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff }, /* grdc_regs */
191 },
192 /* index=0x1a vga mode 0x11 */
193 { 80, 29, 16, 0x0000, /* tw, th-1, ch, slength */
194 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
195 0xe3, /* miscreg */
196 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
197 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
198 0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
199 0xff }, /* crtc_regs */
200 { 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f,
201 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f,
202 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
203 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
204 },
205 /* index=0x1b vga mode 0x12 */
206 { 80, 29, 16, 0x0000, /* tw, th-1, ch, slength */
207 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
208 0xe3, /* miscreg */
209 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
210 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
211 0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
212 0xff }, /* crtc_regs */
213 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
214 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
215 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
216 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
217 },
218 /* index=0x1c vga mode 0x13 */
219 { 40, 24, 8, 0x0000, /* tw, th-1, ch, slength */
220 { 0x01, 0x0f, 0x00, 0x0e }, /* sequ_regs */
221 0x63, /* miscreg */
222 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
223 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
224 0x9c, 0x8e, 0x8f, 0x28, 0x40, 0x96, 0xb9, 0xa3,
225 0xff }, /* crtc_regs */
226 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
227 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
228 0x41, 0x00, 0x0f, 0x00 }, /* actl_regs */
229 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff }, /* grdc_regs */
230 },
231 /* index=0x1d vga mode 0x6a */
232 { 100, 36, 16, 0x0000, /* tw, th-1, ch, slength */
233 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
234 0xe3, /* miscreg */
235 { 0x7f, 0x63, 0x63, 0x83, 0x6b, 0x1b, 0x72, 0xf0,
236 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
237 0x59, 0x8d, 0x57, 0x32, 0x00, 0x57, 0x73, 0xe3,
238 0xff }, /* crtc_regs */
239 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
240 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
241 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
242 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
243 },
244};
245
Kevin O'Connor5727c292009-05-16 17:29:32 -0400246
247/****************************************************************
248 * Palette definitions
249 ****************************************************************/
250
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400251/* Mono */
Kevin O'Connor5727c292009-05-16 17:29:32 -0400252static u8 palette0[] VAR16 = {
Kevin O'Connora959aa12009-05-25 00:12:18 -0400253 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
254 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
255 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
256 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
257 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
258 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
259 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
260 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
261 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
262 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
263 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
264 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
265 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
266 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
267 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
268 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400269};
270
Kevin O'Connor5727c292009-05-16 17:29:32 -0400271static u8 palette1[] VAR16 = {
Kevin O'Connora959aa12009-05-25 00:12:18 -0400272 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
273 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
274 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
275 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
276 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
277 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
278 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
279 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
280 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
281 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
282 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
283 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
284 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
285 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
286 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
287 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400288};
289
Kevin O'Connor5727c292009-05-16 17:29:32 -0400290static u8 palette2[] VAR16 = {
Kevin O'Connora959aa12009-05-25 00:12:18 -0400291 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
292 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x2a,0x00, 0x2a,0x2a,0x2a,
293 0x00,0x00,0x15, 0x00,0x00,0x3f, 0x00,0x2a,0x15, 0x00,0x2a,0x3f,
294 0x2a,0x00,0x15, 0x2a,0x00,0x3f, 0x2a,0x2a,0x15, 0x2a,0x2a,0x3f,
295 0x00,0x15,0x00, 0x00,0x15,0x2a, 0x00,0x3f,0x00, 0x00,0x3f,0x2a,
296 0x2a,0x15,0x00, 0x2a,0x15,0x2a, 0x2a,0x3f,0x00, 0x2a,0x3f,0x2a,
297 0x00,0x15,0x15, 0x00,0x15,0x3f, 0x00,0x3f,0x15, 0x00,0x3f,0x3f,
298 0x2a,0x15,0x15, 0x2a,0x15,0x3f, 0x2a,0x3f,0x15, 0x2a,0x3f,0x3f,
299 0x15,0x00,0x00, 0x15,0x00,0x2a, 0x15,0x2a,0x00, 0x15,0x2a,0x2a,
300 0x3f,0x00,0x00, 0x3f,0x00,0x2a, 0x3f,0x2a,0x00, 0x3f,0x2a,0x2a,
301 0x15,0x00,0x15, 0x15,0x00,0x3f, 0x15,0x2a,0x15, 0x15,0x2a,0x3f,
302 0x3f,0x00,0x15, 0x3f,0x00,0x3f, 0x3f,0x2a,0x15, 0x3f,0x2a,0x3f,
303 0x15,0x15,0x00, 0x15,0x15,0x2a, 0x15,0x3f,0x00, 0x15,0x3f,0x2a,
304 0x3f,0x15,0x00, 0x3f,0x15,0x2a, 0x3f,0x3f,0x00, 0x3f,0x3f,0x2a,
305 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
306 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400307};
308
Kevin O'Connor5727c292009-05-16 17:29:32 -0400309static u8 palette3[] VAR16 = {
Kevin O'Connora959aa12009-05-25 00:12:18 -0400310 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
311 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
312 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
313 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
314 0x00,0x00,0x00, 0x05,0x05,0x05, 0x08,0x08,0x08, 0x0b,0x0b,0x0b,
315 0x0e,0x0e,0x0e, 0x11,0x11,0x11, 0x14,0x14,0x14, 0x18,0x18,0x18,
316 0x1c,0x1c,0x1c, 0x20,0x20,0x20, 0x24,0x24,0x24, 0x28,0x28,0x28,
317 0x2d,0x2d,0x2d, 0x32,0x32,0x32, 0x38,0x38,0x38, 0x3f,0x3f,0x3f,
318 0x00,0x00,0x3f, 0x10,0x00,0x3f, 0x1f,0x00,0x3f, 0x2f,0x00,0x3f,
319 0x3f,0x00,0x3f, 0x3f,0x00,0x2f, 0x3f,0x00,0x1f, 0x3f,0x00,0x10,
320 0x3f,0x00,0x00, 0x3f,0x10,0x00, 0x3f,0x1f,0x00, 0x3f,0x2f,0x00,
321 0x3f,0x3f,0x00, 0x2f,0x3f,0x00, 0x1f,0x3f,0x00, 0x10,0x3f,0x00,
322 0x00,0x3f,0x00, 0x00,0x3f,0x10, 0x00,0x3f,0x1f, 0x00,0x3f,0x2f,
323 0x00,0x3f,0x3f, 0x00,0x2f,0x3f, 0x00,0x1f,0x3f, 0x00,0x10,0x3f,
324 0x1f,0x1f,0x3f, 0x27,0x1f,0x3f, 0x2f,0x1f,0x3f, 0x37,0x1f,0x3f,
325 0x3f,0x1f,0x3f, 0x3f,0x1f,0x37, 0x3f,0x1f,0x2f, 0x3f,0x1f,0x27,
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400326
Kevin O'Connora959aa12009-05-25 00:12:18 -0400327 0x3f,0x1f,0x1f, 0x3f,0x27,0x1f, 0x3f,0x2f,0x1f, 0x3f,0x37,0x1f,
328 0x3f,0x3f,0x1f, 0x37,0x3f,0x1f, 0x2f,0x3f,0x1f, 0x27,0x3f,0x1f,
329 0x1f,0x3f,0x1f, 0x1f,0x3f,0x27, 0x1f,0x3f,0x2f, 0x1f,0x3f,0x37,
330 0x1f,0x3f,0x3f, 0x1f,0x37,0x3f, 0x1f,0x2f,0x3f, 0x1f,0x27,0x3f,
331 0x2d,0x2d,0x3f, 0x31,0x2d,0x3f, 0x36,0x2d,0x3f, 0x3a,0x2d,0x3f,
332 0x3f,0x2d,0x3f, 0x3f,0x2d,0x3a, 0x3f,0x2d,0x36, 0x3f,0x2d,0x31,
333 0x3f,0x2d,0x2d, 0x3f,0x31,0x2d, 0x3f,0x36,0x2d, 0x3f,0x3a,0x2d,
334 0x3f,0x3f,0x2d, 0x3a,0x3f,0x2d, 0x36,0x3f,0x2d, 0x31,0x3f,0x2d,
335 0x2d,0x3f,0x2d, 0x2d,0x3f,0x31, 0x2d,0x3f,0x36, 0x2d,0x3f,0x3a,
336 0x2d,0x3f,0x3f, 0x2d,0x3a,0x3f, 0x2d,0x36,0x3f, 0x2d,0x31,0x3f,
337 0x00,0x00,0x1c, 0x07,0x00,0x1c, 0x0e,0x00,0x1c, 0x15,0x00,0x1c,
338 0x1c,0x00,0x1c, 0x1c,0x00,0x15, 0x1c,0x00,0x0e, 0x1c,0x00,0x07,
339 0x1c,0x00,0x00, 0x1c,0x07,0x00, 0x1c,0x0e,0x00, 0x1c,0x15,0x00,
340 0x1c,0x1c,0x00, 0x15,0x1c,0x00, 0x0e,0x1c,0x00, 0x07,0x1c,0x00,
341 0x00,0x1c,0x00, 0x00,0x1c,0x07, 0x00,0x1c,0x0e, 0x00,0x1c,0x15,
342 0x00,0x1c,0x1c, 0x00,0x15,0x1c, 0x00,0x0e,0x1c, 0x00,0x07,0x1c,
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400343
Kevin O'Connora959aa12009-05-25 00:12:18 -0400344 0x0e,0x0e,0x1c, 0x11,0x0e,0x1c, 0x15,0x0e,0x1c, 0x18,0x0e,0x1c,
345 0x1c,0x0e,0x1c, 0x1c,0x0e,0x18, 0x1c,0x0e,0x15, 0x1c,0x0e,0x11,
346 0x1c,0x0e,0x0e, 0x1c,0x11,0x0e, 0x1c,0x15,0x0e, 0x1c,0x18,0x0e,
347 0x1c,0x1c,0x0e, 0x18,0x1c,0x0e, 0x15,0x1c,0x0e, 0x11,0x1c,0x0e,
348 0x0e,0x1c,0x0e, 0x0e,0x1c,0x11, 0x0e,0x1c,0x15, 0x0e,0x1c,0x18,
349 0x0e,0x1c,0x1c, 0x0e,0x18,0x1c, 0x0e,0x15,0x1c, 0x0e,0x11,0x1c,
350 0x14,0x14,0x1c, 0x16,0x14,0x1c, 0x18,0x14,0x1c, 0x1a,0x14,0x1c,
351 0x1c,0x14,0x1c, 0x1c,0x14,0x1a, 0x1c,0x14,0x18, 0x1c,0x14,0x16,
352 0x1c,0x14,0x14, 0x1c,0x16,0x14, 0x1c,0x18,0x14, 0x1c,0x1a,0x14,
353 0x1c,0x1c,0x14, 0x1a,0x1c,0x14, 0x18,0x1c,0x14, 0x16,0x1c,0x14,
354 0x14,0x1c,0x14, 0x14,0x1c,0x16, 0x14,0x1c,0x18, 0x14,0x1c,0x1a,
355 0x14,0x1c,0x1c, 0x14,0x1a,0x1c, 0x14,0x18,0x1c, 0x14,0x16,0x1c,
356 0x00,0x00,0x10, 0x04,0x00,0x10, 0x08,0x00,0x10, 0x0c,0x00,0x10,
357 0x10,0x00,0x10, 0x10,0x00,0x0c, 0x10,0x00,0x08, 0x10,0x00,0x04,
358 0x10,0x00,0x00, 0x10,0x04,0x00, 0x10,0x08,0x00, 0x10,0x0c,0x00,
359 0x10,0x10,0x00, 0x0c,0x10,0x00, 0x08,0x10,0x00, 0x04,0x10,0x00,
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400360
Kevin O'Connora959aa12009-05-25 00:12:18 -0400361 0x00,0x10,0x00, 0x00,0x10,0x04, 0x00,0x10,0x08, 0x00,0x10,0x0c,
362 0x00,0x10,0x10, 0x00,0x0c,0x10, 0x00,0x08,0x10, 0x00,0x04,0x10,
363 0x08,0x08,0x10, 0x0a,0x08,0x10, 0x0c,0x08,0x10, 0x0e,0x08,0x10,
364 0x10,0x08,0x10, 0x10,0x08,0x0e, 0x10,0x08,0x0c, 0x10,0x08,0x0a,
365 0x10,0x08,0x08, 0x10,0x0a,0x08, 0x10,0x0c,0x08, 0x10,0x0e,0x08,
366 0x10,0x10,0x08, 0x0e,0x10,0x08, 0x0c,0x10,0x08, 0x0a,0x10,0x08,
367 0x08,0x10,0x08, 0x08,0x10,0x0a, 0x08,0x10,0x0c, 0x08,0x10,0x0e,
368 0x08,0x10,0x10, 0x08,0x0e,0x10, 0x08,0x0c,0x10, 0x08,0x0a,0x10,
369 0x0b,0x0b,0x10, 0x0c,0x0b,0x10, 0x0d,0x0b,0x10, 0x0f,0x0b,0x10,
370 0x10,0x0b,0x10, 0x10,0x0b,0x0f, 0x10,0x0b,0x0d, 0x10,0x0b,0x0c,
371 0x10,0x0b,0x0b, 0x10,0x0c,0x0b, 0x10,0x0d,0x0b, 0x10,0x0f,0x0b,
372 0x10,0x10,0x0b, 0x0f,0x10,0x0b, 0x0d,0x10,0x0b, 0x0c,0x10,0x0b,
373 0x0b,0x10,0x0b, 0x0b,0x10,0x0c, 0x0b,0x10,0x0d, 0x0b,0x10,0x0f,
374 0x0b,0x10,0x10, 0x0b,0x0f,0x10, 0x0b,0x0d,0x10, 0x0b,0x0c,0x10,
375 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
376 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400377};
378
Kevin O'Connor5727c292009-05-16 17:29:32 -0400379
380/****************************************************************
381 * Video mode list
382 ****************************************************************/
383
384#define PAL(x) x, sizeof(x)
385#define VPARAM(x) &video_param_table[x]
386
387static struct vgamode_s vga_modes[] VAR16 = {
Kevin O'Connore4f220f2009-05-25 23:37:13 -0400388 //mode vparam model bits sstart pelm dac
389 {0x00, VPARAM(0x17), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
390 {0x01, VPARAM(0x17), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
391 {0x02, VPARAM(0x18), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
392 {0x03, VPARAM(0x18), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
393 {0x04, VPARAM(0x04), CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
394 {0x05, VPARAM(0x05), CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
395 {0x06, VPARAM(0x06), CGA, 1, SEG_CTEXT, 0xFF, PAL(palette1)},
396 {0x07, VPARAM(0x07), MTEXT, 4, SEG_MTEXT, 0xFF, PAL(palette0)},
397 {0x0D, VPARAM(0x0d), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
398 {0x0E, VPARAM(0x0e), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
399 {0x0F, VPARAM(0x11), PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette0)},
400 {0x10, VPARAM(0x12), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
401 {0x11, VPARAM(0x1a), PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette2)},
402 {0x12, VPARAM(0x1b), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
403 {0x13, VPARAM(0x1c), LINEAR8, 8, SEG_GRAPH, 0xFF, PAL(palette3)},
404 {0x6A, VPARAM(0x1d), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
Kevin O'Connor5727c292009-05-16 17:29:32 -0400405};
406
407struct vgamode_s *
408find_vga_entry(u8 mode)
409{
410 int i;
411 for (i = 0; i < ARRAY_SIZE(vga_modes); i++) {
412 struct vgamode_s *vmode_g = &vga_modes[i];
413 if (GET_GLOBAL(vmode_g->svgamode) == mode)
414 return vmode_g;
415 }
416 return NULL;
417}
418
Kevin O'Connor5727c292009-05-16 17:29:32 -0400419
420/****************************************************************
421 * Static functionality table
422 ****************************************************************/
423
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400424u8 static_functionality[0x10] VAR16 = {
425 /* 0 */ 0xff, // All modes supported #1
426 /* 1 */ 0xe0, // All modes supported #2
427 /* 2 */ 0x0f, // All modes supported #3
428 /* 3 */ 0x00, 0x00, 0x00, 0x00, // reserved
429 /* 7 */ 0x07, // 200, 350, 400 scan lines
430 /* 8 */ 0x02, // mamimum number of visible charsets in text mode
431 /* 9 */ 0x08, // total number of charset blocks in text mode
432 /* a */ 0xe7, // Change to add new functions
433 /* b */ 0x0c, // Change to add new functions
434 /* c */ 0x00, // reserved
435 /* d */ 0x00, // reserved
436 /* e */ 0x00, // Change to add new functions
437 /* f */ 0x00 // reserved
438};