GBA Savedata: Fix loading savestates with 512Mb Flash saves

This commit is contained in:
Jeffrey Pfau 2016-09-25 13:39:08 -07:00
parent 9c4de0e30c
commit 19d2f68a28
1 changed files with 2 additions and 3 deletions

View File

@ -230,10 +230,9 @@ void GBASavedataInitFlash(struct GBASavedata* savedata, bool realisticTiming) {
} else { } else {
end = savedata->vf->size(savedata->vf); end = savedata->vf->size(savedata->vf);
if (end < flashSize) { if (end < flashSize) {
savedata->vf->truncate(savedata->vf, SIZE_CART_FLASH1M); savedata->vf->truncate(savedata->vf, flashSize);
flashSize = SIZE_CART_FLASH1M;
} }
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; savedata->currentBank = savedata->data;