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

InputCommon: Add support for Wii Remotes in ControllerInterface #8575

Merged
merged 9 commits into from
Feb 22, 2020

Conversation

jordan-woyak
Copy link
Member

@jordan-woyak jordan-woyak commented Jan 23, 2020

AKA "Hybrid Wiimote 2.0".
Based on PR #8610 for gyroscope calibration.

Why?

  • "Real" Wii Remote support in NetPlay
  • Non-hacky "Hybrid Wiimote" (Mix of real and emulated Wii Remote data)
  • Emulating GameCube controllers with Wii Remotes
  • Simulating a sensor bar with MotionPlus data

An additional setting, "Connect Wii Remotes for Emulated Controllers", is added to the "Controllers" dialog.
I also fixed up all the widget disabling/enabling when passthrough/emu BT is changed and core state changes.
https://i.imgur.com/hq81jFW.png
I'm open to suggestions on the UI wording and the ini name, "WiimoteControllerInterface".

When enabled, after real Wii Remote slots are filled, additional remotes are sent to ControllerInterface where inputs can be mapped 1:1 or completely reconfigured.
Wii Remotes are moved to/from ControllerInterface/pool as settings change.

Nunchuk and Classic Controller extensions function with or without simultaneous M+.
Calibration data is read for all extensions and all inputs are supported. (raw accel data is provided for Nunchuk)
Eliminated redundant bithacks in our TAS code for get/setting of Nunchuk/Classic Controller values.

I've found M+ calibration data is almost useless beyond providing the "handedness" of the sensors so real-time calibration must be done when data is stable. (Usually requires placing the remote on a table for a few seconds).

Raw accelerometer and gyroscope inputs are provided for IMU mappings.
When enabling IMU "pointer" emulation this allows simulating a sensor bar as long as MotionPlus is present.
Many games will no longer need a sensor bar. One game I can think of that won't behave well is, Metroid: Other M.
Demonstration: https://giant.gfycat.com/JampackedDiscreteImago.webm
(Ignore the weird gyro mappings, they were before real-time calibration)

The Wii Remote orientation is calculated from M+ data and corrected with accelerometer and IR data when present. Yaw/Roll/Pitch inputs are provided from this.

Pass-through of M+ presence, current extension, and battery level is possible with PR #8417.
Demonstration: https://giant.gfycat.com/OrangeDemandingCanadagoose.webm

Variable strength rumble is simulated with pulses.

I'm open to suggestions on naming of inputs.

I've tested with many official Wii Remotes and two generic ones.

To be fixed at a later date:

  • All inputs for all extensions are always listed even when not connected.
    • ControllerInterface will need changes to allow dynamically removing inputs
  • Include Emulated Wii Remote input profiles for Real Wii Remotes to give users a starting point

This fixes: https://bugs.dolphin-emu.org/issues/11642

@jordan-woyak jordan-woyak force-pushed the ciface-wiimotes branch 3 times, most recently from aa60b39 to 44bb413 Compare February 10, 2020 21:23
@jordan-woyak jordan-woyak force-pushed the ciface-wiimotes branch 3 times, most recently from ea055d4 to 90989b9 Compare February 15, 2020 20:16
Copy link
Member

@BhaaLseN BhaaLseN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems fine at a glance, but untested.

@icebearko
Copy link

icebearko commented May 20, 2022

If I use the Connect Wii Remotes for Emulated Controllers setting, it won't have the WiiMote Rumble and Speaker. Can you add the Rumble and Speaker setting on the next Dev version? I'm using a Wii Remote Plus

@Trihy
Copy link

Trihy commented Nov 24, 2023

Could be possible that after this commit, continuous scan is always on? Besides disabling on settings, seems like is always on.

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

Successfully merging this pull request may close these issues.

5 participants