GB, GBA Savedata: Fix unmasking savedata crash

This commit is contained in:
Vicki Pfau 2018-09-15 23:12:29 -07:00
parent 3660246a83
commit 69c2969db0
3 changed files with 3 additions and 2 deletions

View File

@ -52,6 +52,7 @@ Bugfixes:
- GBA Serialize: Fix loading states in Hblank
- PSP2: Fix more issues causing poor audio
- GBA Memory: Fix Vast Fame support (taizou) (fixes mgba.io/i/1170)
- GB, GBA Savedata: Fix unmasking savedata crash
Misc:
- GBA Timer: Use global cycles for timers
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)

View File

@ -256,7 +256,7 @@ void GBSavedataMask(struct GB* gb, struct VFile* vf, bool writeback) {
}
void GBSavedataUnmask(struct GB* gb) {
if (gb->sramVf == gb->sramRealVf) {
if (!gb->sramRealVf || gb->sramVf == gb->sramRealVf) {
return;
}
struct VFile* vf = gb->sramVf;

View File

@ -95,7 +95,7 @@ void GBASavedataMask(struct GBASavedata* savedata, struct VFile* vf, bool writeb
}
void GBASavedataUnmask(struct GBASavedata* savedata) {
if (savedata->vf == savedata->realVf) {
if (!savedata->realVf || savedata->vf == savedata->realVf) {
return;
}
enum SavedataType type = savedata->type;