From dc15c004e90258c428ddbed9b2a8e3e869aee21f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 9 Feb 2013 00:26:46 -0800 Subject: [PATCH] Don't sleep for vsync in headless. Makes the tests run faster, timeout less. --- Core/HLE/sceDisplay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index da021db024..f6e4c4f583 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -25,6 +25,7 @@ #include "Thread.h" #include "../Core/CoreTiming.h" +#include "../Core/CoreParameter.h" #include "../MIPS/MIPS.h" #include "../HLE/HLE.h" #include "sceAudio.h" @@ -78,7 +79,7 @@ static int hCountTotal; //unused static int vCount; static int isVblank; static bool hasSetMode; -double lastFrameTime; +static double lastFrameTime; std::vector vblankWaitingThreads; @@ -269,12 +270,11 @@ void hleEnterVblank(u64 userdata, int cyclesLate) { host->EndFrame(); #ifdef _WIN32 - static double lastFrameTime = 0.0; // Best place to throttle the frame rate on non vsynced platforms is probably here. Let's try it. time_update(); if (lastFrameTime == 0.0) lastFrameTime = time_now_d(); - if (!GetAsyncKeyState(VK_TAB)) { + if (!GetAsyncKeyState(VK_TAB) && !PSP_CoreParameter().headLess) { while (time_now_d() < lastFrameTime + 1.0 / 60.0) { Common::SleepCurrentThread(1); time_update();