| 161 | } |
| 162 | |
| 163 | void CTC2() { |
| 164 | vu0Sync(); |
| 165 | |
| 166 | if (cpuRegs.code & 1) { |
| 167 | _vu0WaitMicro(); |
| 168 | } |
| 169 | |
| 170 | if (_Fs_ == 0) return; |
| 171 | |
| 172 | switch(_Fs_) { |
| 173 | case REG_MAC_FLAG: // read-only |
| 174 | case REG_TPC: // read-only |
| 175 | case REG_VPU_STAT: // read-only |
| 176 | break; |
| 177 | case REG_R: |
| 178 | VU0.VI[REG_R].UL = ((cpuRegs.GPR.r[_Rt_].UL[0] & 0x7FFFFF) | 0x3F800000); |
| 179 | break; |
| 180 | case REG_FBRST: |
| 181 | VU0.VI[REG_FBRST].UL = cpuRegs.GPR.r[_Rt_].UL[0] & 0x0C0C; |
| 182 | if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x1) { // VU0 Force Break |
| 183 | Console.Error("fixme: VU0 Force Break"); |
| 184 | } |
| 185 | if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x2) { // VU0 Reset |
| 186 | //Console.WriteLn("fixme: VU0 Reset"); |
| 187 | vu0ResetRegs(); |
| 188 | } |
| 189 | if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x100) { // VU1 Force Break |
| 190 | Console.Error("fixme: VU1 Force Break"); |
| 191 | } |
| 192 | if (cpuRegs.GPR.r[_Rt_].UL[0] & 0x200) { // VU1 Reset |
| 193 | // Console.WriteLn("fixme: VU1 Reset"); |
| 194 | vu1ResetRegs(); |
| 195 | } |
| 196 | break; |
| 197 | case REG_CMSAR1: // REG_CMSAR1 |
| 198 | vu1Finish(true); |
| 199 | vu1ExecMicro(cpuRegs.GPR.r[_Rt_].US[0]); // Execute VU1 Micro SubRoutine |
| 200 | break; |
| 201 | case REG_CLIP_FLAG: |
| 202 | VU0.clipflag = cpuRegs.GPR.r[_Rt_].UL[0]; |
| 203 | default: |
| 204 | VU0.VI[_Fs_].UL = cpuRegs.GPR.r[_Rt_].UL[0]; |
| 205 | break; |
| 206 | } |
| 207 | } |
nothing calls this directly
no test coverage detected