diff --git a/src/gtk/system.cpp b/src/gtk/system.cpp index 6160dd42..6c3c98d0 100644 --- a/src/gtk/system.cpp +++ b/src/gtk/system.cpp @@ -39,11 +39,6 @@ u16 systemGbPalette[24]; int emulating; int RGB_LOW_BITS_MASK; -// Extra vars, only used for the GUI -// -int systemRenderedFrames; -int systemFPS; - inline VBA::Window * GUI() { return VBA::Window::poGetInstance(); @@ -62,7 +57,6 @@ void systemMessage(int _iId, const char * _csFormat, ...) void systemDrawScreen() { GUI()->vDrawScreen(); - systemRenderedFrames++; } bool systemReadJoypads() @@ -77,9 +71,6 @@ u32 systemReadJoypad(int joy) void systemShowSpeed(int _iSpeed) { - systemFPS = systemRenderedFrames; - systemRenderedFrames = 0; - GUI()->vShowSpeed(_iSpeed); } diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 2fbe581d..fd60a2cf 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -43,8 +43,6 @@ #include "screenarea-opengl.h" #endif // USE_OPENGL -extern int systemRenderedFrames; -extern int systemFPS; extern int RGB_LOW_BITS_MASK; @@ -556,12 +554,11 @@ void Window::vInitSystem() systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; systemFrameSkip = 2; - systemRenderedFrames = 0; - systemFPS = 0; - emulating = 0; gbFrameSkip = 0; + + m_iFrameCount = 0; soundInit(); } @@ -1149,6 +1146,7 @@ void Window::vPopupErrorV(const char * _csFormat, va_list _args) void Window::vDrawScreen() { m_poScreenArea->vDrawPixels(pix); + m_iFrameCount++; } void Window::vDrawDefaultScreen() @@ -1173,9 +1171,11 @@ void Window::vShowSpeed(int _iSpeed) else if (m_eShowSpeed == ShowDetailed) { snprintf(csTitle, 50, "VBA-M - %d%% (%d, %d fps)", - _iSpeed, systemFrameSkip, systemFPS); + _iSpeed, systemFrameSkip, m_iFrameCount); set_title(csTitle); } + + m_iFrameCount = 0; } void Window::vComputeFrameskip(int _iRate) diff --git a/src/gtk/window.h b/src/gtk/window.h index cf9a3f65..7e6fd05a 100644 --- a/src/gtk/window.h +++ b/src/gtk/window.h @@ -245,6 +245,7 @@ private: int m_bFullscreen; int m_iScreenWidth; int m_iScreenHeight; + int m_iFrameCount; std::string m_sRomFile; ECartridge m_eCartridge;