@sebastianangel
I may be able to help some. I am familiar with 6502 assembly coding, just not with the NES or SNES specifically.
From what I understand, reading the SNES controller isn't much different from reading the NES controller.
NES -->
https://wiki.nesdev.com/w/index.php?title=Controller_reading_codeNES controller detection -->
https://wiki.nesdev.com/w/index.php?title=Controller_detectionSNES -->
https://wiki.nesdev.com/w/index.php?title=SNES_controllerSNES hardware ID codes -->
http://problemkaputt.de/fullsnes.htm#snescontrollershardwareidcodesThe only difference is in the contents of the successive controller byte reads. On the NES, the 2nd and 3rd bytes would be all 1's which confirm it's an NES gamepad. On the SNES, the 2nd byte's upper nibble (bits 4-7) is part of the device ID info, where:
NES
Byte1: Right, Left, Down, Up, Start, Select, B, A
Byte2: 8x 1's = #$FF if connected || 8x 0's = #$00 if not connected(?)
Byte3: 8x 1's = #$FF if connected || 8x 0's = #$00 if not connected(?)
SNES
Byte1: Right, Left, Down, Up, Start, Select, Y, B
Byte2: 4x 0's (high nibble), R, L, X, A
Byte3: 8x 1's = #$FF if connected || 8x 0's = #$00 if not connected
I believe something like this would work for detecting which gamepad is plugged in:
;Shift in 3 bytes of controller info
;Anything connected?
LDA Byte3
BEQ Nothing_connected
CMP #$FF
BNE Not_a_gamepad
;NES or SNES?
LDA Byte2
CMP #$FF
BEQ NES_gamepad
;Check SNES ID
AND #$F0 ;ignore any button presses from A,X,L,R
BEQ SNES_gamepad
;Unsupported device!
Not_a_gamepad: