mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Merge pull request #3471 from frangarcj/master
Latest sdk and vibration
This commit is contained in:
commit
e94d21388e
@ -140,11 +140,11 @@ static void psp_input_grab_mouse(void *data, bool state)
|
||||
static bool psp_input_set_rumble(void *data, unsigned port,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
(void)data;
|
||||
(void)port;
|
||||
(void)effect;
|
||||
(void)strength;
|
||||
psp_input_t *psp = (psp_input_t*)data;
|
||||
|
||||
if (psp && psp->joypad)
|
||||
return input_joypad_set_rumble(psp->joypad,
|
||||
port, effect, strength);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -197,6 +197,33 @@ static bool psp_joypad_query_pad(unsigned pad)
|
||||
return pad < PSP_MAX_PADS && pad_state[pad];
|
||||
}
|
||||
|
||||
static bool psp_joypad_rumble(unsigned pad,
|
||||
enum retro_rumble_effect effect, uint16_t strength)
|
||||
{
|
||||
struct SceCtrlActuator params = {
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
switch (effect)
|
||||
{
|
||||
case RETRO_RUMBLE_WEAK:
|
||||
if (strength > 1)
|
||||
strength = 1;
|
||||
params.unk = strength;
|
||||
break;
|
||||
case RETRO_RUMBLE_STRONG:
|
||||
if (strength > 255)
|
||||
strength = 255;
|
||||
params.enable = strength;
|
||||
break;
|
||||
}
|
||||
unsigned p = (pad == 1) ? 2 : pad;
|
||||
sceCtrlSetActuator(p, ¶ms);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static void psp_joypad_destroy(void)
|
||||
{
|
||||
@ -210,7 +237,7 @@ input_device_driver_t psp_joypad = {
|
||||
psp_joypad_get_buttons,
|
||||
psp_joypad_axis,
|
||||
psp_joypad_poll,
|
||||
NULL,
|
||||
psp_joypad_rumble,
|
||||
psp_joypad_name,
|
||||
#ifdef VITA
|
||||
"vita",
|
||||
|
@ -154,7 +154,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
|
||||
#elif defined(GEKKO)
|
||||
time_ticks = gettime();
|
||||
#elif defined(PSP) || defined(VITA)
|
||||
sceRtcGetCurrentTick(&time_ticks);
|
||||
sceRtcGetCurrentTick((SceRtcTick *)&time_ticks);
|
||||
#elif defined(_3DS)
|
||||
time_ticks = svcGetSystemTick();
|
||||
#elif defined(__mips__)
|
||||
|
Loading…
x
Reference in New Issue
Block a user