From 538718997fd9c85289669c1b5a8e46a45b6328af Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 3 Feb 2013 15:52:45 -0500 Subject: Write back the data cache before using DMA to draw emulated frames. --- source/nds/entry.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp index 3fa6517..286722e 100644 --- a/source/nds/entry.cpp +++ b/source/nds/entry.cpp @@ -144,6 +144,7 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) //Up case 1: #ifdef DS2_DMA + __dcache_writeback_all(); dma_copy32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 32 * 2, 256 * 192 * 2); dma_wait_finish(1); dma_stop(1); @@ -155,6 +156,7 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) //Down case 2: #ifdef DS2_DMA + __dcache_writeback_all(); dma_copy32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen, 256 * 192 * 2); dma_wait_finish(1); dma_stop(1); @@ -166,6 +168,7 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) //Both case 3: #ifdef DS2_DMA + __dcache_writeback_all(); dma_copy32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 16 * 2, 256 * 192 * 2); dma_wait_finish(1); dma_stop(1); @@ -181,8 +184,11 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) default: { - unsigned char *src, *dst; - unsigned int m; +#ifdef DS2_DMA + __dcache_writeback_all(); +#endif + register unsigned char *src, *dst; + register unsigned int m; src = GFX.Screen; dst = (unsigned char*)up_screen_addr; -- cgit v1.2.3