1
0
mirror of synced 2025-02-01 03:55:43 +01:00

add SingleMotor rumble option

This commit is contained in:
Boomslangnz 2022-10-23 18:16:36 +13:00
parent 1d00463ca8
commit 692129c13c
2 changed files with 11 additions and 1 deletions

View File

@ -698,7 +698,7 @@ DamperStrength=100
[Sonic & Sega All Stars Racing]
GameId=21
FeedbackLength=500
FeedbackLength=80
EnableDamper=1
DamperStrength=100

View File

@ -906,6 +906,7 @@ int PowerMode = GetPrivateProfileInt(TEXT("Settings"), TEXT("PowerMode"), 0, set
int EnableRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableRumble"), 0, settingsFilename);
int EnableRumbleTriggers = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableRumbleTriggers"), 0, settingsFilename);
int ReverseRumble = GetPrivateProfileInt(TEXT("Settings"), TEXT("ReverseRumble"), 0, settingsFilename);
int SingleRumbleMotor = GetPrivateProfileInt(TEXT("Settings"), TEXT("SingleRumbleMotor"), 0, settingsFilename);
int EnableDamper = GetPrivateProfileInt(TEXT("Settings"), TEXT("EnableDamper"), 0, settingsFilename);
int DamperStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("DamperStrength"), 100, settingsFilename);
wchar_t* deviceGUIDString = new wchar_t[256];
@ -1897,6 +1898,15 @@ void TriggerRumbleEffect(double highfrequency, double lowfrequency, double lengt
DWORD LowMotor = (DWORD)(lowfrequency * rangeLow + minForceLow);
DWORD HighMotor = (DWORD)(highfrequency * rangeHigh + minForceHigh);
if (SingleRumbleMotor)
{
double LowPercent = (LowMotor / 65535.0) * 100.0;
double LowPercentRange = 100.0 - LowPercent;
double HighPercent = (HighMotor / 65535.0) * 100.0;
double Calculation = LowPercent + ((LowPercentRange * HighPercent) / 100.0);
LowMotor = 65535.0 * (Calculation / 100.0);
}
if (ReverseRumble == 1)
{
int ReverseRumble = SDL_JoystickRumble(GameController, HighMotor, LowMotor, length);