mirror of
https://github.com/libretro/mgba.git
synced 2024-11-27 18:20:33 +00:00
GBA Memory: Fix DMAs from BIOS while not in BIOS
DMAs appear to have special protections against reading from the BIOS, causing BIOS reads to be entirely zero. This behavior needs confirmation on hardware, but seems to make sense.
This commit is contained in:
parent
b5afb04ca5
commit
b8b7ec0b12
1
CHANGES
1
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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user