GBA: Fix savedata type forcing when masked (fixes #1166)
Vicki Pfau vi@endrift.com
Sun, 16 Sep 2018 11:03:21 -0700
1 files changed,
5 insertions(+),
0 deletions(-)
jump to
M
src/gba/savedata.c
→
src/gba/savedata.c
@@ -47,6 +47,7 @@ savedata->flashState = FLASH_STATE_RAW;
savedata->vf = vf; savedata->realVf = vf; savedata->mapMode = MAP_WRITE; + savedata->maskWriteback = false; savedata->dirty = 0; savedata->dirtAge = 0; savedata->dust.name = "GBA Savedata Settling";@@ -196,8 +197,12 @@
void GBASavedataForceType(struct GBASavedata* savedata, enum SavedataType type) { if (savedata->type != SAVEDATA_AUTODETECT) { struct VFile* vf = savedata->vf; + int mapMode = savedata->mapMode; + bool maskWriteback = savedata->maskWriteback; GBASavedataDeinit(savedata); GBASavedataInit(savedata, vf); + savedata->mapMode = mapMode; + savedata->maskWriteback = maskWriteback; } switch (type) { case SAVEDATA_FLASH512: