From 2a8f15c68be9b159d8536958ed0830fe58355189 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 28 Feb 2020 18:10:09 +0200 Subject: [PATCH] The fetcher pushes pixels to the FIFO as soon as it's empty --- Core/display.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Core/display.c b/Core/display.c index b4455fd..d6acaf3 100644 --- a/Core/display.c +++ b/Core/display.c @@ -656,7 +656,7 @@ static void advance_fetcher_state_machine(GB_gameboy_t *gb) } } gb->fetcher_state++; - break; + // fallthrough case GB_FETCHER_PUSH: { @@ -964,7 +964,7 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles) fifo_clear(&gb->bg_fifo); gb->bg_fifo_paused = true; gb->oam_fifo_paused = true; - gb->fetcher_state = 1; + gb->fetcher_state = 0; window_got_activated = true; } } @@ -988,7 +988,6 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles) /* TODO: This is wrong. It is only correct for a single object, not for more than one. */ if (window_got_activated) { window_got_activated = false; - gb->fetcher_state = 0; gb->cycles_for_line += 6; GB_SLEEP(gb, display, 42, 6); }