From 9b75c09a7fd7c78d8c42077478e796672fae5c1b Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Sun, 3 Feb 2013 06:25:12 -0500 Subject: Force waiting for a screen to be transferred (update mode 1) because otherwise the next screen can go into DMA. Use channel 1 instead of channel 5, which must be busy for some reason. --- source/nds/entry.cpp | 24 ++++++++++++------------ source/nds/gui.h | 4 ++++ 2 files changed, 16 insertions(+), 12 deletions(-) (limited to 'source/nds') diff --git a/source/nds/entry.cpp b/source/nds/entry.cpp index 4aa2977..3fa6517 100644 --- a/source/nds/entry.cpp +++ b/source/nds/entry.cpp @@ -144,9 +144,9 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) //Up case 1: #ifdef DS2_DMA - dma_copy32Byte(5 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 32 * 2, 256 * 192 * 2); - dma_wait_finish(5); - dma_stop(5); + dma_copy32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 32 * 2, 256 * 192 * 2); + dma_wait_finish(1); + dma_stop(1); #else memcpy(up_screen_addr, GFX.Screen+256*32*2, 256*192*2); #endif @@ -155,9 +155,9 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) //Down case 2: #ifdef DS2_DMA - dma_copy32Byte(5 /* channel: graphics */, up_screen_addr, GFX.Screen, 256 * 192 * 2); - dma_wait_finish(5); - dma_stop(5); + dma_copy32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen, 256 * 192 * 2); + dma_wait_finish(1); + dma_stop(1); #else memcpy(up_screen_addr, GFX.Screen, 256*192*2); #endif @@ -166,9 +166,9 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) //Both case 3: #ifdef DS2_DMA - dma_copy32Byte(5 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 16 * 2, 256 * 192 * 2); - dma_wait_finish(5); - dma_stop(5); + dma_copy32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 16 * 2, 256 * 192 * 2); + dma_wait_finish(1); + dma_stop(1); #else memcpy(up_screen_addr, GFX.Screen+256*16*2, 256*192*2); #endif @@ -189,9 +189,9 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/) for(m = 0; m < 32; m++) { #ifdef DS2_DMA - dma_copy32Byte(5 /* channel: graphics */, dst, src, 256 * 6 * 2); - dma_wait_finish(5); - dma_stop(5); + dma_copy32Byte(1 /* channel: graphics */, dst, src, 256 * 6 * 2); + dma_wait_finish(1); + dma_stop(1); #else memcpy(dst, src, 256*6*2); #endif diff --git a/source/nds/gui.h b/source/nds/gui.h index b2eae62..9df2ad2 100644 --- a/source/nds/gui.h +++ b/source/nds/gui.h @@ -24,7 +24,11 @@ #include "fs_api.h" #include "gcheat.h" +#ifdef DS2_DMA +#define UP_SCREEN_UPDATE_METHOD 1 +#else #define UP_SCREEN_UPDATE_METHOD 0 +#endif #define DOWN_SCREEN_UPDATE_METHOD 2 #define MAX_GAMEPAD_MAP 16 -- cgit v1.2.3