HW/SerialInterface: Refactor to class.

This commit is contained in:
Admiral H. Curtiss
2023-03-12 14:20:32 +01:00
parent d371b17f37
commit bf2f901a99
11 changed files with 463 additions and 455 deletions

View File

@ -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++;
}