GB, GBA Savedata: Fix savestate loading overwriting saves on reset

This commit is contained in:
Vicki Pfau 2018-07-25 21:27:51 -07:00
parent f888d9b408
commit d25d4d30ff
3 changed files with 3 additions and 1 deletions

View File

@ -43,6 +43,7 @@ Bugfixes:
- 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)

View File

@ -295,7 +295,6 @@ void GBUnloadROM(struct GB* gb) {
gb->isPristine = false;
gb->sramMaskWriteback = false;
GBSavedataUnmask(gb);
GBSramDeinit(gb);
if (gb->sramRealVf) {
gb->sramRealVf->close(gb->sramRealVf);
@ -468,6 +467,7 @@ void GBReset(struct LR35902Core* cpu) {
cpu->memory.setActiveRegion(cpu, cpu->pc);
gb->sramMaskWriteback = false;
GBSavedataUnmask(gb);
}

View File

@ -185,6 +185,7 @@ void GBAReset(struct ARMCore* cpu) {
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);
}