From b4163892481ed3202d1ba955d3c00a883f6e84e5 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 14 Jan 2020 17:08:21 -0600 Subject: [PATCH] Core/DolphinQt: Fix IR Sensitivity slider. --- Source/Core/Core/SysConf.h | 6 +++++- Source/Core/DolphinQt/Settings/WiiPane.cpp | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/SysConf.h b/Source/Core/Core/SysConf.h index 0e8557f451..b0ad8c2341 100644 --- a/Source/Core/Core/SysConf.h +++ b/Source/Core/Core/SysConf.h @@ -14,6 +14,7 @@ #include "Common/Assert.h" #include "Common/CommonTypes.h" #include "Common/NandPaths.h" +#include "Common/Swap.h" namespace IOS::HLE::FS { @@ -55,14 +56,17 @@ public: { if (bytes.size() != sizeof(T)) return default_value; + T value; std::memcpy(&value, bytes.data(), bytes.size()); - return value; + return Common::FromBigEndian(value); } template void SetData(T value) { ASSERT(sizeof(value) == bytes.size()); + + value = Common::FromBigEndian(value); std::memcpy(bytes.data(), &value, bytes.size()); } diff --git a/Source/Core/DolphinQt/Settings/WiiPane.cpp b/Source/Core/DolphinQt/Settings/WiiPane.cpp index ba6df4d1c7..35f9af561a 100644 --- a/Source/Core/DolphinQt/Settings/WiiPane.cpp +++ b/Source/Core/DolphinQt/Settings/WiiPane.cpp @@ -177,8 +177,9 @@ void WiiPane::CreateWiiRemoteSettings() // i18n: IR stands for infrared and refers to the pointer functionality of Wii Remotes m_wiimote_ir_sensitivity_label = new QLabel(tr("IR Sensitivity:")); m_wiimote_ir_sensitivity = new QSlider(Qt::Horizontal); - m_wiimote_ir_sensitivity->setMinimum(4); - m_wiimote_ir_sensitivity->setMaximum(127); + // Wii menu saves values from 1 to 5. + m_wiimote_ir_sensitivity->setMinimum(1); + m_wiimote_ir_sensitivity->setMaximum(5); // Speaker Volume Slider m_wiimote_speaker_volume_label = new QLabel(tr("Speaker Volume:"));