From b6a35f7833411ff8bda72d5e7270f1869d40bbcc Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Thu, 3 Feb 2005 23:31:40 +0000 Subject: [PATCH] Mirror F1/F3 menu CPU usage fix in Windows version and a type in the previous commit I just put in CVS a second ago --- zsnes/src/linux/sdllink.c | 2 +- zsnes/src/win/winlink.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index 94631501..f685c90c 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -1047,7 +1047,7 @@ void UpdateVFrame(void) int i; //Quick fix for GUI CPU usage - if (GUIOn | GUIOn2) usleep(6000); + if (GUIOn || GUIOn2) usleep(6000); CheckTimers(); Main_Proc(); diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 80521731..94b6598c 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -422,6 +422,7 @@ BOOL InputDeAcquire(void) extern "C" { void initwinvideo(); void DosExit(void); +extern BYTE GUIOn; extern BYTE GUIOn2; extern BYTE cfgsoundon; extern BYTE StereoSound; @@ -658,7 +659,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { IsActivated = 0; InputDeAcquire(); - if (GUIOn2 == 1) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); + if (GUIOn || GUIOn2) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); } break; case WM_SETFOCUS: @@ -669,7 +670,7 @@ LRESULT CALLBACK Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_KILLFOCUS: InputDeAcquire(); IsActivated = 0; - if (GUIOn2 == 1) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); + if (GUIOn || GUIOn2) SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS); break; case WM_DESTROY: break; @@ -2110,7 +2111,7 @@ void CheckTimers(void) { // Lame fix for GUI using 100% CPU - if (GUIOn2) Sleep(1); + if (GUIOn || GUIOn2) Sleep(1); QueryPerformanceCounter((LARGE_INTEGER*)&end2);