What bits should the serial bootloader read from? The candidates for input are D0, D1, D2, D3, and D4 of the second controller port (we keep the first controller port free for a normal controller).
Supporting anything different than just D0 in the serial receive routine only adds a couple of extra instructions and isn't a problem. This allows it to receive serial on any one of the inputs, *as long as the other inputs stay idle (high)*. This is the case for D1-D4 when nothing is connected. For D0, if we set the controller latch to 1 (LDA #1; STA $4016), and nothing is pressing the A button, it will output high and not interfere.
Ideally we'd just connect to an unused data line (D2?), but this would require modification of the NES and an extra plug/cord coming out since it's not on the controller port. So we allow connection through the controller port. Some information about what pins are available and limitations:
* D0 seems like a must, to allow normal NES controller cables to be modified for this.
* D1 would be useful to allow modification of an external Famicom controller cable, which definitely connects D1 but may not connect to others (as with D0 on NES controller cables).
* D2 is nice because no controllers use it.
* D4 allows modification of a NES extension cable to pass through D0 to a second controller, and route D4 to serial, so you can have two controllers while doing PC communication. And it's available on expansion ports. Since I believe only the Zapper uses this, it would be a minor conflict. It should be solvable, as the Zapper just uses this for the trigger, so as long as the trigger isn't pressed while the PC is sending data, they wouldn't conflict.
Currently I have D0, D1, D2, and D4 specified, but this seems like an overkill. Having this many also seems risky because each one opens the opportunity for possible conflict; if anything is connected that generates a signal, it will confuse the bootloader so that it doesn't work.
At this point D0 and D4 seem like a good set. This allows using a normal NES controller cable, working on the Famicom with its built-in controllers, making a pass-through cable for a second controller on the NES, and connecting to the NES/Famicom expansion ports.
Supporting anything different than just D0 in the serial receive routine only adds a couple of extra instructions and isn't a problem. This allows it to receive serial on any one of the inputs, *as long as the other inputs stay idle (high)*. This is the case for D1-D4 when nothing is connected. For D0, if we set the controller latch to 1 (LDA #1; STA $4016), and nothing is pressing the A button, it will output high and not interfere.
Ideally we'd just connect to an unused data line (D2?), but this would require modification of the NES and an extra plug/cord coming out since it's not on the controller port. So we allow connection through the controller port. Some information about what pins are available and limitations:
- The NES controller port exposes D0, D3, and D4.
- The expansion ports of the NES and Famicom expose D0, D1, D2, D3, and D4.
- The second Famicom controller is hardwired to D0.
- Many NES controller/extension cables only connect to D0, not D3 or D4.
- NES expansion port connectors aren't very available AFAIK.
- External Famicom controllers use D1.
* D0 seems like a must, to allow normal NES controller cables to be modified for this.
* D1 would be useful to allow modification of an external Famicom controller cable, which definitely connects D1 but may not connect to others (as with D0 on NES controller cables).
* D2 is nice because no controllers use it.
* D4 allows modification of a NES extension cable to pass through D0 to a second controller, and route D4 to serial, so you can have two controllers while doing PC communication. And it's available on expansion ports. Since I believe only the Zapper uses this, it would be a minor conflict. It should be solvable, as the Zapper just uses this for the trigger, so as long as the trigger isn't pressed while the PC is sending data, they wouldn't conflict.
Currently I have D0, D1, D2, and D4 specified, but this seems like an overkill. Having this many also seems risky because each one opens the opportunity for possible conflict; if anything is connected that generates a signal, it will confuse the bootloader so that it doesn't work.
At this point D0 and D4 seem like a good set. This allows using a normal NES controller cable, working on the Famicom with its built-in controllers, making a pass-through cable for a second controller on the NES, and connecting to the NES/Famicom expansion ports.