diff --git a/trunk/desmume/src/GPU.c b/trunk/desmume/src/GPU.c index d9a8ecda0..03a644bee 100644 --- a/trunk/desmume/src/GPU.c +++ b/trunk/desmume/src/GPU.c @@ -128,7 +128,7 @@ void GPU_DeInit(GPU * gpu) void GPU_setVideoProp(GPU * gpu, u32 p) { BOOL LayersEnable[5]; - u16 WinBG; + u16 WinBG=0; struct _DISPCNT * cnt = &gpu->dispCnt.bitfield; gpu->dispCnt.integer = p; @@ -185,8 +185,11 @@ void GPU_setVideoProp(GPU * gpu, u32 p) GPU_setBGProp(gpu, 1, T1ReadWord(ARM9Mem.ARM9_REG, gpu->core * ADDRESS_STEP_4KB + 10)); GPU_setBGProp(gpu, 0, T1ReadWord(ARM9Mem.ARM9_REG, gpu->core * ADDRESS_STEP_4KB + 8)); + if (cnt->Win0_Enable || cnt->Win1_Enable) + { WinBG = (gpu->WINDOW_INCNT.val | gpu->WINDOW_OUTCNT.val); WinBG = WinBG | (WinBG >> 8); + } // Let's prepare the field for WINDOWS implementation LayersEnable[0] = gpu->dispBG[0] && (cnt->BG0_Enable || (WinBG & 0x1));