Multitap

From SNESdev Wiki
Revision as of 20:50, 29 May 2022 by Rainwarrior (talk | contribs) (multitap)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The SNES had a standard 5-player multitap accessory.

A standard controller is used in port 1, and the multitap device is plugged into port 2. The device has 4 ports of its own to connect 4 more standard controllers.

The standard version of the multitap accessory has a 2-player / 5-player switch which can be used to disable the multitap and become a direct passthrough for the 2nd player controller plugged into its own port 2. With this switch set, the difference between a multitap and a directly connected second controller is not detectable.

The SNES Development Manual forbids using a Mouse or SuperScope with the multitap, and even suggests giving the user a warning if these are detected.

Interface

The high bit of WRIO ($4021) controls whether to read from multitap ports 2 and 3, or 4 and 5:

  • $4021.7 = 1: select ports 2/3
  • $4021.7 = 0: select ports 4/5

Normally $4012.7 should be kept at 1 most of the time, so that automatic read can be used for controllers 2 and 3.

The reported bits for each controller are in the same order as with the standard controller, but over JOYSER1 ($4017) on both data lines D0 and D1.

The multitap reports extend the report of each controller with 1 extra bit indicating whether a controller is connected (1) or not (0). This allows you to read the 17th bit to check for the presence of each multitap controller.

Outputs:

  • Controller 1: $4106 D0 bits 0-15 (auto: JOY1)
  • Controller 2: $4017 D0 bits 0-15 (auto: JOY2)
  • Controller 3: $4017 D1 bits 0-15 (auto: JOY4)
  • Controller 4: $4017 D0 bits 17-32 (serial)
  • Controller 5: $4016 D1 bits 17-32 (serial)

Using the automatic read functionality with $4021.7 set, controllers 1, 2 and 3 will be read to JOY1, JOY2, and JOY4. (Note that JOY3 is not used, as it corresponds to $4016 D1.)

Reading

  1. Set $4021.7 to 1 to select ports 2/3, if not already set.
  2. Allow automatic-read to read the first 16 bits of controllers 1, 2 and 3.
    1. Without auto-read: strobe $4016 and read the first 16 bits serially.
  3. Wait for automatic read to finish. (Poll HBVJOY bit 0.)
  4. Read $4017 one extra time for the 17th bit, indicating whether controllers 2 and 3 are connected.
  5. Set $4021.7 to 0 to select ports 4/5.
  6. Read the 16-bit report for controllers 4 and 5.
  7. Read the 17th bit to detect whether controllers 4 and 5 are connected.
  8. Return $4021.7 to 1 to select ports 2/3 for the next frame.

References