1
0
mirror of synced 2024-11-24 06:50:11 +01:00

Sonic All Stars Changes

This commit is contained in:
Boomslangnz 2023-03-11 20:12:38 +13:00
parent 2f8823e940
commit 329b3333d2
3 changed files with 39 additions and 23 deletions

View File

@ -817,8 +817,10 @@ DamperStrength=100
[Sonic & Sega All Stars Racing]
GameId=21
FeedbackLength=80
EnableDamper=1
EnableDamper=0
DamperStrength=100
SpringEnable=1
SpringStrength=100
[GTI Club Supermini Festa]
GameId=27

View File

@ -23,10 +23,8 @@ void SegaRally3::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTri
std::string ffs = std::to_string(ff);
helpers->log((char*)ffs.c_str());
if (EnableDamper == 1)
{
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
}
if (ff > 15)
{

View File

@ -16,32 +16,48 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
extern int EnableDamper;
extern int DamperStrength;
static UINT8 OLDFFB;
static wchar_t* settingsFilename = TEXT(".\\FFBPlugin.ini");
static int SpringEnable = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringEnable"), 0, settingsFilename);
static int SpringStrength = GetPrivateProfileInt(TEXT("Settings"), TEXT("SpringStrength"), 0, settingsFilename);
void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
INT_PTR FFBEnable = helpers->ReadByte(0x5CD858, true);
INT_PTR FFB = helpers->ReadByte(0x5CD864, true);
UINT8 FFB = helpers->ReadByte(0x5CD864, true);
helpers->WriteByte(0x5CD858, 0x03, true);
if (EnableDamper == 1)
{
if (EnableDamper)
triggers->Damper(DamperStrength / 100.0);
}
if ((FFB > 0) && (FFB < 19))
if (SpringEnable)
triggers->Springi(SpringStrength / 100.0);
if (OLDFFB != FFB)
{
helpers->log("moving wheel left");
double percentForce = FFB / 18.0;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
else if ((FFB > 237) && (FFB < 256))
{
helpers->log("moving wheel right");
double percentForce = (256 - FFB) / 18.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
if (FFB > 0 && FFB < 19)
{
helpers->log("moving wheel left");
double percentForce = FFB / 18.0;
double percentLength = 100;
triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
}
else if (FFB > 237 && FFB < 256)
{
helpers->log("moving wheel right");
double percentForce = (256 - FFB) / 18.0;
double percentLength = 100;
triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce);
}
else
{
triggers->Rumble(0, 0, 80);
triggers->Constant(constants->DIRECTION_FROM_LEFT, 0);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, 0);
}
}
OLDFFB = FFB;
}