From 9829739564aa9860924802aef9bf5338138ef02b Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Sun, 19 Jun 2022 21:13:26 +1200 Subject: [PATCH] add strength options to Dead Heat and WMMT3 --- Config/FFBPlugin.ini | 8 ++++++++ DInput8Wrapper.aps | Bin 2740 -> 2740 bytes DInput8Wrapper.rc | Bin 5212 -> 5212 bytes Game Files/DeadHeat.cpp | 18 ++++++++++++------ Game Files/WMMT3.cpp | 18 ++++++++++++------ Version.txt | 2 +- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/Config/FFBPlugin.ini b/Config/FFBPlugin.ini index 077d6c3..c11f543 100644 --- a/Config/FFBPlugin.ini +++ b/Config/FFBPlugin.ini @@ -229,12 +229,20 @@ GameId=61 FeedbackLength=80 EnableDamper=0 DamperStrength=100 +CenterOffsetStrength=100 +ReflectStrength=100 +SpringStrength=100 +ViosityStrength=100 [Dead Heat] GameId=62 FeedbackLength=80 EnableDamper=0 DamperStrength=100 +CenterOffsetStrength=100 +ReflectStrength=100 +SpringStrength=100 +ViosityStrength=100 [Dead Heat Riders] GameId=63 diff --git a/DInput8Wrapper.aps b/DInput8Wrapper.aps index d1422ddec1c0aeeda89615f7da433d29291bf4d4..ff4434026a85765feff7f5526ad1972b78425f2d 100644 GIT binary patch delta 36 ncmdlYxzmO0|+oN@NG_IQ)FZ`+1$>q4Wc%4FfsuEjoSxQ delta 36 ncmdlYxzme0|+oN@NQ0JQ)FZ`-rUZv4Wc%4FfsuEjhF{e diff --git a/DInput8Wrapper.rc b/DInput8Wrapper.rc index 7c36c234ee328c9018989ac6e4aebabe4ac506ff..eb36b9032208005de05df45c1157d696ff775dde 100644 GIT binary patch delta 38 rcmcbkaYtiA7&oKI&0@^G9@b?Qj delta 38 rcmcbkaYtiA7&oKw&0@^G9@Tv. extern int EnableDamper; extern int DamperStrength; +static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini"); +static int CenterOffsetStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("CenterOffsetStrength"), 100, settingsFilename); +static int ReflectStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ReflectStrength"), 100, settingsFilename); +static int SpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringStrength"), 100, settingsFilename); +static int ViosityStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ViosityStrength"), 100, settingsFilename); + void DeadHeat::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { int setSpring = GetTeknoParrotFFB(); @@ -30,13 +36,13 @@ void DeadHeat::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigg if (setSpring) { - double percentForce = setSpring / 63.0; + double percentForce = (setSpring / 63.0) * (SpringStrength / 100.0); triggers->Spring(percentForce); } if (setViosity) { - double percentForce = setViosity / 63.0; + double percentForce = (setViosity / 63.0) * (ViosityStrength / 100.0); triggers->Friction(percentForce); } @@ -50,14 +56,14 @@ void DeadHeat::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigg { if (setReflect > 0x00 && setReflect <= 0x3F) { - double percentForce = setReflect / 63.0; + double percentForce = (setReflect / 63.0) * (ReflectStrength / 100.0); double percentLength = 100; triggers->Rumble(percentForce, 0, percentLength); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); } else if (setReflect > 0x3F) { - double percentForce = (0xFF - setReflect) / 63.0; + double percentForce = ((0xFF - setReflect) / 63.0) * (ReflectStrength / 100.0); double percentLength = 100; triggers->Rumble(0, percentForce, percentLength); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); @@ -65,14 +71,14 @@ void DeadHeat::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigg if (setCenterOffset > 0x00 && setCenterOffset <= 0x3F) { - double percentForce = setCenterOffset / 63.0; + double percentForce = (setCenterOffset / 63.0) * (CenterOffsetStrength / 100.0); double percentLength = 100; triggers->Rumble(percentForce, 0, percentLength); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); } else if (setCenterOffset < 0x00) { - double percentForce = ((0xFFFFFFFF - setCenterOffset) + 1) / 63.0; + double percentForce = (((0xFFFFFFFF - setCenterOffset) + 1) / 63.0) * (CenterOffsetStrength / 100.0); double percentLength = 100; triggers->Rumble(0, percentForce, percentLength); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); diff --git a/Game Files/WMMT3.cpp b/Game Files/WMMT3.cpp index afe1e40..4e1eb8d 100644 --- a/Game Files/WMMT3.cpp +++ b/Game Files/WMMT3.cpp @@ -18,6 +18,12 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. extern int EnableDamper; extern int DamperStrength; +static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini"); +static int CenterOffsetStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("CenterOffsetStrength"), 100, settingsFilename); +static int ReflectStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ReflectStrength"), 100, settingsFilename); +static int SpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringStrength"), 100, settingsFilename); +static int ViosityStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ViosityStrength"), 100, settingsFilename); + void WMMT3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { int setSpring = GetTeknoParrotFFB(); @@ -30,13 +36,13 @@ void WMMT3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers if (setSpring) { - double percentForce = setSpring / 63.0; + double percentForce = (setSpring / 63.0) * (SpringStrength / 100.0); triggers->Spring(percentForce); } if (setViosity) { - double percentForce = setViosity / 63.0; + double percentForce = (setViosity / 63.0) * (ViosityStrength / 100.0); triggers->Friction(percentForce); } @@ -50,14 +56,14 @@ void WMMT3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers { if (setReflect > 0x00 && setReflect <= 0x3F) { - double percentForce = setReflect / 63.0; + double percentForce = (setReflect / 63.0) * (ReflectStrength / 100.0); double percentLength = 100; triggers->Rumble(percentForce, 0, percentLength); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); } else if (setReflect < 0x00) { - double percentForce = ((0xFFFFFFFF - setReflect) + 1) / 63.0; + double percentForce = (((0xFFFFFFFF - setReflect) + 1) / 63.0) * (ReflectStrength / 100.0); double percentLength = 100; triggers->Rumble(0, percentForce, percentLength); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); @@ -65,14 +71,14 @@ void WMMT3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers if (setCenterOffset > 0x00 && setCenterOffset <= 0x3F) { - double percentForce = setCenterOffset / 63.0; + double percentForce = (setCenterOffset / 63.0) * (CenterOffsetStrength / 100.0); double percentLength = 100; triggers->Rumble(percentForce, 0, percentLength); triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); } else if (setCenterOffset < 0x00) { - double percentForce = ((0xFFFFFFFF - setCenterOffset) + 1) / 63.0; + double percentForce = (((0xFFFFFFFF - setCenterOffset) + 1) / 63.0) * (CenterOffsetStrength / 100.0); double percentLength = 100; triggers->Rumble(0, percentForce, percentLength); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); diff --git a/Version.txt b/Version.txt index 4a2f8be..2bbc54d 100644 --- a/Version.txt +++ b/Version.txt @@ -1 +1 @@ -v2.0.0.13 \ No newline at end of file +v2.0.0.14 \ No newline at end of file