From 05ab03a5515c97eff89368963170bfaa0cc9a90b Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Fri, 31 Mar 2017 14:13:48 -0700 Subject: [PATCH] SI_DeviceGBA: make GBASockServer a member instead of parent --- Source/Core/Core/HW/SI/SI_DeviceGBA.cpp | 10 +++++----- Source/Core/Core/HW/SI/SI_DeviceGBA.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/HW/SI/SI_DeviceGBA.cpp b/Source/Core/Core/HW/SI/SI_DeviceGBA.cpp index 8e13b03d04..add3b11f7c 100644 --- a/Source/Core/Core/HW/SI/SI_DeviceGBA.cpp +++ b/Source/Core/Core/HW/SI/SI_DeviceGBA.cpp @@ -293,14 +293,14 @@ int CSIDevice_GBA::RunBuffer(u8* buffer, int length) { case NextAction::SendCommand: { - ClockSync(); - if (Connect()) + m_sock_server.ClockSync(); + if (m_sock_server.Connect()) { #ifdef _DEBUG NOTICE_LOG(SERIALINTERFACE, "%01d cmd %02x [> %02x%02x%02x%02x]", m_device_number, buffer[3], buffer[2], buffer[1], buffer[0], buffer[7]); #endif - Send(buffer); + m_sock_server.Send(buffer); } m_last_cmd = buffer[3]; m_timestamp_sent = CoreTiming::GetTicks(); @@ -320,8 +320,8 @@ int CSIDevice_GBA::RunBuffer(u8* buffer, int length) // [[fallthrough]] case NextAction::ReceiveResponse: { - int num_data_received = Receive(buffer); - if (IsConnected()) + int num_data_received = m_sock_server.Receive(buffer); + if (m_sock_server.IsConnected()) { #ifdef _DEBUG LogTypes::LOG_LEVELS log_level = (m_last_cmd == CMD_STATUS || m_last_cmd == CMD_RESET) ? diff --git a/Source/Core/Core/HW/SI/SI_DeviceGBA.h b/Source/Core/Core/HW/SI/SI_DeviceGBA.h index 92d7637ed5..6e1467b88d 100644 --- a/Source/Core/Core/HW/SI/SI_DeviceGBA.h +++ b/Source/Core/Core/HW/SI/SI_DeviceGBA.h @@ -40,7 +40,7 @@ private: bool m_booted = false; }; -class CSIDevice_GBA : public ISIDevice, private GBASockServer +class CSIDevice_GBA : public ISIDevice { public: CSIDevice_GBA(SIDevices device, int device_number); @@ -58,6 +58,7 @@ private: ReceiveResponse }; + GBASockServer m_sock_server; NextAction m_next_action = NextAction::SendCommand; u8 m_last_cmd; u64 m_timestamp_sent = 0;