8 static int driver_init(
char *title,
int w,
int h,
int depth,
int refresh_rate,
int flags);
39 static int driver_init(
char *title,
int w,
int h,
int depth_arg,
int refresh_rate,
int flags)
41 int depth = depth_arg;
49 if (depth != 8)
return -1;
53 if ((w == 320) && (h == 200)) {
57 }
else if ((w == 320) && (h == 100)) {
61 outportb(0x3D5, inportb(0x3D5) | 0x80);
64 }
else if ((w == 256) && (h == 256)) {
67 outportb(0x3D4, 0x11);
68 c = inportb(0x3D5) & 0x7F;
69 outportb(0x3D4, (c << 8) | 0x11);
72 outportb(0x3C2, 0xE3);
73 outportw(0x3D4, 0x5F00);
74 outportw(0x3D4, 0x3F01);
75 outportw(0x3D4, 0x4002);
76 outportw(0x3D4, 0x8203);
77 outportw(0x3D4, 0x4A04);
78 outportw(0x3D4, 0x9A05);
79 outportw(0x3D4, 0x2306);
80 outportw(0x3D4, 0xB207);
81 outportw(0x3D4, 0x0008);
82 outportw(0x3D4, 0x6109);
83 outportw(0x3D4, 0x0A10);
84 outportw(0x3D4, 0xAC11);
85 outportw(0x3D4, 0xFF12);
86 outportw(0x3D4, 0x2013);
87 outportw(0x3D4, 0x4014);
88 outportw(0x3D4, 0x0715);
89 outportw(0x3D4, 0x1A16);
90 outportw(0x3D4, 0xA317);
91 outportw(0x3C4, 0x0101);
92 outportw(0x3C4, 0x0E04);
93 outportw(0x3CE, 0x4005);
94 outportw(0x3CE, 0x0506);
97 outportb(0x3C0, 0x30);
98 outportb(0x3C0, 0x41);
101 outportb(0x3C0, 0x33);
102 outportb(0x3C0, 0x00);
104 outportb(0x3C6, 0xFF);
107 }
else if ((w == 160) && (h == 120)) {
111 outportb(0x3D4, 0x11);
112 outportb(0x3D5, inportb(0x3D5)&0x7F);
113 outportb(0x3D4, 0x04);
114 outportb(0x3D5, inportb(0x3D5)+1);
115 outportb(0x3D4, 0x11);
116 outportb(0x3D5, inportb(0x3D5)|0x80);
118 outportb(0x3C2, (inportb(0x3CC)&~0xC0)|0x80);
120 outportb(0x3D4, 0x11);
121 outportb(0x3D5, inportb(0x3D5)&0x7F);
123 outportb(0x3D4, 0x06);
124 outportb(0x3D5, 0x0B);
126 outportb(0x3D4, 0x07);
127 outportb(0x3D5, 0x3E);
129 outportb(0x3D4, 0x10);
130 outportb(0x3D5, 0xEA);
132 outportb(0x3D4, 0x11);
133 outportb(0x3D5, 0x8C);
135 outportb(0x3D4, 0x12);
136 outportb(0x3D5, 0xDF);
138 outportb(0x3D4, 0x15);
139 outportb(0x3D5, 0xE7);
141 outportb(0x3D4, 0x16);
142 outportb(0x3D5, 0x04);
144 outportb(0x3D4, 0x11);
145 outportb(0x3D5, inportb(0x3D5)|0x80);
147 outportb(0x3CE, 0x05);
148 outportb(0x3CF, (inportb(0x3CF)&0x60)|0x40);
151 outportb(0x3C0, 0x30);
152 outportb(0x3C0, inportb(0x3C1)|0x40);
154 for (c=0; c<16; c++) {
158 outportb(0x3C0, 0x20);
160 outportb(0x3C8, 0x00);
162 outportb(0x3C4, 0x04);
163 outportb(0x3C5, (inportb(0x3C5)&0xF7)|8);
164 outportb(0x3D4, 0x14);
165 outportb(0x3D5, (inportb(0x3D5)&~0x40)|64);
166 outportb(0x3D4, 0x017);
167 outportb(0x3D5, (inportb(0x3D5)&~0x40)|64);
169 outportb(0x3D4, 0x09);
170 outportb(0x3D5, (inportb(0x3D5)&0x60)|3);
173 }
else if ((w == 80) && (h == 80)) {
176 outportw(0x3C4, 0x0604);
177 outportw(0x3C4, 0x0F02);
179 outportw(0x3D4, 0x0014);
180 outportw(0x3D4, 0xE317);
181 outportw(0x3D4, 0xE317);
182 outportw(0x3D4, 0x0409);
193 return fb_dos_init(title, w, h, depth, refresh_rate, flags);
200 unsigned int screen = 0xA0000;
204 movedata(_my_ds(), buffer, _dos_ds, screen,
fb_dos.
w);
212 if (depth != 8)
return NULL;
214 *size =
sizeof(
modes) /
sizeof(
int);