From c984c44a840b1318e75f000abf653ba0be3ab4d3 Mon Sep 17 00:00:00 2001 From: shashclp Date: Sun, 7 Jan 2007 20:27:17 +0000 Subject: [PATCH] - Some performance checks in case of sprites disabled --- desmume/src/GPU.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h index 2d301bd35..b50155b7b 100644 --- a/desmume/src/GPU.h +++ b/desmume/src/GPU.h @@ -221,20 +221,26 @@ static INLINE void GPU_ligne(Screen * screen, u16 l) gpu->spriteRender(gpu, l, spr, sprPrio); - if((gpu->BGProp[gpu->ordre[0]]&3)!=3) + if (gpu->sprEnable) { - for(i16 = 0; i16 < 128; ++i16) { - T2WriteLong(dst, i16 << 2, T2ReadLong(spr, i16 << 2)); - } + if((gpu->BGProp[gpu->ordre[0]]&3)!=3) + { + for(i16 = 0; i16 < 128; ++i16) { + T2WriteLong(dst, i16 << 2, T2ReadLong(spr, i16 << 2)); + } + } } for(i8 = 0; i8 < gpu->nbBGActif; ++i8) { modeRender[gpu->prop&7][gpu->ordre[i8]](gpu, gpu->ordre[i8], l, dst); bgprio = gpu->BGProp[gpu->ordre[i8]]&3; - for(i16 = 0; i16 < 256; ++i16) + if (gpu->sprEnable) + { + for(i16 = 0; i16 < 256; ++i16) if(bgprio>=sprPrio[i16]) - T2WriteWord(dst, i16 << 1, T2ReadWord(spr, i16 << 1)); + T2WriteWord(dst, i16 << 1, T2ReadWord(spr, i16 << 1)); + } } }