From a7f244e96d0177bad13e81b83f884146da110190 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 4 Sep 2013 19:16:28 -0500 Subject: [PATCH] Revert "Revert "[NetPlay] Make the Memory Card A/B setting sync across netplay."" This reverts commit 5696da0b3ea02a33e64c1de3e389b38c64c47e5a. JMC messed up, it wasn't due to this commit. --- Source/Core/Core/Src/BootManager.cpp | 7 +++++++ Source/Core/Core/Src/NetPlayClient.cpp | 5 +++++ Source/Core/Core/Src/NetPlayProto.h | 4 +++- Source/Core/Core/Src/NetPlayServer.cpp | 2 ++ Source/Core/DolphinWX/Src/NetWindow.cpp | 2 ++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/BootManager.cpp b/Source/Core/Core/Src/BootManager.cpp index 6454df49d5..b2c7dbc058 100644 --- a/Source/Core/Core/Src/BootManager.cpp +++ b/Source/Core/Core/Src/BootManager.cpp @@ -46,6 +46,7 @@ struct ConfigCache bool valid, bCPUThread, bSkipIdle, bEnableFPRF, bMMU, bDCBZOFF, m_EnableJIT, bDSPThread, bVBeamSpeedHack, bSyncGPU, bFastDiscSpeed, bMergeBlocks, bDSPHLE, bHLE_BS2; int iTLBHack, iCPUCore; + TEXIDevices m_EXIDevice[2]; std::string strBackend; }; static ConfigCache config_cache; @@ -94,6 +95,8 @@ bool BootCore(const std::string& _rFilename) config_cache.bHLE_BS2 = StartUp.bHLE_BS2; config_cache.m_EnableJIT = SConfig::GetInstance().m_EnableJIT; config_cache.bDSPThread = StartUp.bDSPThread; + config_cache.m_EXIDevice[0] = SConfig::GetInstance().m_EXIDevice[0]; + config_cache.m_EXIDevice[1] = SConfig::GetInstance().m_EXIDevice[1]; // General settings game_ini.Get("Core", "CPUThread", &StartUp.bCPUThread, StartUp.bCPUThread); @@ -144,6 +147,8 @@ bool BootCore(const std::string& _rFilename) StartUp.bDSPHLE = g_NetPlaySettings.m_DSPHLE; StartUp.bEnableMemcardSaving = g_NetPlaySettings.m_WriteToMemcard; SConfig::GetInstance().m_EnableJIT = g_NetPlaySettings.m_DSPEnableJIT; + SConfig::GetInstance().m_EXIDevice[0] = g_NetPlaySettings.m_EXIDevice[0]; + SConfig::GetInstance().m_EXIDevice[1] = g_NetPlaySettings.m_EXIDevice[1]; } // Run the game @@ -184,6 +189,8 @@ void Stop() VideoBackend::ActivateBackend(StartUp.m_strVideoBackend); StartUp.bHLE_BS2 = config_cache.bHLE_BS2; SConfig::GetInstance().m_EnableJIT = config_cache.m_EnableJIT; + SConfig::GetInstance().m_EXIDevice[0] = config_cache.m_EXIDevice[0]; + SConfig::GetInstance().m_EXIDevice[1] = config_cache.m_EXIDevice[1]; } } diff --git a/Source/Core/Core/Src/NetPlayClient.cpp b/Source/Core/Core/Src/NetPlayClient.cpp index 4a568c9607..2889a44323 100644 --- a/Source/Core/Core/Src/NetPlayClient.cpp +++ b/Source/Core/Core/Src/NetPlayClient.cpp @@ -237,6 +237,11 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet) packet >> g_NetPlaySettings.m_DSPEnableJIT; packet >> g_NetPlaySettings.m_DSPHLE; packet >> g_NetPlaySettings.m_WriteToMemcard; + int tmp; + packet >> tmp; + g_NetPlaySettings.m_EXIDevice[0] = (TEXIDevices) tmp; + packet >> tmp; + g_NetPlaySettings.m_EXIDevice[1] = (TEXIDevices) tmp; } m_dialog->OnMsgStartGame(); diff --git a/Source/Core/Core/Src/NetPlayProto.h b/Source/Core/Core/Src/NetPlayProto.h index 550c7eb2f7..900b08f936 100644 --- a/Source/Core/Core/Src/NetPlayProto.h +++ b/Source/Core/Core/Src/NetPlayProto.h @@ -7,6 +7,7 @@ #include "Common.h" #include "CommonTypes.h" +#include "HW/EXI_Device.h" struct NetSettings { @@ -14,6 +15,7 @@ struct NetSettings bool m_DSPHLE; bool m_DSPEnableJIT; bool m_WriteToMemcard; + TEXIDevices m_EXIDevice[2]; }; struct Rpt : public std::vector @@ -23,7 +25,7 @@ struct Rpt : public std::vector typedef std::vector NetWiimote; -#define NETPLAY_VERSION "Dolphin NetPlay 2013-08-31" +#define NETPLAY_VERSION "Dolphin NetPlay 2013-09-03" // messages enum diff --git a/Source/Core/Core/Src/NetPlayServer.cpp b/Source/Core/Core/Src/NetPlayServer.cpp index c4d2f583ea..715fd5048d 100644 --- a/Source/Core/Core/Src/NetPlayServer.cpp +++ b/Source/Core/Core/Src/NetPlayServer.cpp @@ -455,6 +455,8 @@ bool NetPlayServer::StartGame(const std::string &path) spac << m_settings.m_DSPEnableJIT; spac << m_settings.m_DSPHLE; spac << m_settings.m_WriteToMemcard; + spac << m_settings.m_EXIDevice[0]; + spac << m_settings.m_EXIDevice[1]; std::lock_guard lkp(m_crit.players); std::lock_guard lks(m_crit.send); diff --git a/Source/Core/DolphinWX/Src/NetWindow.cpp b/Source/Core/DolphinWX/Src/NetWindow.cpp index 020ed4e72c..c7ef839198 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.cpp +++ b/Source/Core/DolphinWX/Src/NetWindow.cpp @@ -408,6 +408,8 @@ void NetPlayDiag::GetNetSettings(NetSettings &settings) settings.m_DSPHLE = instance.m_LocalCoreStartupParameter.bDSPHLE; settings.m_DSPEnableJIT = instance.m_EnableJIT; settings.m_WriteToMemcard = m_memcard_write->GetValue(); + settings.m_EXIDevice[0] = instance.m_EXIDevice[0]; + settings.m_EXIDevice[1] = instance.m_EXIDevice[1]; } std::string NetPlayDiag::FindGame()