-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[WIP] Balance Board emulation #8268
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few preliminary comments, if any don't apply due to the WIP status, feel free to disregard them.
I've implemented movie support, which seems to work correctly at least when starting from a save state right before selecting a game. Wii Fit (Plus) seems to be rather annoying with synchronization though, especially with the random fitness tips on startup. (Possibly I just don't know how to work with the realtime clock or saves or something; I haven't used the movie functionality much.) I haven't tested netplay yet, and I suspect it also has the same expectations of 4 wiimotes or gamecube controllers. I'm looking into that one now. (I don't have anything to test it on either as Wii Fit isn't really a multiplayer game and you can only use one balance board, but I should be able to make the same kinds of code changes.) EDIT: I don't think I'll be able to handle netplay at the moment; I don't feel confident in modifying the protocol for it which I'm pretty sure would be needed to add support (especially since you'd generally have one player using both the remote and the balance board) |
For anyone who wants to try with Netplay, Tetris Party is a multiplayer game that supports Wii Balance board. As is Super Monkey Ball Step and Roll. |
07eacde
to
fcfcd2e
Compare
I've found my previous code that calibrated 34kg as I've also adjusted the TAS code to use 4 doubles internally instead of direct sensor values. That seems to be causing some issues (a stackoverflow sometimes) which I haven't fixed yet, but the UI looks and behaves about the way I want it to. Fixed point is probably preferable in the long run. The only thing that I'd say is missing is a more complete UI for normal use. Everything works balance-wise, but for functions involving walking or jumping it's a bit of a mess and there's no way to directly specify a weight. |
7ec8770
to
a02c184
Compare
a02c184
to
8fa1202
Compare
c33d910
to
44ee7f1
Compare
c186bcd
to
03dd631
Compare
03dd631
to
541f720
Compare
4e75aa5
to
ab3da55
Compare
c73b5f5
to
8da8307
Compare
8da8307
to
362940e
Compare
362940e
to
2a62488
Compare
2a62488
to
871d325
Compare
871d325
to
8c7f89b
Compare
This is unlikely to be ready for merging any time soon (due to the incomplete UI and other various bugs), but if you want to try it out, you can download a build from CI by clicking the check mark next to the most recent commit, then finding and clicking the details link for pr-win-x64, and then scrolling to the bottom where under upload there should be "pr-8268-dolphin-latest-x64.7z". This applies to any pull request. |
8c7f89b
to
57b9bb9
Compare
cae3f39
to
7519000
Compare
7519000
to
d07bbbc
Compare
d07bbbc
to
f5e69af
Compare
f5e69af
to
5052b10
Compare
5052b10
to
7607f31
Compare
7607f31
to
ef8ba6a
Compare
const ControllerEmu::Triggers::StateData weight_state = m_weight->GetState(); | ||
const auto weight = weight_state.data[0]; | ||
|
||
const double total_weight = 63.5 * weight; // kilograms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the number here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I can't. I don't think it has any special meaning, other than being chosen as a default weight of some sort (because the way I implemented the controller UI, it gives a value from 0x to 2x instead of a weight in kilograms). It looks like I created a DEFAULT_WEIGHT
constant in WiiTASInputWindow.cpp but just left it as a magic number here. I have no idea why I picked 63.5 though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a DEFAULT_WEIGHT
constant in the header which is used both here and for TAS. It's still a bit jank though.
ef8ba6a
to
4bb32c1
Compare
4bb32c1
to
bfe6fd6
Compare
bfe6fd6
to
4b3240c
Compare
EFfectively reverts 5fe7270. I'm not sure why Mac OS was troubled by this before (though they were const instead of constexpr).
…EPROM for the balance board
This wasn't possible until DolphinLib was unified due to zlib not being present for input devices.
1b384f6
to
78eb864
Compare
This is a bad fix since it doesn't resolve using the balance board on netplay.
78eb864
to
71a2f3e
Compare
This PR adds support for balance board emulation.
This isn't completely finished, and the UI for it isn't too great. In particular, there isn't any way to specify the current weight on the main UI, only to adjust the weight in terms of percentages, though it does exist on the TAS UI. The UI also doesn't support all possible inputs, only cases where actual balance is used; this means that e.g. walking doesn't work too well (or the step game). The balance board is treated as a regular extension and can be set on any remote, and also needs to be manually set for the actual balance board. Also, games that don't support the balance board will continuously disconnect it, and dolphin will then repeatedly attempt to reconnect it. But it is perfectly usable.
One thing I haven't tested is whether this works with movies; the documentation (rev 31 specifically) mentions that a single byte is used to indicate the connected controllers, and adding a 5th pseudo-wiimote probably causes issues there. I currently have a commit that adds an excessive number of bounds-checks for movies, which ideally should be replaced with proper support.