Added the rest of the register manipulation code to int 10. It only
handles the setting of the 16-color palette registers and overscan.
This commit is contained in:
parent
ec67a95525
commit
38fc50d202
|
@ -511,36 +511,42 @@ void WINAPI DOSVM_Int10Handler( CONTEXT86 *context )
|
|||
|
||||
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");
|
||||
/* 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 */
|
||||
FIXME("Set all palette registers - Not Supported\n");
|
||||
/* DX:ES points to a 17 byte table of colors */
|
||||
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");
|
||||
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 */
|
||||
FIXME(
|
||||
"Read All Palette Registers and Overscan Register "
|
||||
" - Not Supported\n");
|
||||
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 */
|
||||
{
|
||||
|
|
|
@ -251,7 +251,7 @@ static void WINAPI VGA_DoSetMode(ULONG_PTR arg)
|
|||
ModeSet *par = (ModeSet *)arg;
|
||||
par->ret=1;
|
||||
|
||||
if (lpddraw) VGA_DoExit(NULL);
|
||||
if (lpddraw) VGA_DoExit(0);
|
||||
if (!lpddraw) {
|
||||
if (!pDirectDrawCreate)
|
||||
{
|
||||
|
@ -357,7 +357,7 @@ void VGA_SetPalette(PALETTEENTRY*pal,int start,int len)
|
|||
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;
|
||||
|
@ -368,6 +368,39 @@ void VGA_SetColor16(int reg,int color)
|
|||
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)
|
||||
{
|
||||
PALETTEENTRY pal[256];
|
||||
|
|
|
@ -30,6 +30,9 @@ int VGA_GetMode(unsigned*Height,unsigned*Width,unsigned*Depth);
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue