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;