Fixed the first load from SRAM not returning a value
Jeffrey Pfau jeffrey@endrift.com
Sat, 26 Oct 2013 03:04:21 -0700
1 files changed,
2 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-memory.c
→
src/gba/gba-memory.c
@@ -318,7 +318,8 @@ case BASE_CART_SRAM:
wait = gbaMemory->waitstates16[address >> BASE_OFFSET]; if (gbaMemory->savedata.type == SAVEDATA_NONE) { GBASavedataInitSRAM(&gbaMemory->savedata); - } else if (gbaMemory->savedata.type == SAVEDATA_SRAM) { + } + if (gbaMemory->savedata.type == SAVEDATA_SRAM) { value = gbaMemory->savedata.data[address & (SIZE_CART_SRAM - 1)]; } else if (gbaMemory->savedata.type == SAVEDATA_FLASH512 || gbaMemory->savedata.type == SAVEDATA_FLASH1M) { value = GBASavedataReadFlash(&gbaMemory->savedata, address);