all repos — mgba @ d25d4d30ff18bac9bb1542fa27a4402cb650e27e

mGBA Game Boy Advance Emulator

GB, GBA Savedata: Fix savestate loading overwriting saves on reset
Vicki Pfau vi@endrift.com
Wed, 25 Jul 2018 21:27:51 -0700
commit

d25d4d30ff18bac9bb1542fa27a4402cb650e27e

parent

f888d9b408b6e9ca5005e78db94907544af95686

3 files changed, 3 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -43,6 +43,7 @@ - GBA BIOS: Fix BitUnPack final byte

- GB I/O: DMA register is R/W - GB Video: Fix SCX timing - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1126) + - GB, GBA Savedata: Fix savestate loading overwriting saves on reset Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
M src/gb/gb.csrc/gb/gb.c

@@ -295,7 +295,6 @@ gb->memory.mbcType = GB_MBC_AUTODETECT;

gb->isPristine = false; gb->sramMaskWriteback = false; - GBSavedataUnmask(gb); GBSramDeinit(gb); if (gb->sramRealVf) { gb->sramRealVf->close(gb->sramRealVf);

@@ -468,6 +467,7 @@ GBSIOReset(&gb->sio);

cpu->memory.setActiveRegion(cpu, cpu->pc); + gb->sramMaskWriteback = false; GBSavedataUnmask(gb); }
M src/gba/gba.csrc/gba/gba.c

@@ -185,6 +185,7 @@ cpu->gprs[ARM_SP] = SP_BASE_SYSTEM;

struct GBA* gba = (struct GBA*) cpu->master; if (!gba->rr || (!gba->rr->isPlaying(gba->rr) && !gba->rr->isRecording(gba->rr))) { + gba->memory.savedata.maskWriteback = false; GBASavedataUnmask(&gba->memory.savedata); }