summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/nes_ctrl/joypad.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/bus/nes_ctrl/joypad.c')
-rw-r--r--src/emu/bus/nes_ctrl/joypad.c63
1 files changed, 31 insertions, 32 deletions
diff --git a/src/emu/bus/nes_ctrl/joypad.c b/src/emu/bus/nes_ctrl/joypad.c
index 538235e7cf5..9d1a853901b 100644
--- a/src/emu/bus/nes_ctrl/joypad.c
+++ b/src/emu/bus/nes_ctrl/joypad.c
@@ -3,16 +3,16 @@
Nintendo Family Computer & Entertainment System Joypads
The original Famicom had two hardwired controller, with the second
- controller slightly different from the first one: it featured no
+ controller slightly different from the first one: it featured no
Start nor Select buttons, but had a built-in microphone (with
very limited capabilities, since it basically only detected two
states: something blowing into it / nothing blowing into it) for
some games to react to users "talking" into it
-
- Crazy Climber Pads are not really a kind of separate controllers,
- but just a couple of small sticks to be put on top of d-pads of
- the regular controllers. Users should then control the game by
- using both controllers, turned 90 degrees, as a couple of dual
+
+ Crazy Climber Pads are not really a kind of separate controllers,
+ but just a couple of small sticks to be put on top of d-pads of
+ the regular controllers. Users should then control the game by
+ using both controllers, turned 90 degrees, as a couple of dual
sticks like in the arcade control panel. However, we emulate them
separately so to map the controls to a friendlier default.
@@ -20,9 +20,9 @@
by Hori, but possibly licensed by Nintendo, since it use the official
logo and brand) which fits into the expansion port and allows to
daisy chain a second controller to the first one, to play 4players
- game (an image of such connection is shown e.g. in Nekketsu Koukou
+ game (an image of such connection is shown e.g. in Nekketsu Koukou
Dodgeball Bu manual)
-
+
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
@@ -45,8 +45,8 @@ static INPUT_PORTS_START( nes_joypad )
PORT_START("JOYPAD")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B")
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
@@ -58,7 +58,7 @@ static INPUT_PORTS_START( nes_fcpad_p2 )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Microphone")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
@@ -69,8 +69,8 @@ static INPUT_PORTS_START( nes_ccpad_left )
PORT_START("JOYPAD")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY
@@ -81,8 +81,8 @@ static INPUT_PORTS_START( nes_ccpad_right )
PORT_START("JOYPAD")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
@@ -103,14 +103,14 @@ static INPUT_PORTS_START( nes_arcstick )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00)
INPUT_PORTS_END
//-------------------------------------------------
@@ -245,7 +245,7 @@ UINT8 nes_joypad_device::read_bit0()
UINT8 nes_fcpad2_device::read_exp(offs_t offset)
{
UINT8 ret = 0;
- if (!offset) // microphone input
+ if (!offset) // microphone input
ret |= m_joypad->read() & 0x04;
return ret;
@@ -260,9 +260,9 @@ UINT8 nes_fcpad2_device::read_exp(offs_t offset)
UINT8 nes_arcstick_device::read_exp(offs_t offset)
{
UINT8 ret = 0;
- if (offset == 0) //$4016
+ if (offset == 0) //$4016
{
- if ((m_cfg->read() & 2) == 0) // we are P1 input
+ if ((m_cfg->read() & 2) == 0) // we are P1 input
{
ret |= (m_latch & 1) << 1;
m_latch >>= 1;
@@ -270,9 +270,9 @@ UINT8 nes_arcstick_device::read_exp(offs_t offset)
else
ret |= m_daisychain->read_exp(0);
}
- else //$4017
+ else //$4017
{
- if ((m_cfg->read() & 2) == 2) // we are P2 input
+ if ((m_cfg->read() & 2) == 2) // we are P2 input
{
ret |= (m_latch & 1) << 1;
m_latch >>= 1;
@@ -280,7 +280,7 @@ UINT8 nes_arcstick_device::read_exp(offs_t offset)
else
ret |= m_daisychain->read_exp(1);
}
-
+
return ret;
}
@@ -292,7 +292,7 @@ void nes_joypad_device::write(UINT8 data)
{
if (data & 0x01)
return;
-
+
m_latch = m_joypad->read();
}
@@ -311,7 +311,6 @@ void nes_arcstick_device::write(UINT8 data)
if (data & 0x01)
return;
-
+
m_latch = m_joypad->read();
}
-