mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-24 12:15:08 +00:00
(PS3) Implement rumble in input driver
This commit is contained in:
parent
b8641af4c3
commit
124022bd69
@ -451,6 +451,28 @@ static bool ps3_input_set_sensor_state(void *data, unsigned port, enum retro_sen
|
||||
}
|
||||
}
|
||||
|
||||
static bool ps3_input_set_rumble(void *data, unsigned port, enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
CellPadActParam params;
|
||||
|
||||
switch (effect)
|
||||
{
|
||||
case RETRO_RUMBLE_WEAK:
|
||||
if (strength > 1)
|
||||
strength = 1;
|
||||
params.motor[0] = strength;
|
||||
break;
|
||||
case RETRO_RUMBLE_STRONG:
|
||||
if (strength > 255)
|
||||
strength = 255;
|
||||
params.motor[1] = strength;
|
||||
}
|
||||
|
||||
cellPadSetActDirect(port, ¶ms);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const input_driver_t input_ps3 = {
|
||||
ps3_input_init,
|
||||
ps3_input_poll,
|
||||
@ -461,5 +483,8 @@ const input_driver_t input_ps3 = {
|
||||
ps3_input_set_sensor_state,
|
||||
ps3_input_get_capabilities,
|
||||
"ps3",
|
||||
};
|
||||
|
||||
NULL,
|
||||
ps3_input_set_rumble,
|
||||
NULL,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user