From 5e74bfac2b33840ef80aced9942e6acb930c5ee7 Mon Sep 17 00:00:00 2001 From: Aaron M Date: Fri, 13 Dec 2019 09:44:23 +1300 Subject: [PATCH] Output changes --- DllMain.cpp | 2 +- Game Files/OutputReading.cpp | 32 +++++++++++++++++++++++--------- Includes/FFBPluginReadme.txt | 6 +++++- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/DllMain.cpp b/DllMain.cpp index ad45395..ef6012e 100644 --- a/DllMain.cpp +++ b/DllMain.cpp @@ -1753,7 +1753,7 @@ DWORD WINAPI FFBLoop(LPVOID lpParam) { hlp.log("In FFBLoop"); - if ((configGameId != 22) && (configGameId != 29) && (configGameId != 34)) //For games which need code to run quicker etc. Some games will crash if no sleep added + if ((configGameId != 29) && (configGameId != 34)) //For games which need code to run quicker etc. Some games will crash if no sleep added { Sleep(2500); } diff --git a/Game Files/OutputReading.cpp b/Game Files/OutputReading.cpp index 8937057..2cca392 100644 --- a/Game Files/OutputReading.cpp +++ b/Game Files/OutputReading.cpp @@ -28,6 +28,7 @@ HINSTANCE ProcDLL = NULL; static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini"); static int configFeedbackLength = GetPrivateProfileInt(TEXT("Settings"), TEXT("FeedbackLength"), 120, settingsFilename); +static int configGameId = GetPrivateProfileInt(TEXT("Settings"), TEXT("GameId"), 0, settingsFilename); static int SinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("SinePeriod"), 0, settingsFilename); static int SineFadePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("SineFadePeriod"), 0, settingsFilename); static int SineStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SineStrength"), 0, settingsFilename); @@ -351,8 +352,16 @@ DWORD WINAPI ThreadForOutputs(LPVOID lpParam) DWORD WINAPI ThreadForForcedSpring(LPVOID lpParam) { - Sleep(2500); - ForceSpringEffect = true; + if (configGameId == 34) + { + Sleep(2500); + ForceSpringEffect = true; + } + else + { + ForceSpringEffect = true; + } + return 0; } @@ -2494,10 +2503,20 @@ void OutputReading::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect std::string ffs = std::to_string(newstateFFB); helpers->log((char*)ffs.c_str()); + if (newstateFFB == 0x00) + { + MAEffect = false; + } + stateFFB = newstateFFB; } else if (name == MB_Steering_Wheel_motor) { + if (newstateFFB == 0x00) + { + MAEffect = false; + } + stateFFBDevice2 = newstateFFB; } @@ -2581,11 +2600,6 @@ void OutputReading::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect { if (Emulator == MAME) { - if (name == wheel) - { - stateFFB = newstateFFB; - } - if (!HardDrivinFrame) { HardDrivinFrame = true; @@ -2614,7 +2628,7 @@ void OutputReading::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect sprintf(test, "hex print: %d", HardDrivinFFB); OutputDebugStringA(test); - if (HardDrivinFFB > 0) +/* if (HardDrivinFFB > 0) { double percentForce = HardDrivinFFB / 100.0; double percentLength = 100; @@ -2629,7 +2643,7 @@ void OutputReading::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect double percentLength = 100; triggers->Rumble(0, percentForce, percentLength); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); - } + } */ } } } diff --git a/Includes/FFBPluginReadme.txt b/Includes/FFBPluginReadme.txt index 2922e2d..f18bf99 100644 --- a/Includes/FFBPluginReadme.txt +++ b/Includes/FFBPluginReadme.txt @@ -18,7 +18,7 @@ so are not using real force feedback values. Most games use correct ffb values h - Added logging values to all Output games (MAME & Supermodel) -- FreeLibrary on MAME32 & MAME64 which was missing previously +- FreeLibrary on MAME32 & MAME64 dll which was missing previously - Changed Forced Spring to occur after 2.5 seconds rather then after first FFB Value sent on Outputs @@ -26,6 +26,10 @@ so are not using real force feedback values. Most games use correct ffb values h - Modified GUI Page so Supermodel Outputs only shows relevant information for Supermodel Games +- Added Sleep before loading MAME Output as this caused issues on some pcs where Outputs values were not recieved + +- Progress made on Hard Drivin' & Race Drivin' (Big thanks to Ducon 2016 for creating math formula and helping with this) but not possible yet to work + - Forgot to mention last release that on Virtua Racing, set cabinet to Upright to recieve FFB values