mirror of https://github.com/PCSX2/pcsx2.git
VU: scale VU0 cycle rate with EE
Also fix cycle underflow issue
This commit is contained in:
parent
9b9e70e7e8
commit
50872438e9
|
@ -135,7 +135,7 @@ struct microVU
|
||||||
u32 p; // Holds current P instance index
|
u32 p; // Holds current P instance index
|
||||||
u32 q; // Holds current Q instance index
|
u32 q; // Holds current Q instance index
|
||||||
u32 totalCycles; // Total Cycles that mVU is expected to run for
|
u32 totalCycles; // Total Cycles that mVU is expected to run for
|
||||||
u32 cycles; // Cycles Counter
|
s32 cycles; // Cycles Counter
|
||||||
|
|
||||||
VURegs& regs() const { return ::vuRegs[index]; }
|
VURegs& regs() const { return ::vuRegs[index]; }
|
||||||
|
|
||||||
|
|
|
@ -464,6 +464,32 @@ void mVUtestCycles(microVU& mVU, microFlagCycles& mFC)
|
||||||
{
|
{
|
||||||
iPC = mVUstartPC;
|
iPC = mVUstartPC;
|
||||||
|
|
||||||
|
if (isVU0 && EmuConfig.Speedhacks.EECycleRate != 0)
|
||||||
|
{
|
||||||
|
switch (std::min(static_cast<int>(EmuConfig.Speedhacks.EECycleRate), static_cast<int>(mVUcycles)))
|
||||||
|
{
|
||||||
|
case -3: // 50%
|
||||||
|
mVUcycles *= 2.0f;
|
||||||
|
break;
|
||||||
|
case -2: // 60%
|
||||||
|
mVUcycles *= 1.6666667f;
|
||||||
|
break;
|
||||||
|
case -1: // 75%
|
||||||
|
mVUcycles *= 1.3333333f;
|
||||||
|
break;
|
||||||
|
case 1: // 130%
|
||||||
|
mVUcycles /= 1.3f;
|
||||||
|
break;
|
||||||
|
case 2: // 180%
|
||||||
|
mVUcycles /= 1.8f;
|
||||||
|
break;
|
||||||
|
case 3: // 300%
|
||||||
|
mVUcycles /= 3.0f;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
xMOV(eax, ptr32[&mVU.cycles]);
|
xMOV(eax, ptr32[&mVU.cycles]);
|
||||||
if (EmuConfig.Gamefixes.VUSyncHack)
|
if (EmuConfig.Gamefixes.VUSyncHack)
|
||||||
xSUB(eax, mVUcycles); // Running behind, make sure we have time to run the block
|
xSUB(eax, mVUcycles); // Running behind, make sure we have time to run the block
|
||||||
|
|
|
@ -355,12 +355,12 @@ _mVUt void mVUcleanUp()
|
||||||
mVUreset(mVU, false);
|
mVUreset(mVU, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mVU.cycles = mVU.totalCycles - mVU.cycles;
|
mVU.cycles = mVU.totalCycles - std::max(0, mVU.cycles);
|
||||||
mVU.regs().cycle += mVU.cycles;
|
mVU.regs().cycle += mVU.cycles;
|
||||||
|
|
||||||
if (!vuIndex || !THREAD_VU1)
|
if (!vuIndex || !THREAD_VU1)
|
||||||
{
|
{
|
||||||
u32 cycles_passed = std::min(mVU.cycles, 3000u) * EmuConfig.Speedhacks.EECycleSkip;
|
u32 cycles_passed = std::min(mVU.cycles, 3000) * EmuConfig.Speedhacks.EECycleSkip;
|
||||||
if (cycles_passed > 0)
|
if (cycles_passed > 0)
|
||||||
{
|
{
|
||||||
s32 vu0_offset = VU0.cycle - cpuRegs.cycle;
|
s32 vu0_offset = VU0.cycle - cpuRegs.cycle;
|
||||||
|
|
Loading…
Reference in New Issue