From bd235cd2dc10f2f30398134a5a3e557e2d112fdd Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Wed, 20 Mar 2024 14:02:55 +1300 Subject: [PATCH] push Arctic Thunder code i never added --- AutoSetup.cmd | 3 ++ Config/FFBPlugin.ini | 9 ++++++ DInput8Wrapper.aps | Bin 2740 -> 2740 bytes DInput8Wrapper.rc | Bin 5212 -> 5212 bytes Dinput8Wrapper.vcxproj | 2 ++ Dinput8Wrapper.vcxproj.filters | 4 +++ DllMain.cpp | 5 +++ Game Files/ArcticThunder.cpp | 56 +++++++++++++++++++++++++++++++++ Game Files/ArcticThunder.h | 21 +++++++++++++ Version.txt | 2 +- 10 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 Game Files/ArcticThunder.cpp create mode 100644 Game Files/ArcticThunder.h diff --git a/AutoSetup.cmd b/AutoSetup.cmd index 20ade77..172d6e5 100644 --- a/AutoSetup.cmd +++ b/AutoSetup.cmd @@ -42,6 +42,9 @@ cd.. cd Aliens Extermination rename dinput8.dll opengl32.dll cd.. +cd Arctic Thunder +rename dinput8.dll d3d9.dll +cd.. cd Batman rename dinput8.dll d3d11.dll cd.. diff --git a/Config/FFBPlugin.ini b/Config/FFBPlugin.ini index fc1fdc4..1089f1f 100644 --- a/Config/FFBPlugin.ini +++ b/Config/FFBPlugin.ini @@ -779,6 +779,15 @@ DoubleConstant=0 DoubleSpring=0 DoubleFriction=0 +[Arctic Thunder] +GameId=75 +FeedbackLength=500 +EnableDamper=0 +DamperStrength=100 +PowerMode=1 +EnableForceSpringEffect = 1; +ForceSpringStrength = 100; + [WMMT5] GameId=9 DefaultCentering=0 diff --git a/DInput8Wrapper.aps b/DInput8Wrapper.aps index 1fe3d31ca34205fb316c6f0e98abecfae238808d..cdfa4fbe63329caf23aa675ed9dca83060a3a548 100644 GIT binary patch delta 36 ncmdlYx&8!0|+oNsBKPVQ)Fbc*xb&p4Wc%4FfsuElBWlZ delta 36 ncmdlYx&8^0|+oNsBTVWQ)FZ`-`viw4Wc%4FfsuEl4J*n diff --git a/DInput8Wrapper.rc b/DInput8Wrapper.rc index 3891c0364efd580f4008ce980edbcc417d40f2b6..b83fc24577a48b49357bd6f8038c441987997e8e 100644 GIT binary patch delta 38 rcmcbkaYtiA7&oKE&0@^G9@+%8T delta 38 rcmcbkaYtiA7&oK&&0@^G9@!ktX diff --git a/Dinput8Wrapper.vcxproj b/Dinput8Wrapper.vcxproj index c5adaec..d4964c7 100644 --- a/Dinput8Wrapper.vcxproj +++ b/Dinput8Wrapper.vcxproj @@ -24,6 +24,7 @@ + @@ -83,6 +84,7 @@ + diff --git a/Dinput8Wrapper.vcxproj.filters b/Dinput8Wrapper.vcxproj.filters index c545365..36df76a 100644 --- a/Dinput8Wrapper.vcxproj.filters +++ b/Dinput8Wrapper.vcxproj.filters @@ -159,6 +159,7 @@ + @@ -399,6 +400,9 @@ Common Header Files + + Common Header Files + diff --git a/DllMain.cpp b/DllMain.cpp index d8e0952..b3196aa 100644 --- a/DllMain.cpp +++ b/DllMain.cpp @@ -102,6 +102,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>. #include "Game Files/Transformers.h" #include "Game Files/H2Overdrive.h" #include "Game Files/StormRacerG.h" +#include "Game Files/ArcticThunder.h" // typedefs typedef unsigned char U8; @@ -1066,6 +1067,7 @@ const int GRID_Custom = 71; const int MARIO_KART_GPDX_118_CUSTOM = 72; const int SEGA_SHOWDOWN = 73; const int SPRING_EFFECT = 74; +const int ARCTIC_THUNDER = 75; HINSTANCE Get_hInstance() { @@ -2590,6 +2592,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam) case SPRING_EFFECT: game = new SpringEffect; break; + case ARCTIC_THUNDER: + game = new ArcticThunder; + break; case TEST_GAME_CONST: case TEST_GAME_FRICTION: case TEST_GAME_SINE: diff --git a/Game Files/ArcticThunder.cpp b/Game Files/ArcticThunder.cpp new file mode 100644 index 0000000..85284c0 --- /dev/null +++ b/Game Files/ArcticThunder.cpp @@ -0,0 +1,56 @@ +/*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 "ArcticThunder.h" + +extern int EnableDamper; +extern int DamperStrength; +extern int EnableForceSpringEffect; +extern int ForceSpringStrength; + +void ArcticThunder::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { + + if (EnableDamper) + triggers->Damper(DamperStrength / 100.0); + + if (EnableForceSpringEffect) + triggers->Springi(ForceSpringStrength / 100.0); + + if (GetTeknoParrotFFB2() != 0xFF && GetTeknoParrotFFB2()) + { + float FFBSine = (GetTeknoParrotFFB2() / 255.0); + triggers->Sine(50, 0, FFBSine); + triggers->Rumble(0, FFBSine, 100.0); + } + + int FFB = GetTeknoParrotFFB3(); + + if (FFB) + { + if (FFB > 0x80) + { + double percentForce = ((FFB - 128.0) / 127.0); + + triggers->Rumble(0, percentForce, 100.0); + triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); + } + else if (FFB < 0x80) + { + double percentForce = ((128.0 - FFB) / 127.0); + + triggers->Rumble(percentForce, 0, 100.0); + triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); + } + } +} \ No newline at end of file diff --git a/Game Files/ArcticThunder.h b/Game Files/ArcticThunder.h new file mode 100644 index 0000000..b9ed554 --- /dev/null +++ b/Game Files/ArcticThunder.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 ArcticThunder : public TeknoParrotGame { +public: + ArcticThunder() : TeknoParrotGame() { } + void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers); +}; \ No newline at end of file diff --git a/Version.txt b/Version.txt index 1821384..580ff66 100644 --- a/Version.txt +++ b/Version.txt @@ -1 +1 @@ -v2.0.0.37 \ No newline at end of file +v2.0.0.38 \ No newline at end of file