Skip to content

Commit

Permalink
SI_DeviceGBA: make GBASockServer a member instead of parent
Browse files Browse the repository at this point in the history
  • Loading branch information
ligfx committed Mar 31, 2017
1 parent d7e463d commit bf30da7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Source/Core/Core/HW/SI/SI_DeviceGBA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,14 +291,14 @@ int CSIDevice_GBA::RunBuffer(u8* buffer, int length)
{
case ConnectionState::AcceptCommand:
{
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();
Expand All @@ -315,8 +315,8 @@ int CSIDevice_GBA::RunBuffer(u8* buffer, int length)

case ConnectionState::ReceiveData:
{
int num_data_received = Receive(buffer);
if (IsConnected())
int num_data_received = m_sock_server.Receive(buffer);
if (m_sock_server.IsConnected())
{
#ifdef _DEBUG
if (m_last_cmd == CMD_STATUS || m_last_cmd == CMD_RESET)
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/HW/SI/SI_DeviceGBA.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GBASockServer
bool m_booted = false;
};

class CSIDevice_GBA : public ISIDevice, private GBASockServer
class CSIDevice_GBA : public ISIDevice
{
public:
CSIDevice_GBA(SIDevices device, int device_number);
Expand All @@ -58,6 +58,7 @@ class CSIDevice_GBA : public ISIDevice, private GBASockServer
ReceiveData
};

GBASockServer m_sock_server;
ConnectionState m_state = ConnectionState::AcceptCommand;
u8 m_last_cmd;
u64 m_timestamp_sent = 0;
Expand Down

0 comments on commit bf30da7

Please sign in to comment.