diff --git a/Config/FFBPlugin.ini b/Config/FFBPlugin.ini index e2e0c4e..67f170f 100644 --- a/Config/FFBPlugin.ini +++ b/Config/FFBPlugin.ini @@ -704,9 +704,13 @@ Gear6=99 [Daytona Championship USA NSE] GameId=59 -FeedbackLength=80 +FeedbackLength=120 EnableDamper=0 DamperStrength=100 +DoubleSine=0 +DoubleConstant=0 +DoubleSpring=0 +DoubleFriction=0 [WMMT5] GameId=9 diff --git a/DllMain.cpp b/DllMain.cpp index a2987cf..c9f1ff9 100644 --- a/DllMain.cpp +++ b/DllMain.cpp @@ -960,6 +960,8 @@ int InputDeviceWheelEnable = GetPrivateProfileInt(TEXT("Settings"), TEXT("InputD int IgnoreFirstMatchingGUID = GetPrivateProfileInt(TEXT("Settings"), TEXT("IgnoreFirstMatchingGUID"), 0, settingsFilename); int DoubleSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSine"), 0, settingsFilename); int DoubleConstant = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleConstant"), 0, settingsFilename); +int DoubleSpring = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSpring"), 0, settingsFilename); +int DoubleFriction = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleFriction"), 0, settingsFilename); extern void DefaultConfigValues(); extern void CustomFFBStrengthSetup(); @@ -1313,6 +1315,14 @@ void TriggerFrictionEffectWithDefaultOption(double strength, bool isDefault) tempEffect.condition.left_sat[0] = 0xFFFF; tempEffect.condition.right_sat[0] = 0xFFFF; + if (DoubleFriction) + { + strength = strength * 2.0; + + if (strength > 1.0) + strength = 1.0; + } + SHORT minForce = (SHORT)(strength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0. SHORT maxForce = (SHORT)(configMaxForce / 100.0 * 32767.0); SHORT range = maxForce - minForce; @@ -1747,6 +1757,14 @@ void TriggerSpringEffectWithDefaultOption(double strength, bool isDefault) tempEffect.condition.direction.dir[0] = 1; tempEffect.constant.direction.dir[1] = 0; //Y Position + if (DoubleSpring) + { + strength = strength * 2.0; + + if (strength > 1.0) + strength = 1.0; + } + SHORT minForce = (SHORT)(strength > 0.001 ? (configMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0. SHORT maxForce = (SHORT)(configMaxForce / 100.0 * 32767.0); SHORT range = maxForce - minForce; diff --git a/Game Files/Daytona3NSE.cpp b/Game Files/Daytona3NSE.cpp index 1df6cea..8c72a9d 100644 --- a/Game Files/Daytona3NSE.cpp +++ b/Game Files/Daytona3NSE.cpp @@ -20,47 +20,58 @@ void Daytona3NSE::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTr UINT8 FFB = helpers->ReadByte(0x1334061, true); - if (FFB >= 0xF8 && FFB <= 0xFF) + if (FFB > 0x80 && FFB <= 0x8F) // ???? { - double percentForce = (256 - FFB) / 8.0; - triggers->Springi(percentForce); - } - - if (FFB >= 0xC4 && FFB <= 0xC7) - { - double percentForce = ((199 - FFB) / 4.0) / 6.0; + double percentForce = (144 - FFB) / 16.0; double percentLength = 100.0; - triggers->Sine(35, 0, percentForce); - triggers->Rumble(percentForce, percentForce, percentLength); + triggers->Spring(percentForce); } - if (FFB >= 0xD8 && FFB <= 0xDF) + if (FFB > 0x90 && FFB <= 0x9F) // Roll Right { - double percentForce = (224 - FFB) / 8.0; - triggers->Friction(percentForce); - } - - if (FFB == 0xBD || FFB == 0xCD) - { - double percentForce = 0.35; + double percentForce = (160 - FFB) / 16.0; double percentLength = 100.0; - triggers->Sine(140, 0, percentForce); - triggers->Rumble(percentForce, percentForce, percentLength); + triggers->Rumble(percentForce, 0, percentLength); + triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); } - if (FFB >= 0xA8 && FFB <= 0xAF) // Roll Left + if (FFB > 0xA0 && FFB <= 0xAF) // Roll Left { - double percentForce = (176 - FFB) / 8.0; + double percentForce = (176 - FFB) / 16.0; double percentLength = 100.0; triggers->Rumble(0, percentForce, percentLength); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); } - if (FFB >= 0x98 && FFB <= 0x9F) // Roll Right + if (FFB > 0xB0 && FFB <= 0xBF) { - double percentForce = (160 - FFB) / 8.0; + double percentForce = (192 - FFB) / 16.0; double percentLength = 100.0; - triggers->Rumble(percentForce, 0, percentLength); - triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); + triggers->Sine(40, 0, percentForce); + triggers->Rumble(percentForce, percentForce, percentLength); + } + + if (FFB > 0xC0 && FFB <= 0xCF) + { + double percentForce = (207 - FFB) / 16.0; + triggers->Spring(percentForce); + } + + if (FFB > 0xD0 && FFB <= 0xDF) + { + double percentForce = (224 - FFB) / 16.0; + triggers->Friction(percentForce); + } + + if (FFB > 0xE0 && FFB <= 0xEF) //???? + { + double percentForce = (FFB - 224) / 16.0; + triggers->Spring(percentForce); + } + + if (FFB > 0xF0 && FFB <= 0xFF) + { + double percentForce = (FFB - 240) / 16.0; + triggers->Spring(percentForce); } } \ No newline at end of file