From 08ec785c240e47ce6863e011a107ecbd45dcc038 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Fri, 15 May 2015 19:51:40 +0000 Subject: [PATCH] [NTVDM] Reverse the HSYNC/VSYNC polarity when it should be reversed. svn path=/trunk/; revision=67746 --- reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c b/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c index c3e0c1943fc..baa73704921 100644 --- a/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c +++ b/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c @@ -1393,15 +1393,21 @@ static BYTE WINAPI VgaReadPort(USHORT Port) case VGA_INSTAT1_READ_COLOR: { BYTE Result = 0; + BOOLEAN Vsync = InVerticalRetrace; + BOOLEAN Hsync = InHorizontalRetrace; /* Reset the AC latch */ VgaAcLatch = FALSE; + /* Reverse the polarity, if needed */ + if (VgaMiscRegister & VGA_MISC_VSYNCP) Vsync = !Vsync; + if (VgaMiscRegister & VGA_MISC_HSYNCP) Hsync = !Hsync; + /* Set a flag if there is a vertical or horizontal retrace */ - if (InVerticalRetrace || InHorizontalRetrace) Result |= VGA_STAT_DD; + if (Vsync || Hsync) Result |= VGA_STAT_DD; /* Set an additional flag if there was a vertical retrace */ - if (InVerticalRetrace) Result |= VGA_STAT_VRETRACE; + if (Vsync) Result |= VGA_STAT_VRETRACE; /* Clear the flags */ InHorizontalRetrace = InVerticalRetrace = FALSE;