diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index e5209524..2fb5b2d8 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -264,6 +264,7 @@ extern SNPServer NPServer; __int64 PCBase, PCFrameTime, PCFrameTimeNTSC, PCFrameTimePAL, PCStart, PCEnd; DWORD PCStartTicks, PCEndTicks; +bool PCFrameTimeIsDefault = true; INT_PTR CALLBACK DlgSoundConf(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgInfoProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -274,7 +275,6 @@ INT_PTR CALLBACK DlgOpenROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara INT_PTR CALLBACK DlgMultiROMProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK DlgChildSplitProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgNPProgress(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK DlgPackConfigProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgNetConnect(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgNPOptions(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); @@ -3579,7 +3579,8 @@ int WINAPI WinMain( { ProcessInput(); - while(!S9xSyncSound()) { + // no sound sync when speed is not set to 100% + while(PCFrameTimeIsDefault && !S9xSyncSound()) { ResetEvent(GUI.SoundSyncEvent); if(WaitForSingleObject(GUI.SoundSyncEvent,1000) != WAIT_OBJECT_0) S9xClearSamples(); @@ -4041,6 +4042,8 @@ static void ResetFrameTimer () else if (Settings.FrameTime == Settings.FrameTimePAL) PCFrameTime = PCFrameTimePAL; else PCFrameTime = (__int64)((double)(PCBase * Settings.FrameTime) * .000001); + // determines if we can do sound sync + PCFrameTimeIsDefault = Settings.PAL ? Settings.FrameTime == Settings.FrameTimePAL : Settings.FrameTime == Settings.FrameTimeNTSC; if (GUI.hFrameTimer) timeKillEvent (GUI.hFrameTimer);