diff --git a/Config/FFBPlugin.ini b/Config/FFBPlugin.ini
index 8bcb218..6bc8347 100644
--- a/Config/FFBPlugin.ini
+++ b/Config/FFBPlugin.ini
@@ -116,6 +116,9 @@ Rumble2Strength=100
Rumble1Length=200
Rumble2Length=200
+[Storm Racer G]
+GameId=48
+
[HOTD4]
GameId=4
FeedbackLength=100
@@ -205,7 +208,7 @@ GameId=39
PowerMode=0
FeedbackLength=500
-[InitialD Zero]
+[InitialD Zero v131]
GameId=32
FeedbackLength=80
PowerMode=0
@@ -214,6 +217,15 @@ EnableForceSpringEffect=0
ForceSpringStrength=70
EscapeKeyExitViaPlugin=0
+[InitialD Zero v211]
+GameId=49
+FeedbackLength=80
+PowerMode=0
+IDZMode=0
+EnableForceSpringEffect=0
+ForceSpringStrength=70
+EscapeKeyExitViaPlugin=0
+
[InitialD 4]
GameId=16
FeedbackLength=5000
diff --git a/DInput8Wrapper.aps b/DInput8Wrapper.aps
index 2b771a9..ee23d01 100644
Binary files a/DInput8Wrapper.aps and b/DInput8Wrapper.aps differ
diff --git a/DInput8Wrapper.rc b/DInput8Wrapper.rc
index 5dcf230..8f4b517 100644
Binary files a/DInput8Wrapper.rc and b/DInput8Wrapper.rc differ
diff --git a/Dinput8Wrapper.vcxproj b/Dinput8Wrapper.vcxproj
index 96e247e..8828b3d 100644
--- a/Dinput8Wrapper.vcxproj
+++ b/Dinput8Wrapper.vcxproj
@@ -31,6 +31,7 @@
+
@@ -47,6 +48,7 @@
+
Document
@@ -71,6 +73,7 @@
+
@@ -99,6 +102,7 @@
+
diff --git a/Dinput8Wrapper.vcxproj.filters b/Dinput8Wrapper.vcxproj.filters
index 3aabe1e..31fcb93 100644
--- a/Dinput8Wrapper.vcxproj.filters
+++ b/Dinput8Wrapper.vcxproj.filters
@@ -131,6 +131,8 @@
+
+
@@ -293,6 +295,12 @@
Common Header Files
+
+ Common Header Files
+
+
+ Common Header Files
+
diff --git a/DllMain.cpp b/DllMain.cpp
index 7519e12..82e1881 100644
--- a/DllMain.cpp
+++ b/DllMain.cpp
@@ -42,6 +42,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/GRID.h"
#include "Game Files/GoldenGun.h"
#include "Game Files/InitialD0.h"
+#include "Game Files/InitialD0v211.h"
#include "Game Files/InitialD4.h"
#include "Game Files/InitialD4Japan.h"
#include "Game Files/InitialD5.h"
@@ -63,6 +64,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/PokkenTournament.h"
#include "Game Files/MarioKartGPDX1.10.h"
#include "Game Files/SonicSegaAllStarsRacing.h"
+#include "Game Files/StormRacerG.h"
#include "Game Files/M2Emulator.h"
#include "Game Files/GTIClub3.h"
#include "Game Files/Demul.h"
@@ -999,6 +1001,8 @@ const int Sno_Cross = 44;
const int Bat_man = 45;
const int R_Tuned = 46;
const int SEGA_RALLY_3_Other = 47;
+const int Storm_Racer_G = 48;
+const int INITIAL_D_0_211 = 49;
HINSTANCE Get_hInstance()
{
@@ -2293,6 +2297,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case INITIAL_D_0:
game = new InitialD0;
break;
+ case INITIAL_D_0_211:
+ game = new InitialD0v211;
+ break;
case INITIAL_D_4:
game = new InitialD4;
break;
@@ -2320,6 +2327,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case SEGA_RALLY_3_Other:
game = new SegaRally3Other;
break;
+ case Storm_Racer_G:
+ game = new StormRacerG;
+ break;
case WACKY_RACES:
game = new WackyRaces;
break;
diff --git a/Game Files/InitialD0v211.cpp b/Game Files/InitialD0v211.cpp
new file mode 100644
index 0000000..6853971
--- /dev/null
+++ b/Game Files/InitialD0v211.cpp
@@ -0,0 +1,152 @@
+/*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 "InitialD0v211.h"
+#include "math.h"
+
+static UINT8 ff;
+static UINT8 oldff;
+static UINT8 newff;
+static UINT8 ff1;
+static UINT8 ff2;
+static UINT8 ff3;
+
+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 EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename);
+static int IDZMode = GetPrivateProfileInt(TEXT("Settings"), TEXT("IDZMode"), 0, settingsFilename);
+
+void InitialD0v211::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
+
+ if (GetAsyncKeyState((VK_ESCAPE)) && (EscapeKeyExitViaPlugin == 1))
+ {
+ ExitProcess(0);
+ }
+
+ if (IDZMode == 0)
+ {
+ ff = helpers->ReadByte(0x18A720F, true);
+ oldff = 0;
+ newff = ff;
+
+ helpers->log("got value: ");
+ std::string ffs = std::to_string(ff);
+ helpers->log((char*)ffs.c_str());
+
+ if (EnableForceSpringEffect == 1)
+ {
+ triggers->Springi(ForceSpringStrength / 100.0);
+ }
+
+ if (oldff != newff)
+ {
+ if ((ff > 0x37) && (ff < 0x80))
+ {
+ helpers->log("moving wheel right");
+ double percentForce = (128 - ff) / 72.0;
+ double percentLength = 100;
+ triggers->Rumble(percentForce, 0, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
+ }
+ else if ((ff > 0x00) && (ff < 0x49))
+ {
+ helpers->log("moving wheel left");
+ double percentForce = (ff) / 72.0;
+ double percentLength = 100;
+ triggers->Rumble(0, percentForce, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
+ }
+ }
+ oldff = newff;
+ }
+ else
+ {
+ ff1 = helpers->ReadByte(0x18A720C, true);
+ ff2 = helpers->ReadByte(0x18A720D, true);
+ if (IDZMode == 1)
+ {
+ ff3 = helpers->ReadByte(0x18A720E, true);
+ }
+ else if (IDZMode == 2)
+ {
+ ff3 = helpers->ReadByte(0x18A720F, true);
+ }
+
+ if (ff1 == 80)
+ {
+ helpers->log("Spring");
+ triggers->Spring(1.0);
+ }
+ else if (ff1 == 0x85)
+ {
+ if ((ff2 > 0x00) && (ff2 < 0x30))
+ {
+ helpers->log("Sine");
+ double percentForce = ff2 / 47.0;
+ double percentLength = 100;
+ triggers->Rumble(percentForce, percentForce, percentLength);
+ triggers->Sine(40, 0, percentForce);
+ }
+ }
+ else if (ff1 == 0x86)
+ {
+ if ((ff3 > 0x00) && (ff3 < 0x4E))
+ {
+ helpers->log("Spring");
+ double percentForce = ff3 / 77.0;
+ double percentLength = 100;
+ triggers->Spring(percentForce);
+ }
+ }
+ else if (ff1 == 0x84)
+ {
+ if ((ff2 == 0x00) && (ff3 > 0x37) && (ff3 < 0x80))
+ {
+ helpers->log("moving wheel right");
+ double percentForce = (128 - ff3) / 72.0;
+ double percentLength = 100;
+ triggers->Rumble(percentForce, 0, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
+ }
+ else if ((ff2 == 0x01) && (ff3 > 0x00) && (ff3 < 0x49))
+ {
+ helpers->log("moving wheel left");
+ double percentForce = (ff3 / 72.0);
+ double percentLength = 100;
+ triggers->Rumble(0, percentForce, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
+ }
+ else
+ {
+ if ((ff2 == 0x00) && (ff3 > 0x00) && (ff3 < 0x38))
+ {
+ helpers->log("moving wheel right");
+ double percentForce = 1.0;
+ double percentLength = 100;
+ triggers->Rumble(percentForce, 0, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
+ }
+ else if ((ff2 == 0x01) && (ff3 > 0x48))
+ {
+ helpers->log("moving wheel left");
+ double percentForce = 1.0;
+ double percentLength = 100;
+ triggers->Rumble(0, percentForce, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Game Files/InitialD0v211.h b/Game Files/InitialD0v211.h
new file mode 100644
index 0000000..d3f45ee
--- /dev/null
+++ b/Game Files/InitialD0v211.h
@@ -0,0 +1,20 @@
+/*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/Game.h"
+
+class InitialD0v211 : public Game {
+public:
+ void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
+};
\ No newline at end of file
diff --git a/Game Files/StormRacerG.cpp b/Game Files/StormRacerG.cpp
new file mode 100644
index 0000000..ea9ec9b
--- /dev/null
+++ b/Game Files/StormRacerG.cpp
@@ -0,0 +1,89 @@
+#include
+#include "StormRacerG.h"
+static EffectTriggers* myTriggers;
+static EffectConstants* myConstants;
+static Helpers* myHelpers;
+
+static bool init = false;
+
+static void __cdecl UsbIO_SetSeatShakeImpluse(int a1, int a2, float a3, bool a4)
+{
+ double percentForce = a1 / 1200.0;
+ myTriggers->Rumble(percentForce, percentForce, 150);
+ return;
+}
+
+static bool Hook(void* toHook, void* ourFunct, int len) {
+ if (len < 5) {
+ return false;
+ }
+
+ DWORD curProtection;
+ VirtualProtect(toHook, len, PAGE_EXECUTE_READWRITE, &curProtection);
+
+ memset(toHook, 0x90, len);
+
+ DWORD relativeAddress = ((DWORD)ourFunct - (DWORD)toHook) - 5;
+
+ *(BYTE*)toHook = 0xE9;
+ *(DWORD*)((DWORD)toHook + 1) = relativeAddress;
+
+ DWORD temp;
+ VirtualProtect(toHook, len, curProtection, &temp);
+
+ return true;
+}
+
+static DWORD jmpBackAddy;
+
+void StormRacerG::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
+
+ if (!init)
+ {
+ uintptr_t ImageBaseSRG = (uintptr_t)GetModuleHandle((L"racing.exe"));
+
+ int hookLength = 6;
+ DWORD hookAddress = ImageBaseSRG + 0x12C5DE;
+
+ jmpBackAddy = hookAddress + hookLength;
+ Hook((void*)hookAddress, UsbIO_SetSeatShakeImpluse, hookLength);
+ helpers->WriteNop(ImageBaseSRG + 0x12C5DE + 5, 1, false);
+
+ init = true;
+ }
+
+ UINT8 FFB = helpers->ReadByte(0x46F429C, false);
+ UINT8 Enable = helpers->ReadByte(0x4710214, false);
+ float speedo = helpers->ReadFloat32(0x114A22D8, false);
+
+ if (Enable == 0x01)
+ {
+ if (speedo < 0)
+ {
+ speedo = -speedo;
+ }
+
+ double percentForce = speedo / 320.0;
+
+ //4 == Slipstring
+
+ if (FFB & 0x01)
+ {
+ myTriggers->Rumble(percentForce, percentForce, 150);
+ }
+
+ if (FFB & 0x02)
+ {
+ myTriggers->Rumble(percentForce, percentForce, 150);
+ }
+
+ if (FFB & 0x08)
+ {
+ myTriggers->Rumble(percentForce, percentForce, 150);
+ }
+ }
+
+ myTriggers = triggers;
+ myConstants = constants;
+ myHelpers = helpers;
+}
\ No newline at end of file
diff --git a/Game Files/StormRacerG.h b/Game Files/StormRacerG.h
new file mode 100644
index 0000000..1b8946a
--- /dev/null
+++ b/Game Files/StormRacerG.h
@@ -0,0 +1,20 @@
+/*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/Game.h"
+class StormRacerG : public Game {
+
+public:
+ void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
+};
\ No newline at end of file
diff --git a/Version.txt b/Version.txt
index 17e2ec8..72b1c0c 100644
--- a/Version.txt
+++ b/Version.txt
@@ -1 +1 @@
-v2.0.0.4
\ No newline at end of file
+v2.0.0.5
\ No newline at end of file