Executes a Block based on EE delta time
| 25 | |
| 26 | // Executes a Block based on EE delta time |
| 27 | void BaseVUmicroCPU::ExecuteBlock(bool startUp) |
| 28 | { |
| 29 | const u32& stat = VU0.VI[REG_VPU_STAT].UL; |
| 30 | const int test = m_Idx ? 0x100 : 1; |
| 31 | |
| 32 | if (m_Idx && THREAD_VU1) |
| 33 | { |
| 34 | vu1Thread.Get_MTVUChanges(); |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | if (!(stat & test)) |
| 39 | { |
| 40 | // VU currently flushes XGKICK on VU1 end so no need for this, yet |
| 41 | /*if (m_Idx == 1 && VU1.xgkickenable) |
| 42 | { |
| 43 | _vuXGKICKTransfer((cpuRegs.cycle - VU1.xgkicklastcycle), false); |
| 44 | }*/ |
| 45 | return; |
| 46 | } |
| 47 | |
| 48 | if (startUp) |
| 49 | { |
| 50 | Execute(CalculateMinRunCycles(0, false)); |
| 51 | } |
| 52 | else // Continue Executing |
| 53 | { |
| 54 | u64 cycle = m_Idx ? VU1.cycle : VU0.cycle; |
| 55 | s32 delta = (s32)(u32)(cpuRegs.cycle - cycle); |
| 56 | |
| 57 | if (delta > 0) |
| 58 | Execute(CalculateMinRunCycles(delta, false)); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // This function is called by VU0 Macro (COP2) after transferring some |
| 63 | // EE data to VU0's registers. We want to run VU0 Micro right after this |