ndeadly / MissionControl

Use controllers from other consoles natively on your Nintendo Switch via Bluetooth. No dongles or other external hardware neccessary.
GNU General Public License v2.0
2.54k stars 139 forks source link

[Feature Request]: Ability to remap Hori Split Pad Pro/Similar Controllers #560

Open Millyawns opened 1 year ago

Millyawns commented 1 year ago

Feature Description

There are a number of handheld only controllers that are on the market like the Hori Split Pad Pro, the Hori Split Pad Compact, Hori's D-Pad JoyCon alternative, etc that do not allow for button remapping natively on Switch. Ideally there would be a way to remap these types of handheld only controllers so that people can use the Xbox layout or other button layouts they would like.

Rationale

Hori Split Pads are far and away the most popular handheld only joycon replacement, but they lack many features, the most notable being the ability to remap buttons. Adding the ability to remap buttons to these aftermarket joycon controllers would make them MUCH more useful for handheld use. Compared to similar joycons that allow for button remapping (Like BinBoks) Horis controllers are much lighter and are built with better parts (like an actual, usable DPad). This would solve a major shortcoming for these types of controllers.

Additional Details

This should be possible in theory, but I'm not sure how. Only one other person (Stunndard) I've seen has taken a crack at it and the repo for it is closed source and out of date. This solution however swaps buttons and doesn't let you change them on the fly. Ideally there would be a way to do that, such as through the Button Mapping menu Nintendo conveniently doesn't want people with aftermarket joycons to use.

PS - If you have a patreon/paypal or something, I'd love to donate for this. I personally can't stand using OEM Joycons for any twitch-heavy games right now and I'm more than happy to throw some money your way for looking into this.

Millyawns commented 1 year ago

My apologies in advance if this is in the wrong place. Horis aren't Bluetooth controllers so I wasn't sure if this fit the criteria as something that could be supported if not, sorry for the trouble and have a good one!

ndeadly commented 1 year ago

Hey, sorry I've been on holiday and only getting a chance to look at this now.

What you propose is likely doable via a uart mitm. It's probably just a matter of tweaking some identifying information sent by the controller to look like a real Joycon. I would just need to figure out what needs changing.

I've already done some work in private on a uart mitm. Here's a build that logs all uart data to sdmc:/mc-mitm.log. Install it, reboot your console and then turn it off and launch hekate UMS to copy off the log file and post it here. I'll compare it to my own Joycons and see if I can't figure out what needs to be modified.

MissionControl-0.8.0-uart-mitm-7d922c4.zip

PS - If you have a patreon/paypal or something, I'd love to donate for this. I personally can't stand using OEM Joycons for any twitch-heavy games right now and I'm more than happy to throw some money your way for looking into this.

I've got a ko-fi page that you can access via the Sponsor button at the top of the page. I'm open to adding other methods if there's something you find more convenient.

Millyawns commented 1 year ago

No worries on the holiday delay and thank you for looking into this!

I'll upload the log file as soon as I can. Should I reboot the console with the HORI Split Pad Compacts attached, or attach them once the console is on and would it help to swap multiple controllers (eg. the Split Pad Compact and the D-Pad JoyCon) while playing on them or test on another unit? Mine is on the latest firmware while my mate's hasn't been updated since 13.2.0.

Also thanks for pointing me to your Ko-Fi - I sent you a couple bucks. Happy Holidays!

ndeadly commented 1 year ago

Oh yeah probably should have specified that for clarity. Just leave the hori pads attached when you reboot and they will send everything I need to see by the time the console has finished starting up. Don't connect any other controllers, it will only pollute the log file with unnecessary data. It's likely only the initial "handshake" I need to see.

And a big thankyou for the kind donation! Much appreciated :)

Millyawns commented 1 year ago

I shut off the Switch, replaced all current files the ones above on the micro SD card, then booted CFW from Hekate - I tried pressing a few buttons but the controller was completely unresponsive and it seemed as if nothing was connected. Hopefully I did this right. Here's the log: mc-mitm.log

Millyawns commented 1 year ago

Tried a couple reboots - log is still more or less empty. I think I messed up on my end, could you explain how I'm supposed to do this? I'm sorry for the trouble!

Log - mc-mitm.log

ndeadly commented 1 year ago

Hmm, if you're getting the log at all I don't think you've done anything wrong. Do you have regular joycons? Maybe you could try connect them instead to see if you get anything in the log.

Or maybe these controllers are actually communicating via bluetooth. Can you try run this build instead? https://github.com/ndeadly/MissionControl/files/10327394/MissionControl-0.8.0-debug-logging-11b3310.zip

Millyawns commented 1 year ago

I do have regular joycons, OEM and thirdparty. I'll try those with this build in a smidge. Here's the log with the new build, Split Pad Pro Compact. Just moved around on the menu a bit - no lock up and controls were responsive. Log: mc-mitm.log

Millyawns commented 1 year ago

Here's the log with OEM JoyCons. Airplane mode was on for both of these tests, but both controllers were responsive and the Switch didn't lock up this time. Log - mc-mitm.log

ndeadly commented 1 year ago

I do have regular joycons, OEM and thirdparty. I'll try those with this build in a smidge. Here's the log with the new build, Split Pad Pro Compact. Just moved around on the menu a bit - no lock up and controls were responsive. Log: mc-mitm.log

Hmm, no bluetooth communication either. I guess they are using UART then. Now the question is why things aren't working. I guess I'll have to add some additional logging.

Here's the log with OEM JoyCons. Airplane mode was on for both of these tests, but both controllers were responsive and the Switch didn't lock up this time. Log - mc-mitm.log

This test should have been done with the original build I linked. The log indicates you used the second one, which doesn't show anything because the controllers aren't communicating via bluetooth. I wanted to prove that it was working on your console for official Nintendo controllers before digging further into why the Hori isn't working.

xMounirV commented 11 months ago

I do have regular joycons, OEM and thirdparty. I'll try those with this build in a smidge. Here's the log with the new build, Split Pad Pro Compact. Just moved around on the menu a bit - no lock up and controls were responsive. Log: mc-mitm.log

Hmm, no bluetooth communication either. I guess they are using UART then. Now the question is why things aren't working. I guess I'll have to add some additional logging.

Here's the log with OEM JoyCons. Airplane mode was on for both of these tests, but both controllers were responsive and the Switch didn't lock up this time. Log - mc-mitm.log

This test should have been done with the original build I linked. The log indicates you used the second one, which doesn't show anything because the controllers aren't communicating via bluetooth. I wanted to prove that it was working on your console for official Nintendo controllers before digging further into why the Hori isn't working.

Please is there any updates for this topic, As someone who is used to the XBOX buttons layout, it's a huge struggle to play with A and B swapped. Please is there's anyway possible to fix this problem even if it's not free.

PlanetEarth3DDesign commented 3 months ago

I have purchased "hoki split pad pro" and have a switch with latest home-brew firmware's and competent enough to dump files as explained above. i would like to help, i use Mission Control with my Xbox controller and works great :) to also get the "hoki split pad pro" to work would be great. ill be checking notification and post daily in hope of a response for what is needed the post is a year old so i expect the procedure or needs have changed

ndeadly commented 3 months ago

It's been some time since I looked into this, kinda forgot about it.

Here's an updated build that will run on the latest firmware (you'll need your atmosphere to be up to date). Install it, reboot, make sure the controller is responding, and then grab the log (sdmc/:mc-mitm.log) that it creates and share it here. You won't be able to get it while the console is running, so you'll either need to boot into hekate and use USB transfer, or shut down your console and read the SD card externally.

MissionControl-0.11.1-uart-mitm-c961675.zip

xMounirV commented 3 months ago

My apologies in advance if this is in the wrong place. Horis aren't Bluetooth controllers so I wasn't sure if this fit the criteria as something that could be supported if not, sorry for the trouble and have a good one!

At LAST we have a solution , you can use this to swap buttons for the Hori split pad just by copying the files to your switch, its very easy, yu can see the full topic here https://github.com/stunndard/Nintendo_Switch_Button_Remap

ndeadly commented 3 months ago

My apologies in advance if this is in the wrong place. Horis aren't Bluetooth controllers so I wasn't sure if this fit the criteria as something that could be supported if not, sorry for the trouble and have a good one!

At LAST we have a solution , you can use this to swap buttons for the Hori split pad just by copying the files to your switch, its very easy, yu can see the full topic here https://github.com/stunndard/Nintendo_Switch_Button_Remap

This seems like a pretty mediocre solution to the problem tbh. It relies on patching the hid module, so it must be updated with every new firmware, applies to all controllers, and is not configurable in any way.

If someone can get me a proper log of the hori pad connecting to the console it should be possible to mitm uart and make it look like the original joycons, unlocking the full button remapping options offered to official Nintendo controllers.

xMounirV commented 2 months ago

My apologies in advance if this is in the wrong place. Horis aren't Bluetooth controllers so I wasn't sure if this fit the criteria as something that could be supported if not, sorry for the trouble and have a good one!

At LAST we have a solution , you can use this to swap buttons for the Hori split pad just by copying the files to your switch, its very easy, yu can see the full topic here https://github.com/stunndard/Nintendo_Switch_Button_Remap

This seems like a pretty mediocre solution to the problem tbh. It relies on patching the hid module, so it must be updated with every new firmware, applies to all controllers, and is not configurable in any way.

If someone can get me a proper log of the hori pad connecting to the console it should be possible to mitm uart and make it look like the original joycons, unlocking the full button remapping options offered to official Nintendo controllers.

hmmm you have a point there, sorry for the late replay, what can I do to get that log ?

ndeadly commented 2 months ago

These builds create a log on your SD card (sdmc:/mc-mitm.log). I need a capture showing these controllers communicating with the console

xMounirV commented 2 months ago

These builds create a log on your SD card (sdmc:/mc-mitm.log). I need a capture showing these controllers communicating with the console

Here it is, thank you for your help mc-mitm.log But I have a Question should I remove those file after, or it creates log only one time

ndeadly commented 2 months ago

Thanks, will look at it later. You can leave it. The log is created if it doesn't exist, otherwise it will add a new timestamp and append to the existing one

ndeadly commented 2 months ago

These builds create a log on your SD card (sdmc:/mc-mitm.log). I need a capture showing these controllers communicating with the console

Here it is, thank you for your help mc-mitm.log But I have a Question should I remove those file after, or it creates log only one time

Was the controller actually working here? After the first few commands it just seems to be spamming the same thing over and over. Doesn't look like HID data either.

xMounirV commented 2 months ago

yes it was working, I have launched the latest atmosphere 1.7.1 with Hekate, latest switch firmware 18.1.0 controller was working and tested, then I turned off the device, BUT, I was using the remap files found here https://github.com/stunndard/Nintendo_Switch_Button_Remap could that be the problem ?

ndeadly commented 2 months ago

yes it was working, I have launched the latest atmosphere 1.7.1 with Hekate, latest switch firmware 18.1.0 controller was working and tested,

Very strange I can't see the inputs I'm expecting, then

BUT, I was using the remap files found here https://github.com/stunndard/Nintendo_Switch_Button_Remap could that be the problem ?

No, that's applied well after the data we're messing with has been processed.

Try with this one and share the log again MissionControl-0.11.1-uart-mitm-logging-e2b74b1.zip

xMounirV commented 2 months ago

yes it was working, I have launched the latest atmosphere 1.7.1 with Hekate, latest switch firmware 18.1.0 controller was working and tested,

Very strange I can't see the inputs I'm expecting, then

BUT, I was using the remap files found here https://github.com/stunndard/Nintendo_Switch_Button_Remap could that be the problem ?

No, that's applied well after the data we're messing with has been processed.

Try with this one and share the log again MissionControl-0.11.1-uart-mitm-logging-e2b74b1.zip

Here is the file mc-mitm.log But something is wierd, this time the controller is not working correctly, the left jocon doesn't work unless I unplug the right one

xMounirV commented 2 months ago

I have just noticed thast you're the developer of mission control, dude thank you so much for your work, you're amazing

ndeadly commented 2 months ago

Ah damn, I messed up one of my logging statements and it doesn't print the outgoing data. Sorry! Could you try this one?

MissionControl-0.11.1-uart-mitm-logging-b9501c3.zip

But something is wierd, this time the controller is not working correctly, the left jocon doesn't work unless I unplug the right one

It's probably not happy about the increased logging. I think there are timeouts when waiting to receive data. I'm only interested in the first few packets exchanged, so it should be ok I think.

I have just noticed thast you're the developer of mission control, dude thank you so much for your work, you're amazing

Who else did you think was making you test unreleased development builds? :p

xMounirV commented 2 months ago

Who else did you think was making you test unreleased development builds? :p

Here it is mc-mitm.log same issue, only one joycon is working at a time.

ndeadly commented 2 months ago

I still don't really understand how this thing is sending data. I'm not logging any of the HID protocol I see with my joycons.

Try this one, it's filtering most of the packets out so it shouldn't interfere with the operation of the controllers so much

MissionControl-0.11.1-uart-mitm-logging-3d69383.zip

ndeadly commented 2 months ago

After a bit of thought (and reverse engineering) I think i know what's going on. It seems the console has another input mode that bypasses the usual controller hid protocol and just starts sending inputs directly. Unfortunately, this probably means that we can't easily just pretend it's a regular joycon and unlock the inbuilt remapping feature.

But that doesn't stop us from remapping manually. Give this build a try. Working on assumptions about the input layout, I'm remapping this alternative input format to the Xbox layout. There's no logging in this one, so just let me know how it goes.

MissionControl-0.11.1-uart-mitm-9f32b28.zip

xMounirV commented 2 months ago

MissionControl-0.11.1-uart-mitm-9f32b28.zip

Tested, remaping is done, but both joycons have some wierd issue of disconnecting when the joysticks are moved and held to the right direction..... BUT thank you for your effort and time,

ndeadly commented 2 months ago

That's strange, disconnection implies that maybe the checksums aren't being recomputed correctly, but then I would expect it to fail for the remapped buttons too. Do you mean it only disconnects when you push the sticks to the right (+X direction) and not the others?

xMounirV commented 2 months ago

That's strange, disconnection implies that maybe the checksums aren't being recomputed correctly, but then I would expect it to fail for the remapped buttons too. Do you mean it only disconnects when you push the sticks to the right (+X direction) and not the others?

Yes that's exactly what happens, on both joycons, when I move the stick to the right direction (and only the right) the joycon disconnects. But the remaping of buttons as Xbox worked fine. Dude I don't want to waste your time anymore, I know you're a developer and your time is precious. The solution I mentionned before is working fine the only downside of it is it needs an update with every switch new firmware. But if you want to continue this work, I'm really happy to help