diff --git a/Src/OSD/SDL/Main.cpp b/Src/OSD/SDL/Main.cpp index 2674541..431a6de 100644 --- a/Src/OSD/SDL/Main.cpp +++ b/Src/OSD/SDL/Main.cpp @@ -1416,11 +1416,13 @@ static Util::Config::Node DefaultConfig() config.Set("XInputConstForceThreshold", "30"); config.Set("XInputConstForceMax", "100"); config.Set("XInputVibrateMax", "100"); + config.Set("XInputStereoVibration", true); // SDL ForceFeedback config.Set("SDLConstForceMax", "100"); config.Set("SDLSelfCenterMax", "100"); config.Set("SDLFrictionMax", "100"); config.Set("SDLVibrateMax", "100"); + config.Set("SDLConstForceThreshold", "30"); #ifdef NET_BOARD // NetBoard config.Set("EmulateNet", false); @@ -1432,6 +1434,7 @@ static Util::Config::Node DefaultConfig() config.Set("SDLSelfCenterMax", "100"); config.Set("SDLFrictionMax", "100"); config.Set("SDLVibrateMax", "100"); + config.Set("SDLConstForceThreshold", "30"); #endif config.Set("Outputs", "none"); return config; diff --git a/Src/OSD/SDL/SDLInputSystem.cpp b/Src/OSD/SDL/SDLInputSystem.cpp index 44aa4e0..8f6d8d9 100644 --- a/Src/OSD/SDL/SDLInputSystem.cpp +++ b/Src/OSD/SDL/SDLInputSystem.cpp @@ -755,7 +755,8 @@ void CSDLInputSystem::ConstantForceEffect(float force, int dir, int length, int } else { - if (force != 0.0f) + float threshold = (float)m_config["SDLConstForceThreshold"].ValueAs() / 100.0f; + if (force != 0.0f && force > threshold) SDL_HapticRumblePlay(m_SDLHapticDatas[joyNum].SDLhaptic, force, 200); else SDL_HapticRumbleStop(m_SDLHapticDatas[joyNum].SDLhaptic); diff --git a/Src/OSD/Windows/DirectInputSystem.cpp b/Src/OSD/Windows/DirectInputSystem.cpp index 6019146..208cb79 100644 --- a/Src/OSD/Windows/DirectInputSystem.cpp +++ b/Src/OSD/Windows/DirectInputSystem.cpp @@ -1792,7 +1792,8 @@ bool CDirectInputSystem::ProcessForceFeedbackCmd(int joyNum, int axisNum, ForceF break; case FFConstantForce: - { + { + bool bothMotorVib = m_config["XInputStereoVibration"].ValueAs(); // Check if constant force effect is disabled unsigned xInputConstForceMax = m_config["XInputConstForceMax"].ValueAs(); if (xInputConstForceMax == 0) @@ -1807,6 +1808,11 @@ bool CDirectInputSystem::ProcessForceFeedbackCmd(int joyNum, int axisNum, ForceF // If so, stop vibration due to force effect pInfo->xiConstForceLeft = 0; pInfo->xiConstForceRight = 0; + pInfo->xiVibrateBoth = 0; + } + else if (bothMotorVib) + { + pInfo->xiVibrateBoth = (WORD)(absForce * (float)(xInputConstForceMax * XI_VIBRATE_SCALE)); } else if (negForce) {