GBA Savedata: Fix potential corruption when loading a 1Mbit flash save
Vicki Pfau vi@endrift.com
Mon, 27 Jul 2020 00:28:56 -0700
2 files changed,
2 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -23,6 +23,7 @@ - GBA BIOS: Fix reloading video registers after reset (fixes mgba.io/i/1808)
- GBA DMA: Linger last DMA on bus (fixes mgba.io/i/301 and mgba.io/i/1320) - GBA Memory: Improve gamepak prefetch timing - GBA Memory: Stall on VRAM access in mode 2 (fixes mgba.io/i/190) + - GBA Savedata: Fix potential corruption when loading a 1Mbit flash save - GBA SIO: Fix copying Normal mode transfer values - GBA Video: Latch scanline at end of Hblank (fixes mgba.io/i/1319) - GBA Video: Fix Hblank timing
M
src/gba/savedata.c
→
src/gba/savedata.c
@@ -599,7 +599,6 @@ }
void _flashSwitchBank(struct GBASavedata* savedata, int bank) { mLOG(GBA_SAVE, DEBUG, "Performing flash bank switch to bank %i", bank); - savedata->currentBank = &savedata->data[bank << 16]; if (bank > 0 && savedata->type == SAVEDATA_FLASH512) { mLOG(GBA_SAVE, INFO, "Updating flash chip from 512kb to 1Mb"); savedata->type = SAVEDATA_FLASH1M;@@ -614,6 +613,7 @@ savedata->data = savedata->vf->map(savedata->vf, SIZE_CART_FLASH1M, MAP_WRITE);
} } } + savedata->currentBank = &savedata->data[bank << 16]; } void _flashErase(struct GBASavedata* savedata) {