HuC6280: Fix glitch in low-speed mode

This commit is contained in:
beirich 2011-03-17 05:54:21 +00:00
parent 138dfa38ae
commit 3cdd222f51
2 changed files with 6 additions and 0 deletions

View File

@ -2116,7 +2116,10 @@ throw new Exception("break");
AfterClearTFlag: // SET command jumps here
int delta = lastCycles - PendingCycles;
if (LowSpeed)
{
delta *= 4;
PendingCycles = lastCycles - delta;
}
TotalExecutedCycles += delta;
if (TimerEnabled)

View File

@ -501,7 +501,10 @@ namespace HuC6280
w.WriteLine(" AfterClearTFlag: // SET command jumps here");
w.WriteLine(" int delta = lastCycles - PendingCycles;");
w.WriteLine(" if (LowSpeed)");
w.WriteLine(" {");
w.WriteLine(" delta *= 4;");
w.WriteLine(" PendingCycles = lastCycles - delta;");
w.WriteLine(" }");
w.WriteLine(" TotalExecutedCycles += delta;");
w.WriteLine();
w.WriteLine(" if (TimerEnabled)");