mirror of https://github.com/mgba-emu/mgba.git
Fixed the first load from SRAM not returning a value
This commit is contained in:
parent
9c922862e8
commit
cd448324c5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue