From 9a012af9279ecd341cfed6266ff48dd6b909de10 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 25 Sep 2016 13:39:08 -0700 Subject: [PATCH] GBA Savedata: Fix loading savestates with 512Mb Flash saves --- src/gba/savedata.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gba/savedata.c b/src/gba/savedata.c index 3308b8cf2..63666161a 100644 --- a/src/gba/savedata.c +++ b/src/gba/savedata.c @@ -230,10 +230,9 @@ void GBASavedataInitFlash(struct GBASavedata* savedata, bool realisticTiming) { } 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;