SI_Device: Amend variable naming

This commit is contained in:
Lioncash
2017-01-22 22:11:39 -05:00
parent f41e5eac2e
commit fb8f19f553
6 changed files with 27 additions and 28 deletions

View File

@ -18,18 +18,17 @@
#include "Core/HW/SI/SI_DeviceKeyboard.h" #include "Core/HW/SI/SI_DeviceKeyboard.h"
#include "Core/HW/SI/SI_DeviceNull.h" #include "Core/HW/SI/SI_DeviceNull.h"
int ISIDevice::RunBuffer(u8* _pBuffer, int _iLength) int ISIDevice::RunBuffer(u8* buffer, int length)
{ {
#ifdef _DEBUG #ifdef _DEBUG
DEBUG_LOG(SERIALINTERFACE, "Send Data Device(%i) - Length(%i) ", ISIDevice::m_iDeviceNumber, DEBUG_LOG(SERIALINTERFACE, "Send Data Device(%i) - Length(%i) ", m_device_number, length);
_iLength);
std::string temp; std::string temp;
int num = 0; int num = 0;
while (num < _iLength) while (num < length)
{ {
temp += StringFromFormat("0x%02x ", _pBuffer[num ^ 3]); temp += StringFromFormat("0x%02x ", buffer[num ^ 3]);
num++; num++;
if ((num % 8) == 0) if ((num % 8) == 0)

View File

@ -74,31 +74,31 @@ class ISIDevice
{ {
public: public:
// Constructor // Constructor
ISIDevice(SIDevices deviceType, int _iDeviceNumber) ISIDevice(SIDevices device_type, int device_number)
: m_iDeviceNumber(_iDeviceNumber), m_deviceType(deviceType) : m_device_number(device_number), m_device_type(device_type)
{ {
} }
// Destructor // Destructor
virtual ~ISIDevice() {} virtual ~ISIDevice() {}
// Run the SI Buffer // Run the SI Buffer
virtual int RunBuffer(u8* _pBuffer, int _iLength); virtual int RunBuffer(u8* buffer, int length);
virtual int TransferInterval(); virtual int TransferInterval();
// Return true on new data // Return true on new data
virtual bool GetData(u32& _Hi, u32& _Low) = 0; virtual bool GetData(u32& hi, u32& low) = 0;
// Send a command directly (no detour per buffer) // Send a command directly (no detour per buffer)
virtual void SendCommand(u32 _Cmd, u8 _Poll) = 0; virtual void SendCommand(u32 command, u8 poll) = 0;
// Savestate support // Savestate support
virtual void DoState(PointerWrap& p) {} virtual void DoState(PointerWrap& p) {}
int GetDeviceNumber() const { return m_iDeviceNumber; } int GetDeviceNumber() const { return m_device_number; }
SIDevices GetDeviceType() const { return m_deviceType; } SIDevices GetDeviceType() const { return m_device_type; }
protected: protected:
int m_iDeviceNumber; int m_device_number;
SIDevices m_deviceType; SIDevices m_device_type;
}; };
bool SIDevice_IsGCController(SIDevices type); bool SIDevice_IsGCController(SIDevices type);

View File

@ -19,7 +19,7 @@ CSIDevice_GCAdapter::CSIDevice_GCAdapter(SIDevices device, int _iDeviceNumber)
: CSIDevice_GCController(device, _iDeviceNumber) : CSIDevice_GCController(device, _iDeviceNumber)
{ {
// get the correct pad number that should rumble locally when using netplay // get the correct pad number that should rumble locally when using netplay
const int numPAD = NetPlay_InGamePadToLocalPad(ISIDevice::m_iDeviceNumber); const int numPAD = NetPlay_InGamePadToLocalPad(m_device_number);
if (numPAD < 4) if (numPAD < 4)
m_simulate_konga = SConfig::GetInstance().m_AdapterKonga[numPAD]; m_simulate_konga = SConfig::GetInstance().m_AdapterKonga[numPAD];
} }
@ -32,7 +32,7 @@ GCPadStatus CSIDevice_GCAdapter::GetPadStatus()
// the remote controllers receive their status there as well // the remote controllers receive their status there as well
if (!NetPlay::IsNetPlayRunning()) if (!NetPlay::IsNetPlayRunning())
{ {
pad_status = GCAdapter::Input(m_iDeviceNumber); pad_status = GCAdapter::Input(m_device_number);
} }
HandleMoviePadStatus(&pad_status); HandleMoviePadStatus(&pad_status);
@ -50,7 +50,7 @@ int CSIDevice_GCAdapter::RunBuffer(u8* buffer, int length)
// This returns an error value if there is no controller plugged // This returns an error value if there is no controller plugged
// into this port on the hardware gc adapter, exposing it to the game. // into this port on the hardware gc adapter, exposing it to the game.
if (!GCAdapter::DeviceConnected(ISIDevice::m_iDeviceNumber)) if (!GCAdapter::DeviceConnected(m_device_number))
{ {
TSIDevices device = SI_NONE; TSIDevices device = SI_NONE;
memcpy(buffer, &device, sizeof(device)); memcpy(buffer, &device, sizeof(device));

View File

@ -117,25 +117,25 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
void CSIDevice_GCController::HandleMoviePadStatus(GCPadStatus* PadStatus) void CSIDevice_GCController::HandleMoviePadStatus(GCPadStatus* PadStatus)
{ {
Movie::CallGCInputManip(PadStatus, ISIDevice::m_iDeviceNumber); Movie::CallGCInputManip(PadStatus, m_device_number);
Movie::SetPolledDevice(); Movie::SetPolledDevice();
if (NetPlay_GetInput(ISIDevice::m_iDeviceNumber, PadStatus)) if (NetPlay_GetInput(m_device_number, PadStatus))
{ {
} }
else if (Movie::IsPlayingInput()) else if (Movie::IsPlayingInput())
{ {
Movie::PlayController(PadStatus, ISIDevice::m_iDeviceNumber); Movie::PlayController(PadStatus, m_device_number);
Movie::InputUpdate(); Movie::InputUpdate();
} }
else if (Movie::IsRecordingInput()) else if (Movie::IsRecordingInput())
{ {
Movie::RecordInput(PadStatus, ISIDevice::m_iDeviceNumber); Movie::RecordInput(PadStatus, m_device_number);
Movie::InputUpdate(); Movie::InputUpdate();
} }
else else
{ {
Movie::CheckPadStatus(PadStatus, ISIDevice::m_iDeviceNumber); Movie::CheckPadStatus(PadStatus, m_device_number);
} }
} }
@ -147,7 +147,7 @@ GCPadStatus CSIDevice_GCController::GetPadStatus()
// the remote controllers receive their status there as well // the remote controllers receive their status there as well
if (!NetPlay::IsNetPlayRunning()) if (!NetPlay::IsNetPlayRunning())
{ {
pad_status = Pad::GetStatus(m_iDeviceNumber); pad_status = Pad::GetStatus(m_device_number);
} }
HandleMoviePadStatus(&pad_status); HandleMoviePadStatus(&pad_status);
@ -290,7 +290,7 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
unsigned int uStrength = command.Parameter2; unsigned int uStrength = command.Parameter2;
// get the correct pad number that should rumble locally when using netplay // get the correct pad number that should rumble locally when using netplay
const int numPAD = NetPlay_InGamePadToLocalPad(ISIDevice::m_iDeviceNumber); const int numPAD = NetPlay_InGamePadToLocalPad(m_device_number);
if (numPAD < 4) if (numPAD < 4)
{ {
@ -303,7 +303,7 @@ void CSIDevice_GCController::SendCommand(u32 _Cmd, u8 _Poll)
if (!_Poll) if (!_Poll)
{ {
m_Mode = command.Parameter2; m_Mode = command.Parameter2;
INFO_LOG(SERIALINTERFACE, "PAD %i set to mode %i", ISIDevice::m_iDeviceNumber, m_Mode); INFO_LOG(SERIALINTERFACE, "PAD %i set to mode %i", m_device_number, m_Mode);
} }
} }
break; break;

View File

@ -83,7 +83,7 @@ void CSIDevice_GCSteeringWheel::SendCommand(u32 _Cmd, u8 _Poll)
unsigned int uType = command.Parameter2; // 06 = motor on, 04 = motor off unsigned int uType = command.Parameter2; // 06 = motor on, 04 = motor off
// get the correct pad number that should rumble locally when using netplay // get the correct pad number that should rumble locally when using netplay
const int numPAD = NetPlay_InGamePadToLocalPad(ISIDevice::m_iDeviceNumber); const int numPAD = NetPlay_InGamePadToLocalPad(m_device_number);
if (numPAD < 4) if (numPAD < 4)
{ {
@ -102,7 +102,7 @@ void CSIDevice_GCSteeringWheel::SendCommand(u32 _Cmd, u8 _Poll)
if (!_Poll) if (!_Poll)
{ {
m_Mode = command.Parameter2; m_Mode = command.Parameter2;
INFO_LOG(SERIALINTERFACE, "PAD %i set to mode %i", ISIDevice::m_iDeviceNumber, m_Mode); INFO_LOG(SERIALINTERFACE, "PAD %i set to mode %i", m_device_number, m_Mode);
} }
} }
else else

View File

@ -57,7 +57,7 @@ int CSIDevice_Keyboard::RunBuffer(u8* _pBuffer, int _iLength)
KeyboardStatus CSIDevice_Keyboard::GetKeyboardStatus() const KeyboardStatus CSIDevice_Keyboard::GetKeyboardStatus() const
{ {
return Keyboard::GetStatus(m_iDeviceNumber); return Keyboard::GetStatus(m_device_number);
} }
bool CSIDevice_Keyboard::GetData(u32& _Hi, u32& _Low) bool CSIDevice_Keyboard::GetData(u32& _Hi, u32& _Low)