Skip to content

Commit

Permalink
Fixed XI rumble value calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
nefarius committed Jul 23, 2021
1 parent 3b90bbd commit 0c8743b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sys/DsHidMiniDrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,18 @@ DsHidMini_WriteReport(
//
if (Packet->reportId == 0x00 && pDevCtx->Configuration.HidDeviceMode == DsHidMiniDeviceModeXInputHIDCompatible)
{
DS3_SET_LARGE_RUMBLE_STRENGTH(pDevCtx, Packet->reportBuffer[3] / 100 * UCHAR_MAX);
DS3_SET_SMALL_RUMBLE_STRENGTH(pDevCtx, Packet->reportBuffer[4] / 100 * UCHAR_MAX);
UCHAR lm = (UCHAR)(Packet->reportBuffer[3] / 100.0f * 255.0f);
UCHAR rm = (UCHAR)(Packet->reportBuffer[4] / 100.0f * 255.0f);

TraceVerbose(
TRACE_DSHIDMINIDRV,
"-- XI FFB LM: %d, RM: %d",
lm,
rm
);

DS3_SET_LARGE_RUMBLE_STRENGTH(pDevCtx, lm);
DS3_SET_SMALL_RUMBLE_STRENGTH(pDevCtx, rm);

(void)Ds_SendOutputReport(pDevCtx, Ds3OutputReportSourceXInputHID);

Expand Down

0 comments on commit 0c8743b

Please sign in to comment.