Skip to content

Commit

Permalink
Waiting for blitter hang fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioni committed Jun 1, 2023
1 parent f190066 commit 07b628f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions blitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1929,9 +1929,21 @@ static bool waitingblits (void)
}

bool waited = false;
int waiting = 0;
int vpos_prev = vpos;
while ((blt_info.blit_main || blt_info.blit_finald) && dmaen (DMA_BLITTER)) {
waited = true;
x_do_cycles (8 * CYCLE_UNIT);
if (vpos_prev != vpos) {
vpos_prev = vpos;
waiting++;
if (waiting > maxvpos * 5) {
break;
}
}
if (blitter_cycle_exact && blit_cyclecounter > 0 && !shifter[0] && !shifter[1] && !shifter[2] && !shifter[3]) {
break;
}
}
if (warned && waited) {
warned--;
Expand Down

0 comments on commit 07b628f

Please sign in to comment.