From c0a3903ec0712de78b381ad46cf4d66343dc5153 Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Wed, 11 Feb 2015 20:45:29 +0000 Subject: [PATCH] Map a single 4kB page of video memory that repeats in the 32kB range when in Hercules text mode, making it compatible with MDA. Fixes Future Wars and Operation Stealth install programs on the Hercules machine type. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3900 --- src/hardware/vga_memory.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/hardware/vga_memory.cpp b/src/hardware/vga_memory.cpp index 974527c0..0a538801 100644 --- a/src/hardware/vga_memory.cpp +++ b/src/hardware/vga_memory.cpp @@ -730,6 +730,20 @@ public: } }; +class VGA_HERC_Handler : public PageHandler { +public: + VGA_HERC_Handler() { + flags=PFLAG_READABLE|PFLAG_WRITEABLE; + } + HostPt GetHostReadPt(Bitu phys_page) { + // The 4kB map area is repeated in the 32kB range + return &vga.mem.linear[0]; + } + HostPt GetHostWritePt(Bitu phys_page) { + return GetHostReadPt( phys_page ); + } +}; + class VGA_Empty_Handler : public PageHandler { public: VGA_Empty_Handler() { @@ -754,6 +768,7 @@ static struct vg { VGA_UnchainedEGA_Handler uega; VGA_UnchainedVGA_Handler uvga; VGA_PCJR_Handler pcjr; + VGA_HERC_Handler herc; VGA_LIN4_Handler lin4; VGA_LFB_Handler lfb; VGA_LFBChanges_Handler lfbchanges; @@ -789,7 +804,7 @@ void VGA_SetupHandlers(void) { } else { vgapages.mask=0x7fff; /* With hercules in 32kb mode it leaves a memory hole on 0xb800 */ - MEM_SetPageHandler(VGA_PAGE_B0,8,&vgaph.map); + MEM_SetPageHandler(VGA_PAGE_B0,8,&vgaph.herc); MEM_SetPageHandler(VGA_PAGE_B8,8,&vgaph.empty); } goto range_done;