|
Nice work. :)
It took me a moment, but I see how it works now.
Reading the controller increments the counter, and strobing it from 1 to 0 puts the counter value on the PC port's data register. It sounds simple enough to work!
If X can be 0-7, then we're working with 3 bits. In that case we'd have a 3-step process for sending a byte, with one extra bit in the 3rd transfer that we could use a parity bit for the byte.
I'll write some NES code to work with this shortly. And I'll try to figure out a handshaking procedure that won't conflict with any NES accessories or some unpredictable conditions.
I figure the logical thing to do is use the interface with the 2nd port on the NES. The only difference is that the reads will go to $4017. This thing should work on any NES, Famicom, and probably even SNES port. (SNES also has the same registers at $4016 and $4017)
|