From 54c1ea2e3b9f3df864f13feb63f42b6e77e0f638 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Sat, 28 Nov 2020 23:52:04 +0100 Subject: [PATCH] Ported the 128K mapping fixes to 86Box. --- src/video/vid_et4000.c | 9 +++++++++ src/video/vid_et4000w32.c | 2 +- src/video/vid_tvga.c | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index aa1ccf52c..8da66fb7f 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -245,6 +245,15 @@ et4000_out(uint16_t addr, uint8_t val, void *priv) svga->read_bank = ((dev->banking >> 4) & 0x0f) * 0x10000; } else svga->write_bank = svga->read_bank = 0; + + old = svga->gdcreg[6]; + svga_out(addr, val, svga); + if ((old & 0xc) != 0 && (val & 0xc) == 0) + { + /*override mask - ET4000 supports linear 128k at A0000*/ + svga->banked_mask = 0x1ffff; + } + return; } break; diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 9fb13de5b..2c04b454e 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -454,7 +454,7 @@ void et4000w32p_recalcmapping(et4000w32p_t *et4000) case 0x0: case 0x4: case 0x8: case 0xC: /*128k at A0000*/ mem_mapping_set_addr(&svga->mapping, 0xa0000, 0x20000); mem_mapping_disable(&et4000->mmu_mapping); - svga->banked_mask = 0xffff; + svga->banked_mask = 0x1ffff; break; case 0x1: /*64k at A0000*/ mem_mapping_set_addr(&svga->mapping, 0xa0000, 0x10000); diff --git a/src/video/vid_tvga.c b/src/video/vid_tvga.c index 750144159..b8065457f 100644 --- a/src/video/vid_tvga.c +++ b/src/video/vid_tvga.c @@ -127,6 +127,15 @@ void tvga_out(uint16_t addr, uint8_t val, void *p) case 0x3CF: switch (svga->gdcaddr & 15) { + case 0x6: + old = svga->gdcreg[6]; + svga_out(addr, val, svga); + if ((old & 0xc) != 0 && (val & 0xc) == 0) + { + /*override mask - TVGA supports linear 128k at A0000*/ + svga->banked_mask = 0x1ffff; + } + return; case 0xE: svga->gdcreg[0xe] = val ^ 2; tvga->tvga_3d9 = svga->gdcreg[0xe] & 0xf;