Remove SRG
This commit is contained in:
parent
573b74546f
commit
c56b4d6235
@ -126,11 +126,6 @@ Rumble2Strength=100
|
||||
Rumble1Length=200
|
||||
Rumble2Length=200
|
||||
|
||||
[Storm Racer G]
|
||||
GameId=48
|
||||
EnableDamper=0
|
||||
DamperStrength=100
|
||||
|
||||
[HOTD4]
|
||||
GameId=4
|
||||
FeedbackLength=100
|
||||
|
@ -49,7 +49,6 @@
|
||||
<ClInclude Include="Game Files\RoadFighters3D.h" />
|
||||
<ClInclude Include="Game Files\LGI.h" />
|
||||
<ClInclude Include="Game Files\LGI3D.h" />
|
||||
<ClInclude Include="Game Files\StormRacerG.h" />
|
||||
<ClInclude Include="Game Files\SWDC2018.h" />
|
||||
<ClInclude Include="Game Files\WMMT6.h" />
|
||||
<ClInclude Include="Game Files\WMMT6R.h" />
|
||||
@ -107,7 +106,6 @@
|
||||
<ClCompile Include="Game Files\SegaRally3Other.cpp" />
|
||||
<ClCompile Include="Game Files\SnoCross.cpp" />
|
||||
<ClCompile Include="Game Files\SonicSegaAllStarsRacing.cpp" />
|
||||
<ClCompile Include="Game Files\StormRacerG.cpp" />
|
||||
<ClCompile Include="Game Files\SWDC2018.cpp" />
|
||||
<ClCompile Include="Game Files\TestGame.cpp" />
|
||||
<ClCompile Include="Game Files\Transformers.cpp" />
|
||||
|
@ -130,7 +130,6 @@
|
||||
<ClCompile Include="Game Files\DemulFasterThanSpeedInputs.cpp" />
|
||||
<ClCompile Include="Game Files\DemulMaximumSpeedInputs.cpp" />
|
||||
<ClCompile Include="Game Files\DemulNascarInputs.cpp" />
|
||||
<ClCompile Include="Game Files\StormRacerG.cpp" />
|
||||
<ClCompile Include="Game Files\InitialD0v211.cpp" />
|
||||
<ClCompile Include="Game Files\SWDC2018.cpp" />
|
||||
<ClCompile Include="Game Files\MarioKartGPDXUSA.cpp" />
|
||||
@ -296,9 +295,6 @@
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Common Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Game Files\StormRacerG.h">
|
||||
<Filter>Common Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Game Files\InitialD0v211.h">
|
||||
<Filter>Common Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
@ -67,7 +67,6 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
|
||||
#include "Game Files/AfterburnerClimax.h"
|
||||
#include "Game Files/PokkenTournament.h"
|
||||
#include "Game Files/SonicSegaAllStarsRacing.h"
|
||||
#include "Game Files/StormRacerG.h"
|
||||
#include "Game Files/M2Emulator.h"
|
||||
#include "Game Files/GTIClub3.h"
|
||||
#include "Game Files/Demul.h"
|
||||
@ -1009,7 +1008,6 @@ const int Sno_Cross = 44;
|
||||
const int Bat_man = 45;
|
||||
const int R_Tuned = 46;
|
||||
const int SEGA_RALLY_3_Other = 47;
|
||||
const int Storm_Racer_G = 48;
|
||||
const int INITIAL_D_0_211 = 49;
|
||||
const int SWDC_2018 = 50;
|
||||
const int MARIO_KART_GPDX_USA = 51;
|
||||
@ -2362,9 +2360,6 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
|
||||
case SEGA_RALLY_3_Other:
|
||||
game = new SegaRally3Other;
|
||||
break;
|
||||
case Storm_Racer_G:
|
||||
game = new StormRacerG;
|
||||
break;
|
||||
case WACKY_RACES:
|
||||
game = new WackyRaces;
|
||||
break;
|
||||
|
@ -1,97 +0,0 @@
|
||||
#include <string>
|
||||
#include "StormRacerG.h"
|
||||
|
||||
static EffectTriggers* myTriggers;
|
||||
static EffectConstants* myConstants;
|
||||
static Helpers* myHelpers;
|
||||
extern int EnableDamper;
|
||||
extern int DamperStrength;
|
||||
|
||||
static bool init = false;
|
||||
|
||||
static void __cdecl UsbIO_SetSeatShakeImpluse(int a1, int a2, float a3, bool a4)
|
||||
{
|
||||
double percentForce = a1 / 1200.0;
|
||||
myTriggers->Rumble(percentForce, percentForce, 150);
|
||||
return;
|
||||
}
|
||||
|
||||
static bool Hook(void* toHook, void* ourFunct, int len) {
|
||||
if (len < 5) {
|
||||
return false;
|
||||
}
|
||||
|
||||
DWORD curProtection;
|
||||
VirtualProtect(toHook, len, PAGE_EXECUTE_READWRITE, &curProtection);
|
||||
|
||||
memset(toHook, 0x90, len);
|
||||
|
||||
DWORD relativeAddress = ((DWORD)ourFunct - (DWORD)toHook) - 5;
|
||||
|
||||
*(BYTE*)toHook = 0xE9;
|
||||
*(DWORD*)((DWORD)toHook + 1) = relativeAddress;
|
||||
|
||||
DWORD temp;
|
||||
VirtualProtect(toHook, len, curProtection, &temp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static DWORD jmpBackAddy;
|
||||
|
||||
void StormRacerG::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
|
||||
|
||||
if (!init)
|
||||
{
|
||||
uintptr_t ImageBaseSRG = (uintptr_t)GetModuleHandle((L"racing.exe"));
|
||||
|
||||
int hookLength = 6;
|
||||
DWORD hookAddress = ImageBaseSRG + 0x12C5DE;
|
||||
|
||||
jmpBackAddy = hookAddress + hookLength;
|
||||
Hook((void*)hookAddress, UsbIO_SetSeatShakeImpluse, hookLength);
|
||||
helpers->WriteNop(ImageBaseSRG + 0x12C5DE + 5, 1, false);
|
||||
|
||||
init = true;
|
||||
}
|
||||
|
||||
UINT8 FFB = helpers->ReadByte(0x46F429C, false);
|
||||
UINT8 Enable = helpers->ReadByte(0x4710214, false);
|
||||
float speedo = helpers->ReadFloat32(0x114A22D8, false);
|
||||
|
||||
if (Enable == 0x01)
|
||||
{
|
||||
if (EnableDamper == 1)
|
||||
{
|
||||
triggers->Damper(DamperStrength / 100.0);
|
||||
}
|
||||
|
||||
if (speedo < 0)
|
||||
{
|
||||
speedo = -speedo;
|
||||
}
|
||||
|
||||
double percentForce = speedo / 320.0;
|
||||
|
||||
//4 == Slipstring
|
||||
|
||||
if (FFB & 0x01)
|
||||
{
|
||||
triggers->Rumble(percentForce, percentForce, 150);
|
||||
}
|
||||
|
||||
if (FFB & 0x02)
|
||||
{
|
||||
triggers->Rumble(percentForce, percentForce, 150);
|
||||
}
|
||||
|
||||
if (FFB & 0x08)
|
||||
{
|
||||
triggers->Rumble(percentForce, percentForce, 150);
|
||||
}
|
||||
}
|
||||
|
||||
myTriggers = triggers;
|
||||
myConstants = constants;
|
||||
myHelpers = helpers;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
/*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 StormRacerG : public Game {
|
||||
|
||||
public:
|
||||
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user