MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / CPU_Go

Function CPU_Go

Source/Core/Dynamo.cpp:230–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228// Process these tasks and loop
229//*****************************************************************************
230template < bool DynaRec, bool TraceEnabled > void CPU_Go()
231{
232 DAEDALUS_PROFILE( __FUNCTION__ );
233
234 while (CPU_KeepRunning())
235 {
236 //
237 // Keep executing ops as long as there's nothing to do
238 //
239 u32 stuff_to_do( gCPUState.GetStuffToDo() );
240 while(stuff_to_do == 0)
241 {
242 CPU_EXECUTE_OP< TraceEnabled >();
243
244 stuff_to_do = gCPUState.GetStuffToDo();
245 }
246
247 if( TraceEnabled && (stuff_to_do != CPU_CHANGE_CORE) )
248 {
249 if(gTraceRecorder.IsTraceActive())
250 {
251#ifdef DAEDALUS_DEBUG_DYNAREC
252 u32 start_address( gTraceRecorder.GetStartTraceAddress() );
253 //DBGConsole_Msg( 0, "Aborting tracing of [R%08x] - StuffToDo is %08x", start_address, stuff_to_do );
254
255 gAbortedTraceReasons[ start_address ] = stuff_to_do;
256#endif
257
258#ifdef ALLOW_TRACES_WHICH_EXCEPT
259 if(stuff_to_do == CPU_CHECK_INTERRUPTS && gCPUState.Delay == NO_DELAY ) // Note checking for exactly equal, not just that it's set
260 {
261 //DBGConsole_Msg( 0, "Adding chunk at %08x after interrupt\n", gTraceRecorder.GetStartTraceAddress() );
262 gTraceRecorder.StopTrace( gCPUState.CurrentPC );
263 CPU_CreateAndAddFragment();
264 }
265#endif
266
267 gTraceRecorder.AbortTrace(); // Abort any traces that were terminated through an interrupt etc
268 }
269 CPU_SelectCore();
270 }
271
272 if (CPU_CheckStuffToDo())
273 break;
274 }
275}
276
277#ifdef DAEDALUS_DEBUG_DYNAREC
278

Callers

nothing calls this directly

Calls 7

CPU_CreateAndAddFragmentFunction · 0.85
CPU_SelectCoreFunction · 0.85
CPU_CheckStuffToDoFunction · 0.85
IsTraceActiveMethod · 0.80
GetStartTraceAddressMethod · 0.80
StopTraceMethod · 0.80
AbortTraceMethod · 0.80

Tested by

no test coverage detected