Standard controller: Difference between revisions

From SNESdev Wiki
Jump to navigationJump to search
(standard controller)
 
(Notes the read behavior past first 16 reads.)
Line 21: Line 21:


The signature is guaranteed to be 0000 for a standard SNES controller. Finding another value here indicates that a different peripheral is plugged in.
The signature is guaranteed to be 0000 for a standard SNES controller. Finding another value here indicates that a different peripheral is plugged in.
Additional reads past the first 16 return 1's on official controllers.


The first 8 bits of this report are identical to the NES controller, with SNES Y and B substituted for NES B and A. This offers potential compatibility with an NES controller through an adapter, though the game would have to ignore the extra buttons and signature which would normally report as all 1s from an NES controller.
The first 8 bits of this report are identical to the NES controller, with SNES Y and B substituted for NES B and A. This offers potential compatibility with an NES controller through an adapter, though the game would have to ignore the extra buttons and signature which would normally report as all 1s from an NES controller.


The first two controllers report through JOYSER0 ($4016) D0 and JOYSER1 ($4017) D0, and a 4-player multitap will also report two more controllers through D1, similar to simple Famicom 4-player adapters. All 4 reports can be delivered by the automatic read system to JOY1-4.
The first two controllers report through JOYSER0 ($4016) D0 and JOYSER1 ($4017) D0, and a 4-player multitap will also report two more controllers through D1, similar to simple Famicom 4-player adapters. All 4 reports can be delivered by the automatic read system to JOY1-4.

Revision as of 23:37, 25 May 2022

The standard controller reports 16 bits of data.

See: Controller reading

If using the automatic read, the reports will be available at JOY1, etc.

   JOY1H       JOY1L
   $4219       $4218
15  bit  8   7  bit  0
 ---- ----   ---- ----
 BYsS UDLR   AXlr 0000
 |||| ||||   |||| ||||
 |||| ||||   |||| ++++- Signature
 |||| ||||   ||++------ L/R shoulder buttons
 |||| ||||   ++-------- A/X buttons
 |||| ++++------------- D-pad
 ||++------------------ Select (s) and Start (S)
 ++-------------------- B/Y buttons

If manually reading through JOYSER0, these bits are delivered starting with the most significant bit (B button).

The signature is guaranteed to be 0000 for a standard SNES controller. Finding another value here indicates that a different peripheral is plugged in.

Additional reads past the first 16 return 1's on official controllers.

The first 8 bits of this report are identical to the NES controller, with SNES Y and B substituted for NES B and A. This offers potential compatibility with an NES controller through an adapter, though the game would have to ignore the extra buttons and signature which would normally report as all 1s from an NES controller.

The first two controllers report through JOYSER0 ($4016) D0 and JOYSER1 ($4017) D0, and a 4-player multitap will also report two more controllers through D1, similar to simple Famicom 4-player adapters. All 4 reports can be delivered by the automatic read system to JOY1-4.