From aee1fd4cbe66e84b1a2bf9170610c8ade4eb59be Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 9 Apr 2012 12:25:58 +0000 Subject: [PATCH] modernization of some CUSTOM_INPUT's part 2 (no whatsnew) --- src/mame/audio/jedi.c | 5 ++--- src/mame/drivers/arkanoid.c | 4 ++-- src/mame/drivers/balsente.c | 2 +- src/mame/drivers/gaelco2.c | 4 ++-- src/mame/drivers/galaxold.c | 14 +++++++------- src/mame/drivers/jedi.c | 2 +- src/mame/drivers/mhavoc.c | 12 ++++++------ src/mame/drivers/micro3d.c | 2 +- src/mame/drivers/phoenix.c | 8 ++++---- src/mame/drivers/playch10.c | 2 +- src/mame/drivers/scobra.c | 2 +- src/mame/drivers/stactics.c | 6 +++--- src/mame/drivers/starwars.c | 2 +- src/mame/drivers/williams.c | 14 +++++++------- src/mame/includes/arkanoid.h | 11 ++--------- src/mame/includes/balsente.h | 3 +-- src/mame/includes/gaelco2.h | 2 +- src/mame/includes/galaxold.h | 2 +- src/mame/includes/jedi.h | 2 +- src/mame/includes/mhavoc.h | 17 ++++++----------- src/mame/includes/micro3d.h | 6 +----- src/mame/includes/phoenix.h | 4 ++-- src/mame/includes/playch10.h | 2 +- src/mame/includes/scramble.h | 3 +-- src/mame/includes/stactics.h | 7 ++++--- src/mame/includes/starwars.h | 4 +--- src/mame/includes/williams.h | 4 +--- src/mame/machine/arkanoid.c | 12 +++++------- src/mame/machine/balsente.c | 5 ++--- src/mame/machine/gaelco2.c | 5 ++--- src/mame/machine/galaxold.c | 5 ++--- src/mame/machine/mhavoc.c | 29 ++++++++++++----------------- src/mame/machine/micro3d.c | 5 ++--- src/mame/machine/playch10.c | 5 ++--- src/mame/machine/scramble.c | 4 ++-- src/mame/machine/starwars.c | 5 ++--- src/mame/machine/williams.c | 7 +++---- src/mame/video/phoenix.c | 16 +++++++--------- src/mame/video/stactics.c | 15 ++++++--------- 39 files changed, 109 insertions(+), 150 deletions(-) diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c index 5a4b0ce9612..26a1cb4b887 100644 --- a/src/mame/audio/jedi.c +++ b/src/mame/audio/jedi.c @@ -101,10 +101,9 @@ static READ8_HANDLER( audio_latch_r ) } -CUSTOM_INPUT( jedi_audio_comm_stat_r ) +CUSTOM_INPUT_MEMBER(jedi_state::jedi_audio_comm_stat_r) { - jedi_state *state = field.machine().driver_data(); - return *state->m_audio_comm_stat >> 6; + return *m_audio_comm_stat >> 6; } diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c index ef748e7995a..0f108d4e51d 100644 --- a/src/mame/drivers/arkanoid.c +++ b/src/mame/drivers/arkanoid.c @@ -639,7 +639,7 @@ static INPUT_PORTS_START( arkanoid ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(arkanoid_68705_input_r, NULL) /* Inputs from the 68705 */ + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arkanoid_state,arkanoid_68705_input_r, NULL) /* Inputs from the 68705 */ PORT_START("BUTTONS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) @@ -648,7 +648,7 @@ static INPUT_PORTS_START( arkanoid ) PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MUX") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(arkanoid_input_mux, "P1\0P2") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arkanoid_state,arkanoid_input_mux, "P1\0P2") PORT_START("DSW") PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:8") diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c index 1648261704e..f06b1682523 100644 --- a/src/mame/drivers/balsente.c +++ b/src/mame/drivers/balsente.c @@ -877,7 +877,7 @@ static INPUT_PORTS_START( nstocker ) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "G1:7" ) PORT_MODIFY("IN0") - PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nstocker_bits_r, NULL) + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, balsente_state,nstocker_bits_r, NULL) /* cheese alert -- we have to map this to player 2 so that it doesn't interfere with the crosshair controls */ diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c index 89660fe8422..3cee182a211 100644 --- a/src/mame/drivers/gaelco2.c +++ b/src/mame/drivers/gaelco2.c @@ -1115,7 +1115,7 @@ static INPUT_PORTS_START( wrally2 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Acc.") PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Gear") PORT_TOGGLE - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(wrally2_analog_bit_r, (void *)0) /* ADC_1 serial input */ + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco2_state,wrally2_analog_bit_r, (void *)0) /* ADC_1 serial input */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:1" ) PORT_DIPNAME( 0x0200, 0x0000, "Coin mechanism" ) PORT_DIPLOCATION("SW2:2") @@ -1173,7 +1173,7 @@ static INPUT_PORTS_START( wrally2 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Acc.") PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Gear") PORT_TOGGLE - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM(wrally2_analog_bit_r, (void *)1) /* ADC_2 serial input */ + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco2_state,wrally2_analog_bit_r, (void *)1) /* ADC_2 serial input */ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN2 ) diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c index fef2204e83a..0d222839291 100644 --- a/src/mame/drivers/galaxold.c +++ b/src/mame/drivers/galaxold.c @@ -1276,18 +1276,18 @@ static INPUT_PORTS_START( 4in1 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x40) // See fake ports - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x80) // See fake ports + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x40) // See fake ports + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x80) // See fake ports PORT_START("DSW0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x01) // See fake ports - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x02) // See fake ports + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x01) // See fake ports + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x02) // See fake ports PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "3" ) // 2 when continue (Scramble PT2) PORT_DIPSETTING( 0x04, "5" ) // 2 when continue (Scramble PT2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x08) // See fake ports - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x10) // See fake ports - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(_4in1_fake_port_r, (void *)0x20) // See fake ports + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x08) // See fake ports + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x10) // See fake ports + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxold_state,_4in1_fake_port_r, (void *)0x20) // See fake ports PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("FAKE1") /* The Ghost Muncher PT3 - FAKE DSW0 (bits 0 to 5) and IN1 (bits 6 and 7) */ diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c index 9981702c734..eb20962eb8f 100644 --- a/src/mame/drivers/jedi.c +++ b/src/mame/drivers/jedi.c @@ -320,7 +320,7 @@ static INPUT_PORTS_START( jedi ) PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_TILT ) PORT_BIT( 0x18, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(jedi_audio_comm_stat_r, NULL) + PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,jedi_state,jedi_audio_comm_stat_r, NULL) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK ) PORT_START("STICKY") /* analog Y */ diff --git a/src/mame/drivers/mhavoc.c b/src/mame/drivers/mhavoc.c index 41dfeace195..f89a434fb7d 100644 --- a/src/mame/drivers/mhavoc.c +++ b/src/mame/drivers/mhavoc.c @@ -338,18 +338,18 @@ static INPUT_PORTS_START( mhavoc ) /* Bit 0 = Vector generator halt flag */ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gamma_xmtd_r, NULL) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gamma_rcvd_r, NULL) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,gamma_xmtd_r, NULL) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,gamma_rcvd_r, NULL) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diag Step/Coin C") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mhavoc_bit67_r, "COIN\0SERVICE") + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,mhavoc_bit67_r, "COIN\0SERVICE") PORT_START("IN1") /* gamma */ /* Bits 7-2 = input switches */ /* Bit 1 = Alpha rcvd flag */ /* Bit 0 = Alpha xmtd flag */ - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(alpha_xmtd_r, NULL) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(alpha_rcvd_r, NULL) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,alpha_xmtd_r, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,alpha_rcvd_r, NULL) PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) @@ -418,7 +418,7 @@ static INPUT_PORTS_START( mhavocrv ) PORT_INCLUDE( mhavoc ) PORT_MODIFY("IN1") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(tms5220_r, NULL) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mhavoc_state,tms5220_r, NULL) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END diff --git a/src/mame/drivers/micro3d.c b/src/mame/drivers/micro3d.c index 6bb26e3899a..cff5118b056 100644 --- a/src/mame/drivers/micro3d.c +++ b/src/mame/drivers/micro3d.c @@ -132,7 +132,7 @@ static INPUT_PORTS_START( botssa ) PORT_INCLUDE( micro3d ) PORT_MODIFY("INPUTS_A_B") - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(botssa_hwchk_r, NULL) + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, micro3d_state,botssa_hwchk_r, NULL) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Shield") PORT_SERVICE( 0x0400, IP_ACTIVE_LOW ) diff --git a/src/mame/drivers/phoenix.c b/src/mame/drivers/phoenix.c index 489737f50c4..ae56da1a7eb 100644 --- a/src/mame/drivers/phoenix.c +++ b/src/mame/drivers/phoenix.c @@ -79,7 +79,7 @@ static INPUT_PORTS_START( phoenix ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(player_input_r, NULL) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,player_input_r, NULL) PORT_START("DSW0") PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" ) @@ -162,7 +162,7 @@ static INPUT_PORTS_START( condor ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(player_input_r, NULL) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,player_input_r, NULL) PORT_START("DSW0") PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) ) PORT_DIPLOCATION( "SW1:1,2" ) @@ -292,7 +292,7 @@ static INPUT_PORTS_START( pleiads ) PORT_INCLUDE( phoenix ) PORT_MODIFY("IN0") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(pleiads_protection_r, NULL) /* Protection. See 0x0552 */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,pleiads_protection_r, NULL) /* Protection. See 0x0552 */ PORT_MODIFY("DSW0") PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW1:7" ) @@ -315,7 +315,7 @@ static INPUT_PORTS_START( pleiadbl ) PORT_INCLUDE( phoenix ) PORT_MODIFY("IN0") - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(pleiads_protection_r, NULL) /* Protection. See 0x0552 */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, phoenix_state,pleiads_protection_r, NULL) /* Protection. See 0x0552 */ PORT_MODIFY("DSW0") PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW1:7" ) diff --git a/src/mame/drivers/playch10.c b/src/mame/drivers/playch10.c index 01445b90a35..7b1091b4a92 100644 --- a/src/mame/drivers/playch10.c +++ b/src/mame/drivers/playch10.c @@ -410,7 +410,7 @@ static INPUT_PORTS_START( playch10 ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Channel Select") PORT_CODE(KEYCODE_0) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Enter") PORT_CODE(KEYCODE_MINUS) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Reset") PORT_CODE(KEYCODE_EQUALS) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(pc10_int_detect_r, NULL) // INT Detect + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, playch10_state,pc10_int_detect_r, NULL) // INT Detect PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c index 17781d24693..670649eb34d 100644 --- a/src/mame/drivers/scobra.c +++ b/src/mame/drivers/scobra.c @@ -368,7 +368,7 @@ static INPUT_PORTS_START( darkplnt ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) ) PORT_DIPSETTING( 0x00, "3" ) PORT_DIPSETTING( 0x02, "5" ) - PORT_BIT( 0xfc, 0x00, IPT_SPECIAL ) PORT_CUSTOM(darkplnt_custom_r, "DIAL") /* scrambled dial */ + PORT_BIT( 0xfc, 0x00, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,scobra_state, darkplnt_custom_r, "DIAL") /* scrambled dial */ PORT_START("IN2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c index a0d51e8b135..14ea843713d 100644 --- a/src/mame/drivers/stactics.c +++ b/src/mame/drivers/stactics.c @@ -246,7 +246,7 @@ static INPUT_PORTS_START( stactics ) PORT_START("IN2") /* IN2 */ PORT_BIT( 0x07, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_rng, NULL) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_frame_count_d3, NULL) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_frame_count_d3, NULL) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) ) @@ -256,7 +256,7 @@ static INPUT_PORTS_START( stactics ) PORT_START("IN3") /* IN3 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_shot_standby, NULL) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_shot_standby, NULL) PORT_DIPNAME( 0x04, 0x04, "Number of Barriers" ) PORT_DIPSETTING( 0x04, "4" ) PORT_DIPSETTING( 0x00, "6" ) @@ -268,7 +268,7 @@ static INPUT_PORTS_START( stactics ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stactics_get_not_shot_arrive, NULL) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, stactics_state,stactics_get_not_shot_arrive, NULL) PORT_START("FAKE") /* FAKE */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c index f5a345ea3e9..2b907e85d34 100644 --- a/src/mame/drivers/starwars.c +++ b/src/mame/drivers/starwars.c @@ -232,7 +232,7 @@ static INPUT_PORTS_START( starwars ) /* Bit 6 is VG_HALT */ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL) /* Bit 7 is MATH_RUN - see machine/starwars.c */ - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(matrix_flag_r, NULL) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, starwars_state,matrix_flag_r, NULL) PORT_START("DSW0") PORT_DIPNAME( 0x03, 0x02, "Starting Shields" ) PORT_DIPLOCATION("10D:1,2") diff --git a/src/mame/drivers/williams.c b/src/mame/drivers/williams.c index 8536a523f0e..f85fb34d595 100644 --- a/src/mame/drivers/williams.c +++ b/src/mame/drivers/williams.c @@ -922,7 +922,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( joust ) PORT_START("IN0") - PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP2\0INP1") + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2\0INP1") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -983,10 +983,10 @@ static INPUT_PORTS_START( splat ) PORT_START("IN0") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP2\0INP1") + PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2\0INP1") PORT_START("IN1") - PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP2A\0INP1A") + PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2A\0INP1A") PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_START("IN2") @@ -1200,7 +1200,7 @@ static INPUT_PORTS_START( alienar ) PORT_START("IN0") PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP2\0INP1") + PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP2\0INP1") PORT_START("IN1") PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -1290,7 +1290,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( tshoot ) PORT_START("IN0") - PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP1X\0INP1Y") + PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP1X\0INP1Y") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) @@ -1321,7 +1321,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( inferno ) PORT_START("IN0") - PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP1\0INP2") + PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP1\0INP2") PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) @@ -1364,7 +1364,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( joust2 ) PORT_START("IN0") - PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(williams_mux_r, "INP1\0INP2") + PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, williams_state,williams_mux_r, "INP1\0INP2") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) diff --git a/src/mame/includes/arkanoid.h b/src/mame/includes/arkanoid.h index 1ebf8fd59ee..6845692a0f7 100644 --- a/src/mame/includes/arkanoid.h +++ b/src/mame/includes/arkanoid.h @@ -62,6 +62,8 @@ public: DECLARE_WRITE8_MEMBER(arkanoid_d008_w); DECLARE_WRITE8_MEMBER(tetrsark_d008_w); DECLARE_WRITE8_MEMBER(hexa_d008_w); + DECLARE_CUSTOM_INPUT_MEMBER(arkanoid_68705_input_r); + DECLARE_CUSTOM_INPUT_MEMBER(arkanoid_input_mux); }; @@ -74,12 +76,3 @@ extern VIDEO_START( arkanoid ); extern SCREEN_UPDATE_IND16( arkanoid ); extern SCREEN_UPDATE_IND16( hexa ); - -/*----------- defined in machine/arkanoid.c -----------*/ - - - - -extern CUSTOM_INPUT( arkanoid_68705_input_r ); -extern CUSTOM_INPUT( arkanoid_input_mux ); - diff --git a/src/mame/includes/balsente.h b/src/mame/includes/balsente.h index 71019a48fb7..058118265a7 100644 --- a/src/mame/includes/balsente.h +++ b/src/mame/includes/balsente.h @@ -158,6 +158,7 @@ public: DECLARE_WRITE8_MEMBER(balsente_palette_select_w); DECLARE_WRITE8_MEMBER(balsente_paletteram_w); DECLARE_WRITE8_MEMBER(shrike_sprite_select_w); + DECLARE_CUSTOM_INPUT_MEMBER(nstocker_bits_r); }; @@ -184,8 +185,6 @@ TIMER_DEVICE_CALLBACK( balsente_clock_counter_0_ff ); -CUSTOM_INPUT( nstocker_bits_r ); - diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h index c89e081cc7e..8a9937888b5 100644 --- a/src/mame/includes/gaelco2.h +++ b/src/mame/includes/gaelco2.h @@ -36,6 +36,7 @@ public: DECLARE_WRITE16_MEMBER(snowboar_protection_w); DECLARE_WRITE16_MEMBER(gaelco2_vram_w); DECLARE_WRITE16_MEMBER(gaelco2_palette_w); + DECLARE_CUSTOM_INPUT_MEMBER(wrally2_analog_bit_r); }; @@ -46,7 +47,6 @@ DRIVER_INIT( touchgo ); DRIVER_INIT( snowboar ); DRIVER_INIT( bang ); TIMER_DEVICE_CALLBACK( bang_irq ); -CUSTOM_INPUT( wrally2_analog_bit_r ); WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w ); WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w ); WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w ); diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h index 2cab16a3d52..2f8febef8c3 100644 --- a/src/mame/includes/galaxold.h +++ b/src/mame/includes/galaxold.h @@ -123,6 +123,7 @@ public: DECLARE_READ8_MEMBER(rockclim_videoram_r); DECLARE_WRITE8_MEMBER(dambustr_bg_split_line_w); DECLARE_WRITE8_MEMBER(dambustr_bg_color_w); + DECLARE_CUSTOM_INPUT_MEMBER(_4in1_fake_port_r); }; @@ -192,7 +193,6 @@ MACHINE_RESET( hunchbkg ); #define galaxold_coin_counter_0_w galaxold_coin_counter_w -CUSTOM_INPUT( _4in1_fake_port_r ); INTERRUPT_GEN( hunchbks_vh_interrupt ); diff --git a/src/mame/includes/jedi.h b/src/mame/includes/jedi.h index 1fb5f4cda1c..9a3f3d22824 100644 --- a/src/mame/includes/jedi.h +++ b/src/mame/includes/jedi.h @@ -54,6 +54,7 @@ public: DECLARE_WRITE8_MEMBER(nvram_enable_w); DECLARE_WRITE8_MEMBER(jedi_vscroll_w); DECLARE_WRITE8_MEMBER(jedi_hscroll_w); + DECLARE_CUSTOM_INPUT_MEMBER(jedi_audio_comm_stat_r); }; @@ -64,7 +65,6 @@ MACHINE_CONFIG_EXTERN( jedi_audio ); WRITE8_HANDLER( jedi_audio_reset_w ); WRITE8_HANDLER( jedi_audio_latch_w ); READ8_HANDLER( jedi_audio_ack_latch_r ); -CUSTOM_INPUT( jedi_audio_comm_stat_r ); /*----------- defined in video/jedi.c -----------*/ diff --git a/src/mame/includes/mhavoc.h b/src/mame/includes/mhavoc.h index d3dc45022cc..51d383fee92 100644 --- a/src/mame/includes/mhavoc.h +++ b/src/mame/includes/mhavoc.h @@ -50,6 +50,12 @@ public: DECLARE_WRITE8_MEMBER(mhavoc_out_1_w); DECLARE_WRITE8_MEMBER(mhavocrv_speech_data_w); DECLARE_WRITE8_MEMBER(mhavocrv_speech_strobe_w); + DECLARE_CUSTOM_INPUT_MEMBER(tms5220_r); + DECLARE_CUSTOM_INPUT_MEMBER(mhavoc_bit67_r); + DECLARE_CUSTOM_INPUT_MEMBER(gamma_rcvd_r); + DECLARE_CUSTOM_INPUT_MEMBER(gamma_xmtd_r); + DECLARE_CUSTOM_INPUT_MEMBER(alpha_rcvd_r); + DECLARE_CUSTOM_INPUT_MEMBER(alpha_xmtd_r); }; @@ -63,14 +69,3 @@ MACHINE_RESET( mhavoc ); DRIVER_INIT( mhavocrv ); - - -CUSTOM_INPUT( tms5220_r ); -CUSTOM_INPUT( gamma_rcvd_r ); -CUSTOM_INPUT( gamma_xmtd_r ); -CUSTOM_INPUT( alpha_rcvd_r ); -CUSTOM_INPUT( alpha_xmtd_r ); -CUSTOM_INPUT( mhavoc_bit67_r ); - - - diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h index 24ee926eb1a..9472238bc7d 100644 --- a/src/mame/includes/micro3d.h +++ b/src/mame/includes/micro3d.h @@ -99,6 +99,7 @@ public: DECLARE_WRITE32_MEMBER(micro3d_fifo_w); DECLARE_WRITE32_MEMBER(micro3d_alt_fifo_w); DECLARE_READ32_MEMBER(micro3d_pipe_r); + DECLARE_CUSTOM_INPUT_MEMBER(botssa_hwchk_r); }; typedef struct _micro3d_vtx_ @@ -115,11 +116,6 @@ typedef struct _micro3d_vtx_ -CUSTOM_INPUT( botssa_hwchk_r ); - - - - void micro3d_duart_irq_handler(device_t *device, UINT8 vector); UINT8 micro3d_duart_input_r(device_t *device); void micro3d_duart_output_w(device_t *device, UINT8 data); diff --git a/src/mame/includes/phoenix.h b/src/mame/includes/phoenix.h index 91c9f05dbb5..b02f8d995ac 100644 --- a/src/mame/includes/phoenix.h +++ b/src/mame/includes/phoenix.h @@ -25,6 +25,8 @@ public: DECLARE_WRITE8_MEMBER(pleiads_videoreg_w); DECLARE_WRITE8_MEMBER(phoenix_scroll_w); DECLARE_READ8_MEMBER(survival_input_port_0_r); + DECLARE_CUSTOM_INPUT_MEMBER(player_input_r); + DECLARE_CUSTOM_INPUT_MEMBER(pleiads_protection_r); }; @@ -60,8 +62,6 @@ VIDEO_START( phoenix ); SCREEN_UPDATE_IND16( phoenix ); -CUSTOM_INPUT( player_input_r ); -CUSTOM_INPUT( pleiads_protection_r ); READ8_DEVICE_HANDLER( survival_protection_r ); READ_LINE_DEVICE_HANDLER( survival_sid_callback ); diff --git a/src/mame/includes/playch10.h b/src/mame/includes/playch10.h index c767a89d2c2..72acdd08a24 100644 --- a/src/mame/includes/playch10.h +++ b/src/mame/includes/playch10.h @@ -80,6 +80,7 @@ public: DECLARE_WRITE8_MEMBER(hboard_rom_switch_w); void pc10_set_mirroring(int mirroring); DECLARE_WRITE8_MEMBER(playch10_videoram_w); + DECLARE_CUSTOM_INPUT_MEMBER(pc10_int_detect_r); }; @@ -104,7 +105,6 @@ DRIVER_INIT( pcgboard_type2 ); /* g-board games with 4 screen mirror */ DRIVER_INIT( pchboard ); /* h-board games */ DRIVER_INIT( pciboard ); /* i-board games */ DRIVER_INIT( pckboard ); /* k-board games */ -CUSTOM_INPUT( pc10_int_detect_r ); diff --git a/src/mame/includes/scramble.h b/src/mame/includes/scramble.h index 54e5679c50f..ee9b1b048d9 100644 --- a/src/mame/includes/scramble.h +++ b/src/mame/includes/scramble.h @@ -11,6 +11,7 @@ public: UINT8 m_cavelon_bank; UINT8 m_security_2B_counter; UINT8 m_xb; + DECLARE_CUSTOM_INPUT_MEMBER(darkplnt_custom_r); }; @@ -54,8 +55,6 @@ READ8_HANDLER( triplep_pap_r ); READ8_HANDLER( hunchbks_mirror_r ); WRITE8_HANDLER( hunchbks_mirror_w ); -CUSTOM_INPUT( darkplnt_custom_r ); - /*----------- defined in audio/scramble.c -----------*/ diff --git a/src/mame/includes/stactics.h b/src/mame/includes/stactics.h index 778b4c65dcd..6c2ed6f8759 100644 --- a/src/mame/includes/stactics.h +++ b/src/mame/includes/stactics.h @@ -43,6 +43,9 @@ public: DECLARE_WRITE8_MEMBER(stactics_speed_latch_w); DECLARE_WRITE8_MEMBER(stactics_shot_trigger_w); DECLARE_WRITE8_MEMBER(stactics_shot_flag_clear_w); + DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_frame_count_d3); + DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_shot_standby); + DECLARE_CUSTOM_INPUT_MEMBER(stactics_get_not_shot_arrive); }; @@ -50,7 +53,5 @@ public: MACHINE_CONFIG_EXTERN( stactics_video ); -CUSTOM_INPUT( stactics_get_frame_count_d3 ); -CUSTOM_INPUT( stactics_get_shot_standby ); -CUSTOM_INPUT( stactics_get_not_shot_arrive ); + diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h index f65d63d2fad..04a0b3b12b8 100644 --- a/src/mame/includes/starwars.h +++ b/src/mame/includes/starwars.h @@ -50,15 +50,13 @@ public: DECLARE_READ8_MEMBER(starwars_div_reh_r); DECLARE_READ8_MEMBER(starwars_div_rel_r); DECLARE_WRITE8_MEMBER(starwars_math_w); + DECLARE_CUSTOM_INPUT_MEMBER(matrix_flag_r); }; /*----------- defined in machine/starwars.c -----------*/ -CUSTOM_INPUT( matrix_flag_r ); - - void starwars_mproc_init(running_machine &machine); void starwars_mproc_reset(running_machine &machine); diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h index c2f5ce90595..6d46357ac24 100644 --- a/src/mame/includes/williams.h +++ b/src/mame/includes/williams.h @@ -65,6 +65,7 @@ public: DECLARE_WRITE8_MEMBER(blaster_video_control_w); DECLARE_WRITE8_MEMBER(williams_blitter_w); DECLARE_WRITE8_MEMBER(williams2_blit_window_enable_w); + DECLARE_CUSTOM_INPUT_MEMBER(williams_mux_r); }; @@ -124,9 +125,6 @@ MACHINE_RESET( joust2 ); /* banking */ -/* misc */ -CUSTOM_INPUT( williams_mux_r ); - /* Mayday protection */ diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c index 30d372c4023..a7f4fce58a1 100644 --- a/src/mame/machine/arkanoid.c +++ b/src/mame/machine/arkanoid.c @@ -97,28 +97,26 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_68705_ddr_c_w) m_ddr_c = data; } -CUSTOM_INPUT( arkanoid_68705_input_r ) +CUSTOM_INPUT_MEMBER(arkanoid_state::arkanoid_68705_input_r) { - arkanoid_state *state = field.machine().driver_data(); int res = 0; /* bit 0x40 of comes from the sticky bit */ - if (!state->m_z80write) + if (!m_z80write) res |= 0x01; /* bit 0x80 comes from a write latch */ - if (!state->m_m68705write) + if (!m_m68705write) res |= 0x02; return res; } -CUSTOM_INPUT( arkanoid_input_mux ) +CUSTOM_INPUT_MEMBER(arkanoid_state::arkanoid_input_mux) { - arkanoid_state *state = field.machine().driver_data(); const char *tag1 = (const char *)param; const char *tag2 = tag1 + strlen(tag1) + 1; - return input_port_read(field.machine(), (state->m_paddle_select == 0) ? tag1 : tag2); + return input_port_read(machine(), (m_paddle_select == 0) ? tag1 : tag2); } /* diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c index a2a4b05f2c8..186f2ceae41 100644 --- a/src/mame/machine/balsente.c +++ b/src/mame/machine/balsente.c @@ -1091,10 +1091,9 @@ WRITE8_MEMBER(balsente_state::balsente_register_addr_w) * *************************************/ -CUSTOM_INPUT( nstocker_bits_r ) +CUSTOM_INPUT_MEMBER(balsente_state::nstocker_bits_r) { - balsente_state *state = field.machine().driver_data(); - return state->m_nstocker_bits; + return m_nstocker_bits; } diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c index 29f1f40e141..772f8c48396 100644 --- a/src/mame/machine/gaelco2.c +++ b/src/mame/machine/gaelco2.c @@ -218,11 +218,10 @@ TIMER_DEVICE_CALLBACK( bang_irq ) ***************************************************************************/ -CUSTOM_INPUT( wrally2_analog_bit_r ) +CUSTOM_INPUT_MEMBER(gaelco2_state::wrally2_analog_bit_r) { - gaelco2_state *state = field.machine().driver_data(); int which = (FPTR)param; - return (state->m_analog_ports[which] >> 7) & 0x01; + return (m_analog_ports[which] >> 7) & 0x01; } diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c index e982b7f24c1..b579ed2ef31 100644 --- a/src/mame/machine/galaxold.c +++ b/src/mame/machine/galaxold.c @@ -254,13 +254,12 @@ WRITE8_MEMBER(galaxold_state::_4in1_bank_w) memory_set_bank(machine(), "bank1", m__4in1_bank); } -CUSTOM_INPUT( _4in1_fake_port_r ) +CUSTOM_INPUT_MEMBER(galaxold_state::_4in1_fake_port_r) { - galaxold_state *state = field.machine().driver_data(); static const char *const portnames[] = { "FAKE1", "FAKE2", "FAKE3", "FAKE4" }; int bit_mask = (FPTR)param; - return (input_port_read(field.machine(), portnames[state->m__4in1_bank]) & bit_mask) ? 0x01 : 0x00; + return (input_port_read(machine(), portnames[m__4in1_bank]) & bit_mask) ? 0x01 : 0x00; } #ifdef UNUSED_FUNCTION diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c index 5523dc80278..1552077607f 100644 --- a/src/mame/machine/mhavoc.c +++ b/src/mame/machine/mhavoc.c @@ -205,45 +205,40 @@ WRITE8_MEMBER(mhavoc_state::mhavoc_rom_banksel_w) * *************************************/ -CUSTOM_INPUT( tms5220_r ) +CUSTOM_INPUT_MEMBER(mhavoc_state::tms5220_r) { - return tms5220_readyq_r(field.machine().device("tms")) ? 1 : 0; + return tms5220_readyq_r(machine().device("tms")) ? 1 : 0; } -CUSTOM_INPUT( mhavoc_bit67_r ) +CUSTOM_INPUT_MEMBER(mhavoc_state::mhavoc_bit67_r) { - mhavoc_state *state = field.machine().driver_data(); const char *tag1 = (const char *)param; const char *tag2 = tag1 + strlen(tag1) + 1; - return input_port_read(field.machine(), state->m_player_1 ? tag2 : tag1) & 0x03; + return input_port_read(machine(), m_player_1 ? tag2 : tag1) & 0x03; } -CUSTOM_INPUT( gamma_rcvd_r ) +CUSTOM_INPUT_MEMBER(mhavoc_state::gamma_rcvd_r) { - mhavoc_state *state = field.machine().driver_data(); /* Gamma rcvd flag */ - return state->m_gamma_rcvd; + return m_gamma_rcvd; } -CUSTOM_INPUT( gamma_xmtd_r ) +CUSTOM_INPUT_MEMBER(mhavoc_state::gamma_xmtd_r) { - mhavoc_state *state = field.machine().driver_data(); /* Gamma xmtd flag */ - return state->m_gamma_xmtd; + return m_gamma_xmtd; } -CUSTOM_INPUT( alpha_rcvd_r ) +CUSTOM_INPUT_MEMBER(mhavoc_state::alpha_rcvd_r) { - mhavoc_state *state = field.machine().driver_data(); /* Alpha rcvd flag */ - return (state->m_has_gamma_cpu && state->m_alpha_rcvd); + return (m_has_gamma_cpu && m_alpha_rcvd); } -CUSTOM_INPUT( alpha_xmtd_r ) +CUSTOM_INPUT_MEMBER(mhavoc_state::alpha_xmtd_r) { - mhavoc_state *state = field.machine().driver_data(); /* Alpha xmtd flag */ - return (state->m_has_gamma_cpu && state->m_alpha_xmtd); + return (m_has_gamma_cpu && m_alpha_xmtd); } /************************************* diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c index dcb4f0ef479..d599405fb83 100644 --- a/src/mame/machine/micro3d.c +++ b/src/mame/machine/micro3d.c @@ -537,11 +537,10 @@ WRITE16_MEMBER(micro3d_state::micro3d_adc_w) machine().scheduler().timer_set(attotime::from_usec(40), FUNC(adc_done_callback), data & ~4); } -CUSTOM_INPUT( botssa_hwchk_r ) +CUSTOM_INPUT_MEMBER(micro3d_state::botssa_hwchk_r) { - micro3d_state *state = field.machine().driver_data(); - return state->m_botssa_latch; + return m_botssa_latch; } READ16_MEMBER(micro3d_state::botssa_140000_r) diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c index e96fca012d4..8fed5a603df 100644 --- a/src/mame/machine/playch10.c +++ b/src/mame/machine/playch10.c @@ -86,10 +86,9 @@ MACHINE_START( playch10_hboard ) * *************************************/ -CUSTOM_INPUT( pc10_int_detect_r ) +CUSTOM_INPUT_MEMBER(playch10_state::pc10_int_detect_r) { - playch10_state *state = field.machine().driver_data(); - return ~state->m_pc10_int_detect & 1; + return ~m_pc10_int_detect & 1; } WRITE8_MEMBER(playch10_state::pc10_SDCS_w) diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c index 9b037cde185..0a8fc2dccd1 100644 --- a/src/mame/machine/scramble.c +++ b/src/mame/machine/scramble.c @@ -33,7 +33,7 @@ MACHINE_RESET( explorer ) } -CUSTOM_INPUT( darkplnt_custom_r ) +CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r) { static const UINT8 remap[] = {0x03, 0x02, 0x00, 0x01, 0x21, 0x20, 0x22, 0x23, 0x33, 0x32, 0x30, 0x31, 0x11, 0x10, 0x12, 0x13, @@ -43,7 +43,7 @@ CUSTOM_INPUT( darkplnt_custom_r ) 0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b, 0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f, 0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 }; - UINT8 val = input_port_read(field.machine(), (const char *)param); + UINT8 val = input_port_read(machine(), (const char *)param); return remap[val >> 2]; } diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c index b16930426bb..c7878bf4509 100644 --- a/src/mame/machine/starwars.c +++ b/src/mame/machine/starwars.c @@ -107,11 +107,10 @@ WRITE8_MEMBER(starwars_state::starwars_out_w) * *************************************/ -CUSTOM_INPUT( matrix_flag_r ) +CUSTOM_INPUT_MEMBER(starwars_state::matrix_flag_r) { - starwars_state *state = field.machine().driver_data(); /* set the matrix processor flag */ - return state->m_math_run ? 1 : 0; + return m_math_run ? 1 : 0; } diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c index 72f64474fd5..c77c4c5cfce 100644 --- a/src/mame/machine/williams.c +++ b/src/mame/machine/williams.c @@ -616,15 +616,14 @@ WRITE8_DEVICE_HANDLER( williams_port_select_w ) state->m_port_select = data; } -CUSTOM_INPUT( williams_mux_r ) +CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r) { - williams_state *state = field.machine().driver_data(); const char *tag = (const char *)param; - if (state->m_port_select != 0) + if (m_port_select != 0) tag += strlen(tag) + 1; - return input_port_read(field.machine(), tag); + return input_port_read(machine(), tag); } /* diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c index 5cb86963f74..ee452759f3e 100644 --- a/src/mame/video/phoenix.c +++ b/src/mame/video/phoenix.c @@ -304,20 +304,18 @@ WRITE8_MEMBER(phoenix_state::phoenix_scroll_w) } -CUSTOM_INPUT( player_input_r ) +CUSTOM_INPUT_MEMBER(phoenix_state::player_input_r) { - phoenix_state *state = field.machine().driver_data(); - if (state->m_cocktail_mode) - return (input_port_read(field.machine(), "CTRL") & 0xf0) >> 4; + if (m_cocktail_mode) + return (input_port_read(machine(), "CTRL") & 0xf0) >> 4; else - return (input_port_read(field.machine(), "CTRL") & 0x0f) >> 0; + return (input_port_read(machine(), "CTRL") & 0x0f) >> 0; } -CUSTOM_INPUT( pleiads_protection_r ) +CUSTOM_INPUT_MEMBER(phoenix_state::pleiads_protection_r) { - phoenix_state *state = field.machine().driver_data(); /* handle Pleiads protection */ - switch (state->m_pleiads_protection_question) + switch (m_pleiads_protection_question) { case 0x00: case 0x20: @@ -328,7 +326,7 @@ CUSTOM_INPUT( pleiads_protection_r ) /* Bit 3 is 1 */ return 1; default: - logerror("%s:Unknown protection question %02X\n", field.machine().describe_context(), state->m_pleiads_protection_question); + logerror("%s:Unknown protection question %02X\n", machine().describe_context(), m_pleiads_protection_question); return 0; } } diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c index 561c17ab39c..eda54eb0482 100644 --- a/src/mame/video/stactics.c +++ b/src/mame/video/stactics.c @@ -111,11 +111,10 @@ WRITE8_MEMBER(stactics_state::stactics_scroll_ram_w) * *************************************/ -CUSTOM_INPUT( stactics_get_frame_count_d3 ) +CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_frame_count_d3) { - stactics_state *state = field.machine().driver_data(); - return (state->m_frame_count >> 3) & 0x01; + return (m_frame_count >> 3) & 0x01; } @@ -166,19 +165,17 @@ WRITE8_MEMBER(stactics_state::stactics_shot_flag_clear_w) } -CUSTOM_INPUT( stactics_get_shot_standby ) +CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_shot_standby) { - stactics_state *state = field.machine().driver_data(); - return state->m_shot_standby; + return m_shot_standby; } -CUSTOM_INPUT( stactics_get_not_shot_arrive ) +CUSTOM_INPUT_MEMBER(stactics_state::stactics_get_not_shot_arrive) { - stactics_state *state = field.machine().driver_data(); - return !state->m_shot_arrive; + return !m_shot_arrive; }