From cc4d0479bf81ff8fdee015b85dea38fb68d0f850 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 31 Jan 2021 15:06:11 -0800 Subject: [PATCH] Core: Assert debug stats remain positive. --- Core/HLE/HLE.cpp | 1 + GPU/GPUCommon.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index eb4575fea6..e57afafe66 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -732,6 +732,7 @@ void CallSyscall(MIPSOpcode op) int funcnum = callno & 0xFFF; int modulenum = (callno & 0xFF000) >> 12; double total = time_now_d() - start - hleSteppingTime; + _dbg_assert_msg_(total >= 0.0, "Time spent in syscall became negative"); hleSteppingTime = 0.0; updateSyscallStats(modulenum, funcnum, total); } diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 67b0dab08e..013072369d 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -954,7 +954,9 @@ void GPUCommon::NotifySteppingExit() { if (timeSteppingStarted_ <= 0.0) { ERROR_LOG(G3D, "Mismatched stepping enter/exit."); } - timeSpentStepping_ += time_now_d() - timeSteppingStarted_; + double total = time_now_d() - timeSteppingStarted_; + _dbg_assert_msg_(total >= 0.0, "Time spent stepping became negative"); + timeSpentStepping_ += total; timeSteppingStarted_ = 0.0; } } @@ -1028,6 +1030,7 @@ bool GPUCommon::InterpretList(DisplayList &list) { if (coreCollectDebugStats) { double total = time_now_d() - start - timeSpentStepping_; + _dbg_assert_msg_(total >= 0.0, "Time spent DL processing became negative"); hleSetSteppingTime(timeSpentStepping_); timeSpentStepping_ = 0.0; gpuStats.msProcessingDisplayLists += total;