Joypad: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
m (moved Joypads to Joypad)
mNo edit summary
Line 1: Line 1:
Need picture and clear bit definitions of registers.
Joypads have 4 directions and 4 buttons contacts.


Registers used to read the button's states directly:
Registers used to read the button's states directly (all bits are active low):
*REG_P1CNT ($300000), byte for DCBARLDU of player 1.
*'''REG_P1CNT''' ($300000), Player 1:
*REG_P2CNT ($340000), byte for DCBARLDU of player 2.
*'''REG_P2CNT''' ($340000), Player 2:
*REG_STATUS_B ($380000), byte for xxxx Select2 Start2 Select1 Start2.
{{8BitRegister|D|1|C|1|B|1|A|1|Right|1|Left|1|Up|1|Down|1}}
*'''REG_STATUS_B''' ($380000), SELECTs and STARTs:
{{8BitRegister|-|4|P2 Select|1|P2 Start|1|P1 Select|1|P2 Start|1}}


A [[BIOS Calls|BIOS call]] can be used to read joypads more easily. The call sets values in the BIOS's RAM space which gives currently-pressed, state-change, and "repeat" values for both joypads.
The '''BIOSF_VBL''' ($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 06:00, 8 March 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 CBARightLeftUpDown
  • REG_STATUS_B ($380000), SELECTs and STARTs:
Bit 7 6 5 4 3 2 1 0
Def - P2 SelectP2 StartP1 SelectP2 Start

The BIOSF_VBL ($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...