all repos — mgba @ 19d2f68a283d299ec56f6c3ea895d6d6c105c654

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

19d2f68a283d299ec56f6c3ea895d6d6c105c654

parent

9c4de0e30cad0f60c70b78a91b74b7a2f5449850

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;