all repos — mgba @ 5b395aafe0a45fda0ce5a4944d589799e5c186eb

mGBA Game Boy Advance Emulator

GBA: Detect hardware for Pokémon FireRed ROM hacks
Vicki Pfau vi@endrift.com
Sat, 09 Sep 2017 11:42:45 -0700
commit

5b395aafe0a45fda0ce5a4944d589799e5c186eb

parent

f5bf85448932d4b22f5aa8b450f551589a7bb0ee

2 files changed, 8 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -25,6 +25,7 @@ - GB Audio: Fix NRx2 writes while active (fixes mgba.io/i/866)

Misc: - Qt: Don't rebuild library view if style hasn't changed - SDL: Fix 2.0.5 build on macOS under some circumstances + - GBA: Detect hardware for Pokémon FireRed ROM hacks 0.6.0: (2017-07-16) Features:
M src/gba/core.csrc/gba/core.c

@@ -385,11 +385,16 @@ struct GBACartridgeOverride override;

const struct GBACartridge* cart = (const struct GBACartridge*) gba->memory.rom; if (cart) { memcpy(override.id, &cart->id, sizeof(override.id)); - if (GBAOverrideFind(gbacore->overrides, &override)) { + + if (!strncmp("pokemon red version", &((const char*) gba->memory.rom)[0x108], 20) && gba->romCrc32 != 0xDD88761C) { + // Enable FLASH1M and RTC on Pokémon FireRed ROM hacks + override.savetype = SAVEDATA_FLASH1M; + override.hardware = HW_RTC; + GBAOverrideApply(gba, &override); + } else if (GBAOverrideFind(gbacore->overrides, &override)) { GBAOverrideApply(gba, &override); } } - #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2 if (!gba->biosVf && core->opts.useBios) { struct VFile* bios = NULL;