mirror of https://github.com/PCSX2/pcsx2.git
USB: Early return from FF test in case of failure
This commit is contained in:
parent
b8406a5b95
commit
9534b2af1d
|
@ -1003,10 +1003,10 @@ namespace usb_pad
|
||||||
}
|
}
|
||||||
|
|
||||||
//set left/right ffb torque
|
//set left/right ffb torque
|
||||||
void SetConstantForce(int port, LONG magnitude)
|
HRESULT SetConstantForce(int port, LONG magnitude)
|
||||||
{
|
{
|
||||||
if (!FFB[port])
|
if (!FFB[port] || !g_pEffectConstant[port])
|
||||||
return;
|
return DIERR_NOTINITIALIZED;
|
||||||
|
|
||||||
if (INVERTFORCES[port])
|
if (INVERTFORCES[port])
|
||||||
cfw.lMagnitude = -magnitude;
|
cfw.lMagnitude = -magnitude;
|
||||||
|
@ -1016,8 +1016,7 @@ namespace usb_pad
|
||||||
if (FFMULTI[port][0] > 0)
|
if (FFMULTI[port][0] > 0)
|
||||||
cfw.lMagnitude *= 1 + FFMULTI[port][0];
|
cfw.lMagnitude *= 1 + FFMULTI[port][0];
|
||||||
|
|
||||||
if (g_pEffectConstant[port])
|
return g_pEffectConstant[port]->SetParameters(&eff, DIEP_TYPESPECIFICPARAMS | DIEP_START);
|
||||||
g_pEffectConstant[port]->SetParameters(&eff, DIEP_TYPESPECIFICPARAMS | DIEP_START);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestForce(int port)
|
void TestForce(int port)
|
||||||
|
@ -1030,7 +1029,8 @@ namespace usb_pad
|
||||||
// Gain value may have changed, so update it for the constant force effect
|
// Gain value may have changed, so update it for the constant force effect
|
||||||
UpdateFFBSettings(port, dev);
|
UpdateFFBSettings(port, dev);
|
||||||
|
|
||||||
SetConstantForce(port, DI_FFNOMINALMAX / 3);
|
if (FAILED(SetConstantForce(port, DI_FFNOMINALMAX / 3)))
|
||||||
|
return;
|
||||||
Sleep(500);
|
Sleep(500);
|
||||||
SetConstantForce(port, -DI_FFNOMINALMAX / 3);
|
SetConstantForce(port, -DI_FFNOMINALMAX / 3);
|
||||||
Sleep(1000);
|
Sleep(1000);
|
||||||
|
|
|
@ -202,9 +202,8 @@ namespace usb_pad
|
||||||
void FreeDirectInput();
|
void FreeDirectInput();
|
||||||
void PollDevices();
|
void PollDevices();
|
||||||
float ReadAxis(const InputMapped& im);
|
float ReadAxis(const InputMapped& im);
|
||||||
float ReadAxis(int port, ControlID axisid);
|
float ReadAxis(int port, int axisid);
|
||||||
float FilterControl(float input, LONG linear, LONG offset, LONG dead);
|
float FilterControl(float input, LONG linear, LONG offset, LONG dead);
|
||||||
bool KeyDown(DWORD KeyID);
|
|
||||||
void TestForce(int port);
|
void TestForce(int port);
|
||||||
LONG GetAxisValueFromOffset(int axis, const DIJOYSTATE2& j);
|
LONG GetAxisValueFromOffset(int axis, const DIJOYSTATE2& j);
|
||||||
bool GetControl(int port, int id);
|
bool GetControl(int port, int id);
|
||||||
|
|
Loading…
Reference in New Issue