[Core] Added a wait before a spin wait.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5869 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
addb89fecc
commit
3997243143
|
@ -626,6 +626,12 @@ void VideoThrottle()
|
||||||
{
|
{
|
||||||
// Make the limiter a bit loose
|
// Make the limiter a bit loose
|
||||||
u32 frametime = ((SConfig::GetInstance().b_UseFPS)? Common::AtomicLoad(DrawnFrame) : DrawnVideo) * 1000 / TargetVPS;
|
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)
|
while ((u32)Timer.GetTimeDifference() < frametime)
|
||||||
Common::YieldCPU();
|
Common::YieldCPU();
|
||||||
//Common::SleepCurrentThread(1);
|
//Common::SleepCurrentThread(1);
|
||||||
|
|
Loading…
Reference in New Issue