[Core/CD] fixed regression in SUB-CPU synchronization with CDC DMA introduced by da8e4e547a (fixes freezes in Ultraverse Prime and probably other games)

This commit is contained in:
ekeeke 2024-02-19 20:27:54 +01:00
parent e8a6086c89
commit 3397941b60

View File

@ -444,8 +444,11 @@ void cdc_dma_update(unsigned int cycles)
/* SUB-CPU idle on register $04 polling ? */ /* SUB-CPU idle on register $04 polling ? */
if (s68k.stopped & (1<<0x04)) if (s68k.stopped & (1<<0x04))
{ {
/* sync SUB-CPU with CDC DMA */ /* sync SUB-CPU with CDC DMA (only if not already ahead) */
s68k.cycles = cdc.cycles[0]; if (s68k.cycles < cdc.cycles[0])
{
s68k.cycles = cdc.cycles[0];
}
/* restart SUB-CPU */ /* restart SUB-CPU */
s68k.stopped = 0; s68k.stopped = 0;