From 8a464fb31251820fef866e72e65299462d03e265 Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Fri, 13 Mar 2015 12:42:12 +0000 Subject: [PATCH] Amend previous Hercules change so the MDA-compatible address wrapping is used only when graphics are disabled, but still only in 32kB mode. Thanks TheGreatCodeholio, and thanks Great Hierophant for testing on a real Hercules card. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3903 --- src/hardware/vga_memory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hardware/vga_memory.cpp b/src/hardware/vga_memory.cpp index 0a538801..39d4d8fc 100644 --- a/src/hardware/vga_memory.cpp +++ b/src/hardware/vga_memory.cpp @@ -803,8 +803,12 @@ void VGA_SetupHandlers(void) { MEM_SetPageHandler(VGA_PAGE_B0,16,&vgaph.map); } else { vgapages.mask=0x7fff; - /* With hercules in 32kb mode it leaves a memory hole on 0xb800 */ - MEM_SetPageHandler(VGA_PAGE_B0,8,&vgaph.herc); + // With hercules in 32kB mode it leaves a memory hole on 0xb800 + // and has MDA-compatible address wrapping when graphics are disabled + if (vga.herc.enable_bits & 0x1) + MEM_SetPageHandler(VGA_PAGE_B0,8,&vgaph.map); + else + MEM_SetPageHandler(VGA_PAGE_B0,8,&vgaph.herc); MEM_SetPageHandler(VGA_PAGE_B8,8,&vgaph.empty); } goto range_done;