all repos — mgba @ b04bf153048f3452da372e22b6abb8f875d0c915

mGBA Game Boy Advance Emulator

DS Memory: Fix uninitialized values in DS*LoadMultiple
Vicki Pfau vi@endrift.com
Fri, 07 Apr 2017 15:46:01 -0700
commit

b04bf153048f3452da372e22b6abb8f875d0c915

parent

d1d7bafd794cdb3f7eab8f7f3f909d66d7db9a36

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M src/ds/memory.csrc/ds/memory.c

@@ -656,6 +656,7 @@ case DS_REGION_VRAM:

LDM_LOOP(if (address < 0x06040000 && memory->vram7[(address & 0x3FFFF) >> 17]) { LOAD_32(value, address & 0x1FFFF, memory->vram7[(address & 0x3FFFF) >> 17]); } else { + value = 0; mLOG(DS_MEM, STUB, "Unimplemented DS7 LDM: %08X", address); }); break;

@@ -1271,13 +1272,15 @@ case DS9_REGION_ITCM_MIRROR:

LDM_LOOP(if (address < memory->itcmSize) { LOAD_32(value, address & (DS9_SIZE_ITCM - 1), memory->itcm); } else { - mLOG(DS_MEM, STUB, "Bad DS9 LDM: %08X:%08X", address, value); + value = 0; + mLOG(DS_MEM, STUB, "Bad DS9 LDM: %08X", address); }); break; case DS_REGION_WORKING_RAM: LDM_LOOP(if (ds->memory.wramSize9) { LOAD_32(value, address & (ds->memory.wramSize9 - 4), memory->wramBase9); } else { + value = 0; mLOG(DS_MEM, STUB, "Bad DS9 LDM: %08X", address); }); break;

@@ -1287,6 +1290,7 @@ LOAD_32(value, address & (DS9_SIZE_DTCM - 1), memory->dtcm);

} else if ((address & (DS_SIZE_RAM - 1)) < DS_SIZE_RAM) { LOAD_32(value, address & (DS_SIZE_RAM - 1), memory->ram); } else { + value = 0; mLOG(DS_MEM, STUB, "Unimplemented DS9 LDM: %08X", address); }); break;