Mefiresu / RSDKv5-Decompilation

A complete decompilation of Retro Engine (v5) ported to the Wii
Other
53 stars 6 forks source link

Gamecube controller and true analog stick support #6

Closed Anh302kay closed 2 years ago

Anh302kay commented 2 years ago

Adds Gamecube controller support. Buttons are correct with GUI. Basic analog stick support, deadzone might need adjusting though. Tested on real hardware with smash bros ultimate Gamecube controller.

Mefiresu commented 2 years ago

Will merge after testing.

niuus commented 2 years ago

Thanks for the PR! For now, your code will prioritize GC controller if it is plugged in (and overwrite any input done by a connected Wiimote), but I don't think many people would keep a GC controller plugged in while playing with a Wiimote anyway.

I tend to have it like this as I do a lot of testing while developing some emulators. Not too important if it can't be done, but can both coexist? For example, with a GCN controller on port 1, it would make a Wiimote turning on a Player 2 (or viceversa, a GCN controller on port 2, a Wiimote being Player 1).

In case you need it, I can do tests with GCN controllers, Wiimotes, and a Wii U Pro controller present.

I am currently playing with a Wii U Pro controller, with a build that was made after this commit. Works great.

Mefiresu commented 2 years ago

I tend to have it like this as I do a lot of testing while developing some emulators. Not too important if it can't be done, but can both coexist? For example, with a GCN controller on port 1, it would make a Wiimote turning on a Player 2 (or viceversa, a GCN controller on port 2, a Wiimote being Player 1).

As of now everything is hardcoded to be player 1 (since splitscreen multiplayer is not implemented on the graphics side anyway), so this can be definitely be done when the time comes.

I am currently playing with a Wii U Pro controller, with a build that was made after this commit. Works great.

Good to know ! I suppose the Wii U Pro controller acting like a Wii Classic controller, right?

Mefiresu commented 2 years ago

@niuus Feel free to test GC controller with these new changes, both controllers should now work at the same time without conflicts.

niuus commented 2 years ago

Sorry I didn't reply sooner, as this doesn't generate notifications and never know if there are replies.

Good to know ! I suppose the Wii U Pro controller acting like a Wii Classic controller, right?

Yes, as long as Classic Controller support is there, that's the defacto behaviour when using libogc to compile, after version 1.8.15, afaik.

@niuus Feel free to test GC controller with these new changes, both controllers should now work at the same time without conflicts.

Works like a charm. They do work even at the same time.