From 93d3eaae1a4dec1f1a0ede69a8e28653fafc168b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 13 Nov 2020 01:54:29 -0800 Subject: [PATCH] GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring --- CHANGES | 1 + src/gba/overrides.c | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index f47651e75..5a7090f69 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.8.5: (Future) Emulation fixes: - ARM: Fix Addressing mode 1 shifter on rs == pc (fixes mgba.io/i/1926) + - GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring Other fixes: - CMake: Fix build with downstream minizip that exports incompatible symbols - Debugger: Close trace log when done tracing diff --git a/src/gba/overrides.c b/src/gba/overrides.c index a8e21caa9..2860c2b4d 100644 --- a/src/gba/overrides.c +++ b/src/gba/overrides.c @@ -190,6 +190,16 @@ static const struct GBACartridgeOverride _overrides[] = { // Aging cartridge { "TCHK", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + // Famicom Mini series 3 (FDS), some aren't mirrored (22 - 28) + // See https://forum.no-intro.org/viewtopic.php?f=2&t=4221 for discussion + { "FNMJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { "FMRJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { "FPTJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { "FLBJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { "FFMJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { "FTKJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { "FTUJ", SAVEDATA_EEPROM, HW_NONE, IDLE_LOOP_NONE, false }, + { { 0, 0, 0, 0 }, 0, 0, IDLE_LOOP_NONE, false } }; @@ -200,20 +210,19 @@ bool GBAOverrideFind(const struct Configuration* config, struct GBACartridgeOver override->mirroring = false; bool found = false; - if (override->id[0] == 'F') { + int i; + for (i = 0; _overrides[i].id[0]; ++i) { + if (memcmp(override->id, _overrides[i].id, sizeof(override->id)) == 0) { + *override = _overrides[i]; + found = true; + break; + } + } + if (!found && override->id[0] == 'F') { // Classic NES Series override->savetype = SAVEDATA_EEPROM; override->mirroring = true; found = true; - } else { - int i; - for (i = 0; _overrides[i].id[0]; ++i) { - if (memcmp(override->id, _overrides[i].id, sizeof(override->id)) == 0) { - *override = _overrides[i]; - found = true; - break; - } - } } if (config) {