Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10072 from Tilka/dsp_cycles
DSPInterpreter: fix off-by-one errors in cycle counting
  • Loading branch information
Tilka committed Aug 31, 2021
2 parents c2c30b4 + 72ca41b commit e69f7e7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Source/Core/Core/DSP/Interpreter/DSPInterpreter.cpp
Expand Up @@ -76,7 +76,7 @@ int Interpreter::RunCyclesThread(int cycles)

Step();
cycles--;
if (cycles < 0)
if (cycles <= 0)
return 0;
}
}
Expand All @@ -99,7 +99,7 @@ int Interpreter::RunCyclesDebug(int cycles)
}
Step();
cycles--;
if (cycles < 0)
if (cycles <= 0)
return 0;
}

Expand All @@ -123,7 +123,7 @@ int Interpreter::RunCyclesDebug(int cycles)

Step();
cycles--;
if (cycles < 0)
if (cycles <= 0)
return 0;
}

Expand All @@ -137,7 +137,7 @@ int Interpreter::RunCyclesDebug(int cycles)
}
Step();
cycles--;
if (cycles < 0)
if (cycles <= 0)
return 0;
// We don't bother directly supporting pause - if the main emu pauses,
// it just won't call this function anymore.
Expand All @@ -160,7 +160,7 @@ int Interpreter::RunCycles(int cycles)
Step();
cycles--;

if (cycles < 0)
if (cycles <= 0)
return 0;
}

Expand All @@ -179,7 +179,7 @@ int Interpreter::RunCycles(int cycles)
Step();
cycles--;

if (cycles < 0)
if (cycles <= 0)
return 0;
}

Expand All @@ -188,7 +188,7 @@ int Interpreter::RunCycles(int cycles)
{
Step();
cycles--;
if (cycles < 0)
if (cycles <= 0)
return 0;
// We don't bother directly supporting pause - if the main emu pauses,
// it just won't call this function anymore.
Expand Down

0 comments on commit e69f7e7

Please sign in to comment.