Int 10 registers code
admiral coeyman
admiral at corner.net
Sun May 12 00:55:15 CDT 2002
This patch adds the rest of the register manipulation code to int-10. It only
handles the setting of the 16-color palette registers and overscan.
God Bless,
--Robert 'Admiral' Coeyman
--
---
May you live as long as you wish and age but a single day.
http://www.dotguy.net/ admiral at corner.net
Webmaster/ Linux Administrator Computer Co-Op/CornerNet
-------------- next part --------------
Index: dlls/winedos/int10.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/int10.c,v
retrieving revision 1.9
diff -u -u -r1.9 int10.c
--- dlls/winedos/int10.c 20 Apr 2002 20:52:05 -0000 1.9
+++ dlls/winedos/int10.c 12 May 2002 05:46:48 -0000
@@ -511,36 +511,42 @@
case 0x10:
switch AL_reg(context) {
- case 0x00: /* SET SINGLE PALETTE REGISTER */
- FIXME("Set Single Palette Register - Not tested\n");
+ case 0x00: /* SET SINGLE PALETTE REGISTER - A.C. */
+ TRACE("Set Single Palette Register - Reg 0x0%x Value 0x0%x\n",
+ BL_reg(context),BH_reg(context));
/* BH is the value BL is the register */
VGA_SetColor16((int)BL_reg(context),(int)BH_reg(context));
break;
case 0x01: /* SET BORDER (OVERSCAN) */
/* Text terminals have no overscan */
- TRACE("Set Border (Overscan) - Ignored\n");
- break;
- case 0x02: /* SET ALL PALETTE REGISTERS */
- FIXME("Set all palette registers - Not Supported\n");
- /* DX:ES points to a 17 byte table of colors */
+ /* I'm setting it anyway. - A.C. */
+ TRACE("Set Border (Overscan) - Ignored but set.\n");
+ VGA_SetColor16(16,(int)BH_reg(context));
+ break;
+ case 0x02: /* SET ALL PALETTE REGISTERS - A.C.*/
+ TRACE("Set all palette registers\n");
+ /* ES:DX points to a 17 byte table of colors */
/* No return data listed */
/* I'll have to update my table and the default palette */
+ VGA_Set16Palette(CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edx));
break;
case 0x03: /* TOGGLE INTENSITY/BLINKING BIT */
FIXME("Toggle Intensity/Blinking Bit - Not Supported\n");
break;
- case 0x07: /* GET INDIVIDUAL PALETTE REGISTER */
- FIXME("Get Individual Palette Register - Not Supported\n");
+ case 0x07: /* GET INDIVIDUAL PALETTE REGISTER - A.C.*/
+ TRACE("Get Individual Palette Register 0x0%x\n",BL_reg(context));
/* BL is register to read [ 0-15 ] BH is return value */
+ BH_reg(context) = VGA_GetColor16((int)BL_reg(context));
break;
- case 0x08: /* READ OVERSCAN (BORDER COLOR) REGISTER */
- FIXME(
- "Read Overscan (Border Color) Register - Not Supported\n");
- break;
- case 0x09: /* READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER */
- FIXME(
- "Read All Palette Registers and Overscan Register "
- " - Not Supported\n");
+ case 0x08: /* READ OVERSCAN (BORDER COLOR) REGISTER - A.C. */
+ TRACE("Read Overscan (Border Color) Register \n");
+ BH_reg(context) = VGA_GetColor16(16);
+ break;
+ case 0x09: /* READ ALL PALETTE REGISTERS AND OVERSCAN REGISTER - A.C.*/
+ TRACE("Read All Palette Registers and Overscan Register \n");
+ /* ES:DX points to a 17 byte table where the results */
+ /* of this call should be stored. */
+ VGA_Get16Palette(CTX_SEG_OFF_TO_LIN(context, context->SegEs, context->Edx));
break;
case 0x10: /* SET INDIVIDUAL DAC REGISTER */
{
Index: dlls/winedos/vga.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/vga.c,v
retrieving revision 1.9
diff -u -u -r1.9 vga.c
--- dlls/winedos/vga.c 19 Apr 2002 00:05:38 -0000 1.9
+++ dlls/winedos/vga.c 12 May 2002 05:46:49 -0000
@@ -357,7 +357,7 @@
IDirectDrawPalette_SetEntries(lpddpal,0,start,len,pal);
}
-/* set a single color in 16 color mode. */
+/* set a single [char wide] color in 16 color mode. */
void VGA_SetColor16(int reg,int color)
{
PALETTEENTRY *pal;
@@ -366,6 +366,39 @@
pal= &vga_def64_palette[color];
IDirectDrawPalette_SetEntries(lpddpal,0,reg,1,pal);
vga_16_palette[reg]=(char)color;
+}
+
+/* Get a single [char wide] color in 16 color mode. */
+char VGA_GetColor16(int reg)
+{
+
+ if (!lpddraw) return 0;
+ return (char)vga_16_palette[reg];
+}
+
+/* set all 17 [char wide] colors at once in 16 color mode. */
+void VGA_Set16Palette(char *Table)
+{
+ PALETTEENTRY *pal;
+ int c;
+
+ if (!lpddraw) return; /* return if we're in text only mode */
+ bcopy((void *)&vga_16_palette,(void *)Table,17);
+ /* copy the entries into the table */
+ for (c=0; c<17; c++) { /* 17 entries */
+ pal= &vga_def64_palette[(int)vga_16_palette[c]]; /* get color */
+ IDirectDrawPalette_SetEntries(lpddpal,0,c,1,pal); /* set entry */
+ TRACE("Palette register %d set to %d\n",c,(int)vga_16_palette[c]);
+ } /* end of the counting loop */
+}
+
+/* Get all 17 [ char wide ] colors at once in 16 color mode. */
+void VGA_Get16Palette(char *Table)
+{
+
+ if (!lpddraw) return; /* return if we're in text only mode */
+ bcopy((void *)Table,(void *)&vga_16_palette,17);
+ /* copy the entries into the table */
}
void VGA_SetQuadPalette(RGBQUAD*color,int start,int len)
Index: dlls/winedos/vga.h
===================================================================
RCS file: /home/wine/wine/dlls/winedos/vga.h,v
retrieving revision 1.6
diff -u -u -r1.6 vga.h
--- dlls/winedos/vga.h 11 Apr 2002 17:33:15 -0000 1.6
+++ dlls/winedos/vga.h 12 May 2002 05:46:49 -0000
@@ -30,6 +30,9 @@
void VGA_Exit(void);
void VGA_SetPalette(PALETTEENTRY*pal,int start,int len);
void VGA_SetColor16(int reg,int color);
+char VGA_GetColor16(int reg);
+void VGA_Set16Palette(char *Table);
+void VGA_Get16Palette(char *Table);
void VGA_SetQuadPalette(RGBQUAD*color,int start,int len);
LPSTR VGA_Lock(unsigned*Pitch,unsigned*Height,unsigned*Width,unsigned*Depth);
void VGA_Unlock(void);
More information about the wine-patches
mailing list