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

Storm Racer G

This commit is contained in:
Aaron M 2021-04-17 10:31:12 +12:00
parent 52dfce2c8b
commit 06d837af24
10 changed files with 275 additions and 12 deletions

View File

@ -88,6 +88,9 @@ cd..
cd "Sonic & Sega All Stars Racing"
rename dinput8.dll d3d9.dll
cd..
cd "Storm Racer G"
rename dinput8.dll xinput1_3.dll
cd..
cd Supermodel 32bit Outputs
rename dinput8.dll opengl32.dll
cd..

View File

@ -4,23 +4,54 @@ static int configGameId = GetPrivateProfileInt(TEXT("Settings"), TEXT("GameId"),
TeknoParrotGame::TeknoParrotGame()
{
secData = 0;
hSection = CreateFileMapping(INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, 64, L"TeknoParrot_JvsState");
if (hSection)
secData = MapViewOfFile(hSection, FILE_MAP_ALL_ACCESS, 0, 0, 64);
if (configGameId == 19)
if (secData)
{
ffbOffset = *((int*)secData + 6);
ffbOffset2 = *((int*)secData + 7);
if (*((int*)secData + 2) > 0)
{
*((int*)secData + 2) = 0;
}
if (*((int*)secData + 6) > 0)
{
*((int*)secData + 6) = 0;
}
if (*((int*)secData + 7) > 0)
{
*((int*)secData + 7) = 0;
}
if (*((int*)secData + 8) > 0)
{
*((int*)secData + 8) = 0;
}
if (configGameId == 54)
{
ffbOffset = *((int*)secData + 6);
ffbOffset2 = *((int*)secData + 7);
ffbOffset3 = *((int*)secData + 8);
}
else if (configGameId == 19)
{
ffbOffset = *((int*)secData + 6);
ffbOffset2 = *((int*)secData + 7);
}
else
{
ffbOffset = *((int*)secData + 2);
}
}
else
{
ffbOffset = *((int*)secData + 2);
}
}
int TeknoParrotGame::GetTeknoParrotFFB()
{
if (configGameId == 19)
if (configGameId == 19 || configGameId == 54)
{
ffbOffset = *((int*)secData + 6);
}
@ -38,6 +69,12 @@ int TeknoParrotGame::GetTeknoParrotFFB2()
return ffbOffset2;
}
int TeknoParrotGame::GetTeknoParrotFFB3()
{
ffbOffset3 = *((int*)secData + 8);
return ffbOffset3;
}
void TeknoParrotGame::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
helpers->log("TeknoParrot game not implemented");
}

View File

@ -6,12 +6,14 @@ class TeknoParrotGame : public Game {
// TP-related
HANDLE hSection;
LPVOID secData;
int ffbOffset = 0;
int ffbOffset2 = 0;
protected:
int ffbOffset = 0;
int ffbOffset2 = 0;
int ffbOffset3 = 0;
int GetTeknoParrotFFB();
int GetTeknoParrotFFB2();
int GetTeknoParrotFFB3();
TeknoParrotGame();
public:

View File

@ -174,6 +174,30 @@ HowtoRumbleKnockEffect=0
HowtoRumbleMotorEffect=0
HowtoRumbleHealthEffect=0
[Storm Racer G]
GameId=54
FeedbackLength=500
EnableDamper=0
DamperStrength=100
EnableShakeEffectsWhileRacing = 1;
EnableShakeEffectsinMenu = 1;
EnableGroundEffects = 1;
EnableForceSpringEffect = 0;
ForceSpringStrength = 100;
MinFFBConstantStrength=100
FFBShakeSineStrength = 30
FFBShakeSinePeriod = 75;
FFBShakeFadeSinePeriod = 0;
FFBGrassSineStrength=40
FFBGrassSinePeriod = 40;
FFBGrassFadeSinePeriod = 0;
FFBRoughTerrainSineStrength=45
FFBRoughTerrainSinePeriod = 120;
FFBRoughTerrainFadeSinePeriod = 0;
FFBRumbleStripSineStrength=55
FFBRumbleStripSinePeriod = 30;
FFBRumbleStripFadeSinePeriod = 0;
[Dirty Drivin']
GameId=42
FeedbackLength=500

View File

@ -49,6 +49,7 @@
<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" />
@ -106,6 +107,7 @@
<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" />

View File

@ -136,6 +136,7 @@
<ClCompile Include="Game Files\WMMT6.cpp" />
<ClCompile Include="Game Files\WMMT6R.cpp" />
<ClCompile Include="Game Files\InitialD0v131.cpp" />
<ClCompile Include="Game Files\StormRacerG.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Game Files\Daytona3.h">
@ -313,6 +314,9 @@
<ClInclude Include="Game Files\InitialD0v131.h">
<Filter>Common Header Files</Filter>
</ClInclude>
<ClInclude Include="Game Files\StormRacerG.h">
<Filter>Common Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<MASM Include="DLLWrapper.asm" />

View File

@ -81,6 +81,7 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "Game Files/SWDC2018.h"
#include "Game Files/Transformers.h"
#include "Game Files/H2Overdrive.h"
#include "Game Files/StormRacerG.h"
// typedefs
typedef unsigned char U8;
@ -1013,6 +1014,7 @@ const int SWDC_2018 = 50;
const int MARIO_KART_GPDX_USA = 51;
const int WMMT_6 = 52;
const int WMMT_6_R = 53;
const int SRG = 54;
HINSTANCE Get_hInstance()
{
@ -2243,7 +2245,7 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
{
hlp.log("In FFBLoop");
if ((configGameId != 22) && (configGameId != 29) && (configGameId != 34)) //For games which need code to run quicker etc. Some games will crash if no sleep added
if (configGameId != 22 && configGameId != 29 && configGameId != 34) //For games which need code to run quicker etc. Some games will crash if no sleep added
{
Sleep(2500);
}
@ -2450,6 +2452,9 @@ DWORD WINAPI FFBLoop(LPVOID lpParam)
case WMMT_6_R:
game = new WMMT6R;
break;
case SRG:
game = new StormRacerG;
break;
case TEST_GAME_CONST:
case TEST_GAME_FRICTION:
case TEST_GAME_SINE:

161
Game Files/StormRacerG.cpp Normal file
View File

@ -0,0 +1,161 @@
/*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 "StormRacerG.h"
extern int EnableDamper;
extern int DamperStrength;
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int EnableShakeEffectsWhileRacing = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableShakeEffectsWhileRacing"), 0, settingsFilename);
static int EnableShakeEffectsinMenu = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableShakeEffectsinMenu"), 0, settingsFilename);
static int EnableGroundEffects = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableGroundEffects"), 0, settingsFilename);
static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffect"), 0, settingsFilename);
static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename);
static int MinFFBConstantStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinFFBConstantStrength"), 0, settingsFilename);
static int FFBShakeSineStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBShakeSineStrength"), 0, settingsFilename);
static int FFBShakeSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBShakeSinePeriod"), 0, settingsFilename);
static int FFBShakeFadeSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBShakeFadeSinePeriod"), 0, settingsFilename);
static int FFBGrassSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBGrassSinePeriod"), 0, settingsFilename);
static int FFBGrassSineStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBGrassSineStrength"), 0, settingsFilename);
static int FFBGrassFadeSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBGrassFadeSinePeriod"), 0, settingsFilename);
static int FFBRoughTerrainSineStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBRoughTerrainSineStrength"), 0, settingsFilename);
static int FFBRoughTerrainSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBRoughTerrainSinePeriod"), 0, settingsFilename);
static int FFBRoughTerrainFadeSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBRoughTerrainFadeSinePeriod"), 0, settingsFilename);
static int FFBRumbleStripSineStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBRumbleStripSineStrength"), 0, settingsFilename);
static int FFBRumbleStripSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBRumbleStripSinePeriod"), 0, settingsFilename);
static int FFBRumbleStripFadeSinePeriod = GetPrivateProfileInt(TEXT("Settings"), TEXT("FFBRumbleStripFadeSinePeriod"), 0, settingsFilename);
void StormRacerG::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers)
{
float FFBConstant = GetTeknoParrotFFB() / 1000.0;
int Shake = GetTeknoParrotFFB2();
float Ground = GetTeknoParrotFFB3();
float Speedo = helpers->ReadFloat32(0x10BE22D8, true);
UINT8 Racing = helpers->ReadByte(0x10BD5B20, true);
if (EnableDamper == 1)
{
triggers->Damper(DamperStrength / 100.0);
}
if (EnableForceSpringEffect == 1)
{
triggers->Springi(ForceSpringStrength / 100.0);
}
else if (EnableForceSpringEffect == 2)
{
if (Racing == 0x00)
{
triggers->Spring(ForceSpringStrength / 100.0);
}
}
if (FFBConstant > 0)
{
double percentForce = FFBConstant / (MinFFBConstantStrength / 2.173913043478261);
double percentLength = 100;
if (percentForce > 1.0)
percentForce = 1.0;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
else if (FFBConstant < 0)
{
double percentForce = -FFBConstant / (MinFFBConstantStrength / 2.173913043478261);
double percentLength = 100;
if (percentForce > 1.0)
percentForce = 1.0;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
if (EnableShakeEffectsWhileRacing == 1)
{
if (Racing == 0x01)
{
if (Shake > 0)
{
double percentForce = ((Shake / 1500.0) * (FFBShakeSineStrength / 100.0));
double percentLength = 100;
if (percentForce > 1.0)
percentForce = 1.0;
triggers->Rumble(percentForce, percentForce, percentLength);
triggers->Sine(FFBShakeSinePeriod, FFBShakeFadeSinePeriod, percentForce);
}
}
}
if (EnableShakeEffectsinMenu == 1)
{
if (Racing == 0x00)
{
if (Shake > 0)
{
double percentForce = ((Shake / 1500.0) * (FFBShakeSineStrength / 100.0));
double percentLength = 100;
if (percentForce > 1.0)
percentForce = 1.0;
triggers->Rumble(percentForce, percentForce, percentLength);
triggers->Sine(FFBShakeSinePeriod, FFBShakeFadeSinePeriod, percentForce);
}
}
}
if (EnableGroundEffects == 1)
{
if (Speedo > 1.0)
{
if (Ground < 10000) // Driving on Road (Not implemented yet)
{
Ground = Ground / 1000.0;
}
else if (Ground < 300000) // Driving on Grass
{
Ground = ((Ground - 10000) / 1000.0);
Ground = Ground * (FFBGrassSineStrength / 100.0);
triggers->Rumble(Ground, Ground, 100);
triggers->Sine(FFBGrassSinePeriod, FFBGrassFadeSinePeriod, Ground);
}
else if (Ground < 700000) // Driving on Rough Ground
{
Ground = ((Ground - 300000) / 1000.0);
Ground = Ground * (FFBRoughTerrainSineStrength / 100.0);
triggers->Rumble(Ground, Ground, 100);
triggers->Sine(FFBRoughTerrainSinePeriod, FFBRoughTerrainFadeSinePeriod, Ground);
}
else
{
Ground = ((Ground - 700000) / 1000.0); // Driving on Rumble Strip
Ground = Ground * (FFBRumbleStripSineStrength / 100.0);
triggers->Rumble(Ground, Ground, 100);
triggers->Sine(FFBRumbleStripSinePeriod, FFBRumbleStripFadeSinePeriod, Ground);
}
}
}
}

21
Game Files/StormRacerG.h Normal file
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 StormRacerG : public TeknoParrotGame {
public:
StormRacerG() : TeknoParrotGame() { }
void FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers);
};

View File

@ -166,11 +166,13 @@ extremely generous.
-Sega Rally Championship (M2 Emulator & MAME)
-Sega Rally 2
-Sega Rally 3
-Sega World Drivers Championship 2018
-Super Chase - Criminal Termination
-Super GT 24h (M2 Emulator & MAME)
-Smashing Drive
-SnoCross
-Sonic & Sega All Stars Racing
-Storm Racer G
-Space gun
-Terminator 2
-Transformers: Human Alliance
@ -180,4 +182,6 @@ extremely generous.
-Vapor TRX
-Virtua Racing (CHANGE TO UPRIGHT CABINET)
-Wacky Races
-Wangan Midnight Maximum Tune 5
-Wangan Midnight Maximum Tune 5
-Wangan Midnight Maximum Tune 6
-Wangan Midnight Maximum Tune 6R