summaryrefslogtreecommitdiffstats
path: root/src/input_common
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-16 05:26:08 +0100
committerGitHub <noreply@github.com>2024-01-16 05:26:08 +0100
commit2c29c2b8dd280d0aeff432569f324cd85d83b415 (patch)
treee5552e7f82ccb37b611a3a577f94c91f9c813320 /src/input_common
parentMerge pull request #12681 from t895/stick-toggles (diff)
parentFix typos in master (diff)
downloadyuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.tar
yuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.tar.gz
yuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.tar.bz2
yuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.tar.lz
yuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.tar.xz
yuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.tar.zst
yuzu-2c29c2b8dd280d0aeff432569f324cd85d83b415.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/drivers/gc_adapter.cpp4
-rw-r--r--src/input_common/helpers/joycon_protocol/irs.cpp4
-rw-r--r--src/input_common/helpers/joycon_protocol/joycon_types.h6
-rw-r--r--src/input_common/helpers/joycon_protocol/nfc.cpp8
-rw-r--r--src/input_common/helpers/joycon_protocol/rumble.cpp12
-rw-r--r--src/input_common/helpers/udp_protocol.h2
6 files changed, 18 insertions, 18 deletions
diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp
index 1ff296af5..f1184a5fa 100644
--- a/src/input_common/drivers/gc_adapter.cpp
+++ b/src/input_common/drivers/gc_adapter.cpp
@@ -451,11 +451,11 @@ ButtonMapping GCAdapter::GetButtonMappingForDevice(const Common::ParamPackage& p
std::tuple{Settings::NativeButton::ZL, PadButton::TriggerL, PadAxes::TriggerLeft},
{Settings::NativeButton::ZR, PadButton::TriggerR, PadAxes::TriggerRight},
};
- for (const auto& [switch_button, gcadapter_buton, gcadapter_axis] : switch_to_gcadapter_axis) {
+ for (const auto& [switch_button, gcadapter_button, gcadapter_axis] : switch_to_gcadapter_axis) {
Common::ParamPackage button_params{};
button_params.Set("engine", GetEngineName());
button_params.Set("port", params.Get("port", 0));
- button_params.Set("button", static_cast<s32>(gcadapter_buton));
+ button_params.Set("button", static_cast<s32>(gcadapter_button));
button_params.Set("axis", static_cast<s32>(gcadapter_axis));
button_params.Set("threshold", 0.5f);
button_params.Set("range", 1.9f);
diff --git a/src/input_common/helpers/joycon_protocol/irs.cpp b/src/input_common/helpers/joycon_protocol/irs.cpp
index 68b0589e3..5bf72114d 100644
--- a/src/input_common/helpers/joycon_protocol/irs.cpp
+++ b/src/input_common/helpers/joycon_protocol/irs.cpp
@@ -236,9 +236,9 @@ Common::Input::DriverResult IrsProtocol::WriteRegistersStep2() {
.number_of_registers = 0x8,
.registers =
{
- IrsRegister{IrRegistersAddress::LedIntensitiyMSB,
+ IrsRegister{IrRegistersAddress::LedIntensityMSB,
static_cast<u8>(led_intensity >> 8)},
- {IrRegistersAddress::LedIntensitiyLSB, static_cast<u8>(led_intensity & 0xff)},
+ {IrRegistersAddress::LedIntensityLSB, static_cast<u8>(led_intensity & 0xff)},
{IrRegistersAddress::ImageFlip, static_cast<u8>(image_flip)},
{IrRegistersAddress::DenoiseSmoothing, static_cast<u8>((denoise >> 16) & 0xff)},
{IrRegistersAddress::DenoiseEdge, static_cast<u8>((denoise >> 8) & 0xff)},
diff --git a/src/input_common/helpers/joycon_protocol/joycon_types.h b/src/input_common/helpers/joycon_protocol/joycon_types.h
index 77a43c67a..792f124e1 100644
--- a/src/input_common/helpers/joycon_protocol/joycon_types.h
+++ b/src/input_common/helpers/joycon_protocol/joycon_types.h
@@ -282,7 +282,7 @@ enum class NFCCommand : u8 {
CancelAll = 0x00,
StartPolling = 0x01,
StopPolling = 0x02,
- StartWaitingRecieve = 0x04,
+ StartWaitingReceive = 0x04,
ReadNtag = 0x06,
WriteNtag = 0x08,
Mifare = 0x0F,
@@ -382,8 +382,8 @@ enum class IrRegistersAddress : u16 {
FinalizeConfig = 0x0700,
LedFilter = 0x0e00,
Leds = 0x1000,
- LedIntensitiyMSB = 0x1100,
- LedIntensitiyLSB = 0x1200,
+ LedIntensityMSB = 0x1100,
+ LedIntensityLSB = 0x1200,
ImageFlip = 0x2d00,
Resolution = 0x2e00,
DigitalGainLSB = 0x2e01,
diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp
index 09953394b..db83f9ef4 100644
--- a/src/input_common/helpers/joycon_protocol/nfc.cpp
+++ b/src/input_common/helpers/joycon_protocol/nfc.cpp
@@ -519,13 +519,13 @@ Common::Input::DriverResult NfcProtocol::GetMifareData(
}
if (output.mcu_report == MCUReport::NFCState && output.mcu_data[1] == 0x10) {
- constexpr std::size_t DATA_LENGHT = 0x10 + 1;
+ constexpr std::size_t DATA_LENGTH = 0x10 + 1;
constexpr std::size_t DATA_START = 11;
const u8 number_of_elements = output.mcu_data[10];
for (std::size_t i = 0; i < number_of_elements; i++) {
- out_data[i].sector = output.mcu_data[DATA_START + (i * DATA_LENGHT)];
+ out_data[i].sector = output.mcu_data[DATA_START + (i * DATA_LENGTH)];
memcpy(out_data[i].data.data(),
- output.mcu_data.data() + DATA_START + 1 + (i * DATA_LENGHT),
+ output.mcu_data.data() + DATA_START + 1 + (i * DATA_LENGTH),
sizeof(MifareReadData::data));
}
package_index++;
@@ -659,7 +659,7 @@ Common::Input::DriverResult NfcProtocol::SendStopPollingRequest(MCUCommandRespon
Common::Input::DriverResult NfcProtocol::SendNextPackageRequest(MCUCommandResponse& output,
u8 packet_id) {
NFCRequestState request{
- .command_argument = NFCCommand::StartWaitingRecieve,
+ .command_argument = NFCCommand::StartWaitingReceive,
.block_id = {},
.packet_id = packet_id,
.packet_flag = MCUPacketFlag::LastCommandPacket,
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 {
// More information about these values can be found here:
// https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
- static constexpr std::array<std::pair<f32, int>, 101> high_fequency_amplitude{
+ static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{
std::pair<f32, int>{0.0f, 0x0},
{0.01f, 0x2},
{0.012f, 0x4},
@@ -171,20 +171,20 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const {
{1.003f, 0xc8},
};
- for (const auto& [amplitude_value, code] : high_fequency_amplitude) {
+ for (const auto& [amplitude_value, code] : high_frequency_amplitude) {
if (amplitude <= amplitude_value) {
return static_cast<u8>(code);
}
}
- return static_cast<u8>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second);
+ return static_cast<u8>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second);
}
u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const {
// More information about these values can be found here:
// https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md
- static constexpr std::array<std::pair<f32, int>, 101> high_fequency_amplitude{
+ static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{
std::pair<f32, int>{0.0f, 0x0040},
{0.01f, 0x8040},
{0.012f, 0x0041},
@@ -288,13 +288,13 @@ u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const {
{1.003f, 0x0072},
};
- for (const auto& [amplitude_value, code] : high_fequency_amplitude) {
+ for (const auto& [amplitude_value, code] : high_frequency_amplitude) {
if (amplitude <= amplitude_value) {
return static_cast<u16>(code);
}
}
- return static_cast<u16>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second);
+ return static_cast<u16>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second);
}
} // namespace InputCommon::Joycon
diff --git a/src/input_common/helpers/udp_protocol.h b/src/input_common/helpers/udp_protocol.h
index d9643ffe0..dba9f87d9 100644
--- a/src/input_common/helpers/udp_protocol.h
+++ b/src/input_common/helpers/udp_protocol.h
@@ -78,7 +78,7 @@ namespace Request {
enum RegisterFlags : u8 {
AllPads,
PadID,
- PadMACAdddress,
+ PadMACAddress,
};
struct Version {};