1
0
mirror of synced 2024-12-18 01:05:58 +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] [Sonic & Sega All Stars Racing]
GameId=21 GameId=21
FeedbackLength=80 FeedbackLength=80
EnableDamper=1 EnableDamper=0
DamperStrength=100 DamperStrength=100
SpringEnable=1
SpringStrength=100
[GTI Club Supermini Festa] [GTI Club Supermini Festa]
GameId=27 GameId=27

View File

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

View File

@ -16,19 +16,27 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
extern int EnableDamper; extern int EnableDamper;
extern int DamperStrength; 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) { void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
INT_PTR FFBEnable = helpers->ReadByte(0x5CD858, true); UINT8 FFB = helpers->ReadByte(0x5CD864, true);
INT_PTR FFB = helpers->ReadByte(0x5CD864, true);
helpers->WriteByte(0x5CD858, 0x03, true); helpers->WriteByte(0x5CD858, 0x03, true);
if (EnableDamper == 1) if (EnableDamper)
{
triggers->Damper(DamperStrength / 100.0); triggers->Damper(DamperStrength / 100.0);
}
if ((FFB > 0) && (FFB < 19)) if (SpringEnable)
triggers->Springi(SpringStrength / 100.0);
if (OLDFFB != FFB)
{
if (FFB > 0 && FFB < 19)
{ {
helpers->log("moving wheel left"); helpers->log("moving wheel left");
double percentForce = FFB / 18.0; double percentForce = FFB / 18.0;
@ -36,7 +44,7 @@ void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpe
triggers->Rumble(0, percentForce, percentLength); triggers->Rumble(0, percentForce, percentLength);
triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce); triggers->Constant(constants->DIRECTION_FROM_RIGHT, percentForce);
} }
else if ((FFB > 237) && (FFB < 256)) else if (FFB > 237 && FFB < 256)
{ {
helpers->log("moving wheel right"); helpers->log("moving wheel right");
double percentForce = (256 - FFB) / 18.0; double percentForce = (256 - FFB) / 18.0;
@ -44,4 +52,12 @@ void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpe
triggers->Rumble(percentForce, 0, percentLength); triggers->Rumble(percentForce, 0, percentLength);
triggers->Constant(constants->DIRECTION_FROM_LEFT, percentForce); 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;
} }