mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
HW/SerialInterface: Refactor to class.
This commit is contained in:
@ -67,6 +67,7 @@
|
||||
#include "Core/NetPlayCommon.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
#include "Core/SyncIdentifier.h"
|
||||
#include "Core/System.h"
|
||||
#include "DiscIO/Blob.h"
|
||||
|
||||
#include "InputCommon/ControllerEmu/ControlGroup/Attachments.h"
|
||||
@ -1833,11 +1834,12 @@ void NetPlayClient::UpdateDevices()
|
||||
u8 local_pad = 0;
|
||||
u8 pad = 0;
|
||||
|
||||
auto& si = Core::System::GetInstance().GetSerialInterface();
|
||||
for (auto player_id : m_pad_map)
|
||||
{
|
||||
if (m_gba_config[pad].enabled && player_id > 0)
|
||||
{
|
||||
SerialInterface::ChangeDevice(SerialInterface::SIDEVICE_GC_GBA_EMULATED, pad);
|
||||
si.ChangeDevice(SerialInterface::SIDEVICE_GC_GBA_EMULATED, pad);
|
||||
}
|
||||
else if (player_id == m_local_player->pid)
|
||||
{
|
||||
@ -1846,7 +1848,7 @@ void NetPlayClient::UpdateDevices()
|
||||
Config::Get(Config::GetInfoForSIDevice(local_pad));
|
||||
if (SerialInterface::SIDevice_IsGCController(si_device))
|
||||
{
|
||||
SerialInterface::ChangeDevice(si_device, pad);
|
||||
si.ChangeDevice(si_device, pad);
|
||||
|
||||
if (si_device == SerialInterface::SIDEVICE_WIIU_ADAPTER)
|
||||
{
|
||||
@ -1855,17 +1857,17 @@ void NetPlayClient::UpdateDevices()
|
||||
}
|
||||
else
|
||||
{
|
||||
SerialInterface::ChangeDevice(SerialInterface::SIDEVICE_GC_CONTROLLER, pad);
|
||||
si.ChangeDevice(SerialInterface::SIDEVICE_GC_CONTROLLER, pad);
|
||||
}
|
||||
local_pad++;
|
||||
}
|
||||
else if (player_id > 0)
|
||||
{
|
||||
SerialInterface::ChangeDevice(SerialInterface::SIDEVICE_GC_CONTROLLER, pad);
|
||||
si.ChangeDevice(SerialInterface::SIDEVICE_GC_CONTROLLER, pad);
|
||||
}
|
||||
else
|
||||
{
|
||||
SerialInterface::ChangeDevice(SerialInterface::SIDEVICE_NONE, pad);
|
||||
si.ChangeDevice(SerialInterface::SIDEVICE_NONE, pad);
|
||||
}
|
||||
pad++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user