From 88a14fb5f2d85e8477957f8ac4ead84ded719b50 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Wed, 18 Oct 2023 20:00:23 +0100 Subject: [PATCH] msx: fix conflicts between rom and scc with KonamiSCC mapper --- ares/msx/cartridge/board/konami-scc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ares/msx/cartridge/board/konami-scc.cpp b/ares/msx/cartridge/board/konami-scc.cpp index 44e6aabe84..ca51ba81b9 100644 --- a/ares/msx/cartridge/board/konami-scc.cpp +++ b/ares/msx/cartridge/board/konami-scc.cpp @@ -48,6 +48,9 @@ struct KonamiSCC : Interface { if(address >= 0x0000 && address <= 0x1fff) data = rom.read(bank[2] << 13 | (n13)address); if(address >= 0x2000 && address <= 0x3fff) data = rom.read(bank[3] << 13 | (n13)address); + //scc is mapped in bank 0x3f for 98xx-98ff + if(bank[2].bit(0, 5) != 0x3f) return data; + address.bit(8) = 0; //SCC ignores A8 if(address >= 0x9800 && address <= 0x981f) { @@ -88,6 +91,9 @@ struct KonamiSCC : Interface { if(address >= 0x9000 && address <= 0x97ff) bank[2] = data; if(address >= 0xb000 && address <= 0xb7ff) bank[3] = data; + //scc is mapped in bank 0x3f for 98xx-98ff + if(bank[2].bit(0, 5) != 0x3f) return; + address.bit(8) = 0; //SCC ignores A8 if(address >= 0x9800 && address <= 0x981f && !test.bit(6)) {