Merge pull request #601 from lioncash/pad-struct

Change SPADStatus struct name to GCPadStatus
This commit is contained in:
Dolphin Bot 2014-07-11 06:20:33 +02:00
commit 75c6575f37
20 changed files with 39 additions and 39 deletions

View File

@ -47,7 +47,7 @@ void Initialize(void* const hwnd)
g_plugin.LoadConfig(true);
}
void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus)
void GetStatus(u8 _numPAD, GCPadStatus* _pPADStatus)
{
memset(_pPADStatus, 0, sizeof(*_pPADStatus));
_pPADStatus->err = PAD_ERR_NONE;

View File

@ -16,7 +16,7 @@ void Initialize(void* const hwnd);
InputPlugin *GetPlugin();
void GetStatus(u8 _numPAD, SPADStatus* _pPADStatus);
void GetStatus(u8 _numPAD, GCPadStatus* _pPADStatus);
void Rumble(u8 _numPAD, unsigned int _uType, unsigned int _uStrength);
void Motor(u8 _numPAD, unsigned int _uType, unsigned int _uStrength);

View File

@ -87,7 +87,7 @@ std::string GCPad::GetName() const
return std::string("GCPad") + char('1'+m_index);
}
void GCPad::GetInput(SPADStatus* const pad)
void GCPad::GetInput(GCPadStatus* const pad)
{
// if window has focus or background input enabled
if (Host_RendererHasFocus() || m_options[0].settings[0]->value)

View File

@ -13,7 +13,7 @@ class GCPad : public ControllerEmu
public:
GCPad(const unsigned int index);
void GetInput(SPADStatus* const pad);
void GetInput(GCPadStatus* const pad);
void SetOutput(const u8 on);
void SetMotor(const u8 on);

View File

@ -134,7 +134,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
case 0x10:
{
DEBUG_LOG(AMBASEBOARDDEBUG, "GC-AM: Command 10, %02x (READ STATUS&SWITCHES)", ptr(1));
SPADStatus PadStatus;
GCPadStatus PadStatus;
memset(&PadStatus, 0 ,sizeof(PadStatus));
Pad::GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);
res[resp++] = 0x10;
@ -299,7 +299,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
msg.addData(0); // tilt
for (i=0; i<nr_players; ++i)
{
SPADStatus PadStatus;
GCPadStatus PadStatus;
Pad::GetStatus(i, &PadStatus);
unsigned char player_data[2] = {0,0};
if (PadStatus.button & PAD_BUTTON_START)
@ -336,7 +336,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
{
int slots = *jvs_io++;
msg.addData(1);
SPADStatus PadStatus;
GCPadStatus PadStatus;
Pad::GetStatus(0, &PadStatus);
while (slots--)
{

View File

@ -106,7 +106,7 @@ int CSIDevice_DanceMat::RunBuffer(u8* _pBuffer, int _iLength)
// |_ ERR_STATUS (error on last GetData or SendCmd?)
bool CSIDevice_DanceMat::GetData(u32& _Hi, u32& _Low)
{
SPADStatus PadStatus;
GCPadStatus PadStatus;
memset(&PadStatus, 0, sizeof(PadStatus));
Pad::GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);

View File

@ -87,7 +87,7 @@ public:
virtual int RunBuffer(u8* _pBuffer, int _iLength) override;
// Send and Receive pad input from network
static bool NetPlay_GetInput(u8 numPAD, SPADStatus status, u32 *PADStatus);
static bool NetPlay_GetInput(u8 numPAD, GCPadStatus status, u32 *PADStatus);
static u8 NetPlay_InGamePadToLocalPad(u8 numPAD);
// Return true on new data

View File

@ -106,7 +106,7 @@ int CSIDevice_GCController::RunBuffer(u8* _pBuffer, int _iLength)
// |_ ERR_STATUS (error on last GetData or SendCmd?)
bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low)
{
SPADStatus PadStatus;
GCPadStatus PadStatus;
memset(&PadStatus, 0, sizeof(PadStatus));
Pad::GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);

View File

@ -88,7 +88,7 @@ public:
virtual int RunBuffer(u8* _pBuffer, int _iLength) override;
// Send and Receive pad input from network
static bool NetPlay_GetInput(u8 numPAD, SPADStatus status, u32 *PADStatus);
static bool NetPlay_GetInput(u8 numPAD, GCPadStatus status, u32 *PADStatus);
static u8 NetPlay_InGamePadToLocalPad(u8 numPAD);
// Return true on new data

View File

@ -97,7 +97,7 @@ int CSIDevice_GCSteeringWheel::RunBuffer(u8* _pBuffer, int _iLength)
// |_ ERR_STATUS (error on last GetData or SendCmd?)
bool CSIDevice_GCSteeringWheel::GetData(u32& _Hi, u32& _Low)
{
SPADStatus PadStatus;
GCPadStatus PadStatus;
memset(&PadStatus, 0, sizeof(PadStatus));
Pad::GetStatus(ISIDevice::m_iDeviceNumber, &PadStatus);

View File

@ -88,7 +88,7 @@ public:
virtual int RunBuffer(u8* _pBuffer, int _iLength) override;
// Send and Receive pad input from network
static bool NetPlay_GetInput(u8 numPAD, SPADStatus status, u32 *PADStatus);
static bool NetPlay_GetInput(u8 numPAD, GCPadStatus status, u32 *PADStatus);
static u8 NetPlay_InGamePadToLocalPad(u8 numPAD);
// Return true on new data

View File

@ -607,7 +607,7 @@ void SetWiiInputDisplayString(int remoteID, u8* const coreData, u8* const accelD
g_InputDisplay[controllerID].append("\n");
}
void CheckPadStatus(SPADStatus *PadStatus, int controllerID)
void CheckPadStatus(GCPadStatus* PadStatus, int controllerID)
{
g_padState.A = ((PadStatus->button & PAD_BUTTON_A) != 0);
g_padState.B = ((PadStatus->button & PAD_BUTTON_B) != 0);
@ -635,7 +635,7 @@ void CheckPadStatus(SPADStatus *PadStatus, int controllerID)
SetInputDisplayString(g_padState, controllerID);
}
void RecordInput(SPADStatus *PadStatus, int controllerID)
void RecordInput(GCPadStatus* PadStatus, int controllerID)
{
if (!IsRecordingInput() || !IsUsingPad(controllerID))
return;
@ -934,7 +934,7 @@ static void CheckInputEnd()
}
}
void PlayController(SPADStatus *PadStatus, int controllerID)
void PlayController(GCPadStatus* PadStatus, int controllerID)
{
// Correct playback is entirely dependent on the emulator polling the controllers
// in the same order done during recording
@ -950,7 +950,7 @@ void PlayController(SPADStatus *PadStatus, int controllerID)
// dtm files don't save the mic button or error bit. not sure if they're actually used, but better safe than sorry
signed char e = PadStatus->err;
memset(PadStatus, 0, sizeof(SPADStatus));
memset(PadStatus, 0, sizeof(GCPadStatus));
PadStatus->err = e;
@ -1172,7 +1172,7 @@ void SetInputManip(ManipFunction func)
mfunc = func;
}
void CallInputManip(SPADStatus *PadStatus, int controllerID)
void CallInputManip(GCPadStatus* PadStatus, int controllerID)
{
if (mfunc)
(*mfunc)(PadStatus, controllerID);

View File

@ -166,13 +166,13 @@ void SetFrameSkipping(unsigned int framesToSkip);
void FrameSkipping();
bool BeginRecordingInput(int controllers);
void RecordInput(SPADStatus *PadStatus, int controllerID);
void RecordInput(GCPadStatus* PadStatus, int controllerID);
void RecordWiimote(int wiimote, u8 *data, u8 size);
bool PlayInput(const std::string& filename);
void LoadInput(const std::string& filename);
void ReadHeader();
void PlayController(SPADStatus *PadStatus, int controllerID);
void PlayController(GCPadStatus* PadStatus, int controllerID);
bool PlayWiimote(int wiimote, u8* data, const struct WiimoteEmu::ReportFeatures& rptf, int irMode);
void EndPlayInput(bool cont);
void SaveRecording(const std::string& filename);
@ -180,14 +180,14 @@ void DoState(PointerWrap &p);
void CheckMD5();
void GetMD5();
void Shutdown();
void CheckPadStatus(SPADStatus *PadStatus, int controllerID);
void CheckPadStatus(GCPadStatus* PadStatus, int controllerID);
void CheckWiimoteStatus(int wiimote, u8* data, const struct WiimoteEmu::ReportFeatures& rptf, int irMode);
std::string GetInputDisplay();
// Done this way to avoid mixing of core and gui code
typedef void(*ManipFunction)(SPADStatus *, int);
typedef void(*ManipFunction)(GCPadStatus*, int);
void SetInputManip(ManipFunction);
void CallInputManip(SPADStatus *PadStatus, int controllerID);
void CallInputManip(GCPadStatus* PadStatus, int controllerID);
};

View File

@ -29,7 +29,7 @@ NetPad::NetPad()
nLo = 0x80800000;
}
NetPad::NetPad(const SPADStatus* const pad_status)
NetPad::NetPad(const GCPadStatus* const pad_status)
{
nHi = (u32)((u8)pad_status->stickY);
nHi |= (u32)((u8)pad_status->stickX << 8);
@ -558,7 +558,7 @@ void NetPlayClient::ClearBuffers()
}
// called from ---CPU--- thread
bool NetPlayClient::GetNetPads(const u8 pad_nb, const SPADStatus* const pad_status, NetPad* const netvalues)
bool NetPlayClient::GetNetPads(const u8 pad_nb, const GCPadStatus* const pad_status, NetPad* const netvalues)
{
// The interface for this is extremely silly.
//
@ -618,7 +618,7 @@ bool NetPlayClient::GetNetPads(const u8 pad_nb, const SPADStatus* const pad_stat
Common::SleepCurrentThread(1);
}
SPADStatus tmp;
GCPadStatus tmp;
tmp.stickY = ((u8*)&netvalues->nHi)[0];
tmp.stickX = ((u8*)&netvalues->nHi)[1];
tmp.button = ((u16*)&netvalues->nHi)[1];
@ -846,7 +846,7 @@ u8 NetPlayClient::LocalWiimoteToInGameWiimote(u8 local_pad)
// called from ---CPU--- thread
// Actual Core function which is called on every frame
bool CSIDevice_GCController::NetPlay_GetInput(u8 numPAD, SPADStatus PadStatus, u32 *PADStatus)
bool CSIDevice_GCController::NetPlay_GetInput(u8 numPAD, GCPadStatus PadStatus, u32 *PADStatus)
{
std::lock_guard<std::mutex> lk(crit_netplay_client);
@ -866,12 +866,12 @@ bool WiimoteEmu::Wiimote::NetPlay_GetWiimoteData(int wiimote, u8* data, u8 size)
return false;
}
bool CSIDevice_GCSteeringWheel::NetPlay_GetInput(u8 numPAD, SPADStatus PadStatus, u32 *PADStatus)
bool CSIDevice_GCSteeringWheel::NetPlay_GetInput(u8 numPAD, GCPadStatus PadStatus, u32 *PADStatus)
{
return CSIDevice_GCController::NetPlay_GetInput(numPAD, PadStatus, PADStatus);
}
bool CSIDevice_DanceMat::NetPlay_GetInput(u8 numPAD, SPADStatus PadStatus, u32 *PADStatus)
bool CSIDevice_DanceMat::NetPlay_GetInput(u8 numPAD, GCPadStatus PadStatus, u32 *PADStatus)
{
return CSIDevice_GCController::NetPlay_GetInput(numPAD, PadStatus, PADStatus);
}

View File

@ -25,7 +25,7 @@ class NetPad
{
public:
NetPad();
NetPad(const SPADStatus* const);
NetPad(const GCPadStatus* const);
u32 nHi;
u32 nLo;
@ -78,7 +78,7 @@ public:
// Send and receive pads values
bool WiimoteUpdate(int _number, u8* data, const u8 size);
bool GetNetPads(const u8 pad_nb, const SPADStatus* const, NetPad* const netvalues);
bool GetNetPads(const u8 pad_nb, const GCPadStatus* const, NetPad* const netvalues);
u8 LocalPadToInGamePad(u8 localPad);
u8 InGamePadToLocalPad(u8 localPad);

View File

@ -922,7 +922,7 @@ void OnStoppedCallback()
}
}
void TASManipFunction(SPADStatus *PadStatus, int controllerID)
void TASManipFunction(GCPadStatus* PadStatus, int controllerID)
{
if (main_frame)
main_frame->g_TASInputDlg[controllerID]->GetValues(PadStatus, controllerID);

View File

@ -358,5 +358,5 @@ void OnAfterLoadCallback();
void OnStoppedCallback();
// For TASInputDlg
void TASManipFunction(SPADStatus *PadStatus, int controllerID);
void TASManipFunction(GCPadStatus* PadStatus, int controllerID);
bool TASInputHasFocus();

View File

@ -242,7 +242,7 @@ void TASInputDlg::ResetValues()
wx_start_button->SetValue(false);
}
void TASInputDlg::GetKeyBoardInput(SPADStatus *PadStatus)
void TASInputDlg::GetKeyBoardInput(GCPadStatus* PadStatus)
{
if (PadStatus->stickX != 128)
{
@ -471,7 +471,7 @@ void TASInputDlg::SetLandRTriggers()
rTrig = wx_r_s->GetValue();
}
void TASInputDlg::GetValues(SPADStatus *PadStatus, int controllerID)
void TASInputDlg::GetValues(GCPadStatus* PadStatus, int controllerID)
{
if (!IsShown())
return;

View File

@ -39,11 +39,11 @@ class TASInputDlg : public wxDialog
void OnMouseDownL(wxMouseEvent& event);
void OnMouseUpR(wxMouseEvent& event);
void ResetValues();
void GetValues(SPADStatus *PadStatus, int controllerID);
void GetValues(GCPadStatus* PadStatus, int controllerID);
void SetTurbo(wxMouseEvent& event);
void SetTurboFalse(wxMouseEvent& event);
void ButtonTurbo();
void GetKeyBoardInput(SPADStatus *PadStatus);
void GetKeyBoardInput(GCPadStatus* PadStatus);
bool TextBoxHasFocus();
void SetLandRTriggers();
bool TASHasFocus();

View File

@ -24,7 +24,7 @@
#define PAD_BUTTON_Y 0x0800
#define PAD_BUTTON_START 0x1000
typedef struct
struct GCPadStatus
{
unsigned short button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
unsigned char stickX; // 0 <= stickX <= 255
@ -36,4 +36,4 @@ typedef struct
unsigned char analogA; // 0 <= analogA <= 255
unsigned char analogB; // 0 <= analogB <= 255
signed char err; // one of PAD_ERR_* number
} SPADStatus;
};