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

View File

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