From fc2ebd4ca2f4fd5f7020e4ba6a215924ab21eab7 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Sun, 23 Apr 2023 16:35:35 +1000 Subject: [PATCH] fix error colour correction to be when on cgb rather than when on cgb in cgb mode --- lib/src/processor/memory/mmio/gpu.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/processor/memory/mmio/gpu.rs b/lib/src/processor/memory/mmio/gpu.rs index 189e03f..3114e32 100644 --- a/lib/src/processor/memory/mmio/gpu.rs +++ b/lib/src/processor/memory/mmio/gpu.rs @@ -322,7 +322,7 @@ where } for x in 0..WIDTH { self.buffer[(scanline as usize * WIDTH) + x] = ColourInner::Error - .rgb_bytes(None, self.is_cgb_mode()) + .rgb_bytes(None, self.cgb_data.is_some()) .into(); } if self.lcdc.bg_window_enable { @@ -337,7 +337,7 @@ where } else { for x in 0..WIDTH { self.buffer[(scanline as usize * WIDTH) + x] = ColourInner::Error - .rgb_bytes(None, self.is_cgb_mode()) + .rgb_bytes(None, self.cgb_data.is_some()) .into(); } } @@ -490,7 +490,7 @@ where }); self.buffer[buffer_index] = - colour.rgb_bytes(cgb_data, self.is_cgb_mode()).into(); + colour.rgb_bytes(cgb_data, self.cgb_data.is_some()).into(); } } } @@ -568,7 +568,7 @@ where .map(|v| (v.palettes.bg, attributes.palette)); self.buffer[(scanline as usize * WIDTH) + x] = - colour.rgb_bytes(cgb_data, self.is_cgb_mode()).into(); + colour.rgb_bytes(cgb_data, self.cgb_data.is_some()).into(); } }