diff --git a/Source/Core/Core/Src/HW/SI.cpp b/Source/Core/Core/Src/HW/SI.cpp index 9142919346..5574ae536e 100644 --- a/Source/Core/Core/Src/HW/SI.cpp +++ b/Source/Core/Core/Src/HW/SI.cpp @@ -262,9 +262,7 @@ void Init() if (Movie::IsRecordingInput() || Movie::IsPlayingInput()) AddDevice(Movie::IsUsingPad(i) ? (Movie::IsUsingBongo(i) ? SIDEVICE_GC_TARUKONGA : SIDEVICE_GC_CONTROLLER) : SIDEVICE_NONE, i); - else if (NetPlay::IsNetPlayRunning()) - AddDevice((SIDevices) g_NetPlaySettings.m_Controllers[i], i); - else + else if (!NetPlay::IsNetPlayRunning()) AddDevice(SConfig::GetInstance().m_SIDevice[i], i); } @@ -567,7 +565,7 @@ void AddDevice(ISIDevice* pDevice) void AddDevice(const SIDevices _device, int _iDeviceNumber) { - ISIDevice* pDevice = SIDevice_Create(_device, _iDeviceNumber); + ISIDevice *pDevice = SIDevice_Create(_device, _iDeviceNumber); AddDevice(pDevice); } diff --git a/Source/Core/Core/Src/NetPlayClient.cpp b/Source/Core/Core/Src/NetPlayClient.cpp index fc8f005fad..46acca6b94 100644 --- a/Source/Core/Core/Src/NetPlayClient.cpp +++ b/Source/Core/Core/Src/NetPlayClient.cpp @@ -8,6 +8,7 @@ #include "IPC_HLE/WII_IPC_HLE_Device_usb.h" #include "IPC_HLE/WII_IPC_HLE_WiiMote.h" // for gcpad +#include "HW/SI.h" #include "HW/SI_DeviceGCController.h" #include "HW/SI_DeviceGCSteeringWheel.h" #include "HW/SI_DeviceDanceMat.h" @@ -187,6 +188,8 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet) for (PadMapping i = 0; i < 4; i++) packet >> m_pad_map[i]; + UpdateDevices(); + m_dialog->Update(); } break; @@ -233,8 +236,6 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet) packet >> g_NetPlaySettings.m_DSPEnableJIT; packet >> g_NetPlaySettings.m_DSPHLE; packet >> g_NetPlaySettings.m_WriteToMemcard; - for (unsigned int i = 0; i < 4; ++i) - packet >> g_NetPlaySettings.m_Controllers[i]; } m_dialog->OnMsgStartGame(); @@ -422,6 +423,8 @@ bool NetPlayClient::StartGame(const std::string &path) // boot game m_dialog->BootGame(path); + UpdateDevices(); + // temporary NetWiimote nw; for (unsigned int i = 0; i<4; ++i) @@ -437,6 +440,16 @@ bool NetPlayClient::ChangeGame(const std::string&) return true; } +// called from ---NETPLAY--- thread +void NetPlayClient::UpdateDevices() +{ + for (PadMapping i = 0; i < 4; i++) + { + // XXX: add support for other device types? does it matter? + SerialInterface::AddDevice(m_pad_map[i] > 0 ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, i); + } +} + // called from ---NETPLAY--- thread void NetPlayClient::ClearBuffers() { diff --git a/Source/Core/Core/Src/NetPlayClient.h b/Source/Core/Core/Src/NetPlayClient.h index 23529dbb95..59d5742b18 100644 --- a/Source/Core/Core/Src/NetPlayClient.h +++ b/Source/Core/Core/Src/NetPlayClient.h @@ -117,6 +117,7 @@ protected: PadMapping m_pad_map[4]; private: + void UpdateDevices(); void SendPadState(const PadMapping in_game_pad, const NetPad& np); unsigned int OnData(sf::Packet& packet); diff --git a/Source/Core/Core/Src/NetPlayProto.h b/Source/Core/Core/Src/NetPlayProto.h index 432b9766e5..02f6a2e96b 100644 --- a/Source/Core/Core/Src/NetPlayProto.h +++ b/Source/Core/Core/Src/NetPlayProto.h @@ -14,7 +14,6 @@ struct NetSettings bool m_DSPHLE; bool m_DSPEnableJIT; bool m_WriteToMemcard; - u8 m_Controllers[4]; }; struct Rpt : public std::vector diff --git a/Source/Core/Core/Src/NetPlayServer.cpp b/Source/Core/Core/Src/NetPlayServer.cpp index 0fd404ea03..d8f2a7dd09 100644 --- a/Source/Core/Core/Src/NetPlayServer.cpp +++ b/Source/Core/Core/Src/NetPlayServer.cpp @@ -441,8 +441,6 @@ bool NetPlayServer::StartGame(const std::string &path) spac << m_settings.m_DSPEnableJIT; spac << m_settings.m_DSPHLE; spac << m_settings.m_WriteToMemcard; - for (unsigned int i = 0; i < 4; ++i) - spac << m_settings.m_Controllers[i]; 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 7d50f42905..7bf3d9816d 100644 --- a/Source/Core/DolphinWX/Src/NetWindow.cpp +++ b/Source/Core/DolphinWX/Src/NetWindow.cpp @@ -107,7 +107,6 @@ NetPlaySetupDiag::NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* " - DSP Emulator Engine Must be the same on all computers!\n" " - DSP on Dedicated Thread [OFF]\n" " - Framelimit NOT set to [Audio]\n" - " - Manually set the exact number of controllers to be used to [Standard Controller]\n" "\n" "All players should use the same Dolphin version and settings.\n" "All memory cards must be identical between players or disabled.\n" @@ -405,9 +404,6 @@ 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(); - - for (unsigned int i = 0; i < 4; ++i) - settings.m_Controllers[i] = SConfig::GetInstance().m_SIDevice[i]; } std::string NetPlayDiag::FindGame()