From 93af0a8e36cb36164bfa66bfd6ca1fb22e6fbd2b Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 27 Dec 2008 08:10:45 +0000 Subject: [PATCH] fix repeating dma. the incremented source and dest address werent being written back into the internal dma control variables. this fixes nsmb parallaxing backgrounds. we still have a rather large BUG in that the updated dma registers can't be read back by the game software. wait until next version to retool the dma control logic. --- desmume/ChangeLog | 1 + desmume/src/MMU.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/desmume/ChangeLog b/desmume/ChangeLog index 8b0975e57..0b09e88b7 100644 --- a/desmume/ChangeLog +++ b/desmume/ChangeLog @@ -22,6 +22,7 @@ - Add secure area decryption from ndstool [zeromus] - change backupmem autodetection to catch more cases of unusual usage patterns [zeromus] - Fixed Thumb LDMIA (fixes ingame Dead'n'Furious) [shash] + - Fix repeating DMA (fixes NSMB parallax BG) [zeromus] Graphics: - Added gfx3d module which emulates the whole GE as part of the core emu. [zeromus] - Moved the windows/cocoa OGLRender to the emu core and replace ogl_collector. diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 1d38f9ca1..a28ab6c63 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -876,6 +876,11 @@ void FASTCALL MMU_doDMA(u32 proc, u32 num) dst += dstinc; src += srcinc; } + + //write back the addresses + DMASrc[proc][num] = src; + if((u & 0x3)!=3) //but dont write back dst if we were supposed to reload + DMADst[proc][num] = dst; } }