diff options
Diffstat (limited to 'src/DMA.cpp')
-rw-r--r-- | src/DMA.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/DMA.cpp b/src/DMA.cpp index 432e0f2..95aa9e6 100644 --- a/src/DMA.cpp +++ b/src/DMA.cpp @@ -246,12 +246,14 @@ s32 DMA::Run(s32 cycles) if (!(Cnt & 0x04000000)) { - u16 (*readfn)(u32) = CPU ? NDS::ARM7Read16 : NDS::ARM9Read16; - void (*writefn)(u32,u16) = CPU ? NDS::ARM7Write16 : NDS::ARM9Write16; + int (*readfn)(u32,u32*) = CPU ? NDS::ARM7Read16 : NDS::ARM9Read16; + int (*writefn)(u32,u16) = CPU ? NDS::ARM7Write16 : NDS::ARM9Write16; while (IterCount > 0 && cycles > 0 && !Stall) { - writefn(CurDstAddr, readfn(CurSrcAddr)); + u32 val; + readfn(CurSrcAddr, &val); + writefn(CurDstAddr, val); s32 c = (Waitstates[0][(CurSrcAddr >> 24) & 0xF] + Waitstates[0][(CurDstAddr >> 24) & 0xF]); cycles -= c; @@ -283,12 +285,14 @@ s32 DMA::Run(s32 cycles) } }*/ - u32 (*readfn)(u32) = CPU ? NDS::ARM7Read32 : NDS::ARM9Read32; - void (*writefn)(u32,u32) = CPU ? NDS::ARM7Write32 : NDS::ARM9Write32; + int (*readfn)(u32,u32*) = CPU ? NDS::ARM7Read32 : NDS::ARM9Read32; + int (*writefn)(u32,u32) = CPU ? NDS::ARM7Write32 : NDS::ARM9Write32; while (IterCount > 0 && cycles > 0 && !Stall) { - writefn(CurDstAddr, readfn(CurSrcAddr)); + u32 val; + readfn(CurSrcAddr, &val); + writefn(CurDstAddr, val); s32 c = (Waitstates[1][(CurSrcAddr >> 24) & 0xF] + Waitstates[1][(CurDstAddr >> 24) & 0xF]); cycles -= c; |