From bdfb1446957bd40543ef294a7a16726614918b7f Mon Sep 17 00:00:00 2001 From: damdoum Date: Tue, 9 Jan 2007 13:59:38 +0000 Subject: [PATCH] tried to add core A - direct RAM display mode --- desmume/src/GPU.c | 13 +++++++++++++ desmume/src/GPU.h | 12 ++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/desmume/src/GPU.c b/desmume/src/GPU.c index 33fa663d7..835095726 100644 --- a/desmume/src/GPU.c +++ b/desmume/src/GPU.c @@ -143,6 +143,19 @@ void GPU_setVideoProp(GPU * gpu, u32 p) gpu->vramBlock = cnt->VRAM_Block; return; case 3: // Display from Main RAM + { + /* would need a test to see if it works */ +// u16 x,y; u32 c; +// u16 * dst = GPU_screen; +// for (y=0; y<192; y++) +// for (x=0; x<256; x+=2) { +// c = FIFOValue(REG_DISPA_DISPMMEMFIFO); +// T2WriteWord(dst, 0, c&0xFFFF); dst++; +// T2WriteWord(dst, 0, c>>16); dst++; +// } + + } + LOG("FIXME: Display Mode 3 not supported(Display from Main RAM)\n"); return; } diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index aeea6f183..5096c81db 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -27,6 +27,7 @@ #include "ARM9.h" #include #include "mem.h" +#include "registers.h" #ifdef __cplusplus extern "C" { @@ -278,7 +279,7 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) u8 i8; u16 i16; u32 c; - + // This could almost be changed to use function pointers switch (gpu->dispMode) { @@ -304,7 +305,14 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) } return; } - case 3: // Display from Main RAM(FIX ME) + case 3: + // it is just a wild wild guess (WWG) + // I dont need a game using this mode ... + for (i=0; i<256;) { + c = FIFOValue(REG_DISPA_DISPMMEMFIFO); + T2WriteWord(dst, i << 1, c&0xFFFF); i++; + T2WriteWord(dst, i << 1, c>>16); i++; + } return; }