From 3b2a07c264ee4052a56b6c306d38da47dc1e3968 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Wed, 8 Feb 2023 09:20:57 +1100 Subject: [PATCH] if bg/window disabled clear with white --- src/processor/gpu.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/processor/gpu.rs b/src/processor/gpu.rs index 61eb6a7..045df97 100644 --- a/src/processor/gpu.rs +++ b/src/processor/gpu.rs @@ -289,6 +289,11 @@ impl CPU { if lcdc.window_enable { self.render_scanline_window(scanline, lcdc, palette); } + } else { + for x in 0..WIDTH { + self.gpu.buffer[(scanline as usize * WIDTH) + x] = + Colour::from_u8_rgb(255, 255, 255); + } } if lcdc.obj_enable { self.render_scanline_obj(scanline, lcdc);