VU: Improved EE Cycle Skipping hack to work better with the new VU0 sync changes

This commit is contained in:
refractionpcsx2 2020-08-30 17:15:18 +01:00
parent 10aced77f0
commit 87dc885a4a
2 changed files with 13 additions and 1 deletions

View File

@ -330,6 +330,7 @@ void VU_Thread::ExecuteVU(u32 vu_addr, u32 vif_top, u32 vif_itop)
KickStart();
u32 cycles = std::min(Get_vuCycles(), 3000u);
cpuRegs.cycle += cycles * EmuConfig.Speedhacks.EECycleSkip;
VU0.cycle += cycles * EmuConfig.Speedhacks.EECycleSkip;
}
void VU_Thread::VifUnpack(vifStruct& _vif, VIFregisters& _vifRegs, u8* data, u32 size)

View File

@ -167,7 +167,18 @@ _mVUt void mVUcleanUp() {
mVU.regs().cycle += mVU.cycles;
if (!vuIndex || !THREAD_VU1) {
cpuRegs.cycle += std::min(mVU.cycles, 3000u) * EmuConfig.Speedhacks.EECycleSkip;
u32 cycles_passed = std::min(mVU.cycles, 3000u) * EmuConfig.Speedhacks.EECycleSkip;
if (cycles_passed > 0) {
s32 vu0_offset = VU0.cycle - cpuRegs.cycle;
cpuRegs.cycle += cycles_passed;
// VU0 needs to stay in sync with the CPU otherwise things get messy
// So we need to adjust when VU1 skips cycles also
if (!vuIndex)
VU0.cycle = cpuRegs.cycle + vu0_offset;
else
VU0.cycle += cycles_passed;
}
}
mVU.profiler.Print();
//static int ax = 0; ax++;