diff options
| author | 2021-10-11 00:43:11 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:24 -0600 | |
| commit | 06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch) | |
| tree | 867fa1153c7285c858cdb5bd7f60f08266532a88 /src/input_common/drivers/gc_adapter.cpp | |
| parent | core: Update input interpreter (diff) | |
| download | yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip | |
core/hid: Add output devices
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/drivers/gc_adapter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 6721ba4f7..2aa5a16a6 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp | |||
| @@ -322,13 +322,17 @@ bool GCAdapter::GetGCEndpoint(libusb_device* device) { | |||
| 322 | return true; | 322 | return true; |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | bool GCAdapter::SetRumble(const PadIdentifier& identifier, const Input::VibrationStatus vibration) { | 325 | Input::VibrationError GCAdapter::SetRumble(const PadIdentifier& identifier, const Input::VibrationStatus vibration) { |
| 326 | const auto mean_amplitude = (vibration.low_amplitude + vibration.high_amplitude) * 0.5f; | 326 | const auto mean_amplitude = (vibration.low_amplitude + vibration.high_amplitude) * 0.5f; |
| 327 | const auto processed_amplitude = | 327 | const auto processed_amplitude = |
| 328 | static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8); | 328 | static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8); |
| 329 | 329 | ||
| 330 | pads[identifier.port].rumble_amplitude = processed_amplitude; | 330 | pads[identifier.port].rumble_amplitude = processed_amplitude; |
| 331 | return rumble_enabled; | 331 | |
| 332 | if (!rumble_enabled) { | ||
| 333 | return Input::VibrationError::Disabled; | ||
| 334 | } | ||
| 335 | return Input::VibrationError::None; | ||
| 332 | } | 336 | } |
| 333 | 337 | ||
| 334 | void GCAdapter::UpdateVibrations() { | 338 | void GCAdapter::UpdateVibrations() { |