From d76e79076f259f123f1ea99cb7a7a9083aabedd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E8=80=BF=E6=A3=AE?= <54354608+ZengGengSen@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:59:30 +0800 Subject: [PATCH] fix(fc): fix mmc3 board (#1529) 1. fix game Mickey's Safari in Letterland (USA) 2. fix game Incredible Crash Dummies, The (USA) --- ares/fc/cartridge/board/hvc-txrom.cpp | 20 +++++++++++++++----- mia/Database/Famicom.bml | 8 ++++---- mia/medium/famicom.cpp | 3 +++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ares/fc/cartridge/board/hvc-txrom.cpp b/ares/fc/cartridge/board/hvc-txrom.cpp index 5e5f8f0ff..6555864a5 100644 --- a/ares/fc/cartridge/board/hvc-txrom.cpp +++ b/ares/fc/cartridge/board/hvc-txrom.cpp @@ -17,6 +17,7 @@ struct HVC_TxROM : Interface { //MMC3 if(id == "HVC-TVROM" ) return new HVC_TxROM(Revision::TVROM); if(id == "NES-QJ" ) return new HVC_TxROM(Revision::NESQJ); if(id == "PAL-ZZ" ) return new HVC_TxROM(Revision::PALZZ); + if(id == "MC-ACC" ) return new HVC_TxROM(Revision::MCACC); return nullptr; } @@ -43,6 +44,7 @@ struct HVC_TxROM : Interface { //MMC3 TVROM, NESQJ, PALZZ, + MCACC, } revision; HVC_TxROM(Revision revision) : revision(revision) {} @@ -228,13 +230,21 @@ struct HVC_TxROM : Interface { //MMC3 } auto ppuAddressBus(n14 address) -> void override { - if(!(characterAddress & 0x1000) && (address & 0x1000)) { - if(irqDelay == 0) { - if(irqCounter == 0) { + bool clocking = false; + if (revision != Revision::MCACC) { + clocking = !(characterAddress & 0x1000) && (address & 0x1000); + } else { + clocking = (characterAddress & 0x1000) && !(address & 0x1000); + } + + if (clocking) { + if (irqDelay == 0) { + if (irqCounter == 0) { irqCounter = irqLatch + 1; } - if(--irqCounter == 0) { - if(irqEnable) irqLine = 1; + + if (--irqCounter == 0) { + if (irqEnable) irqLine = 1; } } irqDelay = 6; diff --git a/mia/Database/Famicom.bml b/mia/Database/Famicom.bml index 3cee84108..8b604fc56 100644 --- a/mia/Database/Famicom.bml +++ b/mia/Database/Famicom.bml @@ -16620,9 +16620,9 @@ game name: Incredible Crash Dummies, The (USA) title: Incredible Crash Dummies, The (USA) region: NTSC-U - board: HVC-TLROM + board: MC-ACC chip - type: MMC3B + type: ACCLAIM-MC-ACC memory type: ROM size: 0x20000 @@ -22753,9 +22753,9 @@ game name: Mickey's Safari in Letterland (USA) title: Mickey's Safari in Letterland (USA) region: NTSC-U - board: HVC-TLROM + board: MC-ACC chip - type: MMC3B + type: ACCLAIM-MC-ACC memory type: ROM size: 0x20000 diff --git a/mia/medium/famicom.cpp b/mia/medium/famicom.cpp index 8b71b90f5..09cd1e07c 100644 --- a/mia/medium/famicom.cpp +++ b/mia/medium/famicom.cpp @@ -254,6 +254,9 @@ auto Famicom::analyzeINES(vector& data) -> string { s += " board: HVC-HKROM\n"; s += " chip type=MMC6\n"; prgram = 1024; + } else if (submapper == 3) { + s += " board: MC-ACC\n"; + s += " chip type=ACCLAIM-MC-ACC\n"; } else { s += " board: HVC-TLROM\n"; s += " chip type=MMC3B\n";