mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-02-16 17:35:39 +00:00
Introduce new config keywords.
In xinput mode, lets the choice to have left and right gamepad motors vibrate together. XInputStereoVibration = 1 (both motors) [default] XInputStereoVibration = 0 (separate motors) In sdl input mode, new control option to set minimum strength above which a Model 3 constant force command will be simulated on an sdl gamepad device. SDLConstForceThreshold = 30 [default] note : the vibration strength can be mod with SDLConstForceMax = [val]
This commit is contained in:
parent
6627b1e95f
commit
ab367774d3
|
@ -1416,11 +1416,13 @@ static Util::Config::Node DefaultConfig()
|
||||||
config.Set("XInputConstForceThreshold", "30");
|
config.Set("XInputConstForceThreshold", "30");
|
||||||
config.Set("XInputConstForceMax", "100");
|
config.Set("XInputConstForceMax", "100");
|
||||||
config.Set("XInputVibrateMax", "100");
|
config.Set("XInputVibrateMax", "100");
|
||||||
|
config.Set("XInputStereoVibration", true);
|
||||||
// SDL ForceFeedback
|
// SDL ForceFeedback
|
||||||
config.Set("SDLConstForceMax", "100");
|
config.Set("SDLConstForceMax", "100");
|
||||||
config.Set("SDLSelfCenterMax", "100");
|
config.Set("SDLSelfCenterMax", "100");
|
||||||
config.Set("SDLFrictionMax", "100");
|
config.Set("SDLFrictionMax", "100");
|
||||||
config.Set("SDLVibrateMax", "100");
|
config.Set("SDLVibrateMax", "100");
|
||||||
|
config.Set("SDLConstForceThreshold", "30");
|
||||||
#ifdef NET_BOARD
|
#ifdef NET_BOARD
|
||||||
// NetBoard
|
// NetBoard
|
||||||
config.Set("EmulateNet", false);
|
config.Set("EmulateNet", false);
|
||||||
|
@ -1432,6 +1434,7 @@ static Util::Config::Node DefaultConfig()
|
||||||
config.Set("SDLSelfCenterMax", "100");
|
config.Set("SDLSelfCenterMax", "100");
|
||||||
config.Set("SDLFrictionMax", "100");
|
config.Set("SDLFrictionMax", "100");
|
||||||
config.Set("SDLVibrateMax", "100");
|
config.Set("SDLVibrateMax", "100");
|
||||||
|
config.Set("SDLConstForceThreshold", "30");
|
||||||
#endif
|
#endif
|
||||||
config.Set("Outputs", "none");
|
config.Set("Outputs", "none");
|
||||||
return config;
|
return config;
|
||||||
|
|
|
@ -755,7 +755,8 @@ void CSDLInputSystem::ConstantForceEffect(float force, int dir, int length, int
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (force != 0.0f)
|
float threshold = (float)m_config["SDLConstForceThreshold"].ValueAs<unsigned>() / 100.0f;
|
||||||
|
if (force != 0.0f && force > threshold)
|
||||||
SDL_HapticRumblePlay(m_SDLHapticDatas[joyNum].SDLhaptic, force, 200);
|
SDL_HapticRumblePlay(m_SDLHapticDatas[joyNum].SDLhaptic, force, 200);
|
||||||
else
|
else
|
||||||
SDL_HapticRumbleStop(m_SDLHapticDatas[joyNum].SDLhaptic);
|
SDL_HapticRumbleStop(m_SDLHapticDatas[joyNum].SDLhaptic);
|
||||||
|
|
|
@ -1792,7 +1792,8 @@ bool CDirectInputSystem::ProcessForceFeedbackCmd(int joyNum, int axisNum, ForceF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FFConstantForce:
|
case FFConstantForce:
|
||||||
{
|
{
|
||||||
|
bool bothMotorVib = m_config["XInputStereoVibration"].ValueAs<bool>();
|
||||||
// Check if constant force effect is disabled
|
// Check if constant force effect is disabled
|
||||||
unsigned xInputConstForceMax = m_config["XInputConstForceMax"].ValueAs<unsigned>();
|
unsigned xInputConstForceMax = m_config["XInputConstForceMax"].ValueAs<unsigned>();
|
||||||
if (xInputConstForceMax == 0)
|
if (xInputConstForceMax == 0)
|
||||||
|
@ -1807,6 +1808,11 @@ bool CDirectInputSystem::ProcessForceFeedbackCmd(int joyNum, int axisNum, ForceF
|
||||||
// If so, stop vibration due to force effect
|
// If so, stop vibration due to force effect
|
||||||
pInfo->xiConstForceLeft = 0;
|
pInfo->xiConstForceLeft = 0;
|
||||||
pInfo->xiConstForceRight = 0;
|
pInfo->xiConstForceRight = 0;
|
||||||
|
pInfo->xiVibrateBoth = 0;
|
||||||
|
}
|
||||||
|
else if (bothMotorVib)
|
||||||
|
{
|
||||||
|
pInfo->xiVibrateBoth = (WORD)(absForce * (float)(xInputConstForceMax * XI_VIBRATE_SCALE));
|
||||||
}
|
}
|
||||||
else if (negForce)
|
else if (negForce)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue