Reading SNES gamepad on NES console?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
EriknocTDW
Posts: 2
Joined: Mon May 24, 2021 7:37 pm

Reading SNES gamepad on NES console?

Post by EriknocTDW »

Has anyone tried doing this yet? I know most people would just stick to programming for the standard NES gamepad. But, wouldn’t it be nice to have game code on the NES to make use of the extra buttons available with the SNES gamepad? Normally you would stop polling after 8 bits. Is there anything stopping us from polling 16 bits with the SNES gamepad plugged in? Would there even be a way to detect if an SNES gamepad was connected vs the standard NES gamepad? Maybe the best solution would be to provide an option to the player to select between “NES Gamepad” and “SNES Gamepad”, with the default being NES, and if SNES is selected, you would call your code that handles SNES input polling and device detection.

SNES controller to NES adapter
https://www.raphnet-tech.com/products/s ... /index.php
User avatar
freem
Posts: 176
Joined: Mon Oct 01, 2012 3:47 pm
Location: freemland (NTSC-U)
Contact:

Re: Reading SNES gamepad on NES console?

Post by freem »

The wiki has a page on the SNES controller, along with a page on controller detection.

If you prefer a real world example, check out tepples' allpads-nes.
poorstudenthobbyist
Posts: 252
Joined: Fri Jun 24, 2016 4:20 pm

Re: Reading SNES gamepad on NES console?

Post by poorstudenthobbyist »

This isn't exactly what you're describing, but I had the idea to make a wireless/Bluetooth controller that had a mode switch on it, with to two separate receivers (one in the NES and one in the SNES). Depending on the switch position, it would send commands to either console. The SNES essentially uses 16 bits in a shift register to communicate button presses, with the first 8 being identical to the NES. So my thought was that the uC would send either the whole 16 to the SNES receiver or just the first 8 to the NES receiver.

I never got around to trying it out, but I did get both a wireless NES and SNES controller working, so it'd be relatively easy to implement. It's still on my list of things to do.
gigi5
Posts: 12
Joined: Tue Nov 07, 2017 5:37 pm

Re: Reading SNES gamepad on NES console?

Post by gigi5 »

A few days ago, I have make it on BATMAN , with L and R for change weapon
Last edited by gigi5 on Wed May 26, 2021 7:27 am, edited 3 times in total.
gigi5
Posts: 12
Joined: Tue Nov 07, 2017 5:37 pm

Re: Reading SNES gamepad on NES console?

Post by gigi5 »

You can play with Raphnet pad's adaptater SNES>NES by example, or on emulator with by example FCEUX

PS: to do the checksum's calcul again for game on real NES
Attachments
Batman - The Video Game (USA) HACK SNES PAD.ips
(640 Bytes) Downloaded 67 times
EriknocTDW
Posts: 2
Joined: Mon May 24, 2021 7:37 pm

Re: Reading SNES gamepad on NES console?

Post by EriknocTDW »

@freem
I didn't see the "Controller detection" page at first. Thank you for pointing that out. I spent some more time navigating through the wiki to see how I could've missed it. Once I slowed down and read it more carefully, I managed to find it linked from the "Standard controller" page, with the accompanying text "has backward compatible protocol with the NES". I apologize for wasting everyone's time.

@poorstudenthobbyist
I personally have never been a fan of wireless technology, but regardless, it's still nice to see people developing new things for retro systems.

@gigi5
I tested out your Batman hack. L/R buttons work like a charm. :-)
puppydrum64
Posts: 160
Joined: Sat Apr 24, 2021 7:25 am

Re: Reading SNES gamepad on NES console?

Post by puppydrum64 »

So you can add extra functions and map them to SNES buttons? Or are you limited to duplicating button functions that are already built in to the game? Suppose I wanted to add a SNES controller option to my game that let you do extra commands that would normally require button combinations. Is that what gigi did for Batman?
Pokun
Posts: 2675
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Reading SNES gamepad on NES console?

Post by Pokun »

Yes the SNES controller works just like the NES controller but the report is 16 bits instead of 8 because of the extra buttons (the second nibble will be all 0 as there are only 12 buttons). There is no reason it wouldn't work on a NES, it's just that no NES games uses it (except for some homebrew and hacks of course).

Just continue to read 8 extra times for the 4 extra buttons and save them in a separate RAM register. SNES B and Y buttons are in the place of A and B on the NES controller, but that might be for the best as the layout matches (photos of early Super Famicom prototypes shows that B and Y was initially supposed to be called A and B, and many games like SMW uses them the same way as A and B is on the NES), A, X, L and R are the 4 new buttons and they come after the d-pad nibble.
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Reading SNES gamepad on NES console?

Post by NovaSquirrel »

EriknocTDW wrote: Tue May 25, 2021 2:37 amHas anyone tried doing this yet?
Yeah Nova the Squirrel will use the extra face button as alternatives for Up+B and Down+B if it detects a SNES controller.

Here's my code for determining what controller type is plugged in. I'm extra cautious here and read three bytes, because the wiki said some third party controllers don't read all 1s past the end of the valid data.
Post Reply