diff options
Diffstat (limited to 'src/mame/drivers/taitosj.cpp')
-rw-r--r-- | src/mame/drivers/taitosj.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp index b1c4a5dc7b3..401bea5bc28 100644 --- a/src/mame/drivers/taitosj.cpp +++ b/src/mame/drivers/taitosj.cpp @@ -254,23 +254,22 @@ void taitosj_state::taitosj_main_mcu_map(address_map &map) /* seems the most logical way to do the gears */ +template <int Player> CUSTOM_INPUT_MEMBER(taitosj_state::kikstart_gear_r) { const char *port_tag; - int player = (int)(uintptr_t)param; - - if (player == 0) + if (Player == 0) port_tag = "GEARP1"; else port_tag = "GEARP2"; /* gear MUST be 1, 2 or 3 */ - if (ioport(port_tag)->read() & 0x01) m_kikstart_gears[player] = 0x02; - if (ioport(port_tag)->read() & 0x02) m_kikstart_gears[player] = 0x03; - if (ioport(port_tag)->read() & 0x04) m_kikstart_gears[player] = 0x01; + if (ioport(port_tag)->read() & 0x01) m_kikstart_gears[Player] = 0x02; + if (ioport(port_tag)->read() & 0x02) m_kikstart_gears[Player] = 0x03; + if (ioport(port_tag)->read() & 0x04) m_kikstart_gears[Player] = 0x01; - return m_kikstart_gears[player]; + return m_kikstart_gears[Player]; } // TODO: merge with above @@ -515,7 +514,7 @@ static INPUT_PORTS_START( spaceskr ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) @@ -597,7 +596,7 @@ static INPUT_PORTS_START( spacecr ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") // according to the manual, dips 1, 2, 3 and 6 are unused but should be left off PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("SWA:1") @@ -681,7 +680,7 @@ static INPUT_PORTS_START( junglek ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, "Finish Bonus" ) @@ -803,7 +802,7 @@ static INPUT_PORTS_START( alpine ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, "Jump Bonus" ) @@ -888,7 +887,7 @@ static INPUT_PORTS_START( alpinea ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, "Jump Bonus" ) @@ -966,7 +965,7 @@ static INPUT_PORTS_START( timetunl ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) @@ -1166,7 +1165,7 @@ static INPUT_PORTS_START( elevator ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:1,2") @@ -1249,7 +1248,7 @@ static INPUT_PORTS_START( tinstar ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, "Bonus Life?" ) @@ -1332,7 +1331,7 @@ static INPUT_PORTS_START( waterski ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) @@ -1421,7 +1420,7 @@ static INPUT_PORTS_START( bioatack ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") /* d50a */ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) @@ -1488,7 +1487,7 @@ static INPUT_PORTS_START( sfposeid ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) @@ -1556,7 +1555,7 @@ static INPUT_PORTS_START( hwrace ) PORT_START("IN4") PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,input_port_4_f0_r, nullptr) // from sound CPU + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, input_port_4_f0_r) // from sound CPU PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) @@ -1645,7 +1644,7 @@ static INPUT_PORTS_START( kikstart ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 ) PORT_START("IN3") /* Service */ - PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,kikstart_gear_r, (void *)0) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08) + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, kikstart_gear_r<0>) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08) PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x00) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* needs to be 0, otherwise cannot shift */ @@ -1655,7 +1654,7 @@ static INPUT_PORTS_START( kikstart ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN4") - PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taitosj_state,kikstart_gear_r, (void *)1) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08) + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taitosj_state, kikstart_gear_r<1>) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x08) PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW3", 0x08, EQUALS, 0x00) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* needs to be 0, otherwise cannot shift */ |