diff --git a/CHANGES b/CHANGES index 5452178e2..2e8cff791 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Bugfixes: - GBA Video: Mark OAM dirty on reset (fixes mgba.io/i/1062) - GBA Hardware: Fix RTC overriding light sensor (fixes mgba.io/i/1069) + - GBA Savedata: Fix savedata modified time updating when read-only 0.6.3: (2017-04-14) Bugfixes: diff --git a/src/gba/savedata.c b/src/gba/savedata.c index c8c6c8be7..e65b441a3 100644 --- a/src/gba/savedata.c +++ b/src/gba/savedata.c @@ -516,12 +516,14 @@ void GBASavedataClean(struct GBASavedata* savedata, uint32_t frameCount) { if (savedata->maskWriteback) { GBASavedataUnmask(savedata); } - size_t size = GBASavedataSize(savedata); - savedata->dirty = 0; - if (savedata->data && savedata->vf->sync(savedata->vf, savedata->data, size)) { - mLOG(GBA_SAVE, INFO, "Savedata synced"); - } else { - mLOG(GBA_SAVE, INFO, "Savedata failed to sync!"); + if (savedata->mapMode & MAP_WRITE) { + size_t size = GBASavedataSize(savedata); + savedata->dirty = 0; + if (savedata->data && savedata->vf->sync(savedata->vf, savedata->data, size)) { + mLOG(GBA_SAVE, INFO, "Savedata synced"); + } else { + mLOG(GBA_SAVE, INFO, "Savedata failed to sync!"); + } } } }