Partial update to CPU copjmp bug emulation.

This commit is contained in:
Dimitris Panokostas 2019-11-09 23:30:47 +01:00
parent f294261c28
commit 3ed2c96c57

View file

@ -5145,7 +5145,19 @@ static void COPJMP (int num, int vblank)
if (!oldstrobe)
cop_state.state_prev = cop_state.state;
if ((cop_state.state == COP_wait || cop_state.state == COP_waitforever) && !vblank && dmaen(DMA_COPPER)) {
cop_state.state = COP_strobe_delay1x;
if (bltstate == BLT_work) {
static int warned = 100;
if (warned > 0) {
write_log(_T("possible buggy copper cycle conflict with blitter PC=%08x\n"), M68K_GETPC);
warned--;
}
}
if (current_hpos() & 1) {
cop_state.state = COP_strobe_delay1x; // CPU unaligned COPJMP while waiting
}
else {
cop_state.state = COP_strobe_delay1;
}
} else {
cop_state.state = vblank ? COP_start_delay : (copper_access ? COP_strobe_delay1 : COP_strobe_extra);
}
@ -6704,9 +6716,15 @@ static void update_copper (int until_hpos)
break;
case COP_strobe_delay1x:
// First cycle after COPJMP and Copper was waiting.
// First cycle after CPU write to COPJMP while Copper was waiting.
// Cycle can be free and copper won't allocate it.
cop_state.state = COP_strobe_delay2x;
if (copper_cant_read(old_hpos)) {
// becomes normal non-buggy cycle if cycle was not free
cop_state.state = COP_strobe_delay2;
}
else {
cop_state.state = COP_strobe_delay2x;
}
break;
case COP_strobe_delay2x:
// Second cycle fetches following word and tosses it away.