From f544a250d32068aae19e8a5663f5a558163013a8 Mon Sep 17 00:00:00 2001 From: HeatXD <45072324+HeatXD@users.noreply.github.com> Date: Tue, 2 May 2023 01:52:06 +0200 Subject: [PATCH] Netplay Desync Detection: for some games CDROM async readahead seems to cause desyncs (most notable during testing were the tekken games) so for now disabling it during netplay games seems like the only option. --- src/core/netplay.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/netplay.cpp b/src/core/netplay.cpp index 037d0a191..47ddd7873 100644 --- a/src/core/netplay.cpp +++ b/src/core/netplay.cpp @@ -184,6 +184,10 @@ void Netplay::SetSettings() // no block linking, it degrades savestate loading performance si.SetBoolValue("CPU", "RecompilerBlockLinking", false); + // for some games CDROM async readahead seems to cause desyncs (most notable during testing were the tekken games) + // so for now disabling it seems like the only option + si.SetIntValue("CDROM", "ReadaheadSectors", 0); + Host::Internal::SetNetplaySettingsLayer(&si); } @@ -538,11 +542,12 @@ bool Netplay::NpOnEventCb(void* ctx, GGPOEvent* ev) HandleTimeSyncEvent(ev->u.timesync.frames_ahead, ev->u.timesync.timeSyncPeriodInFrames); break; case GGPOEventCode::GGPO_EVENTCODE_DESYNC: - sprintf(buff, "Netplay Desync Detected!: Frame: %d, L:%u, R:%u", ev->u.desync.nFrameOfDesync, + sprintf(buff, "Possible Desync Detected: Frame: %d, L:%u, R:%u", ev->u.desync.nFrameOfDesync, ev->u.desync.ourCheckSum, ev->u.desync.remoteChecksum); msg = buff; - Host::AddKeyedOSDMessage("Netplay", msg); - break; + Log_InfoPrintf("%s", msg.c_str()); + Host::AddKeyedOSDMessage("Netplay", msg, 5); + return true; default: sprintf(buff, "Netplay Event Code: %d", ev->code); msg = buff;