Skip to content

Commit

Permalink
GE Debugger: Fix replay timing drift.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Jun 5, 2017
1 parent 7e26c75 commit 73fd75c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Core/CoreTiming.cpp
Expand Up @@ -573,6 +573,10 @@ void ForceCheck()
currentMIPS->downcount = -1;
// But let's not eat a bunch more time in Advance() because of this.
slicelength = -1;

#ifdef _DEBUG
_dbg_assert_msg_(CPU, cyclesExecuted >= 0, "Shouldn't have a negative cyclesExecuted");
#endif
}

void Advance()
Expand Down Expand Up @@ -613,7 +617,7 @@ void LogPendingEvents()
Event *ptr = first;
while (ptr)
{
//INFO_LOG(TIMER, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type);
//INFO_LOG(CPU, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type);
ptr = ptr->next;
}
}
Expand Down
5 changes: 4 additions & 1 deletion GPU/Debugger/Record.cpp
Expand Up @@ -767,7 +767,10 @@ static bool ExecuteSubmitCmds(void *p, u32 sz) {

execListQueue.clear();
gpu->UpdateStall(execListID, execListPos);
currentMIPS->downcount -= gpu->GetListTicks(execListID) - CoreTiming::GetTicks();
s64 listTicks = gpu->GetListTicks(execListID);
if (listTicks != -1) {
currentMIPS->downcount -= listTicks - CoreTiming::GetTicks();
}

// Make sure downcount doesn't overflow.
CoreTiming::ForceCheck();
Expand Down

0 comments on commit 73fd75c

Please sign in to comment.