1
0
mirror of synced 2025-02-17 18:59:24 +01:00

Added VaporTRX ffb

This commit is contained in:
Aaron M 2019-12-26 22:58:04 +13:00
parent ed848ec002
commit 8666be27e1
2 changed files with 78 additions and 0 deletions

View File

@ -1031,6 +1031,16 @@ RumbleStrengthLeftMotorHyperDrive=100
RumbleStrengthRightMotorHyperDrive=100
EnableForceSpringEffectHyperDrive=0
ForceSpringStrengthHyperDrive=80
MinForceVaporTrx=0
MaxForceVaporTrx=100
AlternativeMinForceLeftVaporTrx=0
AlternativeMaxForceLeftVaporTrx=-100
AlternativeMinForceRightVaporTrx=0
AlternativeMaxForceRightVaporTrx=100
RumbleStrengthLeftMotorVaporTrx=100
RumbleStrengthRightMotorVaporTrx=100
EnableForceSpringEffectVaporTrx=0
ForceSpringStrengthVaporTrx=80
[MAME 64bit Outputs]
GameId=22
@ -1369,6 +1379,16 @@ RumbleStrengthLeftMotorHyperDrive=100
RumbleStrengthRightMotorHyperDrive=100
EnableForceSpringEffectHyperDrive=0
ForceSpringStrengthHyperDrive=80
MinForceVaporTrx=0
MaxForceVaporTrx=100
AlternativeMinForceLeftVaporTrx=0
AlternativeMaxForceLeftVaporTrx=-100
AlternativeMinForceRightVaporTrx=0
AlternativeMaxForceRightVaporTrx=100
RumbleStrengthLeftMotorVaporTrx=100
RumbleStrengthRightMotorVaporTrx=100
EnableForceSpringEffectVaporTrx=0
ForceSpringStrengthVaporTrx=80
; ***********************************************************************************************************************************
; ************************************************* Test cases are established below ************************************************

View File

@ -478,6 +478,16 @@ static int configFeedbackLengthHyperDrive = GetPrivateProfileInt(TEXT("Settings"
static int EnableForceSpringEffectHyperDrive = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffectHyperDrive"), 0, settingsFilename);
static int ForceSpringStrengthHyperDrive = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrengthHyperDrive"), 0, settingsFilename);
static int configMinForceVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForceVaporTrx"), 0, settingsFilename);
static int configMaxForceVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForceVaporTrx"), 100, settingsFilename);
static int configAlternativeMinForceLeftVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("AlternativeMinForceLeftVaporTrx"), 0, settingsFilename);
static int configAlternativeMaxForceLeftVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("AlternativeMaxForceLeftVaporTrx"), 100, settingsFilename);
static int configAlternativeMinForceRightVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("AlternativeMinForceRightVaporTrx"), 0, settingsFilename);
static int configAlternativeMaxForceRightVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("AlternativeMaxForceRightVaporTrx"), 100, settingsFilename);
static int configFeedbackLengthVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("FeedbackLengthVaporTrx"), 120, settingsFilename);
static int EnableForceSpringEffectVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableForceSpringEffectVaporTrx"), 0, settingsFilename);
static int ForceSpringStrengthVaporTrx = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrengthVaporTrx"), 0, settingsFilename);
static bool init = false;
static bool initSpring = false;
static bool EmuName = false;
@ -978,6 +988,8 @@ std::string cbombers("cbombers");
std::string cbombersj("cbombersj");
std::string cbombersp("cbombersp");
std::string hyprdriv("hyprdriv");
std::string vaportrx("vaportrx");
std::string vaportrp("vaportrp");
//Our string to load game from
std::string Daytona2Active("Daytona2Active");
@ -999,6 +1011,7 @@ std::string AfterburnerActive("AfterburnerActive");
std::string OutrunActive("OutrunActive");
std::string PDriftActive("PDriftActive");
std::string HyperDriveActive("HyperDriveActive");
std::string VaporTrxActive("VaporTrxActive");
//Names of FFB Outputs
std::string RawDrive("RawDrive");
@ -1776,6 +1789,21 @@ void OutputReading::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect
RunningFFB = "HyperDriveActive";
}
if (romname == vaportrx || romname == vaportrp)
{
configMinForce = configMinForceVaporTrx;
configMaxForce = configMaxForceVaporTrx;
configAlternativeMinForceLeft = configAlternativeMinForceLeftVaporTrx;
configAlternativeMaxForceLeft = configAlternativeMaxForceLeftVaporTrx;
configAlternativeMinForceRight = configAlternativeMinForceRightVaporTrx;
configAlternativeMaxForceRight = configAlternativeMaxForceRightVaporTrx;
configFeedbackLength = configFeedbackLengthVaporTrx;
EnableForceSpringEffect = EnableForceSpringEffectVaporTrx;
ForceSpringStrength = ForceSpringStrengthVaporTrx;
RunningFFB = "VaporTrxActive";
}
if ((RunningFFB != NULL) && (RunningFFB[0] != '\0'))
{
RomGameName = true;
@ -2748,6 +2776,36 @@ void OutputReading::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect
}
}
if (RunningFFB == VaporTrxActive) //VaporTrx
{
if (Emulator == MAME)
{
if (name == wheel)
{
helpers->log("got value: ");
std::string ffs = std::to_string(newstateFFB);
helpers->log((char*)ffs.c_str());
stateFFB = newstateFFB;
}
if ((stateFFB > 0x80) && (stateFFB < 0x100))
{
double percentForce = (256 - stateFFB) / 127.0;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else if ((stateFFB > 0x00) && (stateFFB < 0x80))
{
double percentForce = (stateFFB) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
}
}
if (RunningFFB == HardDrivinActive) //Hard Drivin
{
if (Emulator == MAME)