diff --git a/CHANGES b/CHANGES index 0fae58d42..0c1b86dcb 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ Features: Bugfixes: - Util: Fix PowerPC PNG read/write pixel order - Qt: Use safer isLoaded check in GameController + - GBA Memory: Fix DMAs from BIOS while not in BIOS Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper diff --git a/src/gba/memory.c b/src/gba/memory.c index a0dbaec2f..393ac3b79 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -330,7 +330,12 @@ static void GBASetActiveRegion(struct ARMCore* cpu, uint32_t address) { LOAD_32(value, address, memory->bios); \ } else { \ GBALog(gba, GBA_LOG_GAME_ERROR, "Bad BIOS Load32: 0x%08X", address); \ - value = memory->biosPrefetch; \ + if (memory->activeDMA) { \ + /* TODO: Test on hardware */ \ + value = 0; \ + } else { \ + value = memory->biosPrefetch; \ + } \ } \ } else { \ GBALog(gba, GBA_LOG_GAME_ERROR, "Bad memory Load32: 0x%08X", address); \ @@ -446,7 +451,11 @@ uint32_t GBALoad16(struct ARMCore* cpu, uint32_t address, int* cycleCounter) { LOAD_16(value, address, memory->bios); } else { GBALog(gba, GBA_LOG_GAME_ERROR, "Bad BIOS Load16: 0x%08X", address); - value = (memory->biosPrefetch >> ((address & 2) * 8)) & 0xFFFF; + if (memory->activeDMA) { + value = 0; + } else { + value = (memory->biosPrefetch >> ((address & 2) * 8)) & 0xFFFF; + } } } else { GBALog(gba, GBA_LOG_GAME_ERROR, "Bad memory Load16: 0x%08X", address);