GBA Savedata: Fix EEPROM writing codepath when savetype is not EEPROM
Vicki Pfau vi@endrift.com
Mon, 19 Nov 2018 21:16:57 -0800
3 files changed,
9 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -136,6 +136,7 @@ - PSP2: Fix tearing issues (fixes mgba.io/i/1211)
- Qt: Fix mapping analog triggers (fixes mgba.io/i/495) - Qt: Grab focus when game starts (fixes mgba.io/i/804) - Core: Remember to deinit proxy ring FIFO + - GBA Savedata: Fix EEPROM writing codepath when savetype is not EEPROM Misc: - mGUI: Add SGB border configuration option - mGUI: Add support for different settings types
M
src/gba/dma.c
→
src/gba/dma.c
@@ -278,7 +278,9 @@ if (memory->savedata.type == SAVEDATA_AUTODETECT) {
mLOG(GBA_MEM, INFO, "Detected EEPROM savegame"); GBASavedataInitEEPROM(&memory->savedata); } - GBASavedataWriteEEPROM(&memory->savedata, memory->dmaTransferRegister, wordsRemaining); + if (memory->savedata.type == SAVEDATA_EEPROM512 || memory->savedata.type == SAVEDATA_EEPROM) { + GBASavedataWriteEEPROM(&memory->savedata, memory->dmaTransferRegister, wordsRemaining); + } } else { cpu->memory.store16(cpu, dest, memory->dmaTransferRegister, 0);
M
src/gba/memory.c
→
src/gba/memory.c
@@ -892,7 +892,11 @@ if (memory->savedata.type == SAVEDATA_AUTODETECT) {
mLOG(GBA_MEM, INFO, "Detected EEPROM savegame"); GBASavedataInitEEPROM(&memory->savedata); } - GBASavedataWriteEEPROM(&memory->savedata, value, 1); + if (memory->savedata.type == SAVEDATA_EEPROM512 || memory->savedata.type == SAVEDATA_EEPROM) { + GBASavedataWriteEEPROM(&memory->savedata, value, 1); + break; + } + mLOG(GBA_MEM, GAME_ERROR, "Bad memory Store16: 0x%08X", address); break; case REGION_CART_SRAM: case REGION_CART_SRAM_MIRROR: