I’ve programmed the below in BASCOM-AVR and tested with an ATTINY2313. Potentially there are cheaper/smaller AVRs that will suffice, but the IC is already pretty cheap and plentiful. This code is also quite long (not complex, but repetitive) so it takes up more program space than usual. You can program the BASCOM code easily onto a ATTINY2313 with the cheap, yet powerful, TL866II Plus.
There is only three data wires on the controller to be concerned with; you can of course change what pins you want to use but in my actual PCB design these pins are most convenient for routing.
- Latch (connect to A0)
- Clock (connect to A1)
- Serial (connect to D5)
All the parallelized data will be put on Pins B0 through B7 and D0 through D3. Again, you can of course change this easily, I just chose those for routing purposes.
The basic operation of the SNES controller is that it awaits for a latch pulse (12uS wide, issued by the ATTINY) and then the controller transmits back the state of the buttons (pressed or not) via shift registers over serial - 16 such data points (first 12 only matter though, last 4 are dummy points). The clock pulses issued from the ATTINY to the controller are what ‘setup’ and ‘shift’ these values over serial such that you then sample theses serial pulses with the ATTINY and dump them out in parallel.
It’s also worth noting, I use the term parallel, but it’s really pseudo-parallel… the output pins are set in sequence, but this happens so fast the data is “staged” well in advance of when the Neo Geo will ask for it, thus it appears as parallel from the Neo Geo perspective.
Code below is released under MIT licence!
I have mapped the SNES controller buttons to match that of the newer Neo Geo mini controller, which many people are saying is a better layout than the original controller. It makes sense, if you look at an MVS cabinet, A&B and C&D are next to eachother, which are usually pushed simultaneously for specific moves. The mini controller layout makes it easier to press those buttons at the same time with your thumb, whereas the traditional controller layout made it difficult.
Controller comparison (base photo credit @metaljesusrocks):