1
0
mirror of synced 2024-11-27 16:10:52 +01:00

Merge pull request #76 from PairRoc/master

Fix FFB bug in wmmt6rr
This commit is contained in:
Boomslangnz 2024-08-01 06:45:19 +12:00 committed by GitHub
commit cf47dcb823
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 65 additions and 73 deletions

View File

@ -23,7 +23,7 @@ static Helpers* myHelpers;
extern SDL_Event e;
static UINT8 oldgear = 0;
static bool init = false;
static bool gameFfbStarted = false;
// static bool gameFfbStarted = false;
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int SpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringStrength"), 100, settingsFilename);
static int FrictionStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("FrictionStrength"), 0, settingsFilename);
@ -158,9 +158,10 @@ void WMMT6RR::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigge
float collisions = helpers->ReadFloat32(0x1F2526C, true);
float tiresSlip = helpers->ReadFloat32(0x1F25260, true);
int speed = helpers->ReadInt32(0x1F2612C, true);
int rpm = helpers->ReadInt32(0x1F2629C, true);
std::string msg = "spring: " + std::to_string(spring) + " | friction: " + std::to_string(friction)
+ " | collisions: " + std::to_string(collisions) + " | tires slip: " + std::to_string(tiresSlip)
+ " | speed: " + std::to_string(speed);
+ " | speed: " + std::to_string(speed)+ " | rpm: " +std::to_string(rpm);
helpers->log((char*)msg.c_str());
if(ReverseCollision)
{
@ -177,7 +178,7 @@ void WMMT6RR::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigge
}
double percentForce;
if (0.001 > spring && !gameFfbStarted)
if (!rpm && !speed)
{
helpers->log("fake spring+friction until game's FFB starts");
percentForce = 0.3 * SpringStrength / 100.0;
@ -186,18 +187,12 @@ void WMMT6RR::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigge
triggers->Friction(percentForce);
}
else
{
if (!gameFfbStarted)
{
helpers->log("game's FFB started");
gameFfbStarted = true;
}
percentForce = (1.0 * spring) * SpringStrength / 100.0;
triggers->Spring(percentForce);
percentForce = (1.0 * friction) * FrictionStrength / 100.0;
triggers->Friction(percentForce);
}
if (0 < collisions)
{
if (0.209 <= collisions && 0.311 >= collisions)
@ -262,6 +257,9 @@ void WMMT6RR::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigge
triggers->Rumble(0, percentForce, 150);
}
}
}
/* TODO
INT_PTR ptr1 = helpers->ReadIntPtr(0x20681C0, true); //Wg6Enma_Release_IDL0.dll+29B3E0
UINT8 gear = helpers->ReadByte(ptr1 + 0x3AC, false); //ptr1 + 0x3A8

View File

@ -1,17 +1,9 @@
# FFB Arcade Plugin - WMMT6RR
# FFB Arcade Plugin
Brought to you by Boomslangnz, Ducon2016, Spazzy, Adam_, jpb & pinkimo.
6RR version brought to you by Rocco.
This is a plugin to provide Force Feedback and Rumble to various arcade games.
This is a plugin to provide Force Feedback and Rumble to various arcade games, including WMMT6RR.
## Changelog in 6RR ver:
- Temporarily removed Additional Fake Effects from 6R due to DLL memory access issue
- Add Reverse Collision option
- Add Reverse Tires Slip option
- Have fun ;)
## Requirements
@ -91,6 +83,8 @@ extremely generous.
- headkaze for making MAMEInterOp SDK
- Rocco for WMMT6RR FFB.
- Everyone who helps and gives back to this awesome scene. Thanks for everything!