all repos — mgba @ 261edb3792c564087e8037dba67a4aa5bbc343c9

mGBA Game Boy Advance Emulator

GBA Savedata: Fix save mtime updating when r/o
Vicki Pfau vi@endrift.com
Tue, 08 May 2018 10:20:58 -0700
commit

261edb3792c564087e8037dba67a4aa5bbc343c9

parent

9bf50a9c8930dc5e323d2787572d628360549f40

2 files changed, 9 insertions(+), 6 deletions(-)

jump to
M CHANGESCHANGES

@@ -2,6 +2,7 @@ 0.6.4:

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

@@ -516,12 +516,14 @@ } else if ((savedata->dirty & SAVEDATA_DIRT_SEEN) && frameCount - savedata->dirtAge > CLEANUP_THRESHOLD) {

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!"); + } } } }