From 3fa3fe0fcd95acb2710b7d2816be9e0df4d7c420 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 30 Sep 2016 14:36:23 -0400 Subject: [PATCH] Fixes for the other few Netplay initialization points --- network/netplay/netplay.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index c75b0df87a..db582fe2bd 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -557,6 +557,23 @@ static bool netplay_get_cmd(netplay_t *netplay) { uint32_t frame; + /* Make sure we're ready for it */ + if (netplay->quirks & NETPLAY_QUIRK_INITIALIZATION) + { + if (!netplay->is_replay) + { + netplay->is_replay = true; + netplay->replay_ptr = netplay->self_ptr; + netplay->replay_frame_count = netplay->self_frame_count; + netplay_wait_and_init_serialization(netplay); + netplay->is_replay = false; + } + else + { + netplay_wait_and_init_serialization(netplay); + } + } + /* There is a subtlty in whether the load comes before or after the * current frame: * @@ -1222,6 +1239,13 @@ bool netplay_pre_frame(netplay_t *netplay) if (netplay->local_paused) netplay_frontend_paused(netplay, false); + if (netplay->quirks & NETPLAY_QUIRK_INITIALIZATION) + { + /* Are we ready now? */ + if (!(core_serialization_quirks() & RETRO_SERIALIZATION_QUIRK_INITIALIZING) || netplay->self_frame_count > 60) + netplay_init_serialization(netplay); + } + if (!netplay->net_cbs->pre_frame(netplay)) return false;