diff options
| author | 2024-01-15 23:26:53 +0000 | |
|---|---|---|
| committer | 2024-01-15 23:26:53 +0000 | |
| commit | 2044ae6b3af6fab4d79996a661fef43f6db8d825 (patch) | |
| tree | 49f827eb5f5cc0eca379bce989cbe9450e4831c9 /src/input_common/helpers/joycon_protocol/rumble.cpp | |
| parent | Fix typos in src/core (#12625) (diff) | |
| download | yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.gz yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.xz yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.zip | |
Fix more typos
Diffstat (limited to 'src/input_common/helpers/joycon_protocol/rumble.cpp')
| -rw-r--r-- | src/input_common/helpers/joycon_protocol/rumble.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/input_common/helpers/joycon_protocol/rumble.cpp b/src/input_common/helpers/joycon_protocol/rumble.cpp index 7647f505e..9fd0b8470 100644 --- a/src/input_common/helpers/joycon_protocol/rumble.cpp +++ b/src/input_common/helpers/joycon_protocol/rumble.cpp | |||
| @@ -67,7 +67,7 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const { | |||
| 67 | // More information about these values can be found here: | 67 | // More information about these values can be found here: |
| 68 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md | 68 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md |
| 69 | 69 | ||
| 70 | static constexpr std::array<std::pair<f32, int>, 101> high_fequency_amplitude{ | 70 | static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{ |
| 71 | std::pair<f32, int>{0.0f, 0x0}, | 71 | std::pair<f32, int>{0.0f, 0x0}, |
| 72 | {0.01f, 0x2}, | 72 | {0.01f, 0x2}, |
| 73 | {0.012f, 0x4}, | 73 | {0.012f, 0x4}, |
| @@ -171,20 +171,20 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const { | |||
| 171 | {1.003f, 0xc8}, | 171 | {1.003f, 0xc8}, |
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | for (const auto& [amplitude_value, code] : high_fequency_amplitude) { | 174 | for (const auto& [amplitude_value, code] : high_frequency_amplitude) { |
| 175 | if (amplitude <= amplitude_value) { | 175 | if (amplitude <= amplitude_value) { |
| 176 | return static_cast<u8>(code); | 176 | return static_cast<u8>(code); |
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | return static_cast<u8>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second); | 180 | return static_cast<u8>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { | 183 | u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { |
| 184 | // More information about these values can be found here: | 184 | // More information about these values can be found here: |
| 185 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md | 185 | // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md |
| 186 | 186 | ||
| 187 | static constexpr std::array<std::pair<f32, int>, 101> high_fequency_amplitude{ | 187 | static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{ |
| 188 | std::pair<f32, int>{0.0f, 0x0040}, | 188 | std::pair<f32, int>{0.0f, 0x0040}, |
| 189 | {0.01f, 0x8040}, | 189 | {0.01f, 0x8040}, |
| 190 | {0.012f, 0x0041}, | 190 | {0.012f, 0x0041}, |
| @@ -288,13 +288,13 @@ u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { | |||
| 288 | {1.003f, 0x0072}, | 288 | {1.003f, 0x0072}, |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
| 291 | for (const auto& [amplitude_value, code] : high_fequency_amplitude) { | 291 | for (const auto& [amplitude_value, code] : high_frequency_amplitude) { |
| 292 | if (amplitude <= amplitude_value) { | 292 | if (amplitude <= amplitude_value) { |
| 293 | return static_cast<u16>(code); | 293 | return static_cast<u16>(code); |
| 294 | } | 294 | } |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | return static_cast<u16>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second); | 297 | return static_cast<u16>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second); |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | } // namespace InputCommon::Joycon | 300 | } // namespace InputCommon::Joycon |