Commit Graph

7 Commits

Author SHA1 Message Date
Lioncash 2d9ef3412a GCAdapterConfigDiag: Mark OnUpdateAdapter parameter as unused. 2016-11-10 20:19:53 -05:00
Lioncash 1ae9027a6b GCAdapterConfigDiag: Rename UpdateAdapter to OnUpdateAdapter
Uses the general naming convention for event functions.
2016-11-10 20:18:59 -05:00
Lioncash c5c7ff9fd6 GCAdapterConfigDiag: Make functions private where applicable
These don't need to be in the public interface.
2016-11-10 20:12:02 -05:00
Lioncash 24cf46aa5a GCAdapterConfigDiag: Cull includes in header file
Prevents dragging in unnecessary headers into other including files.
2016-10-20 10:09:19 -04:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Ryan Houdek 1dcc199a63 Fix GCPad recalibration shortcut.
Dolphin has supported the recalibration shortcut (X+Y+Start) for quite a long while. So if someont's axises are terrible, you could easily
recalibrate.
Games even get the initial calibration upon boot(Most of the time).

While changing over the GCAdapter code, I was testing to make sure the reset and calibration shortcuts still worked, turns out they didn't work at
all.
Looking in to the problem, we capture the combination properly, and we wait three seconds until we actually fire that off recalibration.
The problem is for Nintendo's SDK to properly handle recalibrating, we need to send back data saying that it needs to recalibrate.
On hardware this is done as part of the 64bits of data the controller sends back to us.
On holding of the controller, bit 61 of the return value is set, which the Nintendo SDK catches, and then signals immediately afterwards a CMD_ORIGIN
command in order to recalibrate the controller.
We were outright ignoring this bit, so the library wasn't ever recalibrating. I suspect in the past the class itself used to use the calibration data
to to offset the data, but somewhere along the lines it got munged out of existence.

The Gamecube adapter does this shortcut in a bit of a unique way, instead of sending the command and having the library support it and what have you.
Once holding the shortcut for the amount of time, the adapter reports back that the controller has actually been disconnected. Then when you let go of
the combination, the adapter states that a new device has been connected to that port, and the recalibration happens because a new device is
"connected."

This fixes controller calibration for both emulated GC controllers and also the Wii Gamecube Adapter.
2016-01-06 00:41:00 -06:00
Ryan Houdek 49410576e9 Make the Wii U Gamecube adapter work with less magic.
The Wii U Gamecube controller adapter setup has always been a bit weird. It tries to be as automatic as possible to make the user experience as easy
as possible.
The problem with this approach is that it brings a large disconnect in the user experience because you have the Gamecube controller setup with regular
gamepads and then for some reason below that you have a "direct connect" option which will cause the Gamecube Adapter to overwrite the regular inputs
if something was connected.
While this works and allows the user to only click one checkbox to get the device working, it breaks the user's experience because they don't really
know what "direct connect" means and won't look it up to figure out what it is. Just expecting the device to work (At least one occurence of this in
the IRC channel in the last week).

This way around also had the terrible nature of making the code more filthy than it needed to be. The GCAdapter namespace was parasitic and hooked in
to the regular GC Controller SI class to overwrite the data that it was getting from the default configuration.
Now instead we have a specific SIDevice class for the Wii U Gamecube adapter. This class is fairly simple and is a child of the regular SI Gamecube
Pad device and only reimplements what it needs to.
This also gives the ability to configure controllers individually, which allows the user to configure rumble individually per pad input.

Overall the code is cleaner, and it fits more in line with how the rest of Dolphin works.
2016-01-05 13:44:37 -06:00