16-bit DMA address writes
Jeffrey Pfau jeffrey@endrift.com
Tue, 30 Apr 2013 23:22:39 -0700
1 files changed,
25 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-io.c
→
src/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) {