diff --git a/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c b/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c index 5da00c17496..b880197a4d4 100644 --- a/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c +++ b/reactos/subsystems/mvdm/ntvdm/bios/vidbios.c @@ -3379,6 +3379,31 @@ VOID WINAPI VidBiosVideoService(LPWORD Stack) break; } + /* Set Video DAC Color Page */ + case 0x13: + { + if (getBL() == 0) + { + /* Set the highest bit of the AC Mode Control register to BH */ + IOReadB(VGA_INSTAT1_READ); + IOWriteB(VGA_AC_INDEX, VGA_AC_CONTROL_REG); + IOWriteB(VGA_AC_WRITE, (IOReadB(VGA_AC_READ) & 0x7F) | (getBH() << 7)); + } + else if (getBL() == 1) + { + /* Set the AC Color Select register to BH */ + IOReadB(VGA_INSTAT1_READ); + IOWriteB(VGA_AC_INDEX, VGA_AC_COLOR_SEL_REG); + IOWriteB(VGA_AC_WRITE, getBH()); + } + else + { + DPRINT1("BIOS Palette Control Sub-sub-command BL = 0x%02X INVALID\n", getBL()); + } + + break; + } + /* Get Individual DAC Register */ case 0x15: { diff --git a/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c b/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c index e970e76d335..05fc21ca34c 100644 --- a/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c +++ b/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c @@ -946,8 +946,26 @@ static VOID VgaUpdateFramebuffer(VOID) * if external palette access is disabled, otherwise (in case * of palette loading) it is a blank pixel. */ - PixelData = (VgaAcPalDisable ? VgaAcRegisters[PixelData & 0x0F] - : 0); + + if (VgaAcPalDisable) + { + if (!(VgaAcRegisters[VGA_AC_CONTROL_REG] & VGA_AC_CONTROL_P54S)) + { + /* Bits 4 and 5 are taken from the palette register */ + PixelData = ((VgaAcRegisters[VGA_AC_COLOR_SEL_REG] << 4) & 0xC0) + | (VgaAcRegisters[PixelData & 0x0F] & 0x3F); + } + else + { + /* Bits 4 and 5 are taken from the color select register */ + PixelData = (VgaAcRegisters[VGA_AC_COLOR_SEL_REG] << 4) + | (VgaAcRegisters[PixelData & 0x0F] & 0x0F); + } + } + else + { + PixelData = 0; + } } /* Take into account DoubleVision mode when checking for pixel updates */