Bug fix: Emulator no longer crashes when leaving full speed mode
This commit is contained in:
@@ -65,6 +65,7 @@ namespace Desktop
|
||||
if (_isRunning) return;
|
||||
_isRunning = true;
|
||||
_isPaused = false;
|
||||
bool wasHighSpeed = false;
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
@@ -102,6 +103,19 @@ namespace Desktop
|
||||
int elapsedTStates = (int)(_cpu.TotalTStates - tStatesBefore);
|
||||
_tapManager.Update(elapsedTStates);
|
||||
|
||||
if(highSpeed)
|
||||
{
|
||||
wasHighSpeed = true;
|
||||
}
|
||||
else if (wasHighSpeed)
|
||||
{
|
||||
stopwatch.Restart();
|
||||
fpsStopwatch.Restart();
|
||||
scanlineCount = 0;
|
||||
audioSampleCount = (long)(_cpu.TotalTStates / 79.365); // Snap audio to the current T-State time
|
||||
wasHighSpeed = false;
|
||||
}
|
||||
|
||||
//Process audio at the correct time
|
||||
if (!highSpeed)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user