From 67c0e03f3b88532a726fa33ca202ce72a8e76ef2 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 22 Nov 2020 00:21:19 +0200 Subject: [PATCH] Fix a window bug in CGB mode, fixes #123 --- Core/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/display.c b/Core/display.c index b57317b..c876599 100644 --- a/Core/display.c +++ b/Core/display.c @@ -1021,7 +1021,7 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles) bool should_activate_window = false; if (gb->io_registers[GB_IO_WX] == 0) { static const uint8_t scx_to_wx0_comparisons[] = {-7, -9, -10, -11, -12, -13, -14, -14}; - if (gb->position_in_line == scx_to_wx0_comparisons[gb->io_registers[GB_IO_SCX] & 7]) { + if (gb->position_in_line == scx_to_wx0_comparisons[gb->io_registers[GB_IO_SCX] & 7] && !GB_is_cgb(gb)) { should_activate_window = true; } }