From 408bee8ca1fdc83c15422c323a9e27bf8d35bfcd Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Thu, 5 Aug 2021 13:22:13 -0700 Subject: [PATCH] Clear BG/window when it is not displayed --- src/emulator.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/emulator.c b/src/emulator.c index 47520c9..034cb13 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -3324,6 +3324,14 @@ static void ppu_mode3_synchronize(Emulator* e) { pixel[i] = pal->color[palette_index]; bg_is_zero[i] = palette_index == 0; bg_priority[i] = priority; + } else { + if (IS_CGB) { + pixel[i] = PPU.bgcp.palettes[0].color[0]; + } else if (IS_SGB) { + pixel[i] = e->sgb_pal[0].color[0]; + } else { + pixel[i] = e->color_to_rgba[0].color[0]; + } } }