Core: Assert debug stats remain positive.

This commit is contained in:
Unknown W. Brackets 2021-01-31 15:06:11 -08:00
parent ddff063097
commit cc4d0479bf
2 changed files with 5 additions and 1 deletions

View file

@ -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);
}

View file

@ -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;