diff --git a/Config/FFBPlugin.ini b/Config/FFBPlugin.ini
index ca5659c..8603cde 100644
--- a/Config/FFBPlugin.ini
+++ b/Config/FFBPlugin.ini
@@ -128,6 +128,11 @@ GameId=6
FeedbackLength=30000
DefaultCentering=15
+[KODrive]
+GameId=39
+FFBMode=0
+FeedbackLength=500
+
[InitialD4]
GameId=16
FeedbackLength=600
diff --git a/Dinput8Wrapper.vcxproj b/Dinput8Wrapper.vcxproj
index e666d7e..92b0592 100644
--- a/Dinput8Wrapper.vcxproj
+++ b/Dinput8Wrapper.vcxproj
@@ -22,6 +22,7 @@
+
@@ -47,6 +48,7 @@
+
diff --git a/Dinput8Wrapper.vcxproj.filters b/Dinput8Wrapper.vcxproj.filters
index fdbc09a..4ca6799 100644
--- a/Dinput8Wrapper.vcxproj.filters
+++ b/Dinput8Wrapper.vcxproj.filters
@@ -120,6 +120,7 @@
+
@@ -246,6 +247,9 @@
Common Header Files
+
+ Common Header Files
+
diff --git a/DllMain.cpp b/DllMain.cpp
index 2cf9266..6fb4ea3 100644
--- a/DllMain.cpp
+++ b/DllMain.cpp
@@ -52,6 +52,7 @@
#include "Game Files/LGI.h"
#include "Game Files/Mame020632bit.h"
#include "Game Files/Mame020664bit.h"
+#include "Game Files/KODrive.h"
// typedefs
typedef unsigned char U8;
@@ -917,6 +918,7 @@ const int OUTRUN_2Real = 35;
const int Button_Rumble64bit = 36;
const int GRID_ = 37;
const int FORD_RACING_OTHER = 38;
+const int KO_Drive = 39;
HINSTANCE Get_hInstance()
{
@@ -1081,7 +1083,7 @@ void TriggerConstantEffect(int direction, double strength)
{
if (AlternativeFFB == 1)
{
- /*std::chrono::milliseconds now = duration_cast(system_clock::now().time_since_epoch());
+ std::chrono::milliseconds now = duration_cast(system_clock::now().time_since_epoch());
long long elapsedTime = (std::chrono::duration_cast(now - timeOfLastConstantEffect)).count();
int effectId = direction == effectConst.DIRECTION_FROM_LEFT ? effects.effect_right_id : effects.effect_left_id;
std::string effectHash = std::to_string(effectId) + "_" + std::to_string(strength) + "_" + std::to_string(direction);
@@ -1091,7 +1093,7 @@ void TriggerConstantEffect(int direction, double strength)
return; // same effect, do nothing.
}
- TODO: investigate if we need this
+ // TODO: investigate if we need this
if (configResetFeedback || strength <= 0.001) {
SDL_HapticStopEffect(haptic, effects.effect_left_id);
SDL_HapticStopEffect(haptic, effects.effect_right_id);
@@ -1100,7 +1102,7 @@ void TriggerConstantEffect(int direction, double strength)
lastConstantEffectHash = effectHash;
return;
}
- }*/
+ }
SDL_HapticEffect tempEffect;
SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
tempEffect.type = SDL_HAPTIC_CONSTANT;
@@ -1133,12 +1135,12 @@ void TriggerConstantEffect(int direction, double strength)
SDL_HapticUpdateEffect(haptic, effects.effect_right_id, &tempEffect);
SDL_HapticRunEffect(haptic, effects.effect_right_id, 1);
}
- /*timeOfLastConstantEffect = now;
- lastConstantEffectHash = effectHash;*/
+ timeOfLastConstantEffect = now;
+ lastConstantEffectHash = effectHash;
}
else
{
- /*std::chrono::milliseconds now = duration_cast(system_clock::now().time_since_epoch());
+ std::chrono::milliseconds now = duration_cast(system_clock::now().time_since_epoch());
long long elapsedTime = (std::chrono::duration_cast(now - timeOfLastConstantEffect)).count();
int effectId = direction == effectConst.DIRECTION_FROM_LEFT ? effects.effect_right_id : effects.effect_left_id;
std::string effectHash = std::to_string(effectId) + "_" + std::to_string(strength) + "_" + std::to_string(direction);
@@ -1157,7 +1159,7 @@ void TriggerConstantEffect(int direction, double strength)
lastConstantEffectHash = effectHash;
return;
}
- }*/
+ }
SDL_HapticEffect tempEffect;
@@ -1177,8 +1179,8 @@ void TriggerConstantEffect(int direction, double strength)
SDL_HapticUpdateEffect(haptic, effects.effect_id, &tempEffect);
SDL_HapticRunEffect(haptic, effects.effect_id, 1);
- /*timeOfLastConstantEffect = now;
- lastConstantEffectHash = effectHash;*/
+ timeOfLastConstantEffect = now;
+ lastConstantEffectHash = effectHash;
}
}
@@ -1731,6 +1733,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case MAME_020664bit:
game = new Mame020664bit;
break;
+ case KO_Drive:
+ game = new KODrive;
+ break;
case TEST_GAME_CONST:
case TEST_GAME_FRICTION:
case TEST_GAME_SINE:
diff --git a/Game Files/KODrive.cpp b/Game Files/KODrive.cpp
new file mode 100644
index 0000000..5590acb
--- /dev/null
+++ b/Game Files/KODrive.cpp
@@ -0,0 +1,59 @@
+#include
+#include "KODrive.h"
+
+void KODrive::FFBLoop(EffectConstants * constants, Helpers * helpers, EffectTriggers * triggers) {
+ UINT8 ff = helpers->ReadByte(0x00B261F6, /* isRelativeOffset */ false);
+ UINT8 ff1 = helpers->ReadByte(0x00B261F5, /* isRelativeOffset */ false);
+ wchar_t *settingsFilename = TEXT(".\\FFBPlugin.ini");
+ int FFBMode = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBMode"), 0, settingsFilename);
+ helpers->log("got value: ");
+ std::string ffs = std::to_string(ff);
+ helpers->log((char *)ffs.c_str());
+
+ if ((ff == 10) & (ff1 == 30))
+ {
+ double percentForce = 0.4;
+ double percentForce1 = 2.7;
+ double percentLength = 100;
+ triggers->LeftRight(percentForce1, percentForce1, percentLength);
+ triggers->Sine(80, 80, percentForce);
+ }
+ if (FFBMode == 1)
+ {
+ if ((ff > 0x66) & (ff < 0x80) & (ff1 == 0))
+ {
+ helpers->log("moving wheel right");
+ double percentForce = (128 - ff) / 24.0;
+ double percentLength = 100;
+ triggers->LeftRight(pow(percentForce, 0.5), 0, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_LEFT, (pow(percentForce, 0.5)));
+ }
+ else if ((ff > 0x00) & (ff < 0x19) & (ff1 == 1))
+ {
+ helpers->log("moving wheel left");
+ double percentForce = (ff) / 24.0;
+ double percentLength = 100;
+ triggers->LeftRight(0, pow(percentForce, 0.5), percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_RIGHT, (pow(percentForce, 0.5)));
+ }
+ }
+ else
+ {
+ if ((ff > 0x66) & (ff < 0x80) & (ff1 == 0))
+ {
+ helpers->log("moving wheel right");
+ double percentForce = (128 - ff) / 24.0;
+ double percentLength = 100;
+ triggers->LeftRight(percentForce, 0, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
+ }
+ else if ((ff > 0x00) & (ff < 0x19) & (ff1 == 1))
+ {
+ helpers->log("moving wheel left");
+ double percentForce = (ff) / 24.0;
+ double percentLength = 100;
+ triggers->LeftRight(0, percentForce, percentLength);
+ triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Game Files/KODrive.h b/Game Files/KODrive.h
new file mode 100644
index 0000000..86bc20d
--- /dev/null
+++ b/Game Files/KODrive.h
@@ -0,0 +1,7 @@
+#pragma once
+#include "../Common Files/Game.h"
+
+class KODrive : public Game {
+public:
+ void FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers);
+};
\ No newline at end of file
diff --git a/Includes/FFBPlugin.txt b/Includes/FFBPlugin.txt
index f669ff3..f7ac2bb 100644
--- a/Includes/FFBPlugin.txt
+++ b/Includes/FFBPlugin.txt
@@ -1,6 +1,6 @@
***FFB Arcade Plugin***
-Version 1.0
+Version 0.9c
Created by Boomslangnz, Ducon2016 & Spazzy.
@@ -10,12 +10,18 @@ While best efforts were made to try to resemble the real arcade force feedback,
in some cases eg Mario Kart GP DX, Pokken Tournament and Battle Gear 4,effects were created entirely from scratch
so are not using real force feedback values. Most games use correct ffb values however :)
-***1.0 Changes***
+***0.9c Changes***
+
+- Added FFB Support for KO Drive
+
+***0.9b Changes***
- Fixed issue where M2 Emulator wouldn't close correctly while using FFB Plugin
- Added FFB support for Ford Racing to non-TP loaders (use FordRacingOther plugin)
+- Fixed wrong SDL2.dll file with WMMT5 on last release (sorry)
+
***0.9a Changes***
- Fixed issue where MAME plugins would not load
@@ -320,6 +326,8 @@ TURN ON FEEDBACK STEERING IN GAME SETTINGS OR YOU WILL NOT RECIEVE FORCE FEEDBAC
-Let's Go Island 3D [d3d9.dll into game exe folder]
+-KO Drive [d3d9.dll into game exe folder]
+
***HOW TO USE***