MissionControl icon indicating copy to clipboard operation
MissionControl copied to clipboard

[Request/Question] Recognize Third Party Switch Pro Controller as First Party

Open BryanHaley opened this issue 3 years ago • 14 comments

I have this controller: https://www.amazon.com/gp/product/B07GXLBCC3

It is recognized as a Switch Pro controller by the Switch, but not a first party one. As such, I cannot remap the controls in system settings. This is troublesome for some games (e.g. controls are wrong in Sunshine in SM3DAS).

What is the feasibility of Mission Control being able to fool the Switch into thinking third party controllers such as this one are first party and able to be remapped?

BryanHaley avatar Feb 01 '21 23:02 BryanHaley

I'm guessing this is an officially licensed controller then? Interesting, I wasn't aware that those can't be remapped.

It should be pretty trivial to fool the switch into thinking the controller is first party, I do this already for other controllers simply by switching out the name string of the controller. The only gotcha might be that the switch tries to send commands that it wouldn't normally send to third party controllers that could cause unexpected behaviour. These cases could be filtered out though. Can you think of any other potential downsides to promoting all licensed controllers to first party?

ndeadly avatar Feb 02 '21 00:02 ndeadly

Could you show me what the controller shows up as in the pairing database using btdb?

ndeadly avatar Feb 02 '21 00:02 ndeadly

Well this is interesting - I got curious and connected my 8BitDo SF30 Pro, and it seems as though it can be remapped just fine. That's peculiar considering the PowerA controller is officially licensed and the SF30 isn't. I wonder if the SF30 intentionally spoofs itself as a first party pro controller when started in switch mode?

PowerA GameCube Controller: 2021020117073600-1E95E5926F1CB99A87326D927F27B47E

SF30 Pro: 2021020117091400-1E95E5926F1CB99A87326D927F27B47E

With this in mind, I'm not sure if it's a good idea to unilaterally spoof all third party controllers as first party ones; this PowerA controller might just be a special case. Afaik there's no way to upgrade the firmware on this thing, and it definitely came out long before 10.0.0, so that might play a part in why it can't be remapped (although it seems arbitrary or perhaps just an oversight).

Here's the btdb output. The top "Pro Controller" is the 8BitDo, and the bottom "Lic Pro Controller" is the PowerA GameCube controller. 2021020117182300-DB1426D1DFD034027CECDE9C2DD914B8

Now I'm curious if other non-licensed third party pro controllers can be remapped or not.

BryanHaley avatar Feb 02 '21 01:02 BryanHaley

I connected my 8BitDo in Xinput mode to see if it would identify itself differently: 2021020117300400-45998392CB216ABF034EB6F98E399A06 You would know better than I, but it seems to me that the 8BitDo does indeed intentionally spoof itself as a first party pro controller. Perhaps it IS safe to automatically spoof all third party pro controllers (that don't already do it like the 8BitDo) to first party, then?

BryanHaley avatar Feb 02 '21 01:02 BryanHaley

@BryanHaley yeah, the officially licensed third party ones use the Lic Pro Controller name. As expected, that's how yours is showing up. You're right, the 8bitdo and other third party controllers offering Switch compatibility modes are all pretending to be official first party Pro Controllers. And likewise, in XInput mode most of those 8bitdo controllers are pretending to be Xbox One controllers.

As for remapping, I can't really think of a good reason for disabling it for third party controllers. It's all handled on console as far as I know. If it can work for Mission Control's faked Pro controllers, it can surely work for a licensed third party controller.

It's probably safe to promote all licensed controllers to first party controllers on the grounds that you're probably not going to do any permanent damage to anything. It may be possible to crash the console or controller if something unexpected happens though. I think if I were to do this properly I'd go the extra mile and create a new kind of hybrid handler that partially emulates the Pro Controller and drops some of the requests like firmware updates and NFC stuff, but passes through all of the other input and output reports.

Leave it with me to think up how best to handle this.

ndeadly avatar Feb 02 '21 02:02 ndeadly

The more I think about this the more I think we can probably just do things the dumb way and switch out the names to begin with and see what problems arise if any. I have no idea which bluetooth subcommands the third party controllers support, so don't really know which ones should be allowed/rejected anyway.

See if these changes are enough to get the controller recognised as official. You may need to be using Atmosphere 0.18.0 for this build to work, not sure.

If that works, maybe play around with it a bit and see if you are able to trigger any weird behaviour that may need to be specially handled.

MissionControl-experimental-lic-pro-controller.zip

ndeadly avatar Feb 05 '21 21:02 ndeadly

Couldn't get it to recognize as an official pro controller. Went through a couple troubleshooting steps including upgrading to atmosphere 18, clearing the bt database and repairing several times, deleting the folders used by mission control entirely and re-copying the folders from the zip, etc.

System settings still show "cannot remap" and btdb shows "Lic Pro Controller" as before.

BryanHaley avatar Feb 07 '21 02:02 BryanHaley

Hmm ok, it must use some additional info passed during the connection handshake to identify the controller type. Could you do me a favour and install this build of Mission Control with debug logging enabled, and capture a log of pairing the controller with the switch. This will create a log file on the root of your sd called bluetooth-mitm.log. The log is wiped on boot so be sure to copy it off the sd without restarting.

btdb shows "Lic Pro Controller" as before

Yeah this is normal. The real controller details are always stored in the database, I just swap out the ones that matter in-flight so that the rest of the system believes it's a real Pro Controller.

ndeadly avatar Feb 09 '21 00:02 ndeadly

Oops, sorry, forgot about this. I also lost my dongle for my switch so that's a pain. Once I install an internal modchip in my switch I'll get on this.

BryanHaley avatar Feb 22 '21 17:02 BryanHaley

No rush. This will require a bit of refactoring of the controller handling classes on my part first anyway.

ndeadly avatar Feb 22 '21 17:02 ndeadly

Oops, sorry, forgot about this. I also lost my dongle for my switch so that's a pain. Once I install an internal modchip in my switch I'll get on this.

You can also use your phone as a dongle. 😃

impeeza avatar Feb 22 '21 18:02 impeeza

I tried before buying the dongle, my phone doesn't work for it 😭 I already have the modchip tho I just gotta get around to sticking it in.

BryanHaley avatar Feb 22 '21 19:02 BryanHaley

Any updates on this? If you don't mind, could you (or anybody else with a licensed 3rd-party pro controller) install this build and post the log it creates in sdmc:/bluetooth-mitm.log? I want to know how these controllers differ from official Nintendo ones during the connection process.

MissionControl-0.5.0-dbg-21c541d.zip

ndeadly avatar Jun 30 '21 11:06 ndeadly

@BryanHaley Any chance you still have that PowerA GameCube Controller lying around? You could try my build above and see if it works for you.

Banz99 avatar Nov 04 '22 08:11 Banz99