aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNebuleon Fumika2013-02-03 15:52:45 -0500
committerNebuleon Fumika2013-02-03 15:52:45 -0500
commit538718997fd9c85289669c1b5a8e46a45b6328af (patch)
treed0f6e40ae2cb45d72ec52578bed12a728cbe7cd6
parent397bf5192a44ea95a82a9792cb7a8a23b112bb3e (diff)
downloadsnes9x2005-538718997fd9c85289669c1b5a8e46a45b6328af.tar.gz
snes9x2005-538718997fd9c85289669c1b5a8e46a45b6328af.tar.bz2
snes9x2005-538718997fd9c85289669c1b5a8e46a45b6328af.zip
Write back the data cache before using DMA to draw emulated frames.
-rw-r--r--source/nds/entry.cpp10
1 files 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;