mirror of https://github.com/mgba-emu/mgba.git
GB, GBA: Save writeback-pending masked saves on unload (fixes #2396)
This commit is contained in:
parent
ee68e9742d
commit
fff87985fe
1
CHANGES
1
CHANGES
|
@ -26,6 +26,7 @@ Other fixes:
|
||||||
- Core: Don't attempt to restore rewind diffs past start of rewind
|
- Core: Don't attempt to restore rewind diffs past start of rewind
|
||||||
- FFmpeg: Fix crash when encoding audio with some containers
|
- FFmpeg: Fix crash when encoding audio with some containers
|
||||||
- GB: Fix temporary saves
|
- GB: Fix temporary saves
|
||||||
|
- GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396)
|
||||||
Misc:
|
Misc:
|
||||||
- Core: Suspend runloop when a core crashes
|
- Core: Suspend runloop when a core crashes
|
||||||
- GB Video: Add default SGB border
|
- GB Video: Add default SGB border
|
||||||
|
|
|
@ -318,7 +318,9 @@ void GBUnloadROM(struct GB* gb) {
|
||||||
gb->memory.mbcType = GB_MBC_AUTODETECT;
|
gb->memory.mbcType = GB_MBC_AUTODETECT;
|
||||||
gb->isPristine = false;
|
gb->isPristine = false;
|
||||||
|
|
||||||
|
if (!gb->sramDirty) {
|
||||||
gb->sramMaskWriteback = false;
|
gb->sramMaskWriteback = false;
|
||||||
|
}
|
||||||
GBSavedataUnmask(gb);
|
GBSavedataUnmask(gb);
|
||||||
GBSramDeinit(gb);
|
GBSramDeinit(gb);
|
||||||
if (gb->sramRealVf) {
|
if (gb->sramRealVf) {
|
||||||
|
|
|
@ -149,7 +149,9 @@ void GBAUnloadROM(struct GBA* gba) {
|
||||||
gba->memory.rom = NULL;
|
gba->memory.rom = NULL;
|
||||||
gba->isPristine = false;
|
gba->isPristine = false;
|
||||||
|
|
||||||
|
if (!gba->memory.savedata.dirty) {
|
||||||
gba->memory.savedata.maskWriteback = false;
|
gba->memory.savedata.maskWriteback = false;
|
||||||
|
}
|
||||||
GBASavedataUnmask(&gba->memory.savedata);
|
GBASavedataUnmask(&gba->memory.savedata);
|
||||||
GBASavedataDeinit(&gba->memory.savedata);
|
GBASavedataDeinit(&gba->memory.savedata);
|
||||||
if (gba->memory.savedata.realVf) {
|
if (gba->memory.savedata.realVf) {
|
||||||
|
|
Loading…
Reference in New Issue