Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiimoteCommon: Tweak battery level math. #8908

Merged
merged 1 commit into from Jul 8, 2020

Conversation

jordan-woyak
Copy link
Member

@jordan-woyak jordan-woyak commented Jun 29, 2020

Wii Remotes provide an 8-bit battery level.
Documentation thought the maximum value to be decimal 200.

My testing shows this is a direct reading of the battery voltage.
The full range of values from 0 to 255 can be produced with voltages not possible from AA batteries.
For fun, a fitted equation is: level = 176.6681 * volts - 372.1352

I've tested the battery levels required to produce 0 to 4 bars in the home menu and tweaked our battery calculations in WiimoteEmu and ControllerInterface to match this.
"Battery" settings of 0, 25, 50, 75, and 100% now produce the matching number of bars in the home menu.

Battery level "passthrough" with DSU, XInput, etc. should now be more sensible.
ControllerInterface Wii Remote battery level inputs should be more accurate.

@lioncash lioncash merged commit 4c50ead into dolphin-emu:master Jul 8, 2020
@jordan-woyak jordan-woyak deleted the wiimote-battery-hax branch July 8, 2020 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants