blob: 56a216339555c0dd8aa999b2795e51b58f880aed [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'Connor5727c292009-05-16 17:29:32 -040016struct VideoParam_s video_param_table[] VAR16 = {
Kevin O'Connor1f2c3072009-05-06 23:35:59 -040017 // index=0x00 no mode defined
18 {},
19 // index=0x01 no mode defined
20 {},
21 // index=0x02 no mode defined
22 {},
23 // index=0x03 no mode defined
24 {},
25 // index=0x04 vga mode 0x04
26 { 40, 24, 8, 0x0800, /* tw, th-1, ch, slength */
27 { 0x09, 0x03, 0x00, 0x02 }, /* sequ_regs */
28 0x63, /* miscreg */
29 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
30 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2,
32 0xff }, /* crtc_regs */
33 { 0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,
34 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
35 0x01, 0x00, 0x03, 0x00 }, /* actl_regs */
36 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff }, /* grdc_regs */
37 },
38 /* index=0x05 vga mode 0x05 */
39 { 40, 24, 8, 0x0800, /* tw, th-1, ch, slength */
40 { 0x09, 0x03, 0x00, 0x02 }, /* sequ_regs */
41 0x63, /* miscreg */
42 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
43 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
44 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2,
45 0xff }, /* crtc_regs */
46 { 0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,
47 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
48 0x01, 0x00, 0x03, 0x00 }, /* actl_regs */
49 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff }, /* grdc_regs */
50 },
51 /* index=0x06 vga mode 0x06 */
52 { 80, 24, 8, 0x1000, /* tw, th-1, ch, slength */
53 { 0x01, 0x01, 0x00, 0x06 }, /* sequ_regs */
54 0x63, /* miscreg */
55 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
56 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xc2,
58 0xff }, /* crtc_regs */
59 { 0x00, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
60 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
61 0x01, 0x00, 0x01, 0x00 }, /* actl_regs */
62 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0xff }, /* grdc_regs */
63 },
64 /* index=0x07 vga mode 0x07 */
65 { 80, 24, 16, 0x1000, /* tw, th-1, ch, slength */
66 { 0x00, 0x03, 0x00, 0x02 }, /* sequ_regs */
67 0x66, /* miscreg */
68 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
69 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
70 0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3,
71 0xff }, /* crtc_regs */
72 { 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
73 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
74 0x0e, 0x00, 0x0f, 0x08 }, /* actl_regs */
75 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff }, /* grdc_regs */
76 },
77 /* index=0x08 no mode defined */
78 {},
79 /* index=0x09 no mode defined */
80 {},
81 /* index=0x0a no mode defined */
82 {},
83 /* index=0x0b no mode defined */
84 {},
85 /* index=0x0c no mode defined */
86 {},
87 /* index=0x0d vga mode 0x0d */
88 { 40, 24, 8, 0x2000, /* tw, th-1, ch, slength */
89 { 0x09, 0x0f, 0x00, 0x06 }, /* sequ_regs */
90 0x63, /* miscreg */
91 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
92 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xe3,
94 0xff }, /* crtc_regs */
95 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
96 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
97 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
98 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
99 },
100 /* index=0x0e vga mode 0x0e */
101 { 80, 24, 8, 0x4000, /* tw, th-1, ch, slength */
102 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
103 0x63, /* miscreg */
104 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
105 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
106 0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xe3,
107 0xff }, /* crtc_regs */
108 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
109 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
110 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
111 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
112 },
113 /* index=0x0f no mode defined */
114 {},
115 /* index=0x10 no mode defined */
116 {},
117 /* index=0x11 vga mode 0x0f */
118 { 80, 24, 14, 0x8000, /* tw, th-1, ch, slength */
119 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
120 0xa3, /* miscreg */
121 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
122 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123 0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3,
124 0xff }, /* crtc_regs */
125 { 0x00, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
126 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
127 0x01, 0x00, 0x01, 0x00 }, /* actl_regs */
128 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
129 },
130 /* index=0x12 vga mode 0x10 */
131 { 80, 24, 14, 0x8000, /* tw, th-1, ch, slength */
132 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
133 0xa3, /* miscreg */
134 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
135 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
136 0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3,
137 0xff }, /* crtc_regs */
138 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
139 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
140 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
141 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
142 },
143 /* index=0x13 no mode defined */
144 {},
145 /* index=0x14 no mode defined */
146 {},
147 /* index=0x15 no mode defined */
148 {},
149 /* index=0x16 no mode defined */
150 {},
151 /* index=0x17 vga mode 0x01 */
152 { 40, 24, 16, 0x0800, /* tw, th-1, ch, slength */
153 { 0x08, 0x03, 0x00, 0x02 }, /* sequ_regs */
154 0x67, /* miscreg */
155 { 0x2d, 0x27, 0x28, 0x90, 0x2b, 0xa0, 0xbf, 0x1f,
156 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
157 0x9c, 0x8e, 0x8f, 0x14, 0x1f, 0x96, 0xb9, 0xa3,
158 0xff }, /* crtc_regs */
159 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
160 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
161 0x0c, 0x00, 0x0f, 0x08 }, /* actl_regs */
162 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff }, /* grdc_regs */
163 },
164 /* index=0x18 vga mode 0x03 */
165 { 80, 24, 16, 0x1000, /* tw, th-1, ch, slength */
166 { 0x00, 0x03, 0x00, 0x02 }, /* sequ_regs */
167 0x67, /* miscreg */
168 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
169 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
170 0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
171 0xff }, /* crtc_regs */
172 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
173 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
174 0x0c, 0x00, 0x0f, 0x08 }, /* actl_regs */
175 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff }, /* grdc_regs */
176 },
177 /* index=0x19 vga mode 0x07 */
178 { 80, 24, 16, 0x1000, /* tw, th-1, ch, slength */
179 { 0x00, 0x03, 0x00, 0x02 }, /* sequ_regs */
180 0x66, /* miscreg */
181 { 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
182 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
183 0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3,
184 0xff }, /* crtc_regs */
185 { 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
186 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
187 0x0e, 0x00, 0x0f, 0x08 }, /* actl_regs */
188 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff }, /* grdc_regs */
189 },
190 /* index=0x1a vga mode 0x11 */
191 { 80, 29, 16, 0x0000, /* tw, th-1, ch, slength */
192 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
193 0xe3, /* miscreg */
194 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
195 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
196 0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
197 0xff }, /* crtc_regs */
198 { 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f,
199 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f,
200 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
201 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
202 },
203 /* index=0x1b vga mode 0x12 */
204 { 80, 29, 16, 0x0000, /* tw, th-1, ch, slength */
205 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
206 0xe3, /* miscreg */
207 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
208 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
209 0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
210 0xff }, /* crtc_regs */
211 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
212 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
213 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
214 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
215 },
216 /* index=0x1c vga mode 0x13 */
217 { 40, 24, 8, 0x0000, /* tw, th-1, ch, slength */
218 { 0x01, 0x0f, 0x00, 0x0e }, /* sequ_regs */
219 0x63, /* miscreg */
220 { 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
221 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
222 0x9c, 0x8e, 0x8f, 0x28, 0x40, 0x96, 0xb9, 0xa3,
223 0xff }, /* crtc_regs */
224 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
225 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
226 0x41, 0x00, 0x0f, 0x00 }, /* actl_regs */
227 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff }, /* grdc_regs */
228 },
229 /* index=0x1d vga mode 0x6a */
230 { 100, 36, 16, 0x0000, /* tw, th-1, ch, slength */
231 { 0x01, 0x0f, 0x00, 0x06 }, /* sequ_regs */
232 0xe3, /* miscreg */
233 { 0x7f, 0x63, 0x63, 0x83, 0x6b, 0x1b, 0x72, 0xf0,
234 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
235 0x59, 0x8d, 0x57, 0x32, 0x00, 0x57, 0x73, 0xe3,
236 0xff }, /* crtc_regs */
237 { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
238 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
239 0x01, 0x00, 0x0f, 0x00 }, /* actl_regs */
240 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff }, /* grdc_regs */
241 },
242};
243
Kevin O'Connor5727c292009-05-16 17:29:32 -0400244
245/****************************************************************
246 * Palette definitions
247 ****************************************************************/
248
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400249/* Mono */
Kevin O'Connor5727c292009-05-16 17:29:32 -0400250static u8 palette0[] VAR16 = {
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400251 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
252 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
253 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
254 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
255 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
256 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 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, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
Kevin O'Connor5727c292009-05-16 17:29:32 -0400258 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400259};
260
Kevin O'Connor5727c292009-05-16 17:29:32 -0400261static u8 palette1[] VAR16 = {
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400262 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
263 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
264 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
265 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
266 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
267 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
268 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
Kevin O'Connor5727c292009-05-16 17:29:32 -0400269 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400270};
271
Kevin O'Connor5727c292009-05-16 17:29:32 -0400272static u8 palette2[] VAR16 = {
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400273 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x2a,0x00, 0x2a,0x2a,0x2a,
274 0x00,0x00,0x15, 0x00,0x00,0x3f, 0x00,0x2a,0x15, 0x00,0x2a,0x3f, 0x2a,0x00,0x15, 0x2a,0x00,0x3f, 0x2a,0x2a,0x15, 0x2a,0x2a,0x3f,
275 0x00,0x15,0x00, 0x00,0x15,0x2a, 0x00,0x3f,0x00, 0x00,0x3f,0x2a, 0x2a,0x15,0x00, 0x2a,0x15,0x2a, 0x2a,0x3f,0x00, 0x2a,0x3f,0x2a,
276 0x00,0x15,0x15, 0x00,0x15,0x3f, 0x00,0x3f,0x15, 0x00,0x3f,0x3f, 0x2a,0x15,0x15, 0x2a,0x15,0x3f, 0x2a,0x3f,0x15, 0x2a,0x3f,0x3f,
277 0x15,0x00,0x00, 0x15,0x00,0x2a, 0x15,0x2a,0x00, 0x15,0x2a,0x2a, 0x3f,0x00,0x00, 0x3f,0x00,0x2a, 0x3f,0x2a,0x00, 0x3f,0x2a,0x2a,
278 0x15,0x00,0x15, 0x15,0x00,0x3f, 0x15,0x2a,0x15, 0x15,0x2a,0x3f, 0x3f,0x00,0x15, 0x3f,0x00,0x3f, 0x3f,0x2a,0x15, 0x3f,0x2a,0x3f,
279 0x15,0x15,0x00, 0x15,0x15,0x2a, 0x15,0x3f,0x00, 0x15,0x3f,0x2a, 0x3f,0x15,0x00, 0x3f,0x15,0x2a, 0x3f,0x3f,0x00, 0x3f,0x3f,0x2a,
Kevin O'Connor5727c292009-05-16 17:29:32 -0400280 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400281};
282
Kevin O'Connor5727c292009-05-16 17:29:32 -0400283static u8 palette3[] VAR16 = {
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400284 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a, 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
285 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f, 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
286 0x00,0x00,0x00, 0x05,0x05,0x05, 0x08,0x08,0x08, 0x0b,0x0b,0x0b, 0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x1c, 0x1a,0x14,0x1c, 0x1c,0x14,0x1c, 0x1c,0x14,0x1a, 0x1c,0x14,0x18, 0x1c,0x14,0x16,
306 0x1c,0x14,0x14, 0x1c,0x16,0x14, 0x1c,0x18,0x14, 0x1c,0x1a,0x14, 0x1c,0x1c,0x14, 0x1a,0x1c,0x14, 0x18,0x1c,0x14, 0x16,0x1c,0x14,
307 0x14,0x1c,0x14, 0x14,0x1c,0x16, 0x14,0x1c,0x18, 0x14,0x1c,0x1a, 0x14,0x1c,0x1c, 0x14,0x1a,0x1c, 0x14,0x18,0x1c, 0x14,0x16,0x1c,
308 0x00,0x00,0x10, 0x04,0x00,0x10, 0x08,0x00,0x10, 0x0c,0x00,0x10, 0x10,0x00,0x10, 0x10,0x00,0x0c, 0x10,0x00,0x08, 0x10,0x00,0x04,
309 0x10,0x00,0x00, 0x10,0x04,0x00, 0x10,0x08,0x00, 0x10,0x0c,0x00, 0x10,0x10,0x00, 0x0c,0x10,0x00, 0x08,0x10,0x00, 0x04,0x10,0x00,
310
311 0x00,0x10,0x00, 0x00,0x10,0x04, 0x00,0x10,0x08, 0x00,0x10,0x0c, 0x00,0x10,0x10, 0x00,0x0c,0x10, 0x00,0x08,0x10, 0x00,0x04,0x10,
312 0x08,0x08,0x10, 0x0a,0x08,0x10, 0x0c,0x08,0x10, 0x0e,0x08,0x10, 0x10,0x08,0x10, 0x10,0x08,0x0e, 0x10,0x08,0x0c, 0x10,0x08,0x0a,
313 0x10,0x08,0x08, 0x10,0x0a,0x08, 0x10,0x0c,0x08, 0x10,0x0e,0x08, 0x10,0x10,0x08, 0x0e,0x10,0x08, 0x0c,0x10,0x08, 0x0a,0x10,0x08,
314 0x08,0x10,0x08, 0x08,0x10,0x0a, 0x08,0x10,0x0c, 0x08,0x10,0x0e, 0x08,0x10,0x10, 0x08,0x0e,0x10, 0x08,0x0c,0x10, 0x08,0x0a,0x10,
315 0x0b,0x0b,0x10, 0x0c,0x0b,0x10, 0x0d,0x0b,0x10, 0x0f,0x0b,0x10, 0x10,0x0b,0x10, 0x10,0x0b,0x0f, 0x10,0x0b,0x0d, 0x10,0x0b,0x0c,
316 0x10,0x0b,0x0b, 0x10,0x0c,0x0b, 0x10,0x0d,0x0b, 0x10,0x0f,0x0b, 0x10,0x10,0x0b, 0x0f,0x10,0x0b, 0x0d,0x10,0x0b, 0x0c,0x10,0x0b,
317 0x0b,0x10,0x0b, 0x0b,0x10,0x0c, 0x0b,0x10,0x0d, 0x0b,0x10,0x0f, 0x0b,0x10,0x10, 0x0b,0x0f,0x10, 0x0b,0x0d,0x10, 0x0b,0x0c,0x10,
318 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00
319};
320
Kevin O'Connor5727c292009-05-16 17:29:32 -0400321
322/****************************************************************
323 * Video mode list
324 ****************************************************************/
325
326#define PAL(x) x, sizeof(x)
327#define VPARAM(x) &video_param_table[x]
328
329static struct vgamode_s vga_modes[] VAR16 = {
330 //mode vparam class model bits sstart pelm dac
Kevin O'Connord113a992009-05-16 21:05:02 -0400331 {0x00, VPARAM(0x17), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
332 {0x01, VPARAM(0x17), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
333 {0x02, VPARAM(0x18), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
334 {0x03, VPARAM(0x18), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
335 {0x04, VPARAM(0x04), GRAPH, CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
336 {0x05, VPARAM(0x05), GRAPH, CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
337 {0x06, VPARAM(0x06), GRAPH, CGA, 1, SEG_CTEXT, 0xFF, PAL(palette1)},
338 {0x07, VPARAM(0x07), TEXT, MTEXT, 4, SEG_MTEXT, 0xFF, PAL(palette0)},
339 {0x0D, VPARAM(0x0d), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
340 {0x0E, VPARAM(0x0e), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
341 {0x0F, VPARAM(0x11), GRAPH, PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette0)},
342 {0x10, VPARAM(0x12), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
343 {0x11, VPARAM(0x1a), GRAPH, PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette2)},
344 {0x12, VPARAM(0x1b), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
345 {0x13, VPARAM(0x1c), GRAPH, LINEAR8, 8, SEG_GRAPH, 0xFF, PAL(palette3)},
346 {0x6A, VPARAM(0x1d), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
Kevin O'Connor5727c292009-05-16 17:29:32 -0400347};
348
349struct vgamode_s *
350find_vga_entry(u8 mode)
351{
352 int i;
353 for (i = 0; i < ARRAY_SIZE(vga_modes); i++) {
354 struct vgamode_s *vmode_g = &vga_modes[i];
355 if (GET_GLOBAL(vmode_g->svgamode) == mode)
356 return vmode_g;
357 }
358 return NULL;
359}
360
361u16 video_save_pointer_table[14] VAR16;
362
363
364/****************************************************************
365 * Static functionality table
366 ****************************************************************/
367
Kevin O'Connor1f2c3072009-05-06 23:35:59 -0400368u8 static_functionality[0x10] VAR16 = {
369 /* 0 */ 0xff, // All modes supported #1
370 /* 1 */ 0xe0, // All modes supported #2
371 /* 2 */ 0x0f, // All modes supported #3
372 /* 3 */ 0x00, 0x00, 0x00, 0x00, // reserved
373 /* 7 */ 0x07, // 200, 350, 400 scan lines
374 /* 8 */ 0x02, // mamimum number of visible charsets in text mode
375 /* 9 */ 0x08, // total number of charset blocks in text mode
376 /* a */ 0xe7, // Change to add new functions
377 /* b */ 0x0c, // Change to add new functions
378 /* c */ 0x00, // reserved
379 /* d */ 0x00, // reserved
380 /* e */ 0x00, // Change to add new functions
381 /* f */ 0x00 // reserved
382};