diff options
author | pjft | 2017-04-07 12:19:05 +0100 |
---|---|---|
committer | pjft | 2017-04-07 21:49:52 +0100 |
commit | 70fb8fe72ff0ff6356e78be861355075bf8fb4fe (patch) | |
tree | e58302d91f5b25270cba24b29f81f6b65457552a /frontend | |
parent | d9e770393ef9f049a40e34c06b12f0e3435dce46 (diff) | |
download | pcsx_rearmed-70fb8fe72ff0ff6356e78be861355075bf8fb4fe.tar.gz pcsx_rearmed-70fb8fe72ff0ff6356e78be861355075bf8fb4fe.tar.bz2 pcsx_rearmed-70fb8fe72ff0ff6356e78be861355075bf8fb4fe.zip |
Adding "Enable Vibration" Core Option to LibRetro
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/libretro.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c index 4d56356..c078494 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -398,8 +398,11 @@ void pl_timing_prepare(int is_pal) void plat_trigger_vibrate(int pad, int low, int high) { - rumble.set_rumble_state(pad, RETRO_RUMBLE_STRONG, high << 8); - rumble.set_rumble_state(pad, RETRO_RUMBLE_WEAK, low ? 0xffff : 0x0); + if(in_enable_vibration) + { + rumble.set_rumble_state(pad, RETRO_RUMBLE_STRONG, high << 8); + rumble.set_rumble_state(pad, RETRO_RUMBLE_WEAK, low ? 0xffff : 0x0); + } } void pl_update_gun(int *xn, int *yn, int *xres, int *yres, int *in) @@ -452,6 +455,7 @@ void retro_set_environment(retro_environment_t cb) { "pcsx_rearmed_pad8type", "Pad 8 Type; default|none|standard|analog|negcon" }, { "pcsx_rearmed_multitap1", "Multitap 1; auto|disabled|enabled" }, { "pcsx_rearmed_multitap2", "Multitap 2; auto|disabled|enabled" }, + { "pcsx_rearmed_vibration", "Enable Vibration; enabled|disabled" }, #ifndef DRC_DISABLE { "pcsx_rearmed_drc", "Dynamic recompiler; enabled|disabled" }, #endif @@ -1361,6 +1365,17 @@ static void update_variables(bool in_flight) update_multitap(); + var.value = NULL; + var.key = "pcsx_rearmed_vibration"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) + { + if (strcmp(var.value, "disabled") == 0) + in_enable_vibration = 0; + else if (strcmp(var.value, "enabled") == 0) + in_enable_vibration = 1; + } + #ifdef __ARM_NEON__ var.value = "NULL"; var.key = "pcsx_rearmed_neon_interlace_enable"; |