Controllers are surprisingly super easy to work with and a good gateway to some basic electronics hacking. I've actually gone the opposite direction from this post. I have a Neo Geo arcade board (JAMMA) and it has plugs for Neo Geo controllers (as in the controllers for the console version of the Neo Geo). I wanted to use the Neo Geo without plugging it into an arcade cabinet, so I got a "Supergun" board to play it o…
Building a USB SNES Controller
81–90 of 101 posts
Re: Building a USB SNES Controller
#82Controllers are surprisingly super easy to work with and a good gateway to some basic electronics hacking. I've actually gone the opposite direction from this post. I have a Neo Geo arcade board (JAMMA) and it has plugs for Neo Geo controllers (as in the controllers for the console version of the Neo Geo). I wanted to use the Neo Geo without plugging it into an arcade cabinet, so I got a "Supergun" board to play it o…
And I'll add my controller hacking as well: https://imgur.com/a/Mu43dqg As a poor college student, I home-built a dance pad for Dance Dance Revolution, out of wood and foil and by soldering the connections into a controller. Worked perfectly!
It probably worked better than a cheap 'soft' pad.
Re: Building a USB SNES Controller
#83Re: Building a USB SNES Controller
#84Re: Building a USB SNES Controller
#85Are there any implications of the polling rate not quite aligning as the original controller would've?
If for the sake of argument we are plugging this into an SNES emulator running at 60Hz, then the stack between the USB gamepad and the emulator already has to handle that the gamepad is not rigidly synced to the emulated SNES and will presumably take every input from the gamepad and use it as the emulated input to the SNES next time it asks, unless a new one comes in first. At slightly faster than 60Hz, the net effec…
Re: Building a USB SNES Controller
#86Is Arduino real-time? I.e. is a 6 millisecond delay guaranteed to actually be 6 milliseconds?
Most instructions for ATmega and ATtiny execute in 1 clock cycle so writing deterministic, time-critical code is straightforward.
Re: Building a USB SNES Controller
#87Earlier quoted context omitted.
And I'll add my controller hacking as well: https://imgur.com/a/Mu43dqg As a poor college student, I home-built a dance pad for Dance Dance Revolution, out of wood and foil and by soldering the connections into a controller. Worked perfectly!
I love this. It probably worked better than a cheap 'soft' pad.
Re: Building a USB SNES Controller
#88Earlier quoted context omitted.
The physical switches may actually bounce, so you might need some debounce logic, if it wasn't the shift register glitching out. It's pretty common for buttons to need this, often seen in keyboard firmware as well for similar reasons, the physical mechanism actually will oscillate a bit between states.
The way the NES and SNES work is that once per frame you read from the memory address mapped to the shift register to get all the bits out, one at a time. For certain inputs you only care if it's pressed now. Others you compare to previous state to see if it changed. Bounce could, theoretically, cause an input to be read as a non-input if it just bounced at exactly the wrong time, but it won't cause multiple inputs,…
Re: Building a USB SNES Controller
#89Controllers are surprisingly super easy to work with and a good gateway to some basic electronics hacking. I've actually gone the opposite direction from this post. I have a Neo Geo arcade board (JAMMA) and it has plugs for Neo Geo controllers (as in the controllers for the console version of the Neo Geo). I wanted to use the Neo Geo without plugging it into an arcade cabinet, so I got a "Supergun" board to play it o…
And one year later I also used a Raspberry Pi Pico to convert a USB controller's signals to MSX: https://blog.qiqitori.com/2023/09/using-a-usb-hid-game-contr...
(And later, USB controller to Nintendo Switch, https://blog.qiqitori.com/2023/09/playing-on-the-nintendo-sw...)
Re: Building a USB SNES Controller
#90Are there any implications of the polling rate not quite aligning as the original controller would've?
Yeah I too wondered why the author would target 60Hz at all. The fact that the SNES controller is polled at 60Hz is simply a consequence of the game reading the input at that rate. As mentioned in the other comment in this setup the polling of the controller is not in sync with the game reading the input at all. Thus even if you target a polling rate of 60Hz perfectly you'd actually have worse input latency than the…