Removed obsolete text mode color and attribute code.
[wine/hacks.git] / dlls / winedos / int10.c
blob3526c38f2a40c49c796be77eb3f91aeda5be6505
1 /*
2 * BIOS interrupt 10h handler
4 * Copyright 1998 Ove Kåven
5 * Copyright 1998 Joseph Pranevich
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
24 #include <stdlib.h>
26 #include "miscemu.h"
27 #include "vga.h"
28 #include "wine/debug.h"
29 #include "console.h"
30 #include "dosexe.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(int);
34 static void scroll_window(int direction, char lines, char row1,
35 char col1, char row2, char col2, char attribute);
37 #define SCROLL_UP 1
38 #define SCROLL_DOWN 2
40 /* FIXME: is row or column first? */
41 static void BIOS_GetCursorPos(BIOSDATA*data,unsigned page,unsigned*X,unsigned*Y)
43 *X = data->VideoCursorPos[page*2];
44 *Y = data->VideoCursorPos[page*2+1];
47 static void BIOS_SetCursorPos(BIOSDATA*data,unsigned page,unsigned X,unsigned Y)
49 data->VideoCursorPos[page*2] = X;
50 data->VideoCursorPos[page*2+1] = Y;
53 /**********************************************************************
54 * DOSVM_Int10Handler (WPROCS.116)
56 * Handler for int 10h (video).
58 * NOTE:
59 * Most INT 10 functions for text-mode, CGA, EGA, and VGA cards
60 * are present in this list. (SVGA and XGA are not) That is not
61 * to say that all these functions should be supported, but if
62 * anyone is brain-damaged enough to want to emulate one of these
63 * beasts then this should get you started.
65 * NOTE:
66 * Several common graphical extensions used by Microsoft hook
67 * off of here. I have *not* added them to this list (yet). They
68 * include:
70 * MSHERC.COM - More functionality for Hercules cards.
71 * EGA.SYS (also MOUSE.COM) - More for EGA cards.
73 * Yes, MS also added this support into their mouse driver. Don't
74 * ask me, I don't work for them.
76 * Joseph Pranevich - 9/98
78 * Jess Haas 2/99
79 * Added support for Vesa. It is not complete but is a start.
80 * NOTE: Im not sure if i did all this right or if eny of it works.
81 * Currently i dont have a program that uses Vesa that actually gets far
82 * enough without crashing to do vesa stuff.
84 * Added additional vga graphic support - 3/99
87 void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
89 BIOSDATA *data = DOSMEM_BiosData();
91 if(AL_reg(context) == 0x4F) { /* VESA functions */
92 switch(AH_reg(context)) {
94 case 0x00: /* GET SuperVGA INFORMATION */
95 FIXME("Vesa Get SuperVGA Info STUB!\n");
96 AL_reg(context) = 0x4f;
97 AH_reg(context) = 0x01; /* 0x01=failed 0x00=succesful */
98 break;
99 case 0x01: /* GET SuperVGA MODE INFORMATION */
100 FIXME("VESA GET SuperVGA Mode Information - Not supported\n");
101 AL_reg(context) = 0x4f;
102 AH_reg(context) = 0x01; /* 0x00 = successful 0x01 = failed */
103 break;
104 case 0x02: /* SET SuperVGA VIDEO MODE */
105 switch(BX_reg(context)) {
106 /* OEM Video Modes */
107 case 0x00: /* 40x25 */
108 case 0x01:
109 TRACE("Set VESA Text Mode - 0x0%x\n",
110 BX_reg(context));
111 VGA_SetAlphaMode(40, 25);
112 data->VideoColumns = 40;
113 break;
114 case 0x02:
115 case 0x03:
116 case 0x07:
117 TRACE("Set VESA Text Mode - 0x0%x\n",
118 BX_reg(context));
119 VGA_SetAlphaMode(80, 25);
120 data->VideoColumns = 80;
121 break;
122 case 0x0D:
123 TRACE("Setting VESA 320x200 16-color mode\n");
124 VGA_SetMode(320,200,4);
125 break;
126 case 0x0E:
127 TRACE("Setting VESA 640x200 16-color mode\n");
128 VGA_SetMode(640,200,4);
129 break;
130 case 0x10:
131 TRACE("Setting VESA 640x350 16-color mode\n");
132 VGA_SetMode(640,350,4);
133 break;
134 case 0x12:
135 TRACE("Setting VESA 640x480 16-color mode\n");
136 VGA_SetMode(640,480,4);
137 break;
138 case 0x13:
139 TRACE("Setting VESA 320x200 256-color mode\n");
140 VGA_SetMode(320,200,8);
141 break;
142 /* VBE Modes */
143 case 0x100:
144 TRACE("Setting VESA 640x400 256-color mode\n");
145 VGA_SetMode(640,400,8);
146 break;
147 case 0x101:
148 TRACE("Setting VESA 640x480 256-color mode\n");
149 VGA_SetMode(640,480,8);
150 break;
151 case 0x102:
152 TRACE("Setting VESA 800x600 16-color mode\n");
153 VGA_SetMode(800,600,4);
154 break;
155 case 0x103:
156 TRACE("Setting VESA 800x600 256-color mode\n");
157 VGA_SetMode(800,600,8);
158 break;
159 case 0x104:
160 TRACE("Setting VESA 1024x768 16-color mode\n");
161 VGA_SetMode(1024,768,4);
162 break;
163 case 0x105:
164 TRACE("Setting VESA 1024x768 256-color mode\n");
165 VGA_SetMode(1024,768,8);
166 break;
167 case 0x106:
168 TRACE("Setting VESA 1280x1024 16-color mode\n");
169 VGA_SetMode(1280,1024,4);
170 break;
171 case 0x107:
172 TRACE("Setting VESA 1280x1024 256-color mode\n");
173 VGA_SetMode(1280,1024,8);
174 break;
175 /* 108h - 10Ch are text modes and im lazy so :p */
176 /* VBE v1.2+ */
177 case 0x10D:
178 TRACE("Setting VESA 320x200 15bpp\n");
179 VGA_SetMode(320,200,15);
180 break;
181 case 0x10E:
182 TRACE("Setting VESA 320x200 16bpp\n");
183 VGA_SetMode(320,200,16);
184 break;
185 case 0x10F:
186 TRACE("Setting VESA 320x200 24bpp\n");
187 VGA_SetMode(320,200,24);
188 break;
189 case 0x110:
190 TRACE("Setting VESA 640x480 15bpp\n");
191 VGA_SetMode(640,480,15);
192 break;
193 case 0x111:
194 TRACE("Setting VESA 640x480 16bpp\n");
195 VGA_SetMode(640,480,16);
196 break;
197 case 0x112:
198 TRACE("Setting VESA 640x480 24bpp\n");
199 VGA_SetMode(640,480,24);
200 break;
201 case 0x113:
202 TRACE("Setting VESA 800x600 15bpp\n");
203 VGA_SetMode(800,600,15);
204 break;
205 case 0x114:
206 TRACE("Setting VESA 800x600 16bpp\n");
207 VGA_SetMode(800,600,16);
208 break;
209 case 0x115:
210 TRACE("Setting VESA 800x600 24bpp\n");
211 VGA_SetMode(800,600,24);
212 break;
213 case 0x116:
214 TRACE("Setting VESA 1024x768 15bpp\n");
215 VGA_SetMode(1024,768,15);
216 break;
217 case 0x117:
218 TRACE("Setting VESA 1024x768 16bpp\n");
219 VGA_SetMode(1024,768,16);
220 break;
221 case 0x118:
222 TRACE("Setting VESA 1024x768 24bpp\n");
223 VGA_SetMode(1024,768,24);
224 break;
225 case 0x119:
226 TRACE("Setting VESA 1280x1024 15bpp\n");
227 VGA_SetMode(1280,1024,15);
228 break;
229 case 0x11A:
230 TRACE("Setting VESA 1280x1024 16bpp\n");
231 VGA_SetMode(1280,1024,16);
232 break;
233 case 0x11B:
234 TRACE("Setting VESA 1280x1024 24bpp\n");
235 VGA_SetMode(1280,1024,24);
236 break;
237 default:
238 FIXME("VESA Set Video Mode (0x%x) - Not Supported\n", BX_reg(context));
240 data->VideoMode = BX_reg(context);
241 AL_reg(context) = 0x4f;
242 AH_reg(context) = 0x00;
243 break;
244 case 0x03: /* VESA SuperVGA BIOS - GET CURRENT VIDEO MODE */
245 AL_reg(context) = 0x4f;
246 AH_reg(context) = 0x00; /* should probly check if a vesa mode has ben set */
247 BX_reg(context) = data->VideoMode;
248 break;
249 case 0x04: /* VESA SuperVGA BIOS - SAVE/RESTORE SuperVGA VIDEO STATE */
250 ERR("VESA SAVE/RESTORE Video State - Not Implemented\n");
251 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
252 /* maybe we should do this instead ? */
253 /* AH_reg(context = 0x01; not implemented so just fail */
254 break;
255 case 0x05: /* VESA SuperVGA BIOS - CPU VIDEO MEMORY CONTROL */
256 ERR("VESA CPU VIDEO MEMORY CONTROL\n");
257 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
258 /* maybe we should do this instead ? */
259 /* AH_reg(context = 0x001; not implemented so just fail */
260 break;
261 case 0x06: /* VESA GET/SET LOGICAL SCAN LINE LENGTH */
262 ERR("VESA GET/SET LOGICAL SCAN LINE LENGTH - Not Implemented\n");
263 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
264 /* maybe we should do this instead ? */
265 /* AH_reg(context = 0x001; not implemented so just fail */
266 break;
267 case 0x07: /* GET/SET DISPLAY START */
268 ERR("VESA GET/SET DISPLAY START - Not Implemented\n");
269 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
270 /* maybe we should do this instead ? */
271 /* AH_reg(context = 0x001; not implemented so just fail */
272 break;
273 case 0x08: /* GET/SET DAC PALETTE CONTROL */
274 ERR("VESA GET/SET DAC PALETTE CONTROL- Not Implemented\n");
275 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
276 /* maybe we should do this instead ? */
277 /* AH_reg(context = 0x001; not implemented so just fail */
278 break;
279 case 0x09: /* SET PALETTE ENTRIES */
280 FIXME("VESA Set palette entries - not implemented\n");
281 break;
282 case 0xef: /* get video mode for hercules-compatibles */
283 /* There's no reason to really support this */
284 /* is there?....................(A.C.) */
285 TRACE("Just report the video not hercules compatible\n");
286 DX_reg(context) = 0xffff;
287 break;
288 case 0xff: /* Turn VESA ON/OFF */
289 /* i dont know what to do */
290 break;
291 default:
292 FIXME("VESA Function (0x%x) - Not Supported\n", AH_reg(context));
293 break;
296 else {
298 switch(AH_reg(context)) {
300 case 0x00: /* SET VIDEO MODE */
301 /* Text Modes: */
302 /* (mode) (text rows/cols)
303 0x00 - 40x25
304 0x01 - 40x25
305 0x02 - 80x25
306 0x03 - 80x25 or 80x43 or 80x50 (assume 80x25)
307 0x07 - 80x25
310 switch (AL_reg(context)) {
311 case 0x00: /* 40x25 */
312 case 0x01:
313 VGA_Exit();
314 TRACE("Set Video Mode - Set to Text - 0x0%x\n",
315 AL_reg(context));
316 VGA_SetAlphaMode(40, 25);
317 data->VideoColumns = 40;
318 break;
319 case 0x02:
320 case 0x03:
321 case 0x07:
322 VGA_Exit();
323 TRACE("Set Video Mode - Set to Text - 0x0%x\n",
324 AL_reg(context));
325 VGA_SetAlphaMode(80, 25);
326 data->VideoColumns = 80;
327 break;
328 case 0x0D:
329 TRACE("Setting VGA 320x200 16-color mode\n");
330 VGA_SetMode(320,200,4);
331 break;
332 case 0x0E:
333 TRACE("Setting VGA 640x200 16-color mode\n");
334 VGA_SetMode(640,200,4);
335 break;
336 case 0x10:
337 TRACE("Setting VGA 640x350 16-color mode\n");
338 VGA_SetMode(640,350,4);
339 break;
340 case 0x12:
341 TRACE("Setting VGA 640x480 16-color mode\n");
342 VGA_SetMode(640,480,4);
343 break;
344 case 0x13:
345 TRACE("Setting VGA 320x200 256-color mode\n");
346 VGA_SetMode(320,200,8);
347 break;
348 default:
349 FIXME("Set Video Mode (0x%x) - Not Supported\n",
350 AL_reg(context));
352 data->VideoMode = AL_reg(context);
353 break;
355 case 0x01: /* SET CURSOR SHAPE */
356 FIXME("Set Cursor Shape - Not Supported\n");
357 break;
359 case 0x02: /* SET CURSOR POSITION */
360 /* BH = Page Number */ /* Not supported */
361 /* DH = Row */ /* 0 is left */
362 /* DL = Column */ /* 0 is top */
363 BIOS_SetCursorPos(data,BH_reg(context),DL_reg(context),DH_reg(context));
364 if (BH_reg(context))
366 FIXME("Set Cursor Position: Cannot set to page %d\n",
367 BH_reg(context));
369 else
371 VGA_SetCursorPos(DL_reg(context), DH_reg(context));
372 TRACE("Set Cursor Position: %d %d\n", DH_reg(context),
373 DL_reg(context));
375 break;
377 case 0x03: /* GET CURSOR POSITION AND SIZE */
379 unsigned row, col;
381 TRACE("Get cursor position and size (page %d)\n", BH_reg(context));
382 CX_reg(context) = data->VideoCursorType;
383 BIOS_GetCursorPos(data,BH_reg(context),&col,&row);
384 DH_reg(context) = row;
385 DL_reg(context) = col;
386 TRACE("Cursor Position: %d %d\n", DH_reg(context), DL_reg(context));
388 break;
390 case 0x04: /* READ LIGHT PEN POSITION */
391 FIXME("Read Light Pen Position - Not Supported\n");
392 AH_reg(context) = 0x00; /* Not down */
393 break;
395 case 0x05: /* SELECT ACTIVE DISPLAY PAGE */
396 FIXME("Select Active Display Page - Not Supported\n");
397 data->VideoCurPage = AL_reg(context);
398 break;
400 case 0x06: /* SCROLL UP WINDOW */
401 /* AL = Lines to scroll */
402 /* BH = Attribute */
403 /* CH,CL = row, col upper-left */
404 /* DH,DL = row, col lower-right */
405 scroll_window(SCROLL_UP, AL_reg(context), CH_reg(context),
406 CL_reg(context), DH_reg(context), DL_reg(context),
407 BH_reg(context));
408 TRACE("Scroll Up Window %d\n", AL_reg(context));
409 break;
411 case 0x07: /* SCROLL DOWN WINDOW */
412 /* AL = Lines to scroll */
413 /* BH = Attribute */
414 /* CH,CL = row, col upper-left */
415 /* DH,DL = row, col lower-right */
416 scroll_window(SCROLL_DOWN, AL_reg(context), CH_reg(context),
417 CL_reg(context), DH_reg(context), DL_reg(context),
418 BH_reg(context));
419 TRACE("Scroll Down Window %d\n", AL_reg(context));
420 break;
422 case 0x08: /* READ CHARACTER AND ATTRIBUTE AT CURSOR POSITION */
424 if (BH_reg(context)) /* Write to different page */
426 FIXME("Read character and attribute at cursor position -"
427 " Can't read from non-0 page\n");
428 AL_reg(context) = ' '; /* That page is blank */
429 AH_reg(context) = 7;
431 else
433 TRACE("Read Character and Attribute at Cursor Position\n");
434 VGA_GetCharacterAtCursor(&AL_reg(context), &AH_reg(context));
437 break;
439 case 0x09: /* WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION */
440 case 0x0a: /* WRITE CHARACTER ONLY AT CURSOR POSITION */
441 /* AL = Character to display. */
442 /* BH = Page Number */ /* We can't write to non-0 pages, yet. */
443 /* BL = Attribute / Color */
444 /* CX = Times to Write Char */
445 /* Note here that the cursor is not advanced. */
447 unsigned row, col;
449 BIOS_GetCursorPos(data,BH_reg(context),&col,&row);
450 VGA_WriteChars(col, row,
451 AL_reg(context),
452 (AH_reg(context) == 0x09) ? BL_reg(context) : -1,
453 CX_reg(context));
454 if (CX_reg(context) > 1)
455 TRACE("Write Character%s at Cursor Position (Rep. %d): %c\n",
456 (AH_reg(context) == 0x09) ? " and Attribute" : "",
457 CX_reg(context), AL_reg(context));
458 else
459 TRACE("Write Character%s at Cursor Position: %c\n",
460 (AH_reg(context) == 0x09) ? " and Attribute" : "",
461 AL_reg(context));
463 break;
465 case 0x0b:
466 switch BH_reg(context) {
467 case 0x00: /* SET BACKGROUND/BORDER COLOR */
468 /* In text modes, this sets only the border... */
469 /* According to the interrupt list and one of my books. */
470 /* Funny though that Beyond Zork seems to indicate that it
471 also sets up the default background attributes for clears
472 and scrolls... */
473 /* Bear in mind here that we do not want to change,
474 apparantly, the foreground or attribute of the background
475 with this call, so we should check first to see what the
476 foreground already is... FIXME */
477 FIXME("Set Background/Border Color: %d\n",
478 BL_reg(context));
479 break;
480 case 0x01: /* SET PALETTE */
481 FIXME("Set Palette - Not Supported\n");
482 break;
483 default:
484 FIXME("INT 10 AH = 0x0b BH = 0x%x - Unknown\n",
485 BH_reg(context));
486 break;
488 break;
490 case 0x0c: /* WRITE GRAPHICS PIXEL */
491 /* Not in graphics mode, can ignore w/o error */
492 FIXME("Write Graphics Pixel - Not Supported\n");
493 break;
495 case 0x0d: /* READ GRAPHICS PIXEL */
496 /* Not in graphics mode, can ignore w/o error */
497 FIXME("Read Graphics Pixel - Not Supported\n");
498 break;
500 case 0x0e: /* TELETYPE OUTPUT */
501 TRACE("Teletype Output\n");
502 DOSVM_PutChar(AL_reg(context));
503 break;
505 case 0x0f: /* GET CURRENT VIDEO MODE */
506 TRACE("Get current video mode\n");
507 /* Note: This should not be a constant value. */
508 AL_reg(context) = data->VideoMode;
509 AH_reg(context) = data->VideoColumns;
510 BH_reg(context) = 0; /* Display page 0 */
511 break;
513 case 0x10:
514 switch AL_reg(context) {
515 case 0x00: /* SET SINGLE PALETTE REGISTER */
516 FIXME("Set Single Palette Register - Not tested\n");
517 /* BH is the value BL is the register */
518 VGA_SetColor16((int)BL_reg(context),(int)BH_reg(context));
519 break;
520 case 0x01: /* SET BORDER (OVERSCAN) */
521 /* Text terminals have no overscan */
522 TRACE("Set Border (Overscan) - Ignored\n");
523 break;
524 case 0x02: /* SET ALL PALETTE REGISTERS */
525 FIXME("Set all palette registers - Not Supported\n");
526 /* DX:ES points to a 17 byte table of colors */
527 /* No return data listed */
528 /* I'll have to update my table and the default palette */
529 break;
530 case 0x03: /* TOGGLE INTENSITY/BLINKING BIT */
531 FIXME("Toggle Intensity/Blinking Bit - Not Supported\n");
532 break;
533 case 0x07: /* GET INDIVIDUAL PALETTE REGISTER */
534 FIXME("Get Individual Palette Register - Not Supported\n");
535 /* BL is register to read [ 0-15 ] BH is return value */
536 break;
537 case 0x08: /* READ OVERSCAN (BORDER COLOR) REGISTER */
538 FIXME(
539 "Read Overscan (Border Color) Register - Not Supported\n");
540 break;
541 case 0x09: /* READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER */
542 FIXME(
543 "Read All Palette Registers and Overscan Register "
544 " - Not Supported\n");
545 break;
546 case 0x10: /* SET INDIVIDUAL DAC REGISTER */
547 FIXME("Set Individual DAC register - Not Supported\n");
548 break;
549 case 0x12: /* SET BLOCK OF DAC REGISTERS */
550 FIXME("Set Block of DAC registers - Not Supported\n");
551 break;
552 case 0x13: /* SELECT VIDEO DAC COLOR PAGE */
553 FIXME("Select video DAC color page - Not Supported\n");
554 break;
555 case 0x15: /* READ INDIVIDUAL DAC REGISTER */
556 FIXME("Read individual DAC register - Not Supported\n");
557 break;
558 case 0x17: /* READ BLOCK OF DAC REGISTERS */
559 FIXME("Read block of DAC registers - Not Supported\n");
560 break;
561 case 0x18: /* SET PEL MASK */
562 FIXME("Set PEL mask - Not Supported\n");
563 break;
564 case 0x19: /* READ PEL MASK */
565 FIXME("Read PEL mask - Not Supported\n");
566 break;
567 case 0x1a: /* GET VIDEO DAC COLOR PAGE STATE */
568 FIXME("Get video DAC color page state - Not Supported\n");
569 break;
570 case 0x1b: /* PERFORM GRAY-SCALE SUMMING */
571 FIXME("Perform Gray-scale summing - Not Supported\n");
572 break;
573 default:
574 FIXME("INT 10 AH = 0x10 AL = 0x%x - Unknown\n",
575 AL_reg(context));
576 break;
578 break;
580 case 0x11: /* TEXT MODE CHARGEN */
581 /* Note that second subfunction is *almost* identical. */
582 /* See INTERRUPT.A for details. */
583 switch AL_reg(context) {
584 case 0x00: /* LOAD USER SPECIFIED PATTERNS */
585 case 0x10:
586 FIXME("Load User Specified Patterns - Not Supported\n");
587 break;
588 case 0x01: /* LOAD ROM MONOCHROME PATTERNS */
589 case 0x11:
590 FIXME("Load ROM Monochrome Patterns - Not Supported\n");
591 break;
592 case 0x02: /* LOAD ROM 8x8 DOUBLE-DOT PATTERNS */
593 case 0x12:
594 FIXME(
595 "Load ROM 8x8 Double Dot Patterns - Not Supported\n");
596 break;
597 case 0x03: /* SET BLOCK SPECIFIER */
598 FIXME("Set Block Specifier - Not Supported\n");
599 break;
600 case 0x04: /* LOAD ROM 8x16 CHARACTER SET */
601 case 0x14:
602 FIXME("Load ROM 8x16 Character Set - Not Supported\n");
603 break;
604 case 0x20: /* SET USER 8x16 GRAPHICS CHARS */
605 FIXME("Set User 8x16 Graphics Chars - Not Supported\n");
606 break;
607 case 0x21: /* SET USER GRAPICS CHARACTERS */
608 FIXME("Set User Graphics Characters - Not Supported\n");
609 break;
610 case 0x22: /* SET ROM 8x14 GRAPHICS CHARS */
611 FIXME("Set ROM 8x14 Graphics Chars - Not Supported\n");
612 break;
613 case 0x23: /* SET ROM 8x8 DBL DOT CHARS */
614 FIXME(
615 "Set ROM 8x8 Dbl Dot Chars (Graphics) - Not Supported\n");
616 break;
617 case 0x24: /* LOAD 8x16 GRAPHIC CHARS */
618 FIXME("Load 8x16 Graphic Chars - Not Supported\n");
619 break;
620 case 0x30: /* GET FONT INFORMATION */
621 FIXME("Get Font Information - Not Supported\n");
622 break;
623 default:
624 FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n",
625 AL_reg(context));
626 break;
628 break;
630 case 0x12: /* ALTERNATE FUNCTION SELECT */
631 switch BL_reg(context) {
632 case 0x10: /* GET EGA INFO */
633 TRACE("EGA info requested\n");
634 BH_reg(context) = 0x00; /* Color screen */
635 BL_reg(context) =
636 data->ModeOptions >> 5; /* EGA memory size */
637 CX_reg(context) =
638 data->FeatureBitsSwitches;
639 break;
640 case 0x20: /* ALTERNATE PRTSC */
641 FIXME("Install Alternate Print Screen - Not Supported\n");
642 break;
643 case 0x30: /* SELECT VERTICAL RESOULTION */
644 FIXME("Select vertical resolution - not supported\n");
645 break;
646 case 0x31: /* ENABLE/DISABLE DEFAULT PALETTE LOADING */
647 FIXME("Default palette loading - not supported\n");
648 data->VGASettings =
649 (data->VGASettings & 0xf7) |
650 ((AL_reg(context) == 1) << 3);
651 break;
652 case 0x32: /* ENABLE/DISABLE VIDEO ADDRERSSING */
653 FIXME("Video Addressing - Not Supported\n");
654 break;
655 case 0x33: /* ENABLE/DISABLE GRAY SCALE SUMMING */
656 FIXME("Gray Scale Summing - Not Supported\n");
657 break;
658 case 0x34: /* ENABLE/DISABLE CURSOR EMULATION */
659 TRACE("Set cursor emulation to %d\n", AL_reg(context));
660 data->ModeOptions =
661 (data->ModeOptions & 0xfe)|(AL_reg(context) == 1);
662 break;
663 case 0x36: /* VIDEO ADDRESS CONTROL */
664 FIXME("Video Address Control - Not Supported\n");
665 break;
666 default:
667 FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n",
668 AL_reg(context));
669 break;
671 break;
673 case 0x13: /* WRITE STRING */
674 /* This one does not imply that string be at cursor. */
675 FIXME("Write String - Not Supported\n");
676 break;
678 case 0x1a:
679 switch AL_reg(context) {
680 case 0x00: /* GET DISPLAY COMBINATION CODE */
681 TRACE("Get Display Combination Code\n");
682 AX_reg(context) = 0x001a;
683 BL_reg(context) = 0x08; /* VGA w/ color analog display */
684 BH_reg(context) = 0x00; /* No secondary hardware */
685 break;
686 case 0x01: /* SET DISPLAY COMBINATION CODE */
687 FIXME("Set Display Combination Code - Not Supported\n");
688 break;
689 default:
690 FIXME("INT 10 AH = 0x1a AL = 0x%x - Unknown\n",
691 AL_reg(context));
692 break;
694 break;
696 case 0x1b: /* FUNCTIONALITY/STATE INFORMATION */
697 FIXME("Get functionality/state information - partially implemented\n");
698 if (BX_reg(context) == 0x0)
700 AL_reg(context) = 0x1b;
701 if (ISV86(context)) /* real */
702 context->SegEs = 0xf000;
703 else
704 context->SegEs = DOSMEM_BiosSysSeg;
705 BX_reg(context) = 0xe000;
707 break;
709 case 0x1c: /* SAVE/RESTORE VIDEO STATE */
710 FIXME("Save/Restore Video State - Not Supported\n");
711 break;
713 case 0x4f: /* Get SuperVGA INFORMATION */
715 BYTE *p =
716 CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edi);
717 /* BOOL16 vesa20 = (*(DWORD *)p == *(DWORD *)"VBE2"); */
719 TRACE("Get SuperVGA information\n");
720 AH_reg(context) = 0;
721 *(DWORD *)p = *(DWORD *)"VESA";
722 *(WORD *)(p+0x04) = 0x0200; /* VESA 2.0 */
723 *(DWORD *)(p+0x06) = 0x00000000; /* pointer to OEM name */
724 *(DWORD *)(p+0x0a) = 0xfffffffd; /* capabilities flags :-) */
726 break;
727 case 0xef: /* get video mode for hercules-compatibles */
728 /* There's no reason to really support this */
729 /* is there?....................(A.C.) */
730 TRACE("Just report the video not hercules compatible\n");
731 DX_reg(context) = 0xffff;
732 break;
733 default:
734 FIXME("Unknown - 0x%x\n", AH_reg(context));
735 INT_BARF( context, 0x10 );
740 static void scroll_window(int direction, char lines, char row1,
741 char col1, char row2, char col2, char attribute)
743 if (!lines) /* Actually, clear the window */
745 VGA_ClearText(row1, col1, row2, col2, attribute);
747 else if (direction == SCROLL_UP)
749 VGA_ScrollUpText(row1, col1, row2, col2, lines, attribute);
751 else
753 VGA_ScrollDownText(row1, col1, row2, col2, lines, attribute);
758 /**********************************************************************
759 * DOSVM_PutChar
763 void WINAPI DOSVM_PutChar(BYTE ascii)
765 BIOSDATA *data = DOSMEM_BiosData();
766 unsigned xpos, ypos;
768 TRACE("char: 0x%02x\n", ascii);
770 VGA_PutChar(ascii);
771 VGA_GetCursorPos(&xpos, &ypos);
772 BIOS_SetCursorPos(data, 0, xpos, ypos);