Don't tickle Bluetooth PS5 controllers in simple mode with an effects packet
That will put the PS5 controller into enhanced mode, which breaks DirectInput games
This commit is contained in:
parent
75d4a91aaa
commit
2fef0be2f6
1 changed files with 16 additions and 7 deletions
|
@ -738,16 +738,25 @@ static void HIDAPI_DriverPS5_CheckPendingLEDReset(SDL_HIDAPI_Device *device)
|
||||||
|
|
||||||
static void HIDAPI_DriverPS5_TickleBluetooth(SDL_HIDAPI_Device *device)
|
static void HIDAPI_DriverPS5_TickleBluetooth(SDL_HIDAPI_Device *device)
|
||||||
{
|
{
|
||||||
/* This is just a dummy packet that should have no effect, since we don't set the CRC */
|
SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context;
|
||||||
Uint8 data[78];
|
|
||||||
|
|
||||||
SDL_zeroa(data);
|
if (ctx->enhanced_mode) {
|
||||||
|
/* This is just a dummy packet that should have no effect, since we don't set the CRC */
|
||||||
|
Uint8 data[78];
|
||||||
|
|
||||||
data[0] = k_EPS5ReportIdBluetoothEffects;
|
SDL_zeroa(data);
|
||||||
data[1] = 0x02; /* Magic value */
|
|
||||||
|
|
||||||
if (SDL_HIDAPI_LockRumble() == 0) {
|
data[0] = k_EPS5ReportIdBluetoothEffects;
|
||||||
SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data));
|
data[1] = 0x02; /* Magic value */
|
||||||
|
|
||||||
|
if (SDL_HIDAPI_LockRumble() == 0) {
|
||||||
|
SDL_HIDAPI_SendRumbleAndUnlock(device, data, sizeof(data));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* We can't even send an invalid effects packet, or it will put the controller in enhanced mode */
|
||||||
|
if (device->num_joysticks > 0) {
|
||||||
|
HIDAPI_JoystickDisconnected(device, device->joysticks[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue