diff options
| author | 2020-10-08 23:43:07 -0400 | |
|---|---|---|
| committer | 2020-11-15 23:33:20 -0500 | |
| commit | 652d6766d55acec6416dccb900a45c6660a86607 (patch) | |
| tree | 7f9c64b78ca02aa1f62de77e25fcacbb2fdc4291 /src/core | |
| parent | controllers/npad: Stop games from vibrating incorrect controllers (diff) | |
| download | yuzu-652d6766d55acec6416dccb900a45c6660a86607.tar.gz yuzu-652d6766d55acec6416dccb900a45c6660a86607.tar.xz yuzu-652d6766d55acec6416dccb900a45c6660a86607.zip | |
configure_input: Hook up the vibration percentage spinbox
This allows setting the vibration strength percentage anywhere from 1% to 100%.
Also hooks up the remaining motion button and checkbox in the Controller Applet.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 3 | ||||
| -rw-r--r-- | src/core/settings.cpp | 1 | ||||
| -rw-r--r-- | src/core/settings.h | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index f865e3f5f..924f209c0 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -703,7 +703,8 @@ void Controller_NPad::VibrateController(const std::vector<DeviceHandle>& vibrati | |||
| 703 | 703 | ||
| 704 | // TODO: Vibrate left/right vibration motors independently if possible. | 704 | // TODO: Vibrate left/right vibration motors independently if possible. |
| 705 | button_state[A - BUTTON_HID_BEGIN]->SetRumblePlay( | 705 | button_state[A - BUTTON_HID_BEGIN]->SetRumblePlay( |
| 706 | vibration_values[i].amp_high, vibration_values[i].amp_low, | 706 | vibration_values[i].amp_high * Settings::values.vibration_strength.GetValue() / 100, |
| 707 | vibration_values[i].amp_low * Settings::values.vibration_strength.GetValue() / 100, | ||
| 707 | vibration_values[i].freq_high, vibration_values[i].freq_low); | 708 | vibration_values[i].freq_high, vibration_values[i].freq_low); |
| 708 | 709 | ||
| 709 | latest_vibration_values[npad_index][device_index] = vibration_values[i]; | 710 | latest_vibration_values[npad_index][device_index] = vibration_values[i]; |
diff --git a/src/core/settings.cpp b/src/core/settings.cpp index aadbc3932..6e39aebb5 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp | |||
| @@ -150,6 +150,7 @@ void RestoreGlobalState() { | |||
| 150 | values.players.SetGlobal(true); | 150 | values.players.SetGlobal(true); |
| 151 | values.use_docked_mode.SetGlobal(true); | 151 | values.use_docked_mode.SetGlobal(true); |
| 152 | values.vibration_enabled.SetGlobal(true); | 152 | values.vibration_enabled.SetGlobal(true); |
| 153 | values.vibration_strength.SetGlobal(true); | ||
| 153 | values.motion_enabled.SetGlobal(true); | 154 | values.motion_enabled.SetGlobal(true); |
| 154 | } | 155 | } |
| 155 | 156 | ||
diff --git a/src/core/settings.h b/src/core/settings.h index edd2a00ca..496f47747 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -170,6 +170,7 @@ struct Values { | |||
| 170 | Setting<bool> use_docked_mode; | 170 | Setting<bool> use_docked_mode; |
| 171 | 171 | ||
| 172 | Setting<bool> vibration_enabled; | 172 | Setting<bool> vibration_enabled; |
| 173 | Setting<int> vibration_strength; | ||
| 173 | 174 | ||
| 174 | Setting<bool> motion_enabled; | 175 | Setting<bool> motion_enabled; |
| 175 | std::string motion_device; | 176 | std::string motion_device; |