Author: aandrejevic Date: Fri Apr 24 01:05:50 2015 New Revision: 67377
URL: http://svn.reactos.org/svn/reactos?rev=67377&view=rev Log: [NTVDM] When the VGA memory map is A0000-BFFFF, mirror the bottom 64 KB into the top. This should take care of all VGA addressing problems.
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/hardw... ============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/hardware/video/vga.c [iso-8859-1] Fri Apr 24 01:05:50 2015 @@ -22,7 +22,7 @@ /* PRIVATE VARIABLES **********************************************************/
static CONST DWORD MemoryBase[] = { 0xA0000, 0xA0000, 0xB0000, 0xB8000 }; -static CONST DWORD MemoryLimit[] = { 0xAFFFF, 0xAFFFF, 0xB7FFF, 0xBFFFF }; +static CONST DWORD MemoryLimit[] = { 0xBFFFF, 0xAFFFF, 0xB7FFF, 0xBFFFF };
/* * Activate this line if you want to use the real @@ -622,7 +622,7 @@
static inline DWORD VgaTranslateReadAddress(DWORD Address) { - DWORD Offset = Address - VgaGetVideoBaseAddress(); + DWORD Offset = LOWORD(Address - VgaGetVideoBaseAddress()); BYTE Plane;
/* Check for chain-4 and odd-even mode */ @@ -649,7 +649,7 @@
static inline DWORD VgaTranslateWriteAddress(DWORD Address) { - DWORD Offset = Address - VgaGetVideoBaseAddress(); + DWORD Offset = LOWORD(Address - VgaGetVideoBaseAddress());
/* Check for chain-4 and odd-even mode */ if (VgaSeqRegisters[VGA_SEQ_MEM_REG] & VGA_SEQ_MEM_C4) @@ -1905,8 +1905,6 @@ PUCHAR BufPtr = (PUCHAR)Buffer;
DPRINT("VgaReadMemory: Address 0x%08X, Size %lu\n", Address, Size); - Address = min(max(Address, VgaGetVideoBaseAddress()), VgaGetVideoLimitAddress()); - Size = min(Size, VgaGetVideoLimitAddress() - Address + 1);
/* Ignore if video RAM access is disabled */ if ((VgaMiscRegister & VGA_MISC_RAM_ENABLED) == 0) return; @@ -1934,8 +1932,6 @@ PUCHAR BufPtr = (PUCHAR)Buffer;
DPRINT("VgaWriteMemory: Address 0x%08X, Size %lu\n", Address, Size); - Address = min(max(Address, VgaGetVideoBaseAddress()), VgaGetVideoLimitAddress()); - Size = min(Size, VgaGetVideoLimitAddress() - Address + 1);
/* Ignore if video RAM access is disabled */ if ((VgaMiscRegister & VGA_MISC_RAM_ENABLED) == 0) return TRUE;