Read Port 4128 on GRID
This commit is contained in:
parent
74907430ce
commit
5cb5f14520
@ -29,25 +29,28 @@ static int FFBCounter;
|
|||||||
static int(__stdcall* Out32Ori)(DWORD device, DWORD data);
|
static int(__stdcall* Out32Ori)(DWORD device, DWORD data);
|
||||||
static int __stdcall Out32Hook(DWORD device, DWORD data)
|
static int __stdcall Out32Hook(DWORD device, DWORD data)
|
||||||
{
|
{
|
||||||
++FFBCounter;
|
if (device == 0x1020)
|
||||||
|
|
||||||
if (FFBCounter == 5)
|
|
||||||
{
|
{
|
||||||
FFBCounter = 0;
|
++FFBCounter;
|
||||||
|
|
||||||
if (data > 15)
|
if (FFBCounter == 5)
|
||||||
{
|
{
|
||||||
double percentForce = (31 - data) / 15.0;
|
FFBCounter = 0;
|
||||||
double percentLength = 100;
|
|
||||||
myTriggers->Rumble(percentForce, 0, percentLength);
|
if (data > 15)
|
||||||
myTriggers->Constant(myConstants->DIRECTION_FROM_LEFT, percentForce);
|
{
|
||||||
}
|
double percentForce = (31 - data) / 15.0;
|
||||||
else if (data > 0)
|
double percentLength = 100;
|
||||||
{
|
myTriggers->Rumble(percentForce, 0, percentLength);
|
||||||
double percentForce = (16 - data) / 15.0;
|
myTriggers->Constant(myConstants->DIRECTION_FROM_LEFT, percentForce);
|
||||||
double percentLength = 100;
|
}
|
||||||
myTriggers->Rumble(0, percentForce, percentLength);
|
else if (data > 0)
|
||||||
myTriggers->Constant(myConstants->DIRECTION_FROM_RIGHT, percentForce);
|
{
|
||||||
|
double percentForce = (16 - data) / 15.0;
|
||||||
|
double percentLength = 100;
|
||||||
|
myTriggers->Rumble(0, percentForce, percentLength);
|
||||||
|
myTriggers->Constant(myConstants->DIRECTION_FROM_RIGHT, percentForce);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user