all repos — mgba @ 5ddebf5d812450e1d35cb345036aa513a2a749b6

mGBA Game Boy Advance Emulator

GBA Memory: Fix allowed DMA addresses
Jeffrey Pfau jeffrey@endrift.com
Sat, 07 Nov 2015 23:03:57 -0800
commit

5ddebf5d812450e1d35cb345036aa513a2a749b6

parent

b69e5392a1653abfd32346c03d44970273b0ad22

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

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

@@ -1330,14 +1330,11 @@ static bool _isValidDMASAD(int dma, uint32_t address) {

if (dma == 0 && address >= BASE_CART0 && address < BASE_CART_SRAM) { return false; } - return address >= BASE_WORKING_RAM && address < 0x10000000; + return address >= BASE_WORKING_RAM; } static bool _isValidDMADAD(int dma, uint32_t address) { - if (dma < 3 && address >= BASE_CART0 && address < 0x10000000) { - return false; - } - return address >= BASE_WORKING_RAM && address < 0x10000000; + return dma == 3 || address < BASE_CART0; } uint32_t GBAMemoryWriteDMASAD(struct GBA* gba, int dma, uint32_t address) {