diff --git a/Common/TimeUtil.cpp b/Common/TimeUtil.cpp index 4e109b544a..1c7f17c7a9 100644 --- a/Common/TimeUtil.cpp +++ b/Common/TimeUtil.cpp @@ -252,6 +252,7 @@ double Instant::ElapsedSeconds() const { #endif void sleep_ms(int ms, const char *reason) { + // INFO_LOG(Log::System, "Sleep %d ms: %s", ms, reason); #ifdef _WIN32 Sleep(ms); #elif defined(HAVE_LIBNX) diff --git a/Core/FrameTiming.cpp b/Core/FrameTiming.cpp index ebabbb29d2..efc6690e4c 100644 --- a/Core/FrameTiming.cpp +++ b/Core/FrameTiming.cpp @@ -32,10 +32,10 @@ FrameTiming g_frameTiming; -void WaitUntil(double now, double timestamp) { +void WaitUntil(double now, double timestamp, const char *reason) { #ifdef _WIN32 while (time_now_d() < timestamp) { - sleep_ms(1, "wait-until"); // Sleep for 1ms on this thread + sleep_ms(1, reason); // Sleep for 1ms on this thread } #else const double left = timestamp - now; @@ -71,7 +71,7 @@ void FrameTiming::DeferWaitUntil(double until, double *curTimePtr) { void FrameTiming::PostSubmit() { if (waitUntil_ != 0.0) { - WaitUntil(time_now_d(), waitUntil_); + WaitUntil(time_now_d(), waitUntil_, "post-submit"); if (curTimePtr_) { *curTimePtr_ = waitUntil_; curTimePtr_ = nullptr; diff --git a/Core/FrameTiming.h b/Core/FrameTiming.h index 3a3048db50..1c535b37d0 100644 --- a/Core/FrameTiming.h +++ b/Core/FrameTiming.h @@ -27,4 +27,4 @@ extern FrameTiming g_frameTiming; Draw::PresentMode ComputePresentMode(Draw::DrawContext *draw, int *interval); -void WaitUntil(double now, double timestamp); +void WaitUntil(double now, double timestamp, const char *reason); diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index c8a4dabb83..5b69540716 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -445,7 +445,7 @@ static void DoFrameTiming(bool throttle, bool *skipFrame, float scaledTimestep, if (endOfFrame) { g_frameTiming.DeferWaitUntil(nextFrameTime, &curFrameTime); } else { - WaitUntil(curFrameTime, nextFrameTime); + WaitUntil(curFrameTime, nextFrameTime, "display-wait"); curFrameTime = time_now_d(); // I guess we could also just set it to nextFrameTime... } } diff --git a/UI/ImDebugger/ImDebugger.cpp b/UI/ImDebugger/ImDebugger.cpp index 9d88d21d43..04e6773871 100644 --- a/UI/ImDebugger/ImDebugger.cpp +++ b/UI/ImDebugger/ImDebugger.cpp @@ -418,7 +418,9 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug) { DrawAtracView(cfg_); } - DrawHLEModules(cfg_); + if (cfg_.hleModulesOpen) { + DrawHLEModules(cfg_); + } if (cfg_.structViewerOpen) { structViewer_.Draw(mipsDebug, &cfg_.structViewerOpen);