From 5ac1ce70b53f75276826bbc4c6c14ba070224130 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 2 Oct 2010 02:04:54 +0000 Subject: [PATCH] repair the rarely used main memory display dma that was broken a year ago --- desmume/src/MMU.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index 2cd59a203..0ec8cd4cf 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -1832,7 +1832,13 @@ void DmaController::doCopy() //generate a copy count depending on various copy mode's behavior u32 todo = wordcount; if(todo == 0) todo = 0x200000; //according to gbatek.. //TODO - this should not work this way for arm7 according to gbatek - if(startmode == EDMAMode_MemDisplay) todo = 128; //this is a hack. maybe an alright one though. it should be 4 words at a time. this is a whole scanline + if(startmode == EDMAMode_MemDisplay) + { + todo = 128; //this is a hack. maybe an alright one though. it should be 4 words at a time. this is a whole scanline + + //apparently this dma turns off after it finishes a frame + if(nds.VCount==191) enable = 0; + } if(startmode == EDMAMode_Card) todo *= 0x80; if(startmode == EDMAMode_GXFifo) todo = std::min(todo,(u32)112);