Fixed the first load from SRAM not returning a value

This commit is contained in:
Jeffrey Pfau 2013-10-26 03:04:21 -07:00
parent 9c922862e8
commit cd448324c5
1 changed files with 2 additions and 1 deletions

View File

@ -318,7 +318,8 @@ int8_t GBALoad8(struct ARMMemory* memory, uint32_t address, int* cycleCounter) {
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);