From 2d542a64c79bb65c2a36b811126ba10ea0cd3ab6 Mon Sep 17 00:00:00 2001 From: shashclp Date: Thu, 11 Jan 2007 05:51:26 +0000 Subject: [PATCH] - Fixed too much background enabled when not needed due to window handling (fixes Megaman ZX subscreen) --- desmume/src/GPU.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desmume/src/GPU.c b/desmume/src/GPU.c index d9a8ecda0..03a644bee 100644 --- a/desmume/src/GPU.c +++ b/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));