The fetcher state machine advances even while handling an object

This commit is contained in:
Lior Halphon 2020-02-21 21:44:44 +02:00
parent f86e682d2c
commit ea2f32b255

View File

@ -761,6 +761,7 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
GB_STATE(gb, display, 38); GB_STATE(gb, display, 38);
GB_STATE(gb, display, 39); GB_STATE(gb, display, 39);
GB_STATE(gb, display, 40); GB_STATE(gb, display, 40);
GB_STATE(gb, display, 41);
} }
@ -956,8 +957,16 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
} }
} }
gb->cycles_for_line += 4; advance_fetcher_state_machine(gb);
GB_SLEEP(gb, display, 20, 4); gb->cycles_for_line++;
GB_SLEEP(gb, display, 41, 1);
if (gb->object_fetch_aborted) {
goto abort_fetching_object;
}
advance_fetcher_state_machine(gb);
gb->cycles_for_line += 3;
GB_SLEEP(gb, display, 20, 3);
if (gb->object_fetch_aborted) { if (gb->object_fetch_aborted) {
goto abort_fetching_object; goto abort_fetching_object;
} }