From 0069c02e73248eba059ad34c9e4ffba5ffce1c5c Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 4 Aug 2009 18:46:39 +0000 Subject: [PATCH] Put that big pile of double commented code inside an if 0. --- desmume/src/OGLRender.cpp | 60 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index 0503b2bd2..473db91b0 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -713,38 +713,40 @@ static void GL_ReadFramebuffer() } } - ////convert the pixels to a different format which is more convenient - ////is it safe to modify the screen buffer? if not, we could make a temp copy - //for(int i=0,y=191;y>=0;y--) - //{ - // u16* dst = gfx3d_convertedScreen + (y<<8); - // u8* dstAlpha = gfx3d_convertedAlpha + (y<<8); +#if 0 + //convert the pixels to a different format which is more convenient + //is it safe to modify the screen buffer? if not, we could make a temp copy + for(int i=0,y=191;y>=0;y--) + { + u16* dst = gfx3d_convertedScreen + (y<<8); + u8* dstAlpha = gfx3d_convertedAlpha + (y<<8); - // //I dont know much about this kind of stuff, but this seems to help - // //for some reason I couldnt make the intrinsics work - // //u8* u8screen3D = (u8*)&((u32*)GPU_screen3D)[i]; - // /*#define PREFETCH32(X,Y) __asm { prefetchnta [u8screen3D+32*0x##X##Y] } - // #define PREFETCH128(X) PREFETCH32(X,0) PREFETCH32(X,1) PREFETCH32(X,2) PREFETCH32(X,3) \ - // PREFETCH32(X,4) PREFETCH32(X,5) PREFETCH32(X,6) PREFETCH32(X,7) \ - // PREFETCH32(X,8) PREFETCH32(X,9) PREFETCH32(X,A) PREFETCH32(X,B) \ - // PREFETCH32(X,C) PREFETCH32(X,D) PREFETCH32(X,E) PREFETCH32(X,F) - // PREFETCH128(0); PREFETCH128(1);*/ + //I dont know much about this kind of stuff, but this seems to help + //for some reason I couldnt make the intrinsics work + //u8* u8screen3D = (u8*)&((u32*)GPU_screen3D)[i]; + /*#define PREFETCH32(X,Y) __asm { prefetchnta [u8screen3D+32*0x##X##Y] } + #define PREFETCH128(X) PREFETCH32(X,0) PREFETCH32(X,1) PREFETCH32(X,2) PREFETCH32(X,3) \ + PREFETCH32(X,4) PREFETCH32(X,5) PREFETCH32(X,6) PREFETCH32(X,7) \ + PREFETCH32(X,8) PREFETCH32(X,9) PREFETCH32(X,A) PREFETCH32(X,B) \ + PREFETCH32(X,C) PREFETCH32(X,D) PREFETCH32(X,E) PREFETCH32(X,F) + PREFETCH128(0); PREFETCH128(1);*/ - // for(int x=0;x<256;x++,i++) - // { - // u32 &u32screen3D = ((u32*)GPU_screen3D)[i]; - // u32screen3D>>=3; - // u32screen3D &= 0x1F1F1F1F; + for(int x=0;x<256;x++,i++) + { + u32 &u32screen3D = ((u32*)GPU_screen3D)[i]; + u32screen3D>>=3; + u32screen3D &= 0x1F1F1F1F; - // const int t = i<<2; - // const u8 a = GPU_screen3D[t+3]; - // const u8 r = GPU_screen3D[t+2]; - // const u8 g = GPU_screen3D[t+1]; - // const u8 b = GPU_screen3D[t+0]; - // dst[x] = R5G5B5TORGB15(r,g,b) | alpha_lookup[a]; - // dstAlpha[x] = a; - // } - //} + const int t = i<<2; + const u8 a = GPU_screen3D[t+3]; + const u8 r = GPU_screen3D[t+2]; + const u8 g = GPU_screen3D[t+1]; + const u8 b = GPU_screen3D[t+0]; + dst[x] = R5G5B5TORGB15(r,g,b) | alpha_lookup[a]; + dstAlpha[x] = a; + } + } +#endif }