1
0
mirror of synced 2024-11-27 16:10:52 +01:00
This commit is contained in:
Boomslangnz 2023-03-05 18:00:07 +13:00
parent 5b16188b5e
commit 98293e8766
15 changed files with 108 additions and 309 deletions

View File

@ -314,7 +314,8 @@ PowerMode=0
FeedbackLength=500
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D Zero v131]
GameId=32
@ -326,7 +327,8 @@ EscapeKeyExitViaPlugin=0
EnableDamper=0
DamperStrength=100
EnableOutputs=0
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D Zero v211]
GameId=49
@ -338,7 +340,8 @@ EscapeKeyExitViaPlugin=0
EnableDamper=0
DamperStrength=100
EnableOutputs=0
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D Zero v230]
GameId=67
@ -350,7 +353,8 @@ EscapeKeyExitViaPlugin=0
EnableDamper=0
DamperStrength=100
EnableOutputs=0
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D 4]
GameId=16
@ -358,7 +362,8 @@ FeedbackLength=5000
PowerMode=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D 4 Japan]
GameId=24
@ -366,7 +371,8 @@ FeedbackLength=5000
PowerMode=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D 5]
GameId=23
@ -374,7 +380,8 @@ FeedbackLength=5000
PowerMode=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D 6]
GameId=8
@ -382,7 +389,8 @@ FeedbackLength=5000
PowerMode=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D 7]
GameId=17
@ -390,7 +398,8 @@ FeedbackLength=5000
PowerMode=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Initial D 8]
GameId=18
@ -398,7 +407,8 @@ FeedbackLength=5000
PowerMode=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Sega World Drivers Championship 2018]
GameId=50
@ -407,7 +417,8 @@ PowerMode=0
EscapeKeyExitViaPlugin=0
EnableDamper=0
DamperStrength=100
IncreaseSine=0
DoubleSine=0
DoubleConstant=0
[Ford Racing]
GameId=7
@ -482,7 +493,8 @@ AlternativeMinForceLeftInitialD=0
AlternativeMaxForceLeftInitialD=-100
AlternativeMinForceRightInitialD=0
AlternativeMaxForceRightInitialD=100
IncreaseSineInitialD=0
DoubleSineInitialD=0
DoubleConstantInitialD=0
EnableDamper18Wheeler=0
DamperStrength18Wheeler=100
FeedbackLength18Wheeler=500
@ -531,7 +543,8 @@ AlternativeMinForceLeftClubKart=0
AlternativeMaxForceLeftClubKart=-100
AlternativeMinForceRightClubKart=0
AlternativeMaxForceRightClubKart=100
IncreaseSineClubKart=0
DoubleSineClubKart=0
DoubleConstantClubKart=0
EnableDamperKingOfRoute66=0
DamperStrengthKingOfRoute66=100
FeedbackLengthKingOfRoute66=500
@ -544,7 +557,8 @@ AlternativeMinForceLeftKingOfRoute66=0
AlternativeMaxForceLeftKingOfRoute66=-100
AlternativeMinForceRightKingOfRoute66=0
AlternativeMaxForceRightKingOfRoute66=100
IncreaseSineKingOfRoute66=0
DoubleSineKingOfRoute66=0
DoubleConstantKingOfRoute66=0
[Crazy Taxi Steam]
GameId=58
@ -1075,7 +1089,8 @@ AlternativeMinForceRightInitialDDemul=0
AlternativeMaxForceRightInitialDDemul=100
EnableForceSpringEffectInitialDDemul=0
ForceSpringStrengthInitialDDemul=80
IncreaseSineInitialDDemul=0
DoubleSineInitialDDemul=0
DoubleConstantInitialDDemul=0
PowerModeNascarRacing=0
FeedbackLengthNascarRacing=500
EnableDamperNascarRacing=0

View File

@ -958,6 +958,8 @@ int EnableFFBStrengthPersistence = GetPrivateProfileInt(TEXT("Settings"), TEXT("
int EnableFFBStrengthTextToSpeech = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableFFBStrengthTextToSpeech"), 0, settingsFilename);
int InputDeviceWheelEnable = GetPrivateProfileInt(TEXT("Settings"), TEXT("InputDeviceWheelEnable"), 0, settingsFilename);
int IgnoreFirstMatchingGUID = GetPrivateProfileInt(TEXT("Settings"), TEXT("IgnoreFirstMatchingGUID"), 0, settingsFilename);
int DoubleSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSine"), 0, settingsFilename);
int DoubleConstant = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleConstant"), 0, settingsFilename);
extern void DefaultConfigValues();
extern void CustomFFBStrengthSetup();
@ -1275,6 +1277,14 @@ void TriggerConstantEffect(int direction, double strength)
if (PowerMode)
strength = pow(strength, 0.5);
if (DoubleConstant)
{
strength = strength * 2.0;
if (strength > 1.0)
strength = 1.0;
}
SHORT MinForce = (SHORT)(strength > 0.001 ? (confMinForce / 100.0 * 32767.0) : 0);
SHORT MaxForce = (SHORT)(confMaxForce / 100.0 * 32767.0);
SHORT range = MaxForce - MinForce;
@ -1557,6 +1567,15 @@ void TriggerSineEffect(UINT16 period, UINT16 fadePeriod, double strength)
confMaxForce = configAlternativeMaxForceRight;
}
}
if (DoubleSine)
{
strength = strength * 2.0;
if (strength > 1.0)
strength = 1.0;
}
SHORT minForce = (SHORT)(strength > 0.001 ? (confMinForce / 100.0 * 32767.0) : 0); // strength is a double so we do an epsilon check of 0.001 instead of > 0.
SHORT maxForce = (SHORT)(confMaxForce / 100.0 * 32767.0);
SHORT range = maxForce - minForce;

View File

@ -93,9 +93,8 @@ extern int ForceSpringStrength;
extern int AutoCloseWindowError;
extern int EnableDamper;
extern int DamperStrength;
static bool IncreaseSine;
extern int DoubleConstant;
extern int DoubleSine;
static int InputDeviceWheelEnable = GetPrivateProfileInt(TEXT("Settings"), TEXT("InputDeviceWheelEnable"), 0, settingsFilename);
@ -111,7 +110,8 @@ static int EnableForceSpringEffectInitialDDemul = GetPrivateProfileInt(TEXT("Set
static int ForceSpringStrengthInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrengthInitialDDemul"), 0, settingsFilename);
static int EnableDamperInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableDamperInitialDDemul"), 0, settingsFilename);
static int DamperStrengthInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("DamperStrengthInitialDDemul"), 100, settingsFilename);
static int IncreaseSineInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSineInitialDDemul"), 0, settingsFilename);
static int DoubleSineInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSineInitialDDemul"), 0, settingsFilename);
static int DoubleConstantInitialDDemul = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleConstantInitialDDemul"), 0, settingsFilename);
static int configMinForceNascarRacing = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForceNascarRacing"), 0, settingsFilename);
static int configMaxForceNascarRacing = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForceNascarRacing"), 100, settingsFilename);
@ -335,15 +335,6 @@ static int InitialDFFBLoop()
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
myTriggers->Rumble(percentForce, percentForce, percentLength);
@ -361,14 +352,14 @@ static int InitialDFFBLoop()
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
myTriggers->Rumble(percentForce, 0, percentLength);
myTriggers->Constant(myConstants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
myTriggers->Rumble(0, percentForce, percentLength);
myTriggers->Constant(myConstants->DIRECTION_FROM_RIGHT, percentForce);
@ -752,6 +743,8 @@ void Demul::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers
ForceSpringStrength = ForceSpringStrengthInitialDDemul;
EnableDamper = EnableDamperInitialDDemul;
DamperStrength = DamperStrengthInitialDDemul;
DoubleSine = DoubleSineInitialDDemul;
DoubleConstant = DoubleConstantInitialDDemul;
romnameDemul = "Initial D Arcade Stage";

View File

@ -25,7 +25,6 @@ static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT
static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename);
static int EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename);
static int EnableOutputs = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableOutputs"), 0, settingsFilename);
static int IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD0::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
@ -56,15 +55,6 @@ void InitialD0::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -82,14 +72,14 @@ void InitialD0::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);

View File

@ -25,7 +25,6 @@ static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT
static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename);
static int EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename);
static int EnableOutputs = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableOutputs"), 0, settingsFilename);
static int IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD0v211::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
@ -56,15 +55,6 @@ void InitialD0v211::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -82,14 +72,14 @@ void InitialD0v211::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);

View File

@ -25,7 +25,6 @@ static int EnableForceSpringEffect = GetPrivateProfileInt(TEXT("Settings"), TEXT
static int ForceSpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrength"), 0, settingsFilename);
static int EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename);
static int EnableOutputs = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableOutputs"), 0, settingsFilename);
static int IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD0v230::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
@ -56,15 +55,6 @@ void InitialD0v230::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -78,18 +68,25 @@ void InitialD0v230::FFBLoop(EffectConstants* constants, Helpers* helpers, Effect
triggers->Spring(percentForce);
}
if (ffb[0] == 0x86 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
double percentLength = 100;
triggers->Spring(percentForce);
}
if (ffb[0] == 0x84 && ffb[2] > 0x00)
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);

View File

@ -18,11 +18,8 @@ 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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD4::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
DWORD FFB = helpers->ReadInt32(0x089AE898, true);
DWORD FFB = helpers->ReadInt32(0x089AE898, false);
BYTE* ffb = reinterpret_cast<BYTE*>(&FFB);
@ -34,15 +31,6 @@ void InitialD4::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -60,14 +48,14 @@ void InitialD4::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);

View File

@ -18,15 +18,12 @@ 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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD4Japan::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
DWORD FFB = helpers->ReadInt32(0x08989858, true);
DWORD FFB = helpers->ReadInt32(0x08989858, false);
BYTE* ffb = reinterpret_cast<BYTE*>(&FFB);
@ -38,15 +35,6 @@ void InitialD4Japan::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -64,14 +52,14 @@ void InitialD4Japan::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);

View File

@ -18,15 +18,12 @@ 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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD5::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
DWORD FFB = helpers->ReadInt32(0x8CB6120, true);
DWORD FFB = helpers->ReadInt32(0x8CB6120, false);
BYTE* ffb = reinterpret_cast<BYTE*>(&FFB);
@ -38,15 +35,6 @@ void InitialD5::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -64,14 +52,14 @@ void InitialD5::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);

View File

@ -17,117 +17,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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
static int carscollide(int ffcollide) {
switch (ffcollide) {
case 0x50F05:
return 16;
case 0x50E05:
return 15;
case 0x50D05:
return 14;
case 0x50C05:
return 13;
case 0x50B05:
return 12;
case 0x50A05:
return 11;
case 0x50905:
return 10;
case 0x50805:
return 9;
case 0x50705:
return 8;
case 0x50605:
return 7;
case 0x050505:
return 6;
case 0x050405:
return 5;
case 0x050305:
return 4;
case 0x50205:
return 3;
case 0x50105:
return 2;
case 0x50005:
return 1;
default:
return 0;
}
}
static int rubbingwalls(int ffwalls) {
switch (ffwalls) {
case 0x51F08:
return 31;
case 0x51E08:
return 30;
case 0x51D08:
return 29;
case 0x51C08:
return 28;
case 0x51B08:
return 27;
case 0x51A08:
return 26;
case 0x51908:
return 25;
case 0x51808:
return 24;
case 0x51708:
return 23;
case 0x51608:
return 22;
case 0x51508:
return 21;
case 0x51408:
return 20;
case 0x51308:
return 19;
case 0x51208:
return 18;
case 0x51108:
return 17;
case 0x50F08:
return 16;
case 0x50E08:
return 15;
case 0x50D08:
return 14;
case 0x50C08:
return 13;
case 0x50B08:
return 12;
case 0x50A08:
return 11;
case 0x50908:
return 10;
case 0x50808:
return 9;
case 0x50708:
return 8;
case 0x50608:
return 7;
case 0x50508:
return 6;
case 0x50408:
return 5;
case 0x50308:
return 4;
case 0x50208:
return 3;
case 0x50108:
return 2;
case 0x50008:
return 1;
default:
return 0;
}
}
void InitialD6::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers)
{
DWORD FFB = GetTeknoParrotFFB();
@ -145,15 +34,6 @@ void InitialD6::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
if (ffb[2] == 0x05 && ffb[1] > 0x00 && ffb[0] > 0x00)
{
double percentForce = ffb[0] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -176,7 +56,7 @@ void InitialD6::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentLength = 100;

View File

@ -17,9 +17,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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD7::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers)
{
DWORD FFB = GetTeknoParrotFFB();
@ -37,15 +34,6 @@ void InitialD7::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
if (ffb[2] == 0x05 && ffb[1] > 0x00 && ffb[0] > 0x00)
{
double percentForce = ffb[0] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -68,7 +56,7 @@ void InitialD7::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentLength = 100;

View File

@ -17,9 +17,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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void InitialD8::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers)
{
DWORD FFB = GetTeknoParrotFFB();
@ -37,15 +34,6 @@ void InitialD8::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
if (ffb[2] == 0x05 && ffb[1] > 0x00 && ffb[0] > 0x00)
{
double percentForce = ffb[0] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -68,7 +56,7 @@ void InitialD8::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrig
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentLength = 100;

View File

@ -17,9 +17,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 IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
void KODrive::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* triggers) {
if (EnableDamper)
@ -37,15 +34,6 @@ void KODrive::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigge
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 24.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 128.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -68,7 +56,7 @@ void KODrive::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTrigge
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[2] / 24.0);
double percentLength = 100;

View File

@ -344,8 +344,8 @@ extern int EnableForceSpringEffect;
extern int ForceSpringStrength;
extern int EnableDamper;
extern int DamperStrength;
static bool IncreaseSine;
extern int DoubleConstant;
extern int DoubleSine;
static int configMinForceDaytona2 = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForceDaytona2"), 0, settingsFilename);
static int configMaxForceDaytona2 = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForceDaytona2"), 100, settingsFilename);
@ -966,7 +966,8 @@ static int EnableForceSpringEffectInitialD = GetPrivateProfileInt(TEXT("Settings
static int ForceSpringStrengthInitialD = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrengthInitialD"), 0, settingsFilename);
static int EnableDamperInitialD = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableDamperInitialD"), 0, settingsFilename);
static int DamperStrengthInitialD = GetPrivateProfileInt(TEXT("Settings"), TEXT("DamperStrengthInitialD"), 100, settingsFilename);
static int IncreaseSineInitialD = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSineInitialD"), 0, settingsFilename);
static int DoubleSineInitialD = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSineInitialD"), 0, settingsFilename);
static int DoubleConstantInitialD = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleConstantInitialD"), 0, settingsFilename);
static int configMinForceF355 = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForceF355"), 0, settingsFilename);
static int configMaxForceF355 = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForceF355"), 100, settingsFilename);
@ -1032,7 +1033,8 @@ static int EnableForceSpringEffectClubKart = GetPrivateProfileInt(TEXT("Settings
static int ForceSpringStrengthClubKart = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrengthClubKart"), 0, settingsFilename);
static int EnableDamperClubKart = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableDamperClubKart"), 0, settingsFilename);
static int DamperStrengthClubKart = GetPrivateProfileInt(TEXT("Settings"), TEXT("DamperStrengthClubKart"), 100, settingsFilename);
static int IncreaseSineClubKart = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSineClubKart"), 0, settingsFilename);
static int DoubleSineClubKart = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSineClubKart"), 0, settingsFilename);
static int DoubleConstantClubKart = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleConstantClubKart"), 0, settingsFilename);
static int configMinForceKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("MinForceKingOfRoute66"), 0, settingsFilename);
static int configMaxForceKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("MaxForceKingOfRoute66"), 100, settingsFilename);
@ -1046,7 +1048,8 @@ static int EnableForceSpringEffectKingOfRoute66 = GetPrivateProfileInt(TEXT("Set
static int ForceSpringStrengthKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("ForceSpringStrengthKingOfRoute66"), 0, settingsFilename);
static int EnableDamperKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableDamperKingOfRoute66"), 0, settingsFilename);
static int DamperStrengthKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("DamperStrengthKingOfRoute66"), 100, settingsFilename);
static int IncreaseSineKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSineKingOfRoute66"), 0, settingsFilename);
static int DoubleSineKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleSineKingOfRoute66"), 0, settingsFilename);
static int DoubleConstantKingOfRoute66 = GetPrivateProfileInt(TEXT("Settings"), TEXT("DoubleConstantKingOfRoute66"), 0, settingsFilename);
static bool init = false;
static bool initSpring = false;
@ -2839,7 +2842,8 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
DamperStrength = DamperStrengthInitialD;
EnableForceSpringEffect = EnableForceSpringEffectInitialD;
ForceSpringStrength = ForceSpringStrengthInitialD;
IncreaseSine = IncreaseSineInitialD;
DoubleSine = DoubleSineInitialD;
DoubleConstant = DoubleConstantInitialD;
RunningFFB = "InitialDActive";
}
@ -2858,7 +2862,8 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
DamperStrength = DamperStrengthKingOfRoute66;
EnableForceSpringEffect = EnableForceSpringEffectKingOfRoute66;
ForceSpringStrength = ForceSpringStrengthKingOfRoute66;
IncreaseSine = IncreaseSineKingOfRoute66;
DoubleSine = DoubleSineKingOfRoute66;
DoubleConstant = DoubleConstantKingOfRoute66;
RunningFFB = "InitialDActive";
}
@ -2877,7 +2882,8 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
DamperStrength = DamperStrengthClubKart;
EnableForceSpringEffect = EnableForceSpringEffectClubKart;
ForceSpringStrength = ForceSpringStrengthClubKart;
IncreaseSine = IncreaseSineClubKart;
DoubleSine = DoubleSineClubKart;
DoubleConstant = DoubleConstantClubKart;
RunningFFB = "InitialDActive";
}
@ -3961,15 +3967,6 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
if (ffb[2] == 0x85 && ffb[1] > 0x00 && ffb[0] > 0x00)
{
double percentForce = ffb[0] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -3992,7 +3989,7 @@ void MAMESupermodel::FFBLoop(EffectConstants* constants, Helpers* helpers, Effec
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if (ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentLength = 100;

View File

@ -25,7 +25,6 @@ static DWORD FFB;
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int EscapeKeyExitViaPlugin = GetPrivateProfileInt(TEXT("Settings"), TEXT("EscapeKeyExitViaPlugin"), 0, settingsFilename);
static int IncreaseSine = GetPrivateProfileInt(TEXT("Settings"), TEXT("IncreaseSine"), 0, settingsFilename);
static const char* SDDS = "SDDS";
@ -92,15 +91,6 @@ void SWDC::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers*
if (ffb[0] == 0x85 && ffb[1] > 0x00 && ffb[2] > 0x00)
{
double percentForce = ffb[2] / 127.0;
if (IncreaseSine)
{
percentForce = percentForce * 2.0;
if (percentForce > 1.0)
percentForce = 1.0;
}
double Period = ffb[1] / 127.0 * 120.0;
double percentLength = 100;
triggers->Rumble(percentForce, percentForce, percentLength);
@ -118,14 +108,14 @@ void SWDC::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers*
{
if (ffb[1] == 0x00)
{
double percentForce = (128 - ffb[0]) / 127.0;
double percentForce = (128 - ffb[2]) / 127.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
else if(ffb[1] == 0x01)
{
double percentForce = (ffb[0] / 127.0);
double percentForce = (ffb[2] / 127.0);
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);