WIP: Fix for networked games becoming out of sync #279

Closed
Vudjun wants to merge 1 commits from frame-sync-fix into master
Showing only changes of commit 4b70c903e2 - Show all commits

View File

@ -329,8 +329,13 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
_device.System?.SignalVsync();
// Apply a maximum bound of 3 frames to the tick remainder, in case some event causes Ryujinx to pause for a long time or messes with the timer.
_ticks = Math.Min(_ticks - _ticksPerFrame, _ticksPerFrame * 3);
// Apply a maximum bound of 30 frames to the tick remainder, in case some event causes Ryujinx to pause for a long time or messes with the timer.
_ticks -= _ticksPerFrame;
if (_ticks > _ticksPerFrame * 30)
{
_ticks = _ticksPerFrame * 30;
Logger.Warning?.Print(LogClass.SurfaceFlinger, "Frame tick remainder exceeded maximum bound, resetting.");
}
}
// Sleep if possible. If the time til the next frame is too low, spin wait instead.