GB, GBA: Save writeback-pending masked saves on unload (fixes #2396)

This commit is contained in:
Vicki Pfau 2022-01-20 22:27:15 -08:00
parent ee68e9742d
commit fff87985fe
3 changed files with 7 additions and 2 deletions

View File

@ -26,6 +26,7 @@ Other fixes:
- Core: Don't attempt to restore rewind diffs past start of rewind
- FFmpeg: Fix crash when encoding audio with some containers
- GB: Fix temporary saves
- GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396)
Misc:
- Core: Suspend runloop when a core crashes
- GB Video: Add default SGB border

View File

@ -318,7 +318,9 @@ void GBUnloadROM(struct GB* gb) {
gb->memory.mbcType = GB_MBC_AUTODETECT;
gb->isPristine = false;
gb->sramMaskWriteback = false;
if (!gb->sramDirty) {
gb->sramMaskWriteback = false;
}
GBSavedataUnmask(gb);
GBSramDeinit(gb);
if (gb->sramRealVf) {

View File

@ -149,7 +149,9 @@ void GBAUnloadROM(struct GBA* gba) {
gba->memory.rom = NULL;
gba->isPristine = false;
gba->memory.savedata.maskWriteback = false;
if (!gba->memory.savedata.dirty) {
gba->memory.savedata.maskWriteback = false;
}
GBASavedataUnmask(&gba->memory.savedata);
GBASavedataDeinit(&gba->memory.savedata);
if (gba->memory.savedata.realVf) {