diff --git a/Config/FFBPlugin.ini b/Config/FFBPlugin.ini index 144a272..c7aac12 100644 --- a/Config/FFBPlugin.ini +++ b/Config/FFBPlugin.ini @@ -236,6 +236,12 @@ FeedbackLength=500 EnableDamper=0 DamperStrength=100 +[Dead Heat Riders] +GameId=63 +FeedbackLength=500 +EnableDamper=0 +DamperStrength=100 + [Winter X Games SnoCross] GameId=44 FeedbackLength=500 diff --git a/Dinput8Wrapper.vcxproj b/Dinput8Wrapper.vcxproj index 4df52de..b7da092 100644 --- a/Dinput8Wrapper.vcxproj +++ b/Dinput8Wrapper.vcxproj @@ -28,6 +28,7 @@ + @@ -76,6 +77,7 @@ + diff --git a/Dinput8Wrapper.vcxproj.filters b/Dinput8Wrapper.vcxproj.filters index 270c89d..8b657f0 100644 --- a/Dinput8Wrapper.vcxproj.filters +++ b/Dinput8Wrapper.vcxproj.filters @@ -148,6 +148,7 @@ + @@ -352,6 +353,9 @@ Common Header Files + + Common Header Files + diff --git a/DllMain.cpp b/DllMain.cpp index 190d09a..64ccc05 100644 --- a/DllMain.cpp +++ b/DllMain.cpp @@ -40,6 +40,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. #include "Game Files/Daytona3.h" #include "Game Files/Daytona3NSE.h" #include "Game Files/DeadHeat.h" +#include "Game Files/DeadHeatRiders.h" #include "Game Files/DirtyDrivin.h" #include "Game Files/FordRacing.h" #include "Game Files/FordRacingOther.h" @@ -1032,6 +1033,7 @@ const int DAYTONA_3_NSE = 59; const int FLYCAST = 60; const int WMMT_3 = 61; const int DEAD_HEAT = 62; +const int DEAD_HEAT_RIDERS = 63; HINSTANCE Get_hInstance() { @@ -2502,6 +2504,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam) case DEAD_HEAT: game = new DeadHeat; break; + case DEAD_HEAT_RIDERS: + game = new DeadHeatRiders; + break; case TEST_GAME_CONST: case TEST_GAME_FRICTION: case TEST_GAME_SINE: diff --git a/Game Files/DeadHeat.cpp b/Game Files/DeadHeat.cpp index 75ca82b..20fe5c1 100644 --- a/Game Files/DeadHeat.cpp +++ b/Game Files/DeadHeat.cpp @@ -18,10 +18,6 @@ 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 EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffect"), 0, settingsFilename); -static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename); - static int OldsetSpring; static int OldsetViosity; static int OldsetCenterOffset; @@ -37,9 +33,6 @@ void DeadHeat::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigg if (EnableDamper) triggers->Damper(DamperStrength / 100.0); - if (EnableForceSpringEffect) - triggers->Springi(ForceSpringStrength / 100.0); - if (setSpring != OldsetSpring && setSpring) { double percentForce = setSpring / 63.0; diff --git a/Game Files/DeadHeatRiders.cpp b/Game Files/DeadHeatRiders.cpp new file mode 100644 index 0000000..17fba6c --- /dev/null +++ b/Game Files/DeadHeatRiders.cpp @@ -0,0 +1,88 @@ +/*This file is part of FFB Arcade Plugin. +FFB Arcade Plugin is free software : you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +FFB Arcade Plugin is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. +*/ + +#include +#include "DeadHeatRiders.h" +#include "../Common Files/Game.h" + +extern int EnableDamper; +extern int DamperStrength; + +static int OldsetSpring; +static int OldsetViosity; +static int OldsetCenterOffset; +static int OldsetReflect; + +void DeadHeatRiders::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) +{ + int setSpring = GetTeknoParrotFFB(); + int setViosity = GetTeknoParrotFFB2(); + int setCenterOffset = GetTeknoParrotFFB3(); + int setReflect = GetTeknoParrotFFB4(); + + if (EnableDamper) + triggers->Damper(DamperStrength / 100.0); + + if (setSpring) + { + double percentForce = setSpring / 500.0; + triggers->Springi(percentForce); + } + + if (setViosity) + { + double percentForce = setViosity / 63.0; + triggers->Friction(percentForce); + } + + if (setReflect != OldsetReflect && setReflect) + { + if (setReflect > 0x00 && setReflect <= 0x3F) + { + double percentForce = setReflect / 63.0; + double percentLength = 100; + triggers->Rumble(percentForce, 0, percentLength); + triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); + } + else + { + double percentForce = (0xFF - setReflect) / 63.0; + double percentLength = 100; + triggers->Rumble(0, percentForce, percentLength); + triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); + } + } + + if (setCenterOffset != OldsetCenterOffset && setCenterOffset) + { + if (setCenterOffset > 0x00 && setCenterOffset <= 0x3F) + { + double percentForce = setCenterOffset / 63.0; + double percentLength = 100; + triggers->Rumble(percentForce, 0, percentLength); + triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); + } + else + { + double percentForce = ((0xFFFFFFFF - setCenterOffset) + 1) / 63.0; + double percentLength = 100; + triggers->Rumble(0, percentForce, percentLength); + triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); + } + } + + OldsetSpring = setSpring; + OldsetViosity = setViosity; + OldsetCenterOffset = setCenterOffset; + OldsetReflect = setReflect; +} \ No newline at end of file diff --git a/Game Files/DeadHeatRiders.h b/Game Files/DeadHeatRiders.h new file mode 100644 index 0000000..6851d09 --- /dev/null +++ b/Game Files/DeadHeatRiders.h @@ -0,0 +1,21 @@ +/*This file is part of FFB Arcade Plugin. +FFB Arcade Plugin is free software : you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +FFB Arcade Plugin is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. +*/ + +#pragma once +#include "../Common Files/TeknoParrotGame.h" + +class DeadHeatRiders : public TeknoParrotGame { +public: + DeadHeatRiders() : TeknoParrotGame() { } + void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers); +}; \ No newline at end of file diff --git a/Game Files/WMMT3.cpp b/Game Files/WMMT3.cpp index feb3780..c4bbad3 100644 --- a/Game Files/WMMT3.cpp +++ b/Game Files/WMMT3.cpp @@ -18,10 +18,6 @@ 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 EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffect"), 0, settingsFilename); -static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename); - static int OldsetSpring; static int OldsetViosity; static int OldsetCenterOffset; @@ -39,9 +35,6 @@ void WMMT3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers if (EnableDamper) triggers->Damper(DamperStrength / 100.0); - if (EnableForceSpringEffect) - triggers->Springi(ForceSpringStrength / 100.0); - if (setSpring != OldsetSpring && setSpring) { double percentForce = setSpring / 63.0;