Author: aandrejevic
Date: Mon Aug 29 04:31:02 2016
New Revision: 72498

URL: http://svn.reactos.org/svn/reactos?rev=72498&view=rev
Log:
[NTVDM:SVGA]
Don't forget to adapt the console attaching code to the new transposed video
memory, and certainly don't forget to make sure the ScanlineSizeLatch and
StartAddressLatch have the correct values before calling VgaVerticalRetrace.


Modified:
    trunk/reactos/subsystems/mvdm/ntvdm/console/video.c
    trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c

Modified: trunk/reactos/subsystems/mvdm/ntvdm/console/video.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/console/video.c?rev=72498&r1=72497&r2=72498&view=diff
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/console/video.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/console/video.c [iso-8859-1] Mon Aug 29 
04:31:02 2016
@@ -395,10 +395,10 @@
             CurrentAddr = LOWORD((Address + j) * AddressSize);
 
             /* Store the character in plane 0 */
-            VgaMemory[CurrentAddr] = CharBuff[i * TextResolution.X + 
j].Char.AsciiChar;
+            VgaMemory[CurrentAddr * VGA_NUM_BANKS] = CharBuff[i * 
TextResolution.X + j].Char.AsciiChar;
 
             /* Store the attribute in plane 1 */
-            VgaMemory[CurrentAddr + VGA_BANK_SIZE] = (BYTE)CharBuff[i * 
TextResolution.X + j].Attributes;
+            VgaMemory[CurrentAddr * VGA_NUM_BANKS + 1] = (BYTE)CharBuff[i * 
TextResolution.X + j].Attributes;
         }
 
         /* Move to the next scanline */

Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c?rev=72498&r1=72497&r2=72498&view=diff
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c   [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/svga.c   [iso-8859-1] 
Mon Aug 29 04:31:02 2016
@@ -1765,6 +1765,19 @@
 
 VOID VgaRefreshDisplay(VOID)
 {
+    /* Save the scanline size */
+    ScanlineSizeLatch = ((DWORD)VgaCrtcRegisters[VGA_CRTC_OFFSET_REG]
+                        + (((DWORD)VgaCrtcRegisters[SVGA_CRTC_EXT_DISPLAY_REG] 
& SVGA_CRTC_EXT_OFFSET_BIT8) << 4)) * 2;
+
+    /* Save the starting address */
+    StartAddressLatch = MAKEWORD(VgaCrtcRegisters[VGA_CRTC_START_ADDR_LOW_REG],
+                                 
VgaCrtcRegisters[VGA_CRTC_START_ADDR_HIGH_REG])
+                        + ((VgaCrtcRegisters[SVGA_CRTC_EXT_DISPLAY_REG] & 
SVGA_CRTC_EXT_ADDR_BIT16) << 16)
+                        + ((VgaCrtcRegisters[SVGA_CRTC_EXT_DISPLAY_REG] & 
SVGA_CRTC_EXT_ADDR_BITS1718) << 15)
+                        + ((VgaCrtcRegisters[SVGA_CRTC_OVERLAY_REG] & 
SVGA_CRTC_EXT_ADDR_BIT19) << 12)
+                        + (VgaCrtcRegisters[VGA_CRTC_PRESET_ROW_SCAN_REG] & 
0x1F) * ScanlineSizeLatch
+                        + ((VgaCrtcRegisters[VGA_CRTC_PRESET_ROW_SCAN_REG] >> 
5) & 3);
+
     VgaVerticalRetrace();
 }
 
@@ -1960,7 +1973,7 @@
     UINT i, j;
     ASSERT(Height <= VGA_MAX_FONT_HEIGHT);
 
-    for (i = 0 ; i < VGA_FONT_CHARACTERS; i++)
+    for (i = 0; i < VGA_FONT_CHARACTERS; i++)
     {
         /* Write the character */
         for (j = 0; j < Height; j++)


Reply via email to