ndeadly / MissionControl

Use controllers from other consoles natively on your Nintendo Switch via Bluetooth. No dongles or other external hardware neccessary.
GNU General Public License v2.0
2.57k stars 141 forks source link

[Controller Request]: Wii Balance Board #505

Open HEYimHeroic opened 2 years ago

HEYimHeroic commented 2 years ago

Controller Name

Wii Balance Board

Current Controller Behaviour

Controller is not successful in pairing with the console

Controller vendor and product ID

No response

Supported Features

Input Report Format

No response

Additional Details

mapping the Wii Balance Board to the left joystick would be pretty cool i think. i know this is just such an out-there idea but that's what makes it fun.

ndeadly commented 2 years ago

Heh, I actually added support for this back in April but never merged the changes. Thanks for the reminder.

Have fun. MissionControl-0.7.0-wii-balance-board-dca863f.zip

HEYimHeroic commented 2 years ago

oh, haha, neat! thanks!

HEYimHeroic commented 2 years ago

okay, after trying it, it seems the joystick can only move up-left by default or up-right if i stand on the right side of the Wii Balance Board. does not let me move anywhere else. testing on the control stick test screen in the Switch settings.

ndeadly commented 2 years ago

There's an easing function being applied to it. Maybe it needs some more work, but I found with the raw data there was way too much movement about zero just due to normal body sway, and you really had to throw your body around to max out the "stick" values. It also might be sensitive to where your center of mass lies.

I suppose it's also possible I was messing with the easing function trying to improve it and I've left it in a broken state. It's been too long I can't remember. Unfortunately I only had access to the balance board when I was back home visiting my parents. If you want to take a look and help improve it, I've pushed the code online. The easing code is here https://github.com/ndeadly/MissionControl/blob/dca863fb51988c10e59a141ed7d9ef4e4beb61c0/mc_mitm/source/controllers/wii_controller.cpp#L48-L53

FlareBlitz17 commented 2 years ago

Any games to recommend that would be fun to play with this?

ndeadly commented 2 years ago

I would say at the moment this is nothing more than a silly proof of concept. The balance board as a controller is limited to just the left joystick and A button as inputs, and you can't even really press the A button without bending down. I doubt there are many games that would be very playable with just these inputs. I tried playing Mario Kart with it when I was testing, but needed my brother sitting on the floor to operate the A button.

In the future when I have joycon emulation working, you could set the balance board as a left joycon and fuse it with another controller acting as right joycon to gain access to additional inputs.

HEYimHeroic commented 2 years ago

the A button? for me, it was pressing the R button..?

ndeadly commented 2 years ago

Hmm, the controller "extension" might be getting detected incorrectly. I know it's not perfect for controllers involving MotionPlus, as there appears to be something timing sensitive that I haven't really got to the bottom of. Usually reconnecting a few times is enough to get it correctly detected. Maybe the same applies here (and might explain the stick mapping being incorrect for you).

The wiimote controls are supposed to be mapped in the vertical orientation when a balance board is detected https://github.com/ndeadly/MissionControl/blob/dca863fb51988c10e59a141ed7d9ef4e4beb61c0/mc_mitm/source/controllers/wii_controller.cpp#L508-L512

wiibrew.com states that the button on the balance board reports as A

The Wii Balance Board has only a single physical button, accessible as core button "A", bit 3 of the second byte of button status.

And mission control is mapping A -> A in vertical mode https://github.com/ndeadly/MissionControl/blob/dca863fb51988c10e59a141ed7d9ef4e4beb61c0/mc_mitm/source/controllers/wii_controller.cpp#L178

Kronos2308 commented 2 years ago

Is there a way to get the pressure to calculate the weight Like balanceboar pro on the Wii that show the white and the graviti center

ndeadly commented 2 years ago

The weight is calculated internally in order to find the center of mass. However, since there is no concept of a balance board on the Switch, the data from the weight sensors can't be passed on directly and must be converted to something found in a conventional input report. It's the same reason why we can't just feed in analog trigger values for controllers that have them.

Kronos2308 commented 2 years ago

Can the weith of the sensors pass to a homebrew by IPC or any other method

To made a homebrew that show the weith The center of mass And the reading of the sensors on a screen

ndeadly commented 2 years ago

In theory, sure. I don't have any current plans to directly expose internal controller data though.

For now you could activate Mission Control's event redirection for hid report events and interpret the raw data from shared memory yourself. This method would require you to be in charge of identifying the controller and filtering the incoming packets accordingly, and signalling back to Mission Control that you have read each packet.