Controller port registers
From Nesdev wiki
NES
| Addr | 7654.3210 | Function |
|---|---|---|
| $4016 (W) | ----.---A | Output data (strobe) to both controllers. |
| ----.-CBA | Output data to the expansion port. | |
| $4016 (R) | ---4.3--0 | Read data from controller port #1. |
| ---4.3210 | Read data from expansion port. | |
| $4017 (R) | ---4.3--0 | Read data from controller port #2. |
| ---4.3210 | Read data from expansion port. |
Famicom
| Addr | 7654.3210 | Function |
|---|---|---|
| $4016 (W) | ----.---A | Output strobe to both controllers. |
| ----.-CBA | Output data to the expansion port. | |
| $4016 (R) | ----.-M-0 | Read data from controller #1 and microphone state from controller #2 |
| ----.--1- | Read data from expansion port. | |
| $4017 (R) | ----.---0 | Read data from controller #2. |
| ---4.3210 | Read data from expansion port. |