From 3f1e080672400938563e44bf15a395eb20e9bbea Mon Sep 17 00:00:00 2001 From: negativeExponent <54053706+negativeExponent@users.noreply.github.com> Date: Tue, 27 Jun 2023 09:03:46 +0800 Subject: [PATCH] Fix PRG in 32K bank mode PRG register $5117 value is used for the entire $8000-$FFFF CPU range in 32K mode. See https://www.nesdev.org/wiki/MMC5#PRG_mode_($5100) in PRG bankswitching --- src/boards/mmc5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boards/mmc5.cpp b/src/boards/mmc5.cpp index a5e1e164..82095f04 100644 --- a/src/boards/mmc5.cpp +++ b/src/boards/mmc5.cpp @@ -424,7 +424,7 @@ static void MMC5PRG(void) { switch (mmc5psize & 3) { case 0: MMC5ROMWrProtect[0] = MMC5ROMWrProtect[1] = MMC5ROMWrProtect[2] = MMC5ROMWrProtect[3] = 1; - setprg32(0x8000, ((PRGBanks[1] & 0x7F) >> 2)); + setprg32(0x8000, ((PRGBanks[3] & 0x7F) >> 2)); for (x = 0; x < 4; x++) MMC5MemIn[1 + x] = 1; break;