From 61406ec4f0120fef5afd9c7fdcb82e0eaa969599 Mon Sep 17 00:00:00 2001 From: Fabio Cavallo Date: Sat, 25 May 2024 10:40:32 +0200 Subject: [PATCH] In the MMC5 mapper fixed the WRAM assignment for roms with the iNES 1.0 header (#402). --- src/core/mappers/mapper_005.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/mappers/mapper_005.c b/src/core/mappers/mapper_005.c index 3f2cad265..b959448b6 100644 --- a/src/core/mappers/mapper_005.c +++ b/src/core/mappers/mapper_005.c @@ -96,6 +96,18 @@ void map_init_005(void) { m005.snd.S4.length.value = 0; } + // Because no ExROM game is known to write PRG-RAM with one bank value and then attempt + // to read back the same data with a different bank value, emulating the PRG-RAM as 64K at all times + // can be used as a compatible superset for all games. + if (info.format == iNES_1_0) { + if (info.mapper.battery) { + wram_set_nvram_size(S16K); + wram_set_ram_size(S48K); + } else { + wram_set_ram_size(S64K); + } + } + info.mapper.extend_wr = TRUE; nes[0].irql2f.present = TRUE; }