all repos — mgba @ 4783e2eef6008b03516491b88b21724cfeaabd10

mGBA Game Boy Advance Emulator

GBA Memory: More DMA register cleanup
Jeffrey Pfau jeffrey@endrift.com
Wed, 11 Nov 2015 23:33:46 -0800
commit

4783e2eef6008b03516491b88b21724cfeaabd10

parent

254721697244411011ab687dad5c18a8c0f2de49

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

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

@@ -1371,7 +1371,11 @@ uint16_t GBAMemoryWriteDMACNT_HI(struct GBA* gba, int dma, uint16_t control) {

struct GBAMemory* memory = &gba->memory; struct GBADMA* currentDma = &memory->dma[dma]; int wasEnabled = GBADMARegisterIsEnable(currentDma->reg); - control &= 0xFFE0; + if (dma < 3) { + control &= 0xF7E0; + } else { + control &= 0xFFE0; + } currentDma->reg = control; if (GBADMARegisterIsDRQ(currentDma->reg)) {