diff options
Diffstat (limited to 'src/mame/drivers/taito_f3.cpp')
-rw-r--r-- | src/mame/drivers/taito_f3.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp index 13db66e85d1..c867b19e8f8 100644 --- a/src/mame/drivers/taito_f3.cpp +++ b/src/mame/drivers/taito_f3.cpp @@ -42,18 +42,17 @@ /******************************************************************************/ +template <int Num> CUSTOM_INPUT_MEMBER(taito_f3_state::f3_analog_r) { - const int num = (uintptr_t)param; - const int data = m_dial[num]->read(); + const int data = m_dial[Num]->read(); return ((data & 0xf) << 12) | ((data & 0xff0) >> 4); } - +template <int Num> CUSTOM_INPUT_MEMBER(taito_f3_state::f3_coin_r) { - const int num = (uintptr_t)param; - return m_coin_word[num]; + return m_coin_word[Num]; } u32 taito_f3_state::f3_control_r(offs_t offset) @@ -273,8 +272,8 @@ static INPUT_PORTS_START( f3 ) PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_START3 ) PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_START4 ) - PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,eeprom_read, nullptr) - PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,eeprom_read, nullptr) + PORT_BIT( 0x00ff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, eeprom_read) + PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, eeprom_read) /* MSW: Coin counters/lockouts are readable, LSW: Joysticks (Player 1 & 2) */ PORT_START("IN.1") @@ -287,7 +286,7 @@ static INPUT_PORTS_START( f3 ) PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0000ff00, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* These must be high */ - PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_coin_r, (void *)0) + PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_coin_r<0>) /* Player 3 & 4 fire buttons (Player 2 top fire buttons in Kaiser Knuckle) */ PORT_START("IN.4") @@ -313,16 +312,16 @@ static INPUT_PORTS_START( f3 ) PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_coin_r, (void *)1) + PORT_BIT( 0xffff0000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_coin_r<1>) /* Analog control 1 */ PORT_START("IN.2") - PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_analog_r, (void*)0) + PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_analog_r<0>) PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* Analog control 2 */ PORT_START("IN.3") - PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, taito_f3_state,f3_analog_r, (void *)1) + PORT_BIT( 0x0000ffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(taito_f3_state, f3_analog_r<1>) PORT_BIT( 0xffff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* These are not read directly, but through PORT_CUSTOMs above */ |