Joypad: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
{{8BitRegister|-|4|P2 Select|1|P2 Start|1|P1 Select|1|P2 Start|1}} | {{8BitRegister|-|4|P2 Select|1|P2 Start|1|P1 Select|1|P2 Start|1}} | ||
The | The [[SYSTEM_IO]] ($C0044A) [[BIOS calls|BIOS call]] can be used to read joypads more easily: it sets values in the BIOS's RAM space which gives currently pressed, state change, and "repeat" values for both joypads. Need details... | ||
[[Category: controllers]] | [[Category: controllers]] |
Revision as of 02:34, 12 July 2011
Joypads have 4 directions and 4 buttons contacts.
Registers used to read the button's states directly (all bits are active low):
- REG_P1CNT ($300000), Player 1:
- REG_P2CNT ($340000), Player 2:
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Def | D | C | B | A | Right | Left | Up | Down |
- REG_STATUS_B ($380000), SELECTs and STARTs:
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Def | - | P2 Select | P2 Start | P1 Select | P2 Start |
The SYSTEM_IO ($C0044A) BIOS call can be used to read joypads more easily: it sets values in the BIOS's RAM space which gives currently pressed, state change, and "repeat" values for both joypads. Need details...