diff options
author | german77 <juangerman-13@hotmail.com> | 2020-11-19 18:30:52 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2020-11-19 18:30:52 +0100 |
commit | 5b6545b1410e2fa907d12f13d37ef710be654c2a (patch) | |
tree | 54a0a44b3ec126ac5ca0514dcd4fb7b2891cde0e | |
parent | Merge pull request #4936 from lioncash/page (diff) | |
download | yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.tar yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.tar.gz yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.tar.bz2 yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.tar.lz yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.tar.xz yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.tar.zst yuzu-5b6545b1410e2fa907d12f13d37ef710be654c2a.zip |
-rw-r--r-- | src/input_common/gcadapter/gc_poller.cpp | 4 | ||||
-rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/input_common/gcadapter/gc_poller.cpp b/src/input_common/gcadapter/gc_poller.cpp index fe57c13a5..d95574bb5 100644 --- a/src/input_common/gcadapter/gc_poller.cpp +++ b/src/input_common/gcadapter/gc_poller.cpp @@ -302,8 +302,8 @@ public: bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const override { const auto mean_amplitude = (amp_low + amp_high) * 0.5f; - const auto processed_amplitude = static_cast<u8>( - pow(mean_amplitude, 0.5f) * (3.0f - 2.0f * pow(mean_amplitude, 0.15f)) * 0x8); + const auto processed_amplitude = + static_cast<u8>((mean_amplitude + std::pow(mean_amplitude, 0.3f)) * 0.5f * 0x8); return gcadapter->RumblePlay(port, processed_amplitude); } diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index 8c48bb861..c395d96cf 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -402,8 +402,7 @@ public: bool SetRumblePlay(f32 amp_low, f32 freq_low, f32 amp_high, f32 freq_high) const override { const auto process_amplitude = [](f32 amplitude) { - return static_cast<u16>(std::pow(amplitude, 0.5f) * - (3.0f - 2.0f * std::pow(amplitude, 0.15f)) * 0xFFFF); + return static_cast<u16>((amplitude + std::pow(amplitude, 0.3f)) * 0.5f * 0xFFFF); }; const auto processed_amp_low = process_amplitude(amp_low); |