If you mean the joypad register, I have a rough idea of how it works(I got the Start button working
).
Here's an extract from one of the documents:
FF00
Name - P1
Contents - Register for reading joy pad info
and determining system type. (R/W)
Bit 7 - Not used
Bit 6 - Not used
Bit 5 - P15 out port
Bit 4 - P14 out port
Bit 3 - P13 in port
Bit 2 - P12 in port
Bit 1 - P11 in port
Bit 0 - P10 in port
This is the matrix layout for register $FF00:
P14 P15
| |
P10-------O-Right----O-A
| |
P11-------O-Left-----O-B
| |
P12-------O-Up-------O-Select
| |
P13-------O-Down-----O-Start
| |
These are all reversed(0 means on, 1 means off). If bit 5 is 0, that means P15 has been turned on. If P15 is turned on, you take the corresponding buttons and put their on/off status in the appropriate bit.
For instance, if I pressed the Start button and P15 was off. I would turn off the P13 bit(remember, off means on). If I pressed Down while P14 was turned off, the P13 bit would also be turned off. The programs can only get the status of 4 buttons at a time. They usually turn on P15, get the keys, then turn on P14, get the keys, and then combine them. This is how I understand it as of right now. There is also an interrupt that is called, I think it's when P10-P13 change.
Here's an extract from one of the documents:
FF00
Name - P1
Contents - Register for reading joy pad info
and determining system type. (R/W)
Bit 7 - Not used
Bit 6 - Not used
Bit 5 - P15 out port
Bit 4 - P14 out port
Bit 3 - P13 in port
Bit 2 - P12 in port
Bit 1 - P11 in port
Bit 0 - P10 in port
This is the matrix layout for register $FF00:
P14 P15
| |
P10-------O-Right----O-A
| |
P11-------O-Left-----O-B
| |
P12-------O-Up-------O-Select
| |
P13-------O-Down-----O-Start
| |
These are all reversed(0 means on, 1 means off). If bit 5 is 0, that means P15 has been turned on. If P15 is turned on, you take the corresponding buttons and put their on/off status in the appropriate bit.
For instance, if I pressed the Start button and P15 was off. I would turn off the P13 bit(remember, off means on). If I pressed Down while P14 was turned off, the P13 bit would also be turned off. The programs can only get the status of 4 buttons at a time. They usually turn on P15, get the keys, then turn on P14, get the keys, and then combine them. This is how I understand it as of right now. There is also an interrupt that is called, I think it's when P10-P13 change.
Last edited: