Author: hbelusca Date: Fri May 9 22:07:49 2014 New Revision: 63209
URL: http://svn.reactos.org/svn/reactos?rev=63209&view=rev Log: [NTVDM] Factor the shift of the interlaced high bit out of the for(...) loop (since the interlaced high bit is not modified anymore after), and add extra parentheses.
Modified: trunk/reactos/subsystems/ntvdm/hardware/vga.c
Modified: trunk/reactos/subsystems/ntvdm/hardware/vga.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/v... ============================================================================== --- trunk/reactos/subsystems/ntvdm/hardware/vga.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/hardware/vga.c [iso-8859-1] Fri May 9 22:07:49 2014 @@ -1136,6 +1136,7 @@ { /* Graphics mode */ PBYTE GraphicsBuffer = (PBYTE)ConsoleFramebuffer; + DWORD InterlaceHighBit = VGA_INTERLACE_HIGH_BIT;
/* * Synchronize access to the graphics framebuffer @@ -1143,17 +1144,15 @@ */ WaitForSingleObject(ConsoleMutex, INFINITE);
+ /* Shift the high bit right by 1 in odd/even mode */ + if (VgaGcRegisters[VGA_GC_MODE_REG] & VGA_GC_MODE_OE) + { + InterlaceHighBit >>= 1; + } + /* Loop through the scanlines */ for (i = 0; i < Resolution.Y; i++) { - DWORD InterlaceHighBit = VGA_INTERLACE_HIGH_BIT; - - if (VgaGcRegisters[VGA_GC_MODE_REG] & VGA_GC_MODE_OE) - { - /* Shift the high bit right by 1 in odd/even mode */ - InterlaceHighBit >>= 1; - } - if ((VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_OE) && (i & 1)) { /* Odd-numbered line in interlaced mode - set the high bit */ @@ -1309,7 +1308,7 @@ } }
- if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_OE && (i & 1)) + if ((VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_OE) && (i & 1)) { /* Clear the high bit */ Address &= ~InterlaceHighBit;