| 37 | } |
| 38 | |
| 39 | void vu0ExecMicro(u32 addr) { |
| 40 | VUM_LOG("vu0ExecMicro %x", addr); |
| 41 | |
| 42 | if(VU0.VI[REG_VPU_STAT].UL & 0x1) { |
| 43 | DevCon.Warning("vu0ExecMicro > Stalling for previous microprogram to finish"); |
| 44 | vu0Finish(); |
| 45 | } |
| 46 | |
| 47 | // Need to copy the clip flag back to the interpreter in case COP2 has edited it |
| 48 | const u32 CLIP = VU0.VI[REG_CLIP_FLAG].UL; |
| 49 | const u32 MAC = VU0.VI[REG_MAC_FLAG].UL; |
| 50 | const u32 STATUS = VU0.VI[REG_STATUS_FLAG].UL; |
| 51 | VU0.clipflag = CLIP; |
| 52 | VU0.macflag = MAC; |
| 53 | VU0.statusflag = STATUS; |
| 54 | |
| 55 | // Copy flags to micro instances, since they may be out of sync if COP2 has run. |
| 56 | // We do this at program start time, because COP2 can't execute until the program has completed, |
| 57 | // but long-running program may be interrupted so we can't do it at dispatch time. |
| 58 | vu0SetMicroFlags(VU0.micro_clipflags, CLIP); |
| 59 | vu0SetMicroFlags(VU0.micro_macflags, MAC); |
| 60 | vu0SetMicroFlags(VU0.micro_statusflags, vu0DenormalizeMicroStatus(STATUS)); |
| 61 | |
| 62 | VU0.VI[REG_VPU_STAT].UL &= ~0xFF; |
| 63 | VU0.VI[REG_VPU_STAT].UL |= 0x01; |
| 64 | VU0.cycle = cpuRegs.cycle; |
| 65 | if ((s32)addr != -1) VU0.VI[REG_TPC].UL = addr & 0x1FF; |
| 66 | |
| 67 | CpuVU0->SetStartPC(VU0.VI[REG_TPC].UL << 3); |
| 68 | _vuExecMicroDebug(VU0); |
| 69 | CpuVU0->ExecuteBlock(1); |
| 70 | } |
no test coverage detected