How the NES & SNES controllers function: https://gamesx.com/wiki/doku.php?id=controls:nes_snes_controller
The link above contains controller port pinouts. Use a multimeter to identify the wires in the extension cable, as they differ by manufacturer.
- CD4021 (x2)
- Schottsky diodes (x2)
- SPDT switch (x1)
- 10k resistors (x16)
- Joystick (x1) AliExpress
- Buttons (x8) AliExpress
- NES controller extension cable (x1)
- SNES controller extension cable (x1)
Note: the Y button for SNES will be the B button for NES, and the B button for SNES will by the A button for NES.