BetterJoy icon indicating copy to clipboard operation
BetterJoy copied to clipboard

[ENHANCEMENT] Support for Switch Nintendo NES controllers

Open sprudel79 opened this issue 4 years ago • 12 comments

Hi everyone,

I would like to request the support for the official Nintendo NES controllers for the Switch (see here https://mynintendostore.nintendo.de/nintendo-entertainment-system-controllers.html) similar to the Nintendo SNES controllers for the Switch.

I am able to pair my NES controllers in the similar way as the SNES ones, they are also detected by BetterJoy as JoyCons but I am running in the "Duplicate timestamp enqueued" issue then. I have followed already the instructions at https://github.com/Davidobot/BetterJoy/wiki/HIDGuardian-and-Steam-(Big-Picture) but without any success so they are not yet usable.

Since the NES controllers are not mentioned on the project landing page I think they haven't just been officially supported.

Thanks and best regards, Sprudel

sprudel79 avatar Feb 10 '21 09:02 sprudel79

Hi!

The SNES support was done by @KurtYilmaz , the NES controllers aren't officially supported. Unfortunately, unless I have the controllers myself, I can't really provide any guarantees for making them work and/or adding support.

Davidobot avatar Feb 10 '21 09:02 Davidobot

Thanks @Davidobot for your answer. Ok, so then it is as I had assumed in my first post. I would like to offer a donation in that case so you could buy them since they are still available (in contrast to the SNES ones). Please let me know what you think (you can also ping me directly). Thanks!

sprudel79 avatar Feb 10 '21 12:02 sprudel79

Thank you for your offer - I'm afraid I would have to decline it at the moment. I would really love to spend more time on this project, but it's not a monetary matter at this point, but a time and priority one.

I'm a bit flooded with university work and other personal projects at the moment, so I am really struggling to dedicate any useful time to BetterJoy. Thank you for the offer - I really appreciate it :)

If I manage to get back into this project, I'll do my best to get NES controller support!

Davidobot avatar Feb 10 '21 13:02 Davidobot

Thanks for your honest answer which I am fine with of course. So once you find some time you can reach out to me so I can support (in whatever way). Thanks again and all the best with your university work.

sprudel79 avatar Feb 10 '21 14:02 sprudel79

Hi @Davidobot , fast forward 2 years later, and I'd love to inquire if your time has loosened any to maybe consider adding NES support to your wonderful program?

Ozy311 avatar Jan 08 '23 06:01 Ozy311

Another 2 years later, just got some imported famicom controllers, can't get them to connect to PC properly without betterjoy. And with betterjoy, there are constant inputs that make mapping on emulators or joy2key impossible, thus making the controllers unusable.

I would appreciate any alternatives that support the NSO NES/Famicom controllers for Windows.

PRGilland avatar Jan 25 '25 23:01 PRGilland

Another few months later, and emboldened by my moderate C# skill, this comment made several years ago, and a general lack of common sense, I've decided to see if I can actually make this work. I got some NES controllers connected so take a peek at their hardware IDs, and I have some bad news. Looks like they are keyed the same as right joycons, see the following two screenshots for the two NES controllers I hooked up (and before you ask, yes they were a matched pair, one connects to the left and one to the right, they even show up as left and right in my device manager, but their HARDWARE IDS match that of a right joycon).

NES controllers:

Image

Image

A standard right joycon for comparison:

Image

There must be some other way the switch is able to recognize them. I will play around a bit more and hope that I find something useful.

ConnorS-P avatar Apr 12 '25 03:04 ConnorS-P

Ok, so I think I might know what's happening. Still in early stages. In this function, calibration data is used to determine which direction the controller stick is pointing. Now normally, this is all well and good, but in the case of the nes controllers (at least the ones that I have) the calibration data is such that the math in this function indicates the stick is pointed in a particular direction, when indeed it is not, as there is no stick! Here is the calibration data for a normal right joycon at rest: Image

Which resolves to an axis state of [0, 0].

The NES controller configs on the other hand are:

(Right)

Image

(Left) [but remember, this is still resolved as a "right" joycon]

Image

Which resolve to axis states of [-1, -1] in both cases. I assume this accounts for the spammed inputs.

I see a section that accepts some kind of user calibration instead of the stock one. Going to try to figure out how to set that, and failing that try out a little hack to set the stick input to zero if this specific array of calibrations is found.

ConnorS-P avatar Apr 12 '25 05:04 ConnorS-P

Ok, well, I quickly abandoned the user calibration idea and tried a little hack to return a [0, 0] position of the axis states if the nes calibration data was found. This... almost worked. The dpad is completely non-functional (~~which in hindsight, had I thought about it for more then 2 seconds, OF COURSE the dpad is mapped to the control stick axis.~~ This is not the case.) Also for some reason the left shoulder button doesn't work? Not sure what that's about.

ConnorS-P avatar Apr 12 '25 06:04 ConnorS-P

I'm digging in a lot further, but what started out as a rather small addition is turning into a bit of a refactor. Not sure how much time will have to work on all this, but I will try to get something out the door at some point.

ConnorS-P avatar Apr 13 '25 02:04 ConnorS-P

I'm not dead, and I'm still working on this. The refactor is getting close to complete. Then adding in more controllers should be super easy. I'll try to add in the Genesis while I'm at it. I've also got some Famicom, Super Famicom, and Mega Drive controllers on order. I'll try to make them all work.

There will need to be lots of testing after the refactor just to make sure I didn't break anything. I'll test as much as I can on my own.

ConnorS-P avatar May 14 '25 17:05 ConnorS-P

Ok, well, rather than force everyone to wait on me touching basically everything and the massive undertaking testing that will entail, I decided to just go ahead and put together a simple fix now that I actually understand the code.

https://github.com/Davidobot/BetterJoy/pull/1220

ConnorS-P avatar May 15 '25 23:05 ConnorS-P