Add R-Tuned Support
This commit is contained in:
parent
f1fcdbc075
commit
00426fd2dc
@ -160,6 +160,11 @@ FeedbackLength=500
|
|||||||
GameId=45
|
GameId=45
|
||||||
FeedbackLength=500
|
FeedbackLength=500
|
||||||
|
|
||||||
|
[R-Tuned]
|
||||||
|
GameId=46
|
||||||
|
SpringStrength=100
|
||||||
|
FeedbackLength=500
|
||||||
|
|
||||||
[Sega Racing Classic]
|
[Sega Racing Classic]
|
||||||
GameId=5
|
GameId=5
|
||||||
FeedbackLength=500
|
FeedbackLength=500
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
<ClInclude Include="Game Files\InitialD5.h" />
|
<ClInclude Include="Game Files\InitialD5.h" />
|
||||||
<ClInclude Include="Game Files\InitialD4Japan.h" />
|
<ClInclude Include="Game Files\InitialD4Japan.h" />
|
||||||
<ClInclude Include="Game Files\M2Emulator.h" />
|
<ClInclude Include="Game Files\M2Emulator.h" />
|
||||||
|
<ClInclude Include="Game Files\R-Tuned.h" />
|
||||||
<ClInclude Include="Game Files\Rambo.h" />
|
<ClInclude Include="Game Files\Rambo.h" />
|
||||||
<ClInclude Include="Game Files\RoadFighters3D.h" />
|
<ClInclude Include="Game Files\RoadFighters3D.h" />
|
||||||
<ClInclude Include="Game Files\LGI.h" />
|
<ClInclude Include="Game Files\LGI.h" />
|
||||||
@ -81,6 +82,7 @@
|
|||||||
<ClCompile Include="Game Files\OldMame.cpp" />
|
<ClCompile Include="Game Files\OldMame.cpp" />
|
||||||
<ClCompile Include="Game Files\OutRun2Fake.cpp" />
|
<ClCompile Include="Game Files\OutRun2Fake.cpp" />
|
||||||
<ClCompile Include="Game Files\PokkenTournament.cpp" />
|
<ClCompile Include="Game Files\PokkenTournament.cpp" />
|
||||||
|
<ClCompile Include="Game Files\R-Tuned.cpp" />
|
||||||
<ClCompile Include="Game Files\Rambo.cpp" />
|
<ClCompile Include="Game Files\Rambo.cpp" />
|
||||||
<ClCompile Include="Game Files\SegaRally3.cpp" />
|
<ClCompile Include="Game Files\SegaRally3.cpp" />
|
||||||
<ClCompile Include="Game Files\SegaRacingClassic.cpp" />
|
<ClCompile Include="Game Files\SegaRacingClassic.cpp" />
|
||||||
|
@ -124,6 +124,7 @@
|
|||||||
<ClCompile Include="Game Files\H2Overdrive.cpp" />
|
<ClCompile Include="Game Files\H2Overdrive.cpp" />
|
||||||
<ClCompile Include="Game Files\SnoCross.cpp" />
|
<ClCompile Include="Game Files\SnoCross.cpp" />
|
||||||
<ClCompile Include="Game Files\Batman.cpp" />
|
<ClCompile Include="Game Files\Batman.cpp" />
|
||||||
|
<ClCompile Include="Game Files\R-Tuned.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Game Files\Daytona3.h">
|
<ClInclude Include="Game Files\Daytona3.h">
|
||||||
@ -271,6 +272,9 @@
|
|||||||
<ClInclude Include="Game Files\Batman.h">
|
<ClInclude Include="Game Files\Batman.h">
|
||||||
<Filter>Common Header Files</Filter>
|
<Filter>Common Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="Game Files\R-Tuned.h">
|
||||||
|
<Filter>Common Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<MASM Include="DLLWrapper.asm" />
|
<MASM Include="DLLWrapper.asm" />
|
||||||
|
@ -70,6 +70,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
|
|||||||
#include "Game Files/KODrive.h"
|
#include "Game Files/KODrive.h"
|
||||||
#include "Game Files/HOTD4.h"
|
#include "Game Files/HOTD4.h"
|
||||||
#include "Game Files/Rambo.h"
|
#include "Game Files/Rambo.h"
|
||||||
|
#include "Game Files/R-Tuned.h"
|
||||||
#include "Game Files/Transformers.h"
|
#include "Game Files/Transformers.h"
|
||||||
#include "Game Files/H2Overdrive.h"
|
#include "Game Files/H2Overdrive.h"
|
||||||
|
|
||||||
@ -961,6 +962,7 @@ const int Dirty_Drivin = 42;
|
|||||||
const int H2_Overdrive = 43;
|
const int H2_Overdrive = 43;
|
||||||
const int Sno_Cross = 44;
|
const int Sno_Cross = 44;
|
||||||
const int Bat_man = 45;
|
const int Bat_man = 45;
|
||||||
|
const int R_Tuned = 46;
|
||||||
|
|
||||||
HINSTANCE Get_hInstance()
|
HINSTANCE Get_hInstance()
|
||||||
{
|
{
|
||||||
@ -2097,6 +2099,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
|
|||||||
case Bat_man:
|
case Bat_man:
|
||||||
game = new Batman;
|
game = new Batman;
|
||||||
break;
|
break;
|
||||||
|
case R_Tuned:
|
||||||
|
game = new RTuned;
|
||||||
|
break;
|
||||||
case TEST_GAME_CONST:
|
case TEST_GAME_CONST:
|
||||||
case TEST_GAME_FRICTION:
|
case TEST_GAME_FRICTION:
|
||||||
case TEST_GAME_SINE:
|
case TEST_GAME_SINE:
|
||||||
|
61
Game Files/R-Tuned.cpp
Normal file
61
Game Files/R-Tuned.cpp
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/*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 "R-Tuned.h"
|
||||||
|
static bool EnableFFB = false;
|
||||||
|
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
|
||||||
|
static int SpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringStrength"), 0, settingsFilename);
|
||||||
|
|
||||||
|
void RTuned::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
|
||||||
|
|
||||||
|
UINT8 SpringCrash = helpers->ReadByte(0x8519D18, /* isRelativeOffset */ false);
|
||||||
|
UINT8 BoostEffect = helpers->ReadByte(0x8519D10, /* isRelativeOffset */ false);
|
||||||
|
UINT8 WhenBoost = helpers->ReadByte(0x8519D20, /* isRelativeOffset */ false);
|
||||||
|
|
||||||
|
helpers->log("got value: ");
|
||||||
|
std::string ffs = std::to_string(BoostEffect);
|
||||||
|
helpers->log((char*)ffs.c_str());
|
||||||
|
|
||||||
|
if (!EnableFFB)
|
||||||
|
{
|
||||||
|
UINT8 LetsEnableFFB = helpers->ReadByte(0x8519C58, /* isRelativeOffset */ false);
|
||||||
|
|
||||||
|
if (LetsEnableFFB == 0x0C)
|
||||||
|
{
|
||||||
|
helpers->WriteIntPtr(0x8519C60, 0xFFFFFFFF, false);
|
||||||
|
helpers->WriteIntPtr(0x8519C64, 0xFFFFFFFF, false);
|
||||||
|
EnableFFB = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SpringCrash == 0xFF)
|
||||||
|
{
|
||||||
|
double percentForce = 1.0;
|
||||||
|
triggers->Sine(300, 300, percentForce);
|
||||||
|
triggers->Rumble(percentForce, percentForce, 100);
|
||||||
|
}
|
||||||
|
else if (SpringCrash == 0x04)
|
||||||
|
{
|
||||||
|
double percentForce = SpringStrength / 100.0;
|
||||||
|
triggers->Spring(percentForce);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WhenBoost == 0x7F)
|
||||||
|
{
|
||||||
|
double percentForce = (BoostEffect / 400.0);
|
||||||
|
double percentLength = (100);
|
||||||
|
triggers->Rumble(percentForce, percentForce, percentLength);
|
||||||
|
triggers->Sine(60, 60, percentForce);
|
||||||
|
}
|
||||||
|
}
|
20
Game Files/R-Tuned.h
Normal file
20
Game Files/R-Tuned.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/*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 RTuned : public Game {
|
||||||
|
|
||||||
|
public:
|
||||||
|
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user