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

Function CTC2

pcsx2/VU0.cpp:163–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163void 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}

Callers

nothing calls this directly

Calls 7

vu0SyncFunction · 0.85
_vu0WaitMicroFunction · 0.85
vu0ResetRegsFunction · 0.85
vu1ResetRegsFunction · 0.85
vu1FinishFunction · 0.85
vu1ExecMicroFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected