Further simplifications

This commit is contained in:
Lior Halphon 2018-04-07 13:02:53 +03:00
parent 097b768127
commit 0725b008be

View File

@ -505,7 +505,7 @@ static void advance_fetcher_state_machine(GB_gameboy_t *gb)
break; break;
case GB_FETCHER_PUSH: { case GB_FETCHER_PUSH: {
if (fifo_size(&gb->bg_fifo) > 1) break; if (fifo_size(&gb->bg_fifo) > 0) break;
fifo_push_bg_row(&gb->bg_fifo, gb->current_tile_data[0], gb->current_tile_data[1], fifo_push_bg_row(&gb->bg_fifo, gb->current_tile_data[0], gb->current_tile_data[1],
gb->current_tile_attributes & 7, gb->current_tile_attributes & 0x80, gb->current_tile_attributes & 0x20); gb->current_tile_attributes & 7, gb->current_tile_attributes & 0x80, gb->current_tile_attributes & 0x20);
gb->bg_fifo_paused = false; gb->bg_fifo_paused = false;
@ -772,9 +772,9 @@ void GB_display_run(GB_gameboy_t *gb, uint8_t cycles)
gb->fetcher_state = 0; gb->fetcher_state = 0;
} }
render_pixel_if_possible(gb);
advance_fetcher_state_machine(gb); advance_fetcher_state_machine(gb);
render_pixel_if_possible(gb);
if (gb->position_in_line == 160) break; if (gb->position_in_line == 160) break;
gb->cycles_for_line++; gb->cycles_for_line++;
GB_SLEEP(gb, display, 21, 1); GB_SLEEP(gb, display, 21, 1);