all repos — mgba @ 5f6cf337a08f18705e6cf1fb8c50487fd5e90817

mGBA Game Boy Advance Emulator

16-bit DMA address writes
Jeffrey Pfau jeffrey@endrift.com
Tue, 30 Apr 2013 23:22:39 -0700
commit

5f6cf337a08f18705e6cf1fb8c50487fd5e90817

parent

da489b90f87e6e4daadc361ce22d13a5c6bb0e09

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

jump to
M src/gba/gba-io.csrc/gba/gba-io.c

@@ -18,6 +18,28 @@ GBAVideoWriteDISPSTAT(&gba->video, value);

break; // DMA + case REG_DMA0SAD_LO: + case REG_DMA0DAD_LO: + case REG_DMA1SAD_LO: + case REG_DMA1DAD_LO: + case REG_DMA2SAD_LO: + case REG_DMA2DAD_LO: + case REG_DMA3SAD_LO: + case REG_DMA3DAD_LO: + GBAIOWrite32(gba, address, (gba->memory.io[(address >> 1) + 1] << 16) | value); + break; + + case REG_DMA0SAD_HI: + case REG_DMA0DAD_HI: + case REG_DMA1SAD_HI: + case REG_DMA1DAD_HI: + case REG_DMA2SAD_HI: + case REG_DMA2DAD_HI: + case REG_DMA3SAD_HI: + case REG_DMA3DAD_HI: + GBAIOWrite32(gba, address - 2, gba->memory.io[(address >> 1) - 1] | (value << 16)); + break; + case REG_DMA0CNT_LO: GBAMemoryWriteDMACNT_LO(&gba->memory, 0, value); break;

@@ -132,8 +154,10 @@ break;

default: GBAIOWrite(gba, address, value & 0xFFFF); GBAIOWrite(gba, address | 2, value >> 16); - break; + return; } + gba->memory.io[address >> 1] = value; + gba->memory.io[(address >> 1) + 1] = value >> 16; } uint16_t GBAIORead(struct GBA* gba, uint32_t address) {