diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 96e2dde36..586622874 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -1712,6 +1712,8 @@ void NDS_exec(s32 nb) #endif } +//this doesnt work anyway. why take a speed hit for public releases? +#ifndef PUBLIC_RELEASE #ifdef EXPERIMENTAL_WIFI // FIXME: the wifi stuff isn't actually clocked by the ARM7 clock, // but by a 22 mhz oscillator. @@ -1737,6 +1739,7 @@ void NDS_exec(s32 nb) WIFI_SoftAP_usTrigger(&wifiMac); } }*/ +#endif #endif } // for (j = 0; j < INSTRUCTIONS_PER_BATCH && (!FORCE) && (execute); j++) diff --git a/desmume/src/gfx3d.h b/desmume/src/gfx3d.h index 164e96a5c..34304ce2f 100644 --- a/desmume/src/gfx3d.h +++ b/desmume/src/gfx3d.h @@ -54,9 +54,9 @@ inline u32 gfx3d_extendDepth_15_to_24(u32 depth) { //formula from http://nocash.emubase.de/gbatek.htm#ds3drearplane //return (depth*0x200)+((depth+1)>>15)*0x01FF; - //but this is identical for values 0..0x7FFF. prove it to yourself with brute force. - //i think this isnt right since we can't get up to 0x00FFFFFF - return depth<<9; + //I think this might be slightly faster + if(depth==0x7FFF) return 0x00FFFFFF; + else return depth<<9; } #define TEXMODE_NONE 0 diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 3795b99b7..1e6a48c59 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -487,19 +487,8 @@ static FORCEINLINE void pixel(int adr,float r, float g, float b, float invu, flo } else { - //the traditional value depth = u32floor(z*0x7FFF); - - //this would work in sonic chronicles but break battles of prince of persia - //depth = u32floor(z*0xFFFFFF); - - //so we have this compromise: - depth = gfx3d_extendDepth_15_to_24(depth); - - //some contemplation on the matter: - //it seems that everything in the ds uses 15 bit depths - //except that thedepth buffer is 24 bit. but nothing ever uses 24 bits!!! - //this makes no sense. + depth <<= 9; } if(polyAttr.decalMode) {