summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2020-07-08 08:46:58 -0400
committerGitHub <noreply@github.com>2020-07-08 08:46:58 -0400
commit4c50eadf3446cc5a9cb65a435093c49a965f9bae (patch)
treed1dd9b5bb4b97be2020312819142b7e859df5689 /Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp
parentb9ae7c350e8af06aaec541de742a00e364725b23 (diff)
parentd382c6bab91a8ab6ed453f8d87f0db9eff3fdc8e (diff)
Merge pull request #8908 from jordan-woyak/wiimote-battery-hax
WiimoteCommon: Tweak battery level math.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp b/Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp
index 059138e52a..3ff61621d8 100644
--- a/Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Wiimote/Wiimote.cpp
@@ -288,8 +288,7 @@ Device::Device(std::unique_ptr<WiimoteReal::Wiimote> wiimote) : m_wiimote(std::m
AddInput(new AnalogInput<float>(&m_classic_state.triggers[1], classic_prefix + "R-Analog", 1.f));
// Specialty inputs:
- AddInput(new UndetectableAnalogInput<u8>(
- &m_battery, "Battery", WiimoteCommon::MAX_BATTERY_LEVEL / ciface::BATTERY_INPUT_MAX_VALUE));
+ AddInput(new UndetectableAnalogInput<float>(&m_battery, "Battery", 1.f));
AddInput(new UndetectableAnalogInput<WiimoteEmu::ExtensionNumber>(
&m_extension_number_input, "Attached Extension", WiimoteEmu::ExtensionNumber(1)));
AddInput(new UndetectableAnalogInput<bool>(&m_mplus_attached_input, "Attached MotionPlus", 1));
@@ -1550,7 +1549,7 @@ void Device::ProcessStatusReport(const InputReportStatus& status)
// Update status periodically to keep battery level value up to date.
m_status_outdated_time = Clock::now() + std::chrono::seconds(10);
- m_battery = status.battery;
+ m_battery = status.GetEstimatedCharge() * BATTERY_INPUT_MAX_VALUE;
m_leds = status.leds;
if (!status.ir)