MCPcopy Create free account
hub / github.com/TASEmulators/fceux / fceuWrapperUpdate

Function fceuWrapperUpdate

src/drivers/Qt/fceuWrapper.cpp:1447–1514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1445}
1446
1447int fceuWrapperUpdate( void )
1448{
1449 bool lock_acq;
1450 static bool mutexLockFail = false;
1451
1452 // If a request is pending,
1453 // sleep to allow request to be serviced.
1454 if ( mutexPending > 0 )
1455 {
1456 msleep( 16 );
1457 }
1458
1459 lock_acq = fceuWrapperTryLock( __FILE__, __LINE__, __func__ );
1460
1461 if ( !lock_acq )
1462 {
1463 if ( GameInfo )
1464 {
1465 if ( !mutexLockFail )
1466 {
1467 printf("Warning: Emulator Thread Failed to Acquire Mutex - GUI has Lock\n");
1468 }
1469 mutexLockFail = true;
1470 }
1471 msleep( 16 );
1472
1473 return -1;
1474 }
1475 mutexLockFail = false;
1476 emulatorHasMutex = 1;
1477
1478 if ( GameInfo )
1479 {
1480 DoFun(frameskip, periodic_saves);
1481
1482 hexEditorUpdateMemoryValues();
1483
1484 if ( consoleWindow )
1485 {
1486 consoleWindow->emulatorThread->signalFrameFinished();
1487 }
1488 fceuWrapperUnLock();
1489
1490 emulatorHasMutex = 0;
1491
1492#ifdef __FCEU_PROFILER_ENABLE__
1493 FCEU_profiler_log_thread_activity();
1494#endif
1495 while ( SpeedThrottle() )
1496 {
1497 // Input device processing is in main thread
1498 // because to MAC OS X SDL2 requires it.
1499 //FCEUD_UpdateInput();
1500 }
1501 }
1502 else
1503 {
1504 fceuWrapperUnLock();

Callers 1

runMethod · 0.85

Calls 8

msleepFunction · 0.85
fceuWrapperTryLockFunction · 0.85
fceuWrapperUnLockFunction · 0.85
signalFrameFinishedMethod · 0.80
DoFunFunction · 0.70
SpeedThrottleFunction · 0.70

Tested by

no test coverage detected