Merge pull request #7762 from jordan-woyak/gcadapter-calibration
HW: SI_Device_GCAdapter: Restore calibration behavior for real gamecube controllers.
This commit is contained in:
commit
a129d60a57
|
@ -37,6 +37,11 @@ GCPadStatus CSIDevice_GCAdapter::GetPadStatus()
|
|||
|
||||
HandleMoviePadStatus(&pad_status);
|
||||
|
||||
// Our GCAdapter code sets PAD_GET_ORIGIN when a new device has been connected.
|
||||
// Watch for this to calibrate real controllers on connection.
|
||||
if (pad_status.button & PAD_GET_ORIGIN)
|
||||
SetOrigin(pad_status);
|
||||
|
||||
return pad_status;
|
||||
}
|
||||
|
||||
|
|
|
@ -149,6 +149,12 @@ GCPadStatus CSIDevice_GCController::GetPadStatus()
|
|||
}
|
||||
|
||||
HandleMoviePadStatus(&pad_status);
|
||||
|
||||
// Our GCAdapter code sets PAD_GET_ORIGIN when a new device has been connected.
|
||||
// Watch for this to calibrate real controllers on connection.
|
||||
if (pad_status.button & PAD_GET_ORIGIN)
|
||||
SetOrigin(pad_status);
|
||||
|
||||
return pad_status;
|
||||
}
|
||||
|
||||
|
@ -257,16 +263,13 @@ CSIDevice_GCController::HandleButtonCombos(const GCPadStatus& pad_status)
|
|||
{
|
||||
if (m_last_button_combo == COMBO_RESET)
|
||||
{
|
||||
INFO_LOG(SERIALINTERFACE, "PAD - COMBO_RESET");
|
||||
ProcessorInterface::ResetButton_Tap();
|
||||
}
|
||||
else if (m_last_button_combo == COMBO_ORIGIN)
|
||||
{
|
||||
m_origin.origin_stick_x = pad_status.stickX;
|
||||
m_origin.origin_stick_y = pad_status.stickY;
|
||||
m_origin.substick_x = pad_status.substickX;
|
||||
m_origin.substick_y = pad_status.substickY;
|
||||
m_origin.trigger_left = pad_status.triggerLeft;
|
||||
m_origin.trigger_right = pad_status.triggerRight;
|
||||
INFO_LOG(SERIALINTERFACE, "PAD - COMBO_ORIGIN");
|
||||
SetOrigin(pad_status);
|
||||
}
|
||||
|
||||
m_last_button_combo = COMBO_NONE;
|
||||
|
@ -277,6 +280,16 @@ CSIDevice_GCController::HandleButtonCombos(const GCPadStatus& pad_status)
|
|||
return COMBO_NONE;
|
||||
}
|
||||
|
||||
void CSIDevice_GCController::SetOrigin(const GCPadStatus& pad_status)
|
||||
{
|
||||
m_origin.origin_stick_x = pad_status.stickX;
|
||||
m_origin.origin_stick_y = pad_status.stickY;
|
||||
m_origin.substick_x = pad_status.substickX;
|
||||
m_origin.substick_y = pad_status.substickY;
|
||||
m_origin.trigger_left = pad_status.triggerLeft;
|
||||
m_origin.trigger_right = pad_status.triggerRight;
|
||||
}
|
||||
|
||||
// SendCommand
|
||||
void CSIDevice_GCController::SendCommand(u32 command, u8 poll)
|
||||
{
|
||||
|
|
|
@ -110,6 +110,7 @@ public:
|
|||
|
||||
protected:
|
||||
void HandleMoviePadStatus(GCPadStatus* pad_status);
|
||||
void SetOrigin(const GCPadStatus& pad_status);
|
||||
};
|
||||
|
||||
// "TaruKonga", the DK Bongo controller
|
||||
|
|
Loading…
Reference in New Issue