all repos — mgba @ 9a012af9279ecd341cfed6266ff48dd6b909de10

mGBA Game Boy Advance Emulator

GBA Savedata: Fix loading savestates with 512Mb Flash saves
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Sep 2016 13:39:08 -0700
commit

9a012af9279ecd341cfed6266ff48dd6b909de10

parent

f64a999e7fe89dfdc722c3259f26e710ce8bc722

1 files changed, 2 insertions(+), 3 deletions(-)

jump to
M src/gba/savedata.csrc/gba/savedata.c

@@ -230,10 +230,9 @@ savedata->data = anonymousMemoryMap(SIZE_CART_FLASH1M);

} else { end = savedata->vf->size(savedata->vf); if (end < flashSize) { - savedata->vf->truncate(savedata->vf, SIZE_CART_FLASH1M); - flashSize = SIZE_CART_FLASH1M; + savedata->vf->truncate(savedata->vf, flashSize); } - savedata->data = savedata->vf->map(savedata->vf, SIZE_CART_FLASH1M, savedata->mapMode); + savedata->data = savedata->vf->map(savedata->vf, flashSize, savedata->mapMode); } savedata->currentBank = savedata->data;