From 12cd2d41ec5d45e9da53df139ac9413684f1c09a Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 2 Mar 2011 22:19:56 +0000 Subject: [PATCH] Change YieldCPU to sleep(0) like on windows. Time trials show this to be the most effective. Also, when using usleep(1) and dsp on thread the emulator is painfully slow. With the old _mm_pause() the emulator hangs on shutdown. With sleep(0) the emulator is faster, and doesn't hang on shutdown. Also fix a possible undefined operation (according to gcc). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7275 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.h | 2 +- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/Src/Thread.h b/Source/Core/Common/Src/Thread.h index 6516615932..33ab20fe36 100644 --- a/Source/Core/Common/Src/Thread.h +++ b/Source/Core/Common/Src/Thread.h @@ -141,7 +141,7 @@ void SetCurrentThreadAffinity(u32 mask); #ifdef _WIN32 Sleep(0); #elif defined(_M_IX86) || defined(_M_X64) - usleep(1); + sleep(0); #endif } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index e361c30d53..314b3bfe5a 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -533,7 +533,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update() NetPlay_WiimoteUpdate(wiimote_to_update); Wiimote::Update(wiimote_to_update); } - wiimote_to_update = ++wiimote_to_update % m_WiiMotes.size(); + wiimote_to_update = (wiimote_to_update + 1) % m_WiiMotes.size(); m_last_ticks = now; }