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
28 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(int);
33 static void scroll_window(int direction
, char lines
, char row1
,
34 char col1
, char row2
, char col2
, char attribute
);
39 /* FIXME: is row or column first? */
40 static void BIOS_GetCursorPos(BIOSDATA
*data
,unsigned page
,unsigned*X
,unsigned*Y
)
42 *X
= data
->VideoCursorPos
[page
*2];
43 *Y
= data
->VideoCursorPos
[page
*2+1];
46 static void BIOS_SetCursorPos(BIOSDATA
*data
,unsigned page
,unsigned X
,unsigned Y
)
48 data
->VideoCursorPos
[page
*2] = X
;
49 data
->VideoCursorPos
[page
*2+1] = Y
;
52 /**********************************************************************
53 * DOSVM_Int10Handler (WPROCS.116)
55 * Handler for int 10h (video).
58 * Most INT 10 functions for text-mode, CGA, EGA, and VGA cards
59 * are present in this list. (SVGA and XGA are not) That is not
60 * to say that all these functions should be supported, but if
61 * anyone is brain-damaged enough to want to emulate one of these
62 * beasts then this should get you started.
65 * Several common graphical extensions used by Microsoft hook
66 * off of here. I have *not* added them to this list (yet). They
69 * MSHERC.COM - More functionality for Hercules cards.
70 * EGA.SYS (also MOUSE.COM) - More for EGA cards.
72 * Yes, MS also added this support into their mouse driver. Don't
73 * ask me, I don't work for them.
75 * Joseph Pranevich - 9/98
78 * Added support for Vesa. It is not complete but is a start.
79 * NOTE: Im not sure if i did all this right or if eny of it works.
80 * Currently i dont have a program that uses Vesa that actually gets far
81 * enough without crashing to do vesa stuff.
83 * Added additional vga graphic support - 3/99
86 void WINAPI
DOSVM_Int10Handler( CONTEXT86
*context
)
88 BIOSDATA
*data
= DOSMEM_BiosData();
90 if(AH_reg(context
) == 0x4F) { /* VESA functions */
91 switch(AL_reg(context
)) {
93 case 0x00: /* GET SuperVGA INFORMATION */
94 TRACE("VESA GET SuperVGA INFORMATION\n");
95 memcpy(CTX_SEG_OFF_TO_LIN(context
,context
->SegEs
,context
->Edi
),
96 DOSMEM_BiosSys()+DOSMEM_GetBiosSysStructOffset(OFF_VESAINFO
),sizeof(VESAINFO
));
97 AL_reg(context
) = 0x4f;
98 AH_reg(context
) = 0x00; /* 0x00 = successful 0x01 = failed */
101 case 0x01: /* GET SuperVGA MODE INFORMATION */
102 FIXME("VESA GET SuperVGA Mode Information - Not supported\n");
103 AL_reg(context
) = 0x4f;
104 AH_reg(context
) = 0x01; /* 0x00 = successful 0x01 = failed */
106 case 0x02: /* SET SuperVGA VIDEO MODE */
107 switch(BX_reg(context
)) {
108 /* OEM Video Modes */
109 case 0x00: /* 40x25 */
111 TRACE("Set VESA Text Mode - 0x0%x\n",
113 VGA_SetAlphaMode(40, 25);
114 data
->VideoColumns
= 40;
119 TRACE("Set VESA Text Mode - 0x0%x\n",
121 VGA_SetAlphaMode(80, 25);
122 data
->VideoColumns
= 80;
125 TRACE("Setting VESA 320x200 16-color mode\n");
126 VGA_SetMode(320,200,4);
129 TRACE("Setting VESA 640x200 16-color mode\n");
130 VGA_SetMode(640,200,4);
133 TRACE("Setting VESA 640x350 16-color mode\n");
134 VGA_SetMode(640,350,4);
137 TRACE("Setting VESA 640x480 16-color mode\n");
138 VGA_SetMode(640,480,4);
141 TRACE("Setting VESA 320x200 256-color mode\n");
142 VGA_SetMode(320,200,8);
146 TRACE("Setting VESA 640x400 256-color mode\n");
147 VGA_SetMode(640,400,8);
150 TRACE("Setting VESA 640x480 256-color mode\n");
151 VGA_SetMode(640,480,8);
154 TRACE("Setting VESA 800x600 16-color mode\n");
155 VGA_SetMode(800,600,4);
158 TRACE("Setting VESA 800x600 256-color mode\n");
159 VGA_SetMode(800,600,8);
162 TRACE("Setting VESA 1024x768 16-color mode\n");
163 VGA_SetMode(1024,768,4);
166 TRACE("Setting VESA 1024x768 256-color mode\n");
167 VGA_SetMode(1024,768,8);
170 TRACE("Setting VESA 1280x1024 16-color mode\n");
171 VGA_SetMode(1280,1024,4);
174 TRACE("Setting VESA 1280x1024 256-color mode\n");
175 VGA_SetMode(1280,1024,8);
177 /* 108h - 10Ch are text modes and im lazy so :p */
180 TRACE("Setting VESA 320x200 15bpp\n");
181 VGA_SetMode(320,200,15);
184 TRACE("Setting VESA 320x200 16bpp\n");
185 VGA_SetMode(320,200,16);
188 TRACE("Setting VESA 320x200 24bpp\n");
189 VGA_SetMode(320,200,24);
192 TRACE("Setting VESA 640x480 15bpp\n");
193 VGA_SetMode(640,480,15);
196 TRACE("Setting VESA 640x480 16bpp\n");
197 VGA_SetMode(640,480,16);
200 TRACE("Setting VESA 640x480 24bpp\n");
201 VGA_SetMode(640,480,24);
204 TRACE("Setting VESA 800x600 15bpp\n");
205 VGA_SetMode(800,600,15);
208 TRACE("Setting VESA 800x600 16bpp\n");
209 VGA_SetMode(800,600,16);
212 TRACE("Setting VESA 800x600 24bpp\n");
213 VGA_SetMode(800,600,24);
216 TRACE("Setting VESA 1024x768 15bpp\n");
217 VGA_SetMode(1024,768,15);
220 TRACE("Setting VESA 1024x768 16bpp\n");
221 VGA_SetMode(1024,768,16);
224 TRACE("Setting VESA 1024x768 24bpp\n");
225 VGA_SetMode(1024,768,24);
228 TRACE("Setting VESA 1280x1024 15bpp\n");
229 VGA_SetMode(1280,1024,15);
232 TRACE("Setting VESA 1280x1024 16bpp\n");
233 VGA_SetMode(1280,1024,16);
236 TRACE("Setting VESA 1280x1024 24bpp\n");
237 VGA_SetMode(1280,1024,24);
240 FIXME("VESA Set Video Mode (0x%x) - Not Supported\n", BX_reg(context
));
242 data
->VideoMode
= BX_reg(context
);
243 AL_reg(context
) = 0x4f;
244 AH_reg(context
) = 0x00;
246 case 0x03: /* VESA SuperVGA BIOS - GET CURRENT VIDEO MODE */
247 AL_reg(context
) = 0x4f;
248 AH_reg(context
) = 0x00; /* should probly check if a vesa mode has ben set */
249 BX_reg(context
) = data
->VideoMode
;
251 case 0x04: /* VESA SuperVGA BIOS - SAVE/RESTORE SuperVGA VIDEO STATE */
252 ERR("VESA SAVE/RESTORE Video State - Not Implemented\n");
253 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
254 /* maybe we should do this instead ? */
255 /* AH_reg(context = 0x01; not implemented so just fail */
257 case 0x05: /* VESA SuperVGA BIOS - CPU VIDEO MEMORY CONTROL */
258 ERR("VESA CPU VIDEO MEMORY CONTROL\n");
259 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
260 /* maybe we should do this instead ? */
261 /* AH_reg(context = 0x001; not implemented so just fail */
263 case 0x06: /* VESA GET/SET LOGICAL SCAN LINE LENGTH */
264 ERR("VESA GET/SET LOGICAL SCAN LINE LENGTH - Not Implemented\n");
265 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
266 /* maybe we should do this instead ? */
267 /* AH_reg(context = 0x001; not implemented so just fail */
269 case 0x07: /* GET/SET DISPLAY START */
270 ERR("VESA GET/SET DISPLAY START - Not Implemented\n");
271 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
272 /* maybe we should do this instead ? */
273 /* AH_reg(context = 0x001; not implemented so just fail */
275 case 0x08: /* GET/SET DAC PALETTE CONTROL */
276 ERR("VESA GET/SET DAC PALETTE CONTROL- Not Implemented\n");
277 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
278 /* maybe we should do this instead ? */
279 /* AH_reg(context = 0x001; not implemented so just fail */
281 case 0x09: /* SET PALETTE ENTRIES */
282 FIXME("VESA Set palette entries - not implemented\n");
284 case 0xef: /* get video mode for hercules-compatibles */
285 /* There's no reason to really support this */
286 /* is there?....................(A.C.) */
287 TRACE("Just report the video not hercules compatible\n");
288 DX_reg(context
) = 0xffff;
290 case 0xff: /* Turn VESA ON/OFF */
291 /* i dont know what to do */
294 FIXME("VESA Function (0x%x) - Not Supported\n", AH_reg(context
));
300 switch(AH_reg(context
)) {
302 case 0x00: /* SET VIDEO MODE */
304 /* (mode) (text rows/cols)
308 0x03 - 80x25 or 80x43 or 80x50 (assume 80x25)
312 /* Bit 7 of AH = 0 -> Clean the video memory
315 if (!(AL_reg(context
)&0x80)) {
316 /* FIXME: Do something which cleans the video memory */
319 /* FIXME: Should we keep the bit 7 in the Bios Data memory? */
320 AL_reg(context
) &= ~0x80;
322 switch (AL_reg(context
)) {
323 case 0x00: /* 40x25 */
326 TRACE("Set Video Mode - Set to Text - 0x0%x\n",
328 VGA_SetAlphaMode(40, 25);
329 data
->VideoColumns
= 40;
335 TRACE("Set Video Mode - Set to Text - 0x0%x\n",
337 VGA_SetAlphaMode(80, 25);
338 data
->VideoColumns
= 80;
341 TRACE("Setting VGA 320x200 16-color mode\n");
342 VGA_SetMode(320,200,4);
345 TRACE("Setting VGA 640x200 16-color mode\n");
346 VGA_SetMode(640,200,4);
349 TRACE("Setting VGA 640x350 16-color mode\n");
350 VGA_SetMode(640,350,4);
353 TRACE("Setting VGA 640x480 16-color mode\n");
354 VGA_SetMode(640,480,4);
357 TRACE("Setting VGA 320x200 256-color mode\n");
358 VGA_SetMode(320,200,8);
361 FIXME("Set Video Mode (0x%x) - Not Supported\n",
364 data
->VideoMode
= AL_reg(context
);
367 case 0x01: /* SET CURSOR SHAPE */
368 FIXME("Set Cursor Shape - Not Supported\n");
371 case 0x02: /* SET CURSOR POSITION */
372 /* BH = Page Number */ /* Not supported */
373 /* DH = Row */ /* 0 is left */
374 /* DL = Column */ /* 0 is top */
375 BIOS_SetCursorPos(data
,BH_reg(context
),DL_reg(context
),DH_reg(context
));
378 FIXME("Set Cursor Position: Cannot set to page %d\n",
383 VGA_SetCursorPos(DL_reg(context
), DH_reg(context
));
384 TRACE("Set Cursor Position: %d %d\n", DH_reg(context
),
389 case 0x03: /* GET CURSOR POSITION AND SIZE */
393 TRACE("Get cursor position and size (page %d)\n", BH_reg(context
));
394 CX_reg(context
) = data
->VideoCursorType
;
395 BIOS_GetCursorPos(data
,BH_reg(context
),&col
,&row
);
396 DH_reg(context
) = row
;
397 DL_reg(context
) = col
;
398 TRACE("Cursor Position: %d %d\n", DH_reg(context
), DL_reg(context
));
402 case 0x04: /* READ LIGHT PEN POSITION */
403 FIXME("Read Light Pen Position - Not Supported\n");
404 AH_reg(context
) = 0x00; /* Not down */
407 case 0x05: /* SELECT ACTIVE DISPLAY PAGE */
408 FIXME("Select Active Display Page - Not Supported\n");
409 data
->VideoCurPage
= AL_reg(context
);
412 case 0x06: /* SCROLL UP WINDOW */
413 /* AL = Lines to scroll */
415 /* CH,CL = row, col upper-left */
416 /* DH,DL = row, col lower-right */
417 scroll_window(SCROLL_UP
, AL_reg(context
), CH_reg(context
),
418 CL_reg(context
), DH_reg(context
), DL_reg(context
),
420 TRACE("Scroll Up Window %d\n", AL_reg(context
));
423 case 0x07: /* SCROLL DOWN WINDOW */
424 /* AL = Lines to scroll */
426 /* CH,CL = row, col upper-left */
427 /* DH,DL = row, col lower-right */
428 scroll_window(SCROLL_DOWN
, AL_reg(context
), CH_reg(context
),
429 CL_reg(context
), DH_reg(context
), DL_reg(context
),
431 TRACE("Scroll Down Window %d\n", AL_reg(context
));
434 case 0x08: /* READ CHARACTER AND ATTRIBUTE AT CURSOR POSITION */
436 if (BH_reg(context
)) /* Write to different page */
438 FIXME("Read character and attribute at cursor position -"
439 " Can't read from non-0 page\n");
440 AL_reg(context
) = ' '; /* That page is blank */
445 TRACE("Read Character and Attribute at Cursor Position\n");
446 VGA_GetCharacterAtCursor(&AL_reg(context
), &AH_reg(context
));
451 case 0x09: /* WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION */
452 case 0x0a: /* WRITE CHARACTER ONLY AT CURSOR POSITION */
453 /* AL = Character to display. */
454 /* BH = Page Number */ /* We can't write to non-0 pages, yet. */
455 /* BL = Attribute / Color */
456 /* CX = Times to Write Char */
457 /* Note here that the cursor is not advanced. */
461 BIOS_GetCursorPos(data
,BH_reg(context
),&col
,&row
);
462 VGA_WriteChars(col
, row
,
464 (AH_reg(context
) == 0x09) ? BL_reg(context
) : -1,
466 if (CX_reg(context
) > 1)
467 TRACE("Write Character%s at Cursor Position (Rep. %d): %c\n",
468 (AH_reg(context
) == 0x09) ? " and Attribute" : "",
469 CX_reg(context
), AL_reg(context
));
471 TRACE("Write Character%s at Cursor Position: %c\n",
472 (AH_reg(context
) == 0x09) ? " and Attribute" : "",
478 switch BH_reg(context
) {
479 case 0x00: /* SET BACKGROUND/BORDER COLOR */
480 /* In text modes, this sets only the border... */
481 /* According to the interrupt list and one of my books. */
482 /* Funny though that Beyond Zork seems to indicate that it
483 also sets up the default background attributes for clears
485 /* Bear in mind here that we do not want to change,
486 apparantly, the foreground or attribute of the background
487 with this call, so we should check first to see what the
488 foreground already is... FIXME */
489 FIXME("Set Background/Border Color: %d\n",
492 case 0x01: /* SET PALETTE */
493 FIXME("Set Palette - Not Supported\n");
496 FIXME("INT 10 AH = 0x0b BH = 0x%x - Unknown\n",
502 case 0x0c: /* WRITE GRAPHICS PIXEL */
503 /* Not in graphics mode, can ignore w/o error */
504 FIXME("Write Graphics Pixel - Not Supported\n");
507 case 0x0d: /* READ GRAPHICS PIXEL */
508 /* Not in graphics mode, can ignore w/o error */
509 FIXME("Read Graphics Pixel - Not Supported\n");
512 case 0x0e: /* TELETYPE OUTPUT */
513 TRACE("Teletype Output\n");
514 DOSVM_PutChar(AL_reg(context
));
517 case 0x0f: /* GET CURRENT VIDEO MODE */
518 TRACE("Get current video mode\n");
519 /* Note: This should not be a constant value. */
520 AL_reg(context
) = data
->VideoMode
;
521 AH_reg(context
) = data
->VideoColumns
;
522 BH_reg(context
) = 0; /* Display page 0 */
526 switch AL_reg(context
) {
527 case 0x00: /* SET SINGLE PALETTE REGISTER - A.C. */
528 TRACE("Set Single Palette Register - Reg 0x0%x Value 0x0%x\n",
529 BL_reg(context
),BH_reg(context
));
530 /* BH is the value BL is the register */
531 VGA_SetColor16((int)BL_reg(context
),(int)BH_reg(context
));
533 case 0x01: /* SET BORDER (OVERSCAN) */
534 /* Text terminals have no overscan */
535 /* I'm setting it anyway. - A.C. */
536 TRACE("Set Border (Overscan) - Ignored but set.\n");
537 VGA_SetColor16(16,(int)BH_reg(context
));
539 case 0x02: /* SET ALL PALETTE REGISTERS - A.C.*/
540 TRACE("Set all palette registers\n");
541 /* ES:DX points to a 17 byte table of colors */
542 /* No return data listed */
543 /* I'll have to update my table and the default palette */
544 VGA_Set16Palette(CTX_SEG_OFF_TO_LIN(context
, context
->SegEs
, context
->Edx
));
546 case 0x03: /* TOGGLE INTENSITY/BLINKING BIT */
547 FIXME("Toggle Intensity/Blinking Bit - Not Supported\n");
549 case 0x07: /* GET INDIVIDUAL PALETTE REGISTER - A.C.*/
550 TRACE("Get Individual Palette Register 0x0%x\n",BL_reg(context
));
551 /* BL is register to read [ 0-15 ] BH is return value */
552 BH_reg(context
) = VGA_GetColor16((int)BL_reg(context
));
554 case 0x08: /* READ OVERSCAN (BORDER COLOR) REGISTER - A.C. */
555 TRACE("Read Overscan (Border Color) Register \n");
556 BH_reg(context
) = VGA_GetColor16(16);
558 case 0x09: /* READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER - A.C.*/
559 TRACE("Read All Palette Registers and Overscan Register \n");
560 /* ES:DX points to a 17 byte table where the results */
561 /* of this call should be stored. */
562 VGA_Get16Palette(CTX_SEG_OFF_TO_LIN(context
, context
->SegEs
, context
->Edx
));
564 case 0x10: /* SET INDIVIDUAL DAC REGISTER */
568 TRACE("Set Individual DAC register\n");
569 paldat
.peRed
= DH_reg(context
);
570 paldat
.peGreen
= CH_reg(context
);
571 paldat
.peBlue
= CL_reg(context
);
573 VGA_SetPalette(&paldat
,BX_reg(context
)&0xFF,1);
576 case 0x12: /* SET BLOCK OF DAC REGISTERS */
582 TRACE("Set Block of DAC registers\n");
583 pt
= (BYTE
*)CTX_SEG_OFF_TO_LIN(context
,context
->SegEs
,context
->Edx
);
584 for (i
=0;i
<CX_reg(context
);i
++)
586 paldat
.peRed
= (*(pt
+i
*3+0)) << 2;
587 paldat
.peGreen
= (*(pt
+i
*3+1)) << 2;
588 paldat
.peBlue
= (*(pt
+i
*3+2)) << 2;
590 VGA_SetPalette(&paldat
,(BX_reg(context
)+i
)&0xFF,1);
594 case 0x13: /* SELECT VIDEO DAC COLOR PAGE */
595 FIXME("Select video DAC color page - Not Supported\n");
597 case 0x15: /* READ INDIVIDUAL DAC REGISTER */
598 FIXME("Read individual DAC register - Not Supported\n");
600 case 0x17: /* READ BLOCK OF DAC REGISTERS */
601 FIXME("Read block of DAC registers - Not Supported\n");
603 case 0x18: /* SET PEL MASK */
604 FIXME("Set PEL mask - Not Supported\n");
606 case 0x19: /* READ PEL MASK */
607 FIXME("Read PEL mask - Not Supported\n");
609 case 0x1a: /* GET VIDEO DAC COLOR PAGE STATE */
610 FIXME("Get video DAC color page state - Not Supported\n");
612 case 0x1b: /* PERFORM GRAY-SCALE SUMMING */
613 FIXME("Perform Gray-scale summing - Not Supported\n");
616 FIXME("INT 10 AH = 0x10 AL = 0x%x - Unknown\n",
622 case 0x11: /* TEXT MODE CHARGEN */
623 /* Note that second subfunction is *almost* identical. */
624 /* See INTERRUPT.A for details. */
625 switch AL_reg(context
) {
626 case 0x00: /* LOAD USER SPECIFIED PATTERNS */
628 FIXME("Load User Specified Patterns - Not Supported\n");
630 case 0x01: /* LOAD ROM MONOCHROME PATTERNS */
632 FIXME("Load ROM Monochrome Patterns - Not Supported\n");
634 case 0x02: /* LOAD ROM 8x8 DOUBLE-DOT PATTERNS */
637 "Load ROM 8x8 Double Dot Patterns - Not Supported\n");
639 case 0x03: /* SET BLOCK SPECIFIER */
640 FIXME("Set Block Specifier - Not Supported\n");
642 case 0x04: /* LOAD ROM 8x16 CHARACTER SET */
644 FIXME("Load ROM 8x16 Character Set - Not Supported\n");
646 case 0x20: /* SET USER 8x16 GRAPHICS CHARS */
647 FIXME("Set User 8x16 Graphics Chars - Not Supported\n");
649 case 0x21: /* SET USER GRAPICS CHARACTERS */
650 FIXME("Set User Graphics Characters - Not Supported\n");
652 case 0x22: /* SET ROM 8x14 GRAPHICS CHARS */
653 FIXME("Set ROM 8x14 Graphics Chars - Not Supported\n");
655 case 0x23: /* SET ROM 8x8 DBL DOT CHARS */
657 "Set ROM 8x8 Dbl Dot Chars (Graphics) - Not Supported\n");
659 case 0x24: /* LOAD 8x16 GRAPHIC CHARS */
660 FIXME("Load 8x16 Graphic Chars - Not Supported\n");
662 case 0x30: /* GET FONT INFORMATION */
663 FIXME("Get Font Information - Not Supported\n");
666 FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n",
672 case 0x12: /* ALTERNATE FUNCTION SELECT */
673 switch BL_reg(context
) {
674 case 0x10: /* GET EGA INFO */
675 TRACE("EGA info requested\n");
676 BH_reg(context
) = 0x00; /* Color screen */
678 data
->ModeOptions
>> 5; /* EGA memory size */
680 data
->FeatureBitsSwitches
;
682 case 0x20: /* ALTERNATE PRTSC */
683 FIXME("Install Alternate Print Screen - Not Supported\n");
685 case 0x30: /* SELECT VERTICAL RESOULTION */
686 FIXME("Select vertical resolution - not supported\n");
688 case 0x31: /* ENABLE/DISABLE DEFAULT PALETTE LOADING */
689 FIXME("Default palette loading - not supported\n");
691 (data
->VGASettings
& 0xf7) |
692 ((AL_reg(context
) == 1) << 3);
694 case 0x32: /* ENABLE/DISABLE VIDEO ADDRERSSING */
695 FIXME("Video Addressing - Not Supported\n");
697 case 0x33: /* ENABLE/DISABLE GRAY SCALE SUMMING */
698 FIXME("Gray Scale Summing - Not Supported\n");
700 case 0x34: /* ENABLE/DISABLE CURSOR EMULATION */
701 TRACE("Set cursor emulation to %d\n", AL_reg(context
));
703 (data
->ModeOptions
& 0xfe)|(AL_reg(context
) == 1);
705 case 0x36: /* VIDEO ADDRESS CONTROL */
706 FIXME("Video Address Control - Not Supported\n");
709 FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n",
715 case 0x13: /* WRITE STRING */
716 /* This one does not imply that string be at cursor. */
717 FIXME("Write String - Not Supported\n");
721 switch AL_reg(context
) {
722 case 0x00: /* GET DISPLAY COMBINATION CODE */
723 TRACE("Get Display Combination Code\n");
724 AX_reg(context
) = 0x001a;
725 BL_reg(context
) = 0x08; /* VGA w/ color analog display */
726 BH_reg(context
) = 0x00; /* No secondary hardware */
728 case 0x01: /* SET DISPLAY COMBINATION CODE */
729 FIXME("Set Display Combination Code - Not Supported\n");
732 FIXME("INT 10 AH = 0x1a AL = 0x%x - Unknown\n",
738 case 0x1b: /* FUNCTIONALITY/STATE INFORMATION */
739 TRACE("Get functionality/state information\n");
740 if (BX_reg(context
) == 0x0)
742 AL_reg(context
) = 0x1b;
743 /* Copy state information structure to ES:DI */
744 memcpy(CTX_SEG_OFF_TO_LIN(context
,context
->SegEs
,context
->Edi
),
745 DOSMEM_BiosSys()+DOSMEM_GetBiosSysStructOffset(OFF_VIDEOSTATE
),sizeof(VIDEOSTATE
));
749 case 0x1c: /* SAVE/RESTORE VIDEO STATE */
750 FIXME("Save/Restore Video State - Not Supported\n");
753 case 0xef: /* get video mode for hercules-compatibles */
754 /* There's no reason to really support this */
755 /* is there?....................(A.C.) */
756 TRACE("Just report the video not hercules compatible\n");
757 DX_reg(context
) = 0xffff;
760 FIXME("Unknown - 0x%x\n", AH_reg(context
));
761 INT_BARF( context
, 0x10 );
766 static void scroll_window(int direction
, char lines
, char row1
,
767 char col1
, char row2
, char col2
, char attribute
)
769 if (!lines
) /* Actually, clear the window */
771 VGA_ClearText(row1
, col1
, row2
, col2
, attribute
);
773 else if (direction
== SCROLL_UP
)
775 VGA_ScrollUpText(row1
, col1
, row2
, col2
, lines
, attribute
);
779 VGA_ScrollDownText(row1
, col1
, row2
, col2
, lines
, attribute
);
784 /**********************************************************************
789 void WINAPI
DOSVM_PutChar(BYTE ascii
)
791 BIOSDATA
*data
= DOSMEM_BiosData();
794 TRACE("char: 0x%02x\n", ascii
);
797 VGA_GetCursorPos(&xpos
, &ypos
);
798 BIOS_SetCursorPos(data
, 0, xpos
, ypos
);