From 3997243143b4fdec0c6e1c7347896fa7c196927c Mon Sep 17 00:00:00 2001 From: nodchip Date: Sun, 11 Jul 2010 03:16:52 +0000 Subject: [PATCH] [Core] Added a wait before a spin wait. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5869 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index bfd18e4d76..48f1b9fa02 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -626,6 +626,12 @@ void VideoThrottle() { // Make the limiter a bit loose u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS; + + u32 timeDifference = (u32)Timer.GetTimeDifference(); + if (timeDifference < frametime) { + Common::SleepCurrentThread(frametime - timeDifference - 1); + } + while ((u32)Timer.GetTimeDifference() < frametime) Common::YieldCPU(); //Common::SleepCurrentThread(1);