Skip to content

Conversation

@dkosmari
Copy link

This adds a number of Balance Board changes:

  • Fixed LED not turning on (it only has LED 1.)
  • wii_board_t members renamed to be more readable, and reordered to match the serialized data.
  • Added battery and temperature fields.
  • Weights are adjusted from the current temperature.
  • The .x/.y members are now normalized between -1 and +1, and only set if 2 Kg or more is detected.
  • The .y member was negated, so positive means top/front.
  • .total_weight contains the sum of the 4 weights.
  • .battery goes from 0 (critical) to 4 (full charge.) The values match the Wii U's padscore library.

Daniel K. O. (dkosmari) added 2 commits December 17, 2025 06:46
- Fixed LED not turning on (it only has LED 1.)
- `wii_board_t` members renamed to be more readable.
- Added battery and temperature fields.
- Weights are adjusted from the current temperature.
- The `.x`/`.y` members are now normalized between -1 and +1, and only set if 2 Kg or more is detected.
- The `.y` member was negated, so positive means top/front.
- `.total_weight` contains the sum of the 4 weights.
- `.battery` goes from 0 (critical) to 4 (full charge.)
@DacoTaco
Copy link
Member

Hi @dkosmari,
thanks for the PR! just a question before i merge this. would you mind checking the code of upstream wiiuse ( https://github.com/wiiuse/wiiuse ) and see if the mistakes are also there?

this is to keep track how far we deviated from upstream wiiuse incase we can remove our wiiuse and use upstream instead.

@dkosmari
Copy link
Author

Here's what I've found:

  • Fixed LED not turning on (it only has LED 1.)

This is not a problem with wiiuse because it leaves the LED untouched, and you can control the LEDs state yourself. The WPAD functions in libogc don't offer control over the LEDs.

  • wii_board_t members renamed to be more readable, and reordered to match the serialized data.

Having the sensors in an array is more useful for the user, since you'll want to process them all. All other expansion structs have nice names, only wii_board_t has obnoxious 2-letter and 3-letter abbreviations, making it hard to spot a copy-paste typo.

  • Added battery and temperature fields.

Upstream wiiuse does not read battery nor temperature data.

  • Weights are adjusted from the current temperature.

Upstream wiiuse does not correct for temperature since it doesn't read it.

  • The .x/.y members are now normalized between -1 and +1, and only set if 2 Kg or more is detected.
  • The .y member was negated, so positive means top/front.

Upstream wiiuse does not have these fields, and I don't think libogc should have them either. It's not very correct when the true zero weight needs to be found by the application/game. On the Wii U's padscore library, there's a function to set the zero, after the player is informed to perform some actions (e.g. step on the board for a few seconds, then off.)

  • .total_weight contains the sum of the 4 weights.

I added this for convenience.

  • .battery goes from 0 (critical) to 4 (full charge.) The values match the Wii U's padscore library.

Also brand new in this PR. After this we can maybe introduce a "get battery bars" function to unify the battery reading for all three cases (wiimote, Pro and board) since the bars reading will match official games and System Menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants