Joypad: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
m (moved Joypads to Joypad)
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
Need picture and clear bit definitions of registers.
Regular NeoGeo joypads or joysticks have 4 directions and 6 button switches.


Registers used to read the button's states directly:
Registers used to read the switches states are {{Reg|REG_P1CNT}}, {{Reg|REG_P2CNT}}, and {{Reg|REG_STATUS_B}}.
*REG_P1CNT ($300000), byte for DCBARLDU of player 1.
*REG_P2CNT ($340000), byte for DCBARLDU of player 2.
*REG_STATUS_B ($380000), byte for xxxx Select2 Start2 Select1 Start2.


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 [[SYSTEM_IO]] ($C0044A) [[BIOS calls|BIOS call]] can be used to read inputs more easily: it sets values in the [[BIOS_RAM_locations|BIOS RAM]] which gives currently pressed, state change, and repeat values for both joypads ports.


[[Category: controllers]]
Only one output is used: [[Pinouts|OUT3]], which is connected to the D button input. This loop is used for detection (D = 0 if OUT3 = 1).
 
==NeoGeo CD joypads==
 
[[File:G9pinout.png|right|thumb|"G9" internal schematic. Pin 2 is ground, 1 and 3 are buttons, 4 and 5 are port inputs.]]
 
[[File:Ngcdpad.jpg|400px]]
 
The NeoGeo CD joypads use membrane switches and springs for the 4 directions (replacement part ?) which directly set the corresponding inputs to ground.
 
The buttons are buffered with 3 dual NPN "digital transistors" marked G9, providing good press detection even if the carbon contacts have high resistance.
 
[[Category:Base system]]
[[Category:Controllers]]

Latest revision as of 22:53, 22 June 2016

Regular NeoGeo joypads or joysticks have 4 directions and 6 button switches.

Registers used to read the switches states are REG_P1CNT, REG_P2CNT, and REG_STATUS_B.

The SYSTEM_IO ($C0044A) BIOS call can be used to read inputs more easily: it sets values in the BIOS RAM which gives currently pressed, state change, and repeat values for both joypads ports.

Only one output is used: OUT3, which is connected to the D button input. This loop is used for detection (D = 0 if OUT3 = 1).

NeoGeo CD joypads

"G9" internal schematic. Pin 2 is ground, 1 and 3 are buttons, 4 and 5 are port inputs.

The NeoGeo CD joypads use membrane switches and springs for the 4 directions (replacement part ?) which directly set the corresponding inputs to ground.

The buttons are buffered with 3 dual NPN "digital transistors" marked G9, providing good press detection even if the carbon contacts have high resistance.