MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ExecuteBlockJIT

Method ExecuteBlockJIT

pcsx2/VUmicro.cpp:66–80  ·  view source on GitHub ↗

This function is called by VU0 Macro (COP2) after transferring some EE data to VU0's registers. We want to run VU0 Micro right after this to ensure that the register is used at the correct time. This fixes spinning/hanging in some games like Ratchet and Clank's Intro.

Source from the content-addressed store, hash-verified

64// to ensure that the register is used at the correct time.
65// This fixes spinning/hanging in some games like Ratchet and Clank's Intro.
66void BaseVUmicroCPU::ExecuteBlockJIT(BaseVUmicroCPU* cpu, bool interlocked)
67{
68 const u32& stat = VU0.VI[REG_VPU_STAT].UL;
69 constexpr int test = 1;
70
71 if (stat & test)
72 { // VU is running
73 s64 delta = (s64)(u64)(cpuRegs.cycle - VU0.cycle);
74
75 if (delta > 0)
76 {
77 cpu->Execute(CalculateMinRunCycles(delta, interlocked)); // Execute the time since the last call
78 }
79 }
80}

Callers

nothing calls this directly

Calls 2

CalculateMinRunCyclesFunction · 0.85
ExecuteMethod · 0.45

Tested by

no test coverage detected