From aca7687edd3f1c437955db911130ac7514a2b45b Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Mon, 20 Feb 2017 22:52:34 +0200 Subject: [PATCH] Fixed a bug where LYC would be compared to the wrong value in the first cycle of a frame --- Core/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/display.c b/Core/display.c index 71396d40..76819da6 100755 --- a/Core/display.c +++ b/Core/display.c @@ -380,7 +380,7 @@ static void update_display_state(GB_gameboy_t *gb, uint8_t cycles) gb->io_registers[GB_IO_STAT] &= ~3; gb->io_registers[GB_IO_STAT] |= 2; } - else if (position_in_line == 0) { + else if (position_in_line == 0 && gb->display_cycles != 0) { should_compare_ly = gb->is_cgb; ly_for_comparison--; }