-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add wasteland racers and update version
- Loading branch information
1 parent
71ef119
commit dd522f6
Showing
9 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/*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 "WasteLandRacers2071.h" | ||
#include <string> | ||
#include <sstream> | ||
#include "SDL.h" | ||
|
||
static EffectTriggers* myTriggers; | ||
static EffectConstants* myConstants; | ||
static Helpers* myHelpers; | ||
|
||
extern int EnableDamper; | ||
extern int DamperStrength; | ||
|
||
static bool init; | ||
static double ffb = 1; | ||
|
||
static int(__cdecl* SetForceOrig)(int param_1, int param_2, int param_3, int param_4); | ||
static int __cdecl SetForce(int param_1, int param_2, int param_3, int param_4) { | ||
|
||
ffb = (double)param_1 / 32768.0; | ||
|
||
return 0; | ||
} | ||
|
||
static int(__cdecl* SetSteeringPosOrig)(int param_1, int param_2, int param_3, int param_4); | ||
static int __cdecl SetSteeringPos(int param_1, int param_2, int param_3, int param_4) { | ||
|
||
double wheelPos = (double)param_1 / 128000.0; | ||
|
||
if (wheelPos >= 0) { | ||
myTriggers->Rumble(0, param_1, 100.0); | ||
myTriggers->Constant(myConstants->DIRECTION_FROM_RIGHT, wheelPos); | ||
} | ||
else if (wheelPos <= 0) { | ||
myTriggers->Rumble(0, param_1 * -1, 100.0); | ||
myTriggers->Constant(myConstants->DIRECTION_FROM_LEFT, wheelPos * -1); | ||
} | ||
return 0; | ||
} | ||
|
||
static int(__cdecl* SetDigitalOutOrig)(int param_1, int param_2, int param_3, int param_4); | ||
static int __cdecl SetDigitalOut(int param_1, int param_2, int param_3, int param_4) { | ||
return 0; | ||
} | ||
|
||
void WasteLandRacers2071::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) { | ||
|
||
//check a DLL has been loaded | ||
if (GetModuleHandleA("sdc2.dll") != NULL && !init) { | ||
init = true; | ||
MH_Initialize(); | ||
MH_CreateHookApi(L"sdc2.dll", "SetForce", SetForce, (void**)&SetForceOrig); | ||
MH_CreateHookApi(L"sdc2.dll", "SetSteeringPos", SetSteeringPos, (void**)&SetSteeringPosOrig); | ||
MH_CreateHookApi(L"sdc2.dll", "SetDigitalOut", SetDigitalOut, (void**)&SetDigitalOutOrig); | ||
MH_EnableHook(MH_ALL_HOOKS); | ||
} | ||
|
||
if (EnableDamper) | ||
triggers->Damper(DamperStrength / 100.0); | ||
|
||
triggers->Spring(ffb); | ||
|
||
myTriggers = triggers; | ||
myConstants = constants; | ||
myHelpers = helpers; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/Game.h" | ||
|
||
class WasteLandRacers2071 : public Game { | ||
|
||
public: | ||
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v2.0.0.50 | ||
v2.0.0.51 |