all repos — mgba @ 1f57dec081f68ba3572c2ce11786867557069a57

mGBA Game Boy Advance Emulator

GBA: Fix savedata type forcing when masked (fixes #1166)
Vicki Pfau vi@endrift.com
Sun, 16 Sep 2018 11:03:21 -0700
commit

1f57dec081f68ba3572c2ce11786867557069a57

parent

69c2969db01c900d000e9c7cdba83db0fd8036e2

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M src/gba/savedata.csrc/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: