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

@ -169,9 +169,10 @@ std::string GetInputDisplay()
s_wiimotes = {};
for (int i = 0; i < 4; ++i)
{
if (SerialInterface::GetDeviceType(i) == SerialInterface::SIDEVICE_GC_GBA_EMULATED)
auto& si = Core::System::GetInstance().GetSerialInterface();
if (si.GetDeviceType(i) == SerialInterface::SIDEVICE_GC_GBA_EMULATED)
s_controllers[i] = ControllerType::GBA;
else if (SerialInterface::GetDeviceType(i) != SerialInterface::SIDEVICE_NONE)
else if (si.GetDeviceType(i) != SerialInterface::SIDEVICE_NONE)
s_controllers[i] = ControllerType::GC;
else
s_controllers[i] = ControllerType::None;
@ -484,6 +485,7 @@ void ChangePads()
if (s_controllers == controllers)
return;
auto& si = Core::System::GetInstance().GetSerialInterface();
for (int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
{
SerialInterface::SIDevices device = SerialInterface::SIDEVICE_NONE;
@ -505,7 +507,7 @@ void ChangePads()
}
}
SerialInterface::ChangeDevice(device, i);
si.ChangeDevice(device, i);
}
}