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
1 changed files with 11 additions and 2 deletions

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, 39);
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;
GB_SLEEP(gb, display, 20, 4);
advance_fetcher_state_machine(gb);
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) {
goto abort_fetching_object;
}