- make sure even GUI users notice a "missing xmessage" problem by
[wine/wine64.git] / dlls / winedos / int10.c
blobbbf592adab79d0ad867a137e5c885e2c60b505fe
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 "dosexe.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);
36 #define SCROLL_UP 1
37 #define SCROLL_DOWN 2
39 static void BIOS_GetCursorPos(BIOSDATA*data,unsigned page,unsigned*X,unsigned*Y)
41 *X = data->VideoCursorPos[page*2]; /* column */
42 *Y = data->VideoCursorPos[page*2+1]; /* row */
45 static void BIOS_SetCursorPos(BIOSDATA*data,unsigned page,unsigned X,unsigned Y)
47 data->VideoCursorPos[page*2] = X;
48 data->VideoCursorPos[page*2+1] = Y;
51 /**********************************************************************
52 * DOSVM_Int10Handler (WPROCS.116)
54 * Handler for int 10h (video).
56 * NOTE:
57 * Most INT 10 functions for text-mode, CGA, EGA, and VGA cards
58 * are present in this list. (SVGA and XGA are not) That is not
59 * to say that all these functions should be supported, but if
60 * anyone is brain-damaged enough to want to emulate one of these
61 * beasts then this should get you started.
63 * NOTE:
64 * Several common graphical extensions used by Microsoft hook
65 * off of here. I have *not* added them to this list (yet). They
66 * include:
68 * MSHERC.COM - More functionality for Hercules cards.
69 * EGA.SYS (also MOUSE.COM) - More for EGA cards.
71 * Yes, MS also added this support into their mouse driver. Don't
72 * ask me, I don't work for them.
74 * Joseph Pranevich - 9/98
76 * Jess Haas 2/99
77 * Added support for Vesa. It is not complete but is a start.
78 * NOTE: Im not sure if i did all this right or if eny of it works.
79 * Currently i dont have a program that uses Vesa that actually gets far
80 * enough without crashing to do vesa stuff.
82 * Added additional vga graphic support - 3/99
85 void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
87 BIOSDATA *data = DOSMEM_BiosData();
89 if(AH_reg(context) == 0x4F) { /* VESA functions */
90 switch(AL_reg(context)) {
92 case 0x00: /* GET SuperVGA INFORMATION */
93 TRACE("VESA GET SuperVGA INFORMATION\n");
94 memcpy(CTX_SEG_OFF_TO_LIN(context,context->SegEs,context->Edi),
95 DOSMEM_BiosSys()+DOSMEM_GetBiosSysStructOffset(OFF_VESAINFO),sizeof(VESAINFO));
96 AL_reg(context) = 0x4f;
97 AH_reg(context) = 0x00; /* 0x00 = successful 0x01 = failed */
98 break;
100 case 0x01: /* GET SuperVGA MODE INFORMATION */
101 FIXME("VESA GET SuperVGA Mode Information - Not supported\n");
102 AL_reg(context) = 0x4f;
103 AH_reg(context) = 0x01; /* 0x00 = successful 0x01 = failed */
104 break;
105 case 0x02: /* SET SuperVGA VIDEO MODE */
106 switch(BX_reg(context)) {
107 /* OEM Video Modes */
108 case 0x00: /* 40x25 */
109 case 0x01:
110 TRACE("Set VESA Text Mode - 0x0%x\n",
111 BX_reg(context));
112 VGA_SetAlphaMode(40, 25);
113 data->VideoColumns = 40;
114 break;
115 case 0x02:
116 case 0x03:
117 case 0x07:
118 TRACE("Set VESA Text Mode - 0x0%x\n",
119 BX_reg(context));
120 VGA_SetAlphaMode(80, 25);
121 data->VideoColumns = 80;
122 break;
123 case 0x0D:
124 TRACE("Setting VESA 320x200 16-color mode\n");
125 VGA_SetMode(320,200,4);
126 break;
127 case 0x0E:
128 TRACE("Setting VESA 640x200 16-color mode\n");
129 VGA_SetMode(640,200,4);
130 break;
131 case 0x10:
132 TRACE("Setting VESA 640x350 16-color mode\n");
133 VGA_SetMode(640,350,4);
134 break;
135 case 0x12:
136 TRACE("Setting VESA 640x480 16-color mode\n");
137 VGA_SetMode(640,480,4);
138 break;
139 case 0x13:
140 TRACE("Setting VESA 320x200 256-color mode\n");
141 VGA_SetMode(320,200,8);
142 break;
143 /* VBE Modes */
144 case 0x100:
145 TRACE("Setting VESA 640x400 256-color mode\n");
146 VGA_SetMode(640,400,8);
147 break;
148 case 0x101:
149 TRACE("Setting VESA 640x480 256-color mode\n");
150 VGA_SetMode(640,480,8);
151 break;
152 case 0x102:
153 TRACE("Setting VESA 800x600 16-color mode\n");
154 VGA_SetMode(800,600,4);
155 break;
156 case 0x103:
157 TRACE("Setting VESA 800x600 256-color mode\n");
158 VGA_SetMode(800,600,8);
159 break;
160 case 0x104:
161 TRACE("Setting VESA 1024x768 16-color mode\n");
162 VGA_SetMode(1024,768,4);
163 break;
164 case 0x105:
165 TRACE("Setting VESA 1024x768 256-color mode\n");
166 VGA_SetMode(1024,768,8);
167 break;
168 case 0x106:
169 TRACE("Setting VESA 1280x1024 16-color mode\n");
170 VGA_SetMode(1280,1024,4);
171 break;
172 case 0x107:
173 TRACE("Setting VESA 1280x1024 256-color mode\n");
174 VGA_SetMode(1280,1024,8);
175 break;
176 /* 108h - 10Ch are text modes and im lazy so :p */
177 /* VBE v1.2+ */
178 case 0x10D:
179 TRACE("Setting VESA 320x200 15bpp\n");
180 VGA_SetMode(320,200,15);
181 break;
182 case 0x10E:
183 TRACE("Setting VESA 320x200 16bpp\n");
184 VGA_SetMode(320,200,16);
185 break;
186 case 0x10F:
187 TRACE("Setting VESA 320x200 24bpp\n");
188 VGA_SetMode(320,200,24);
189 break;
190 case 0x110:
191 TRACE("Setting VESA 640x480 15bpp\n");
192 VGA_SetMode(640,480,15);
193 break;
194 case 0x111:
195 TRACE("Setting VESA 640x480 16bpp\n");
196 VGA_SetMode(640,480,16);
197 break;
198 case 0x112:
199 TRACE("Setting VESA 640x480 24bpp\n");
200 VGA_SetMode(640,480,24);
201 break;
202 case 0x113:
203 TRACE("Setting VESA 800x600 15bpp\n");
204 VGA_SetMode(800,600,15);
205 break;
206 case 0x114:
207 TRACE("Setting VESA 800x600 16bpp\n");
208 VGA_SetMode(800,600,16);
209 break;
210 case 0x115:
211 TRACE("Setting VESA 800x600 24bpp\n");
212 VGA_SetMode(800,600,24);
213 break;
214 case 0x116:
215 TRACE("Setting VESA 1024x768 15bpp\n");
216 VGA_SetMode(1024,768,15);
217 break;
218 case 0x117:
219 TRACE("Setting VESA 1024x768 16bpp\n");
220 VGA_SetMode(1024,768,16);
221 break;
222 case 0x118:
223 TRACE("Setting VESA 1024x768 24bpp\n");
224 VGA_SetMode(1024,768,24);
225 break;
226 case 0x119:
227 TRACE("Setting VESA 1280x1024 15bpp\n");
228 VGA_SetMode(1280,1024,15);
229 break;
230 case 0x11A:
231 TRACE("Setting VESA 1280x1024 16bpp\n");
232 VGA_SetMode(1280,1024,16);
233 break;
234 case 0x11B:
235 TRACE("Setting VESA 1280x1024 24bpp\n");
236 VGA_SetMode(1280,1024,24);
237 break;
238 default:
239 FIXME("VESA Set Video Mode (0x%x) - Not Supported\n", BX_reg(context));
241 data->VideoMode = BX_reg(context);
242 AL_reg(context) = 0x4f;
243 AH_reg(context) = 0x00;
244 break;
245 case 0x03: /* VESA SuperVGA BIOS - GET CURRENT VIDEO MODE */
246 AL_reg(context) = 0x4f;
247 AH_reg(context) = 0x00; /* should probly check if a vesa mode has ben set */
248 BX_reg(context) = data->VideoMode;
249 break;
250 case 0x04: /* VESA SuperVGA BIOS - SAVE/RESTORE SuperVGA VIDEO STATE */
251 ERR("VESA SAVE/RESTORE Video State - Not Implemented\n");
252 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
253 /* maybe we should do this instead ? */
254 /* AH_reg(context = 0x01; not implemented so just fail */
255 break;
256 case 0x05: /* VESA SuperVGA BIOS - CPU VIDEO MEMORY CONTROL */
257 ERR("VESA CPU VIDEO MEMORY CONTROL\n");
258 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
259 /* maybe we should do this instead ? */
260 /* AH_reg(context = 0x001; not implemented so just fail */
261 break;
262 case 0x06: /* VESA GET/SET LOGICAL SCAN LINE LENGTH */
263 ERR("VESA GET/SET LOGICAL SCAN LINE LENGTH - Not Implemented\n");
264 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
265 /* maybe we should do this instead ? */
266 /* AH_reg(context = 0x001; not implemented so just fail */
267 break;
268 case 0x07: /* GET/SET DISPLAY START */
269 ERR("VESA GET/SET DISPLAY START - Not Implemented\n");
270 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
271 /* maybe we should do this instead ? */
272 /* AH_reg(context = 0x001; not implemented so just fail */
273 break;
274 case 0x08: /* GET/SET DAC PALETTE CONTROL */
275 ERR("VESA GET/SET DAC PALETTE CONTROL- Not Implemented\n");
276 /* AL_reg(context) = 0x4f; = supported so not set since not implemented */
277 /* maybe we should do this instead ? */
278 /* AH_reg(context = 0x001; not implemented so just fail */
279 break;
280 case 0x09: /* SET PALETTE ENTRIES */
281 FIXME("VESA Set palette entries - not implemented\n");
282 break;
283 case 0xef: /* get video mode for hercules-compatibles */
284 /* There's no reason to really support this */
285 /* is there?....................(A.C.) */
286 TRACE("Just report the video not hercules compatible\n");
287 DX_reg(context) = 0xffff;
288 break;
289 case 0xff: /* Turn VESA ON/OFF */
290 /* i dont know what to do */
291 break;
292 default:
293 FIXME("VESA Function (0x%x) - Not Supported\n", AH_reg(context));
294 break;
297 else {
299 switch(AH_reg(context)) {
301 case 0x00: /* SET VIDEO MODE */
302 /* Text Modes: */
303 /* (mode) (text rows/cols)
304 0x00 - 40x25
305 0x01 - 40x25
306 0x02 - 80x25
307 0x03 - 80x25 or 80x43 or 80x50 (assume 80x25)
308 0x07 - 80x25
311 /* Bit 7 of AH = 0 -> Clean the video memory
312 1 -> Don't clean it
314 if (!(AL_reg(context)&0x80)) {
315 /* FIXME: Do something which cleans the video memory */
318 /* FIXME: Should we keep the bit 7 in the Bios Data memory? */
319 AL_reg(context) &= ~0x80;
321 switch (AL_reg(context)) {
322 case 0x00: /* 40x25 */
323 case 0x01:
324 VGA_Exit();
325 TRACE("Set Video Mode - Set to Text - 0x0%x\n",
326 AL_reg(context));
327 VGA_SetAlphaMode(40, 25);
328 data->VideoColumns = 40;
329 break;
330 case 0x02:
331 case 0x03:
332 case 0x07:
333 VGA_Exit();
334 TRACE("Set Video Mode - Set to Text - 0x0%x\n",
335 AL_reg(context));
336 VGA_SetAlphaMode(80, 25);
337 data->VideoColumns = 80;
338 break;
339 case 0x0D:
340 TRACE("Setting VGA 320x200 16-color mode\n");
341 VGA_SetMode(320,200,4);
342 break;
343 case 0x0E:
344 TRACE("Setting VGA 640x200 16-color mode\n");
345 VGA_SetMode(640,200,4);
346 break;
347 case 0x10:
348 TRACE("Setting VGA 640x350 16-color mode\n");
349 VGA_SetMode(640,350,4);
350 break;
351 case 0x12:
352 TRACE("Setting VGA 640x480 16-color mode\n");
353 VGA_SetMode(640,480,4);
354 break;
355 case 0x13:
356 TRACE("Setting VGA 320x200 256-color mode\n");
357 VGA_SetMode(320,200,8);
358 break;
359 default:
360 FIXME("Set Video Mode (0x%x) - Not Supported\n",
361 AL_reg(context));
363 data->VideoMode = AL_reg(context);
364 break;
366 case 0x01: /* SET CURSOR SHAPE */
367 TRACE("Set Cursor Shape start %d end %d options %d\n", CH_reg(context) & 0x1f, CL_reg(context) & 0x1f, CH_reg(context) & 0xe0);
368 data->VideoCursorType = CX_reg(context); /* direct copy */
369 VGA_SetCursorShape(CH_reg(context), CL_reg(context));
370 break;
372 case 0x02: /* SET CURSOR POSITION */
373 /* BH = Page Number */ /* Not supported */
374 /* DH = Row */ /* 0 is left */
375 /* DL = Column */ /* 0 is top */
376 BIOS_SetCursorPos(data,BH_reg(context),DL_reg(context),DH_reg(context));
377 if (BH_reg(context))
379 FIXME("Set Cursor Position: Cannot set to page %d\n",
380 BH_reg(context));
382 else
384 VGA_SetCursorPos(DL_reg(context), DH_reg(context));
385 TRACE("Set Cursor Position: %d %d\n", DH_reg(context),
386 DL_reg(context));
388 break;
390 case 0x03: /* GET CURSOR POSITION AND SIZE */
392 unsigned row, col;
394 TRACE("Get cursor position and size (page %d)\n", BH_reg(context));
395 CX_reg(context) = data->VideoCursorType;
396 BIOS_GetCursorPos(data,BH_reg(context),&col,&row);
397 DH_reg(context) = row;
398 DL_reg(context) = col;
399 TRACE("Cursor Position: %d %d\n", DH_reg(context), DL_reg(context));
401 break;
403 case 0x04: /* READ LIGHT PEN POSITION */
404 FIXME("Read Light Pen Position - Not Supported\n");
405 AH_reg(context) = 0x00; /* Not down */
406 break;
408 case 0x05: /* SELECT ACTIVE DISPLAY PAGE */
409 FIXME("Select Active Display Page - Not Supported\n");
410 data->VideoCurPage = AL_reg(context);
411 break;
413 case 0x06: /* SCROLL UP WINDOW */
414 /* AL = Lines to scroll */
415 /* BH = Attribute */
416 /* CH,CL = row, col upper-left */
417 /* DH,DL = row, col lower-right */
418 scroll_window(SCROLL_UP, AL_reg(context), CH_reg(context),
419 CL_reg(context), DH_reg(context), DL_reg(context),
420 BH_reg(context));
421 TRACE("Scroll Up Window %d\n", AL_reg(context));
422 break;
424 case 0x07: /* SCROLL DOWN WINDOW */
425 /* AL = Lines to scroll */
426 /* BH = Attribute */
427 /* CH,CL = row, col upper-left */
428 /* DH,DL = row, col lower-right */
429 scroll_window(SCROLL_DOWN, AL_reg(context), CH_reg(context),
430 CL_reg(context), DH_reg(context), DL_reg(context),
431 BH_reg(context));
432 TRACE("Scroll Down Window %d\n", AL_reg(context));
433 break;
435 case 0x08: /* READ CHARACTER AND ATTRIBUTE AT CURSOR POSITION */
437 if (BH_reg(context)) /* Write to different page */
439 FIXME("Read character and attribute at cursor position -"
440 " Can't read from non-0 page\n");
441 AL_reg(context) = ' '; /* That page is blank */
442 AH_reg(context) = 7;
444 else
446 TRACE("Read Character and Attribute at Cursor Position\n");
447 VGA_GetCharacterAtCursor(&AL_reg(context), &AH_reg(context));
450 break;
452 case 0x09: /* WRITE CHARACTER AND ATTRIBUTE AT CURSOR POSITION */
453 case 0x0a: /* WRITE CHARACTER ONLY AT CURSOR POSITION */
454 /* AL = Character to display. */
455 /* BH = Page Number */ /* We can't write to non-0 pages, yet. */
456 /* BL = Attribute / Color */
457 /* CX = Times to Write Char */
458 /* Note here that the cursor is not advanced. */
460 unsigned row, col;
462 BIOS_GetCursorPos(data,BH_reg(context),&col,&row);
463 VGA_WriteChars(col, row,
464 AL_reg(context),
465 (AH_reg(context) == 0x09) ? BL_reg(context) : -1,
466 CX_reg(context));
467 if (CX_reg(context) > 1)
468 TRACE("Write Character%s at Cursor Position (Rep. %d): %c\n",
469 (AH_reg(context) == 0x09) ? " and Attribute" : "",
470 CX_reg(context), AL_reg(context));
471 else
472 TRACE("Write Character%s at Cursor Position: %c\n",
473 (AH_reg(context) == 0x09) ? " and Attribute" : "",
474 AL_reg(context));
476 break;
478 case 0x0b:
479 switch BH_reg(context) {
480 case 0x00: /* SET BACKGROUND/BORDER COLOR */
481 /* In text modes, this sets only the border... */
482 /* According to the interrupt list and one of my books. */
483 /* Funny though that Beyond Zork seems to indicate that it
484 also sets up the default background attributes for clears
485 and scrolls... */
486 /* Bear in mind here that we do not want to change,
487 apparantly, the foreground or attribute of the background
488 with this call, so we should check first to see what the
489 foreground already is... FIXME */
490 FIXME("Set Background/Border Color: %d\n",
491 BL_reg(context));
492 break;
493 case 0x01: /* SET PALETTE */
494 FIXME("Set Palette - Not Supported\n");
495 break;
496 default:
497 FIXME("INT 10 AH = 0x0b BH = 0x%x - Unknown\n",
498 BH_reg(context));
499 break;
501 break;
503 case 0x0c: /* WRITE GRAPHICS PIXEL */
504 /* Not in graphics mode, can ignore w/o error */
505 FIXME("Write Graphics Pixel - Not Supported\n");
506 break;
508 case 0x0d: /* READ GRAPHICS PIXEL */
509 /* Not in graphics mode, can ignore w/o error */
510 FIXME("Read Graphics Pixel - Not Supported\n");
511 break;
513 case 0x0e: /* TELETYPE OUTPUT */
514 TRACE("Teletype Output\n");
515 DOSVM_PutChar(AL_reg(context));
516 break;
518 case 0x0f: /* GET CURRENT VIDEO MODE */
519 TRACE("Get current video mode\n");
520 /* Note: This should not be a constant value. */
521 AL_reg(context) = data->VideoMode;
522 AH_reg(context) = data->VideoColumns;
523 BH_reg(context) = 0; /* Display page 0 */
524 break;
526 case 0x10:
527 switch AL_reg(context) {
528 case 0x00: /* SET SINGLE PALETTE REGISTER - A.C. */
529 TRACE("Set Single Palette Register - Reg 0x0%x Value 0x0%x\n",
530 BL_reg(context),BH_reg(context));
531 /* BH is the value BL is the register */
532 VGA_SetColor16((int)BL_reg(context),(int)BH_reg(context));
533 break;
534 case 0x01: /* SET BORDER (OVERSCAN) */
535 /* Text terminals have no overscan */
536 /* I'm setting it anyway. - A.C. */
537 TRACE("Set Border (Overscan) - Ignored but set.\n");
538 VGA_SetColor16(16,(int)BH_reg(context));
539 break;
540 case 0x02: /* SET ALL PALETTE REGISTERS - A.C.*/
541 TRACE("Set all palette registers\n");
542 /* ES:DX points to a 17 byte table of colors */
543 /* No return data listed */
544 /* I'll have to update my table and the default palette */
545 VGA_Set16Palette(CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edx));
546 break;
547 case 0x03: /* TOGGLE INTENSITY/BLINKING BIT */
548 FIXME("Toggle Intensity/Blinking Bit - Not Supported\n");
549 break;
550 case 0x07: /* GET INDIVIDUAL PALETTE REGISTER - A.C.*/
551 TRACE("Get Individual Palette Register 0x0%x\n",BL_reg(context));
552 /* BL is register to read [ 0-15 ] BH is return value */
553 BH_reg(context) = VGA_GetColor16((int)BL_reg(context));
554 break;
555 case 0x08: /* READ OVERSCAN (BORDER COLOR) REGISTER - A.C. */
556 TRACE("Read Overscan (Border Color) Register \n");
557 BH_reg(context) = VGA_GetColor16(16);
558 break;
559 case 0x09: /* READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER - A.C.*/
560 TRACE("Read All Palette Registers and Overscan Register \n");
561 /* ES:DX points to a 17 byte table where the results */
562 /* of this call should be stored. */
563 VGA_Get16Palette(CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edx));
564 break;
565 case 0x10: /* SET INDIVIDUAL DAC REGISTER */
567 PALETTEENTRY paldat;
569 TRACE("Set Individual DAC register\n");
570 paldat.peRed = DH_reg(context);
571 paldat.peGreen = CH_reg(context);
572 paldat.peBlue = CL_reg(context);
573 paldat.peFlags = 0;
574 VGA_SetPalette(&paldat,BX_reg(context)&0xFF,1);
576 break;
577 case 0x12: /* SET BLOCK OF DAC REGISTERS */
579 int i;
580 PALETTEENTRY paldat;
581 BYTE *pt;
583 TRACE("Set Block of DAC registers\n");
584 pt = (BYTE*)CTX_SEG_OFF_TO_LIN(context,context->SegEs,context->Edx);
585 for (i=0;i<CX_reg(context);i++)
587 paldat.peRed = (*(pt+i*3+0)) << 2;
588 paldat.peGreen = (*(pt+i*3+1)) << 2;
589 paldat.peBlue = (*(pt+i*3+2)) << 2;
590 paldat.peFlags = 0;
591 VGA_SetPalette(&paldat,(BX_reg(context)+i)&0xFF,1);
594 break;
595 case 0x13: /* SELECT VIDEO DAC COLOR PAGE */
596 FIXME("Select video DAC color page - Not Supported\n");
597 break;
598 case 0x15: /* READ INDIVIDUAL DAC REGISTER */
599 FIXME("Read individual DAC register - Not Supported\n");
600 break;
601 case 0x17: /* READ BLOCK OF DAC REGISTERS */
602 FIXME("Read block of DAC registers - Not Supported\n");
603 break;
604 case 0x18: /* SET PEL MASK */
605 FIXME("Set PEL mask - Not Supported\n");
606 break;
607 case 0x19: /* READ PEL MASK */
608 FIXME("Read PEL mask - Not Supported\n");
609 break;
610 case 0x1a: /* GET VIDEO DAC COLOR PAGE STATE */
611 FIXME("Get video DAC color page state - Not Supported\n");
612 break;
613 case 0x1b: /* PERFORM GRAY-SCALE SUMMING */
614 FIXME("Perform Gray-scale summing - Not Supported\n");
615 break;
616 default:
617 FIXME("INT 10 AH = 0x10 AL = 0x%x - Unknown\n",
618 AL_reg(context));
619 break;
621 break;
623 case 0x11: /* TEXT MODE CHARGEN */
624 /* Note that second subfunction is *almost* identical. */
625 /* See INTERRUPT.A for details. */
626 switch AL_reg(context) {
627 case 0x00: /* LOAD USER SPECIFIED PATTERNS */
628 case 0x10:
629 FIXME("Load User Specified Patterns - Not Supported\n");
630 break;
631 case 0x01: /* LOAD ROM MONOCHROME PATTERNS */
632 case 0x11:
633 FIXME("Load ROM Monochrome Patterns - Not Supported\n");
634 break;
635 case 0x02: /* LOAD ROM 8x8 DOUBLE-DOT PATTERNS */
636 case 0x12:
637 FIXME(
638 "Load ROM 8x8 Double Dot Patterns - Not Supported\n");
639 break;
640 case 0x03: /* SET BLOCK SPECIFIER */
641 FIXME("Set Block Specifier - Not Supported\n");
642 break;
643 case 0x04: /* LOAD ROM 8x16 CHARACTER SET */
644 case 0x14:
645 FIXME("Load ROM 8x16 Character Set - Not Supported\n");
646 break;
647 case 0x20: /* SET USER 8x16 GRAPHICS CHARS */
648 FIXME("Set User 8x16 Graphics Chars - Not Supported\n");
649 break;
650 case 0x21: /* SET USER GRAPICS CHARACTERS */
651 FIXME("Set User Graphics Characters - Not Supported\n");
652 break;
653 case 0x22: /* SET ROM 8x14 GRAPHICS CHARS */
654 FIXME("Set ROM 8x14 Graphics Chars - Not Supported\n");
655 break;
656 case 0x23: /* SET ROM 8x8 DBL DOT CHARS */
657 FIXME(
658 "Set ROM 8x8 Dbl Dot Chars (Graphics) - Not Supported\n");
659 break;
660 case 0x24: /* LOAD 8x16 GRAPHIC CHARS */
661 FIXME("Load 8x16 Graphic Chars - Not Supported\n");
662 break;
663 case 0x30: /* GET FONT INFORMATION */
664 FIXME("Get Font Information - 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 0x12: /* ALTERNATE FUNCTION SELECT */
674 switch BL_reg(context) {
675 case 0x10: /* GET EGA INFO */
676 TRACE("EGA info requested\n");
677 BH_reg(context) = 0x00; /* Color screen */
678 BL_reg(context) =
679 data->ModeOptions >> 5; /* EGA memory size */
680 CX_reg(context) =
681 data->FeatureBitsSwitches;
682 break;
683 case 0x20: /* ALTERNATE PRTSC */
684 FIXME("Install Alternate Print Screen - Not Supported\n");
685 break;
686 case 0x30: /* SELECT VERTICAL RESOULTION */
687 FIXME("Select vertical resolution - not supported\n");
688 break;
689 case 0x31: /* ENABLE/DISABLE DEFAULT PALETTE LOADING */
690 FIXME("Default palette loading - not supported\n");
691 data->VGASettings =
692 (data->VGASettings & 0xf7) |
693 ((AL_reg(context) == 1) << 3);
694 break;
695 case 0x32: /* ENABLE/DISABLE VIDEO ADDRERSSING */
696 FIXME("Video Addressing - Not Supported\n");
697 break;
698 case 0x33: /* ENABLE/DISABLE GRAY SCALE SUMMING */
699 FIXME("Gray Scale Summing - Not Supported\n");
700 break;
701 case 0x34: /* ENABLE/DISABLE CURSOR EMULATION */
702 TRACE("Set cursor emulation to %d\n", AL_reg(context));
703 data->ModeOptions =
704 (data->ModeOptions & 0xfe)|(AL_reg(context) == 1);
705 break;
706 case 0x36: /* VIDEO ADDRESS CONTROL */
707 FIXME("Video Address Control - Not Supported\n");
708 break;
709 default:
710 FIXME("INT 10 AH = 0x11 AL = 0x%x - Unknown\n",
711 AL_reg(context));
712 break;
714 break;
716 case 0x13: /* WRITE STRING */
717 /* This one does not imply that string be at cursor. */
718 FIXME("Write String - Not Supported\n");
719 break;
721 case 0x1a:
722 switch AL_reg(context) {
723 case 0x00: /* GET DISPLAY COMBINATION CODE */
724 TRACE("Get Display Combination Code\n");
725 AX_reg(context) = 0x001a;
726 BL_reg(context) = 0x08; /* VGA w/ color analog display */
727 BH_reg(context) = 0x00; /* No secondary hardware */
728 break;
729 case 0x01: /* SET DISPLAY COMBINATION CODE */
730 FIXME("Set Display Combination Code - Not Supported\n");
731 break;
732 default:
733 FIXME("INT 10 AH = 0x1a AL = 0x%x - Unknown\n",
734 AL_reg(context));
735 break;
737 break;
739 case 0x1b: /* FUNCTIONALITY/STATE INFORMATION */
740 TRACE("Get functionality/state information\n");
741 if (BX_reg(context) == 0x0)
743 AL_reg(context) = 0x1b;
744 /* Copy state information structure to ES:DI */
745 memcpy(CTX_SEG_OFF_TO_LIN(context,context->SegEs,context->Edi),
746 DOSMEM_BiosSys()+DOSMEM_GetBiosSysStructOffset(OFF_VIDEOSTATE),sizeof(VIDEOSTATE));
748 break;
750 case 0x1c: /* SAVE/RESTORE VIDEO STATE */
751 FIXME("Save/Restore Video State - Not Supported\n");
752 break;
754 case 0xef: /* get video mode for hercules-compatibles */
755 /* There's no reason to really support this */
756 /* is there?....................(A.C.) */
757 TRACE("Just report the video not hercules compatible\n");
758 DX_reg(context) = 0xffff;
759 break;
760 default:
761 FIXME("Unknown - 0x%x\n", AH_reg(context));
762 INT_BARF( context, 0x10 );
767 static void scroll_window(int direction, char lines, char row1,
768 char col1, char row2, char col2, char attribute)
770 if (!lines) /* Actually, clear the window */
772 VGA_ClearText(row1, col1, row2, col2, attribute);
774 else if (direction == SCROLL_UP)
776 VGA_ScrollUpText(row1, col1, row2, col2, lines, attribute);
778 else
780 VGA_ScrollDownText(row1, col1, row2, col2, lines, attribute);
785 /**********************************************************************
786 * DOSVM_PutChar
790 void WINAPI DOSVM_PutChar(BYTE ascii)
792 BIOSDATA *data = DOSMEM_BiosData();
793 unsigned xpos, ypos;
795 TRACE("char: 0x%02x\n", ascii);
797 VGA_PutChar(ascii);
798 VGA_GetCursorPos(&xpos, &ypos);
799 BIOS_SetCursorPos(data, 0, xpos, ypos);