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

remove friction from sonic racing

This commit is contained in:
Aaron M 2019-11-21 21:46:01 +13:00
parent 52d0068964
commit 40ebed5560

View File

@ -15,28 +15,23 @@ along with FFB Arcade Plugin.If not, see < https://www.gnu.org/licenses/>.
#include "SonicSegaAllStarsRacing.h"
void SonicSegaAllStarsRacing::FFBLoop(EffectConstants *constants, Helpers *helpers, EffectTriggers* triggers) {
INT_PTR FFBEnable = helpers->ReadByte(0x5CD858, /* isRelativeOffset*/ true);
INT_PTR FFB = helpers->ReadByte(0x5CD864, /* isRelativeOffset*/ true);
UINT8 FFBEnable = helpers->ReadByte(0x5CD858, /* isRelativeOffset*/ true);
UINT8 FFB = helpers->ReadByte(0x5CD864, /* isRelativeOffset*/ true);
{
//Enable FFB
helpers->WriteByte(0x5CD858, 0x03, true);
}
{
//Trigger friction to stop any oscillation
double percentForce = 0.2;
triggers->Friction(percentForce);
}
if ((FFB > 0) & (FFB < 19))
if ((FFB > 0) && (FFB < 19))
{
helpers->log("moving wheel right");
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))
else if ((FFB > 237) && (FFB < 256))
{
helpers->log("moving wheel right");
double percentForce = (256 - FFB) / 18.0;