From 607c3687cadca83a1462e9cd6c3483af893a6e43 Mon Sep 17 00:00:00 2001 From: rogerman Date: Sun, 14 Feb 2016 07:44:01 +0000 Subject: [PATCH] =?UTF-8?q?Cocoa=20Port:=20-=20Fix=20bug=20where=20the=20H?= =?UTF-8?q?UD=20wouldn=E2=80=99t=20report=20the=20correct=20FPS=20if=20mor?= =?UTF-8?q?e=20than=20one=20display=20window=20is=20in=20use.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- desmume/src/cocoa/cocoa_core.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desmume/src/cocoa/cocoa_core.mm b/desmume/src/cocoa/cocoa_core.mm index bd4bad87c..39e9cf52a 100644 --- a/desmume/src/cocoa/cocoa_core.mm +++ b/desmume/src/cocoa/cocoa_core.mm @@ -947,13 +947,14 @@ volatile bool execute = true; NDS_GetCPULoadAverage(loadAvgARM9, loadAvgARM7); pthread_rwlock_unlock(&threadParam.rwlockCoreExecute); + // The timer should fire every 0.5 seconds, so only take the frame + // count every other instance the timer fires. + _isTimerAtSecond = !_isTimerAtSecond; + for (CocoaDSOutput *cdsOutput in cdsOutputList) { if ([cdsOutput isKindOfClass:[CocoaDSDisplay class]]) { - // The timer should fire every 0.5 seconds, so only take the frame - // count every other instance the timer fires. - _isTimerAtSecond = !_isTimerAtSecond; if (_isTimerAtSecond) { [(CocoaDSDisplay *)cdsOutput takeFrameCount];