1
0
mirror of synced 2025-01-20 01:32:51 +01:00

Merge pull request #96 from Boomslangnz/master

Add vibration values to shared page
This commit is contained in:
Nezarn 2020-04-12 12:35:35 +02:00 committed by GitHub
commit 481002f13b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -169,6 +169,8 @@ int* ffbOffset = &secData[2];
int* ffbOffset2 = &secData[3];
int* ffbOffset3 = &secData[4];
int* ffbOffset4 = &secData[5];
int* ffbOffset5 = &secData[6]; //Vibration Left Motor
int* ffbOffset6 = &secData[7]; //Vibration Right Motor
static bool IsCommHooked(HANDLE hFile);

View File

@ -60,6 +60,8 @@ extern int* ffbOffset;
extern int* ffbOffset2;
extern int* ffbOffset3;
extern int* ffbOffset4;
extern int* ffbOffset5;
extern int* ffbOffset6;
DWORD WINAPI XInputGetState
(
@ -206,6 +208,10 @@ DWORD WINAPI XInputSetState
// We're receiving as XInput [0 ~ 65535], need to be [0 ~ 255] !!
int leftVal = iround(((float)pVibration->wLeftMotorSpeed / 65535) * 255);
int rightVal = iround(((float)pVibration->wRightMotorSpeed / 65535) * 255);
*ffbOffset5 = leftVal;
*ffbOffset6 = rightVal;
return ERROR_SUCCESS;
}
else