1
0
mirror of synced 2024-11-23 22:40:57 +01:00

add Dead Heat Riders

This commit is contained in:
Boomslangnz 2022-06-09 17:25:54 +12:00
parent c364a25ec6
commit 64fb751e8b
8 changed files with 126 additions and 14 deletions

View File

@ -236,6 +236,12 @@ FeedbackLength=500
EnableDamper=0
DamperStrength=100
[Dead Heat Riders]
GameId=63
FeedbackLength=500
EnableDamper=0
DamperStrength=100
[Winter X Games SnoCross]
GameId=44
FeedbackLength=500

View File

@ -28,6 +28,7 @@
<ClInclude Include="Game Files\D1GP.h" />
<ClInclude Include="Game Files\Daytona3NSE.h" />
<ClInclude Include="Game Files\DeadHeat.h" />
<ClInclude Include="Game Files\DeadHeatRiders.h" />
<ClInclude Include="Game Files\DirtyDrivin.h" />
<ClInclude Include="Game Files\Flycast.h" />
<ClInclude Include="Game Files\FordRacingOther.h" />
@ -76,6 +77,7 @@
<ClCompile Include="Game Files\D1GP.cpp" />
<ClCompile Include="Game Files\Daytona3NSE.cpp" />
<ClCompile Include="Game Files\DeadHeat.cpp" />
<ClCompile Include="Game Files\DeadHeatRiders.cpp" />
<ClCompile Include="Game Files\DemulATVTrackInputs.cpp" />
<ClCompile Include="Game Files\DemulFasterThanSpeedInputs.cpp" />
<ClCompile Include="Game Files\DemulMaximumSpeedInputs.cpp" />

View File

@ -148,6 +148,7 @@
<ClCompile Include="Game Files\Flycast.cpp" />
<ClCompile Include="Game Files\WMMT3.cpp" />
<ClCompile Include="Game Files\DeadHeat.cpp" />
<ClCompile Include="Game Files\DeadHeatRiders.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Game Files\Daytona3.h">
@ -352,6 +353,9 @@
<ClInclude Include="Game Files\DeadHeat.h">
<Filter>Common Header Files</Filter>
</ClInclude>
<ClInclude Include="Game Files\DeadHeatRiders.h">
<Filter>Common Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<MASM Include="DLLWrapper.asm" />

View File

@ -40,6 +40,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/Daytona3.h"
#include "Game Files/Daytona3NSE.h"
#include "Game Files/DeadHeat.h"
#include "Game Files/DeadHeatRiders.h"
#include "Game Files/DirtyDrivin.h"
#include "Game Files/FordRacing.h"
#include "Game Files/FordRacingOther.h"
@ -1032,6 +1033,7 @@ const int DAYTONA_3_NSE = 59;
const int FLYCAST = 60;
const int WMMT_3 = 61;
const int DEAD_HEAT = 62;
const int DEAD_HEAT_RIDERS = 63;
HINSTANCE Get_hInstance()
{
@ -2502,6 +2504,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case DEAD_HEAT:
game = new DeadHeat;
break;
case DEAD_HEAT_RIDERS:
game = new DeadHeatRiders;
break;
case TEST_GAME_CONST:
case TEST_GAME_FRICTION:
case TEST_GAME_SINE:

View File

@ -18,10 +18,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
extern int EnableDamper;
extern int DamperStrength;
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 OldsetSpring;
static int OldsetViosity;
static int OldsetCenterOffset;
@ -37,9 +33,6 @@ void DeadHeat::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigg
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
if (EnableForceSpringEffect)
triggers->Springi(ForceSpringStrength / 100.0);
if (setSpring != OldsetSpring && setSpring)
{
double percentForce = setSpring / 63.0;

View File

@ -0,0 +1,88 @@
/*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 <string>
#include "DeadHeatRiders.h"
#include "../Common Files/Game.h"
extern int EnableDamper;
extern int DamperStrength;
static int OldsetSpring;
static int OldsetViosity;
static int OldsetCenterOffset;
static int OldsetReflect;
void DeadHeatRiders::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers)
{
int setSpring = GetTeknoParrotFFB();
int setViosity = GetTeknoParrotFFB2();
int setCenterOffset = GetTeknoParrotFFB3();
int setReflect = GetTeknoParrotFFB4();
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
if (setSpring)
{
double percentForce = setSpring / 500.0;
triggers->Springi(percentForce);
}
if (setViosity)
{
double percentForce = setViosity / 63.0;
triggers->Friction(percentForce);
}
if (setReflect != OldsetReflect && setReflect)
{
if (setReflect > 0x00 && setReflect <= 0x3F)
{
double percentForce = setReflect / 63.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
else
{
double percentForce = (0xFF - setReflect) / 63.0;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
}
if (setCenterOffset != OldsetCenterOffset && setCenterOffset)
{
if (setCenterOffset > 0x00 && setCenterOffset <= 0x3F)
{
double percentForce = setCenterOffset / 63.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
{
double percentForce = ((0xFFFFFFFF - setCenterOffset) + 1) / 63.0;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
}
OldsetSpring = setSpring;
OldsetViosity = setViosity;
OldsetCenterOffset = setCenterOffset;
OldsetReflect = setReflect;
}

View File

@ -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/TeknoParrotGame.h"
class DeadHeatRiders : public TeknoParrotGame {
public:
DeadHeatRiders() : TeknoParrotGame() { }
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
};

View File

@ -18,10 +18,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
extern int EnableDamper;
extern int DamperStrength;
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 OldsetSpring;
static int OldsetViosity;
static int OldsetCenterOffset;
@ -39,9 +35,6 @@ void WMMT3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
if (EnableForceSpringEffect)
triggers->Springi(ForceSpringStrength / 100.0);
if (setSpring != OldsetSpring && setSpring)
{
double percentForce = setSpring / 63.0;