summaryrefslogtreecommitdiffstats
path: root/src/input_common/drivers/gc_adapter.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-10-11 07:43:11 +0200
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:24 +0100
commit06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch)
tree867fa1153c7285c858cdb5bd7f60f08266532a88 /src/input_common/drivers/gc_adapter.cpp
parentcore: Update input interpreter (diff)
downloadyuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.bz2
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.lz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.zst
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/drivers/gc_adapter.cpp8
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) {
return true;
}
-bool GCAdapter::SetRumble(const PadIdentifier& identifier, const Input::VibrationStatus vibration) {
+Input::VibrationError GCAdapter::SetRumble(const PadIdentifier& identifier, const Input::VibrationStatus vibration) {
const auto mean_amplitude = (vibration.low_amplitude + vibration.high_amplitude) * 0.5f;
const auto processed_amplitude =
static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8);
pads[identifier.port].rumble_amplitude = processed_amplitude;
- return rumble_enabled;
+
+ if (!rumble_enabled) {
+ return Input::VibrationError::Disabled;
+ }
+ return Input::VibrationError::None;
}
void GCAdapter::UpdateVibrations() {