From 82df1b1fa88a572794a30f5f2ef05e6f613fda14 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 5 Apr 2014 12:04:10 -0700 Subject: [PATCH] Simplify UpdatePC() a bit more. --- GPU/GPUCommon.cpp | 4 ++-- GPU/GPUCommon.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 8fd9f501c2..5fab34bdb8 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -561,7 +561,7 @@ void GPUCommon::UpdatePC(u32 currentPC, u32 newPC) { // Rough estimate, 2 CPU ticks (it's double the clock rate) per GPU instruction. u32 executed = (currentPC - cycleLastPC) / 4; cyclesExecuted += 2 * executed; - cycleLastPC = newPC == 0 ? currentPC : newPC; + cycleLastPC = currentPC; if (g_Config.bShowDebugStats) { gpuStats.otherGPUCycles += 2 * executed; @@ -571,7 +571,7 @@ void GPUCommon::UpdatePC(u32 currentPC, u32 newPC) { // Exit the runloop and recalculate things. This happens a lot in some games. easy_guard innerGuard(listLock); if (currentList) - downcount = currentList->stall == 0 ? 0x0FFFFFFF : (currentList->stall - cycleLastPC) / 4; + downcount = currentList->stall == 0 ? 0x0FFFFFFF : (currentList->stall - currentPC) / 4; else downcount = 0; } diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 6f53879939..c25e98e8db 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -81,7 +81,10 @@ protected: // To avoid virtual calls to PreExecuteOp(). virtual void FastRunLoop(DisplayList &list) = 0; void SlowRunLoop(DisplayList &list); - void UpdatePC(u32 currentPC, u32 newPC = 0); + void UpdatePC(u32 currentPC, u32 newPC); + void UpdatePC(u32 currentPC) { + UpdatePC(currentPC, currentPC); + } void UpdateState(GPUState state); void PopDLQueue(); void CheckDrawSync();