VIF: Make sure VU's are updated when waiting

This commit is contained in:
refractionpcsx2 2022-12-28 17:23:56 +00:00
parent 4242201777
commit a10b0c5dc5
2 changed files with 8 additions and 0 deletions

View File

@ -136,6 +136,10 @@ __fi void vif0SetupTransfer()
__fi void vif0VUFinish() __fi void vif0VUFinish()
{ {
// Sync up VU0 so we don't errantly wait.
while ((static_cast<int>(cpuRegs.cycle) - static_cast<int>(VU0.cycle)) > 0 && (VU0.VI[REG_VPU_STAT].UL & 0x1))
CpuVU0->ExecuteBlock();
if (VU0.VI[REG_VPU_STAT].UL & 0x5) if (VU0.VI[REG_VPU_STAT].UL & 0x5)
{ {
CPU_INT(VIF_VU0_FINISH, 128); CPU_INT(VIF_VU0_FINISH, 128);

View File

@ -229,6 +229,10 @@ __fi void vif1SetupTransfer()
__fi void vif1VUFinish() __fi void vif1VUFinish()
{ {
// Sync up VU1 so we don't errantly wait.
while (!THREAD_VU1 && (static_cast<int>(cpuRegs.cycle) - static_cast<int>(VU1.cycle)) > 0 && (VU0.VI[REG_VPU_STAT].UL & 0x100))
CpuVU1->ExecuteBlock();
if (VU0.VI[REG_VPU_STAT].UL & 0x500) if (VU0.VI[REG_VPU_STAT].UL & 0x500)
{ {
vu1Thread.Get_MTVUChanges(); vu1Thread.Get_MTVUChanges();