summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2012-04-09 11:58:25 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2012-04-09 11:58:25 +0000
commit38fd06415152ad47c1e74425cd3609552bd240f0 (patch)
tree3047e67a175a7cdc06bdda5372499b6224aab989 /src
parent0aca27ceef7dc7d9136da9319737efb48e505205 (diff)
modernization of some CUSTOM_INPUT's (no whatsnew)
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/acefruit.c45
-rw-r--r--src/mame/drivers/alg.c24
-rw-r--r--src/mame/drivers/arcadia.c8
-rw-r--r--src/mame/drivers/bwidow.c13
-rw-r--r--src/mame/drivers/dacholer.c8
-rw-r--r--src/mame/drivers/ddayjlc.c8
-rw-r--r--src/mame/drivers/dlair.c20
-rw-r--r--src/mame/drivers/dorachan.c18
-rw-r--r--src/mame/drivers/ecoinfr.c15
-rw-r--r--src/mame/drivers/enigma2.c23
-rw-r--r--src/mame/drivers/famibox.c8
-rw-r--r--src/mame/drivers/firefox.c16
-rw-r--r--src/mame/drivers/galaxi.c20
-rw-r--r--src/mame/drivers/gstream.c22
-rw-r--r--src/mame/drivers/igs009.c8
-rw-r--r--src/mame/drivers/igs011.c14
-rw-r--r--src/mame/drivers/igspoker.c24
-rw-r--r--src/mame/drivers/jackie.c10
-rw-r--r--src/mame/drivers/jankenmn.c7
-rw-r--r--src/mame/drivers/ksys573.c24
-rw-r--r--src/mame/drivers/limenko.c12
-rw-r--r--src/mame/drivers/littlerb.c7
-rw-r--r--src/mame/drivers/merit.c7
-rw-r--r--src/mame/drivers/missile.c11
-rw-r--r--src/mame/drivers/multfish.c14
-rw-r--r--src/mame/drivers/multigam.c8
-rw-r--r--src/mame/drivers/mw18w.c5
-rw-r--r--src/mame/drivers/peplus.c25
-rw-r--r--src/mame/drivers/peyper.c11
-rw-r--r--src/mame/drivers/pzletime.c8
-rw-r--r--src/mame/drivers/quizshow.c8
-rw-r--r--src/mame/drivers/r2dtank.c8
-rw-r--r--src/mame/drivers/rgum.c10
-rw-r--r--src/mame/drivers/scobra.c13
-rw-r--r--src/mame/drivers/spoker.c14
-rw-r--r--src/mame/drivers/ssingles.c7
-rw-r--r--src/mame/drivers/statriv2.c12
-rw-r--r--src/mame/drivers/tempest.c23
-rw-r--r--src/mame/drivers/thayers.c20
-rw-r--r--src/mame/drivers/ultrsprt.c13
-rw-r--r--src/mame/drivers/vamphalf.c7
-rw-r--r--src/mame/drivers/zn.c8
42 files changed, 303 insertions, 283 deletions
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 818c7f1b13a..3d8832bd5aa 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -30,6 +30,9 @@ public:
DECLARE_WRITE8_MEMBER(acefruit_sound_w);
DECLARE_WRITE8_MEMBER(acefruit_lamp_w);
DECLARE_WRITE8_MEMBER(acefruit_solenoid_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(sidewndr_payout_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(starspnr_coinage_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(starspnr_payout_r);
};
@@ -166,54 +169,54 @@ static SCREEN_UPDATE_IND16( acefruit )
return 0;
}
-static CUSTOM_INPUT( sidewndr_payout_r )
+CUSTOM_INPUT_MEMBER(acefruit_state::sidewndr_payout_r)
{
int bit_mask = (FPTR)param;
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field.machine(), "PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field.machine(), "PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1);
default:
logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
}
}
-static CUSTOM_INPUT( starspnr_coinage_r )
+CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_coinage_r)
{
int bit_mask = (FPTR)param;
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field.machine(), "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field.machine(), "COINAGE") & bit_mask) >> 1);
+ return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(field.machine(), "COINAGE") & bit_mask) >> 2);
+ return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 2);
case 0x08:
- return ((input_port_read(field.machine(), "COINAGE") & bit_mask) >> 3);
+ return ((input_port_read(machine(), "COINAGE") & bit_mask) >> 3);
default:
logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
return 0;
}
}
-static CUSTOM_INPUT( starspnr_payout_r )
+CUSTOM_INPUT_MEMBER(acefruit_state::starspnr_payout_r)
{
int bit_mask = (FPTR)param;
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field.machine(), "PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field.machine(), "PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(field.machine(), "PAYOUT") & bit_mask) >> 2);
+ return ((input_port_read(machine(), "PAYOUT") & bit_mask) >> 2);
default:
logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -326,14 +329,14 @@ static INPUT_PORTS_START( sidewndr )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Cancel/Clear" )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME( "Refill" ) PORT_TOGGLE
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) /* "Token in" - also "Refill" when "Refill" mode ON */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(sidewndr_payout_r, (void *)0x01)
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,sidewndr_payout_r, (void *)0x01)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN3") // 3
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME( "Hold/Nudge 1" )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME( "Accountancy System" ) PORT_TOGGLE
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN4 ) /* "50P in" */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(sidewndr_payout_r, (void *)0x02)
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,sidewndr_payout_r, (void *)0x02)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("IN4") // 4
@@ -440,7 +443,7 @@ static INPUT_PORTS_START( starspnr )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Collect/Cancel" )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
/* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x08) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x08) /* to be confirmed */
PORT_START("IN2") // 2
/* tested at 0xe83c */
@@ -450,7 +453,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xef82 after IN5 bit 1 and after IN1 bit 3 - after coins are tested - table at 0xefa8 (3 bytes) */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0xeeba with IN3 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x02) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x02) /* to be confirmed */
/* tested at 0x1b0f */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -459,7 +462,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xe8ea and 0xecbe */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0xeeba with IN2 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x01) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x01) /* to be confirmed */
/* tested at 0x0178 */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -470,7 +473,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xed86 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0xeed7 with IN1 bit 3 - before coins are tested - table at 0xef55 (4 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_coinage_r, (void *)0x04) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_coinage_r, (void *)0x04) /* to be confirmed */
PORT_START("IN5") // 5
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME( "Hold 3" )
@@ -479,7 +482,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xec6f */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0x1d60 with IN6 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, (void *)0x01) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_payout_r, (void *)0x01) /* to be confirmed */
/* tested at 0xe312 and 0xe377 */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -488,7 +491,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xee42, 0xee5e and 0xeff5 before IN1 bit 0 - invalid code after 0xf000 */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0x1d60 with IN5 bit 3 and IN7 bit 3 - table at 0x1d90 (8 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, (void *)0x02) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_payout_r, (void *)0x02) /* to be confirmed */
/* tested at 0xe8dd and 0xec1c */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -500,7 +503,7 @@ static INPUT_PORTS_START( starspnr )
/* tested at 0xedcb */
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
/* tested at 0x1d60 with IN5 bit 3 and IN6 bit 3 - table at 0x1d90 (8 * 3 bytes) */
- PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM(starspnr_payout_r, (void *)0x04) /* to be confirmed */
+ PORT_BIT( 0x08, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, acefruit_state,starspnr_payout_r, (void *)0x04) /* to be confirmed */
/* tested at 0xec2a */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 1d33f22bf34..c7470827df4 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -42,6 +42,9 @@ public:
emu_timer *m_serial_timer;
UINT8 m_serial_timer_active;
UINT16 m_input_select;
+ DECLARE_CUSTOM_INPUT_MEMBER(lightgun_pos_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(lightgun_trigger_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(lightgun_holster_r);
};
static TIMER_CALLBACK( response_timer );
@@ -184,32 +187,29 @@ static void alg_potgo_w(running_machine &machine, UINT16 data)
}
-static CUSTOM_INPUT( lightgun_pos_r )
+CUSTOM_INPUT_MEMBER(alg_state::lightgun_pos_r)
{
- alg_state *state = field.machine().driver_data<alg_state>();
int x = 0, y = 0;
/* get the position based on the input select */
- get_lightgun_pos(*field.machine().primary_screen, state->m_input_select, &x, &y);
+ get_lightgun_pos(*machine().primary_screen, m_input_select, &x, &y);
return (y << 8) | (x >> 2);
}
-static CUSTOM_INPUT( lightgun_trigger_r )
+CUSTOM_INPUT_MEMBER(alg_state::lightgun_trigger_r)
{
- alg_state *state = field.machine().driver_data<alg_state>();
/* read the trigger control based on the input select */
- return (input_port_read(field.machine(), "TRIGGERS") >> state->m_input_select) & 1;
+ return (input_port_read(machine(), "TRIGGERS") >> m_input_select) & 1;
}
-static CUSTOM_INPUT( lightgun_holster_r )
+CUSTOM_INPUT_MEMBER(alg_state::lightgun_holster_r)
{
- alg_state *state = field.machine().driver_data<alg_state>();
/* read the holster control based on the input select */
- return (input_port_read(field.machine(), "TRIGGERS") >> (2 + state->m_input_select)) & 1;
+ return (input_port_read(machine(), "TRIGGERS") >> (2 + m_input_select)) & 1;
}
@@ -341,7 +341,7 @@ static INPUT_PORTS_START( alg )
PORT_BIT( 0xaaff, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("HVPOS") /* read by Amiga core */
- PORT_BIT( 0x1ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(lightgun_pos_r, NULL)
+ PORT_BIT( 0x1ffff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,lightgun_pos_r, NULL)
PORT_START("FIRE")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
@@ -372,13 +372,13 @@ static INPUT_PORTS_START( alg_2p )
PORT_MODIFY("POTGO")
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(lightgun_trigger_r, NULL)
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,lightgun_trigger_r, NULL)
PORT_MODIFY("FIRE")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("P2JOY")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(lightgun_holster_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,lightgun_holster_r, NULL)
PORT_START("GUN2X") /* referenced by lightgun_pos_r */
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(2)
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index 63ca6f57848..020359df16f 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -64,6 +64,7 @@ public:
UINT8 coin_counter[2];
DECLARE_WRITE16_MEMBER(arcadia_multibios_change_game);
+ DECLARE_CUSTOM_INPUT_MEMBER(coin_counter_r);
};
@@ -156,10 +157,9 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_portb_w )
*
*************************************/
-static CUSTOM_INPUT( coin_counter_r )
+CUSTOM_INPUT_MEMBER(arcadia_amiga_state::coin_counter_r)
{
int coin = (FPTR)param;
- UINT8 *coin_counter = field.machine().driver_data<arcadia_amiga_state>()->coin_counter;
/* return coin counter values */
return coin_counter[coin] & 3;
@@ -229,8 +229,8 @@ static INPUT_PORTS_START( arcadia )
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(coin_counter_r, 0)
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(coin_counter_r, 1)
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,coin_counter_r, 0)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,coin_counter_r, 1)
PORT_START("JOY0DAT")
PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(amiga_joystick_convert, "P1JOY")
diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c
index b7b2ff07ec7..2589e903437 100644
--- a/src/mame/drivers/bwidow.c
+++ b/src/mame/drivers/bwidow.c
@@ -234,6 +234,7 @@ public:
DECLARE_READ8_MEMBER(spacduel_IN3_r);
DECLARE_WRITE8_MEMBER(bwidow_misc_w);
DECLARE_WRITE8_MEMBER(irq_ack_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
};
@@ -317,9 +318,9 @@ READ8_MEMBER(bwidow_state::spacduel_IN3_r)
return res;
}
-static CUSTOM_INPUT( clock_r )
+CUSTOM_INPUT_MEMBER(bwidow_state::clock_r)
{
- return (field.machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
@@ -424,7 +425,7 @@ static INPUT_PORTS_START( bwidow )
/* per default (busy vector processor). */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, NULL)
PORT_START("DSW0")
PORT_DIPNAME(0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("D4:!7,!8")
@@ -503,7 +504,7 @@ static INPUT_PORTS_START( gravitar )
/* per default (busy vector processor). */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, NULL)
PORT_START("DSW0")
PORT_DIPUNUSED_DIPLOC( 0x03, IP_ACTIVE_HIGH, "D4:!7,!8" )
@@ -577,7 +578,7 @@ static INPUT_PORTS_START( lunarbat )
/* per default (busy vector processor). */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, NULL)
PORT_START("DSW0") /* DSW0 - Not read */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -611,7 +612,7 @@ static INPUT_PORTS_START( spacduel )
/* per default (busy vector processor). */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
/* bit 7 is tied to a 3kHz clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bwidow_state,clock_r, NULL)
PORT_START("DSW0")
PORT_DIPNAME(0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("D4:!7,!8")
diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c
index a9390f52574..119c5c8ae06 100644
--- a/src/mame/drivers/dacholer.c
+++ b/src/mame/drivers/dacholer.c
@@ -81,6 +81,7 @@ public:
DECLARE_WRITE8_MEMBER(snd_ack_w);
DECLARE_WRITE8_MEMBER(snd_irq_w);
DECLARE_WRITE8_MEMBER(music_irq_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(snd_ack_r);
};
static TILE_GET_INFO( get_bg_tile_info )
@@ -266,10 +267,9 @@ WRITE8_MEMBER(dacholer_state::snd_ack_w)
m_snd_ack = data;
}
-static CUSTOM_INPUT( snd_ack_r )
+CUSTOM_INPUT_MEMBER(dacholer_state::snd_ack_r)
{
- dacholer_state *state = field.machine().driver_data<dacholer_state>();
- return state->m_snd_ack; //guess ...
+ return m_snd_ack; //guess ...
}
WRITE8_MEMBER(dacholer_state::snd_irq_w)
@@ -345,7 +345,7 @@ static INPUT_PORTS_START( dacholer )
PORT_DIPSETTING( 0x04, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(snd_ack_r, NULL)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dacholer_state,snd_ack_r, NULL)
PORT_START("DSWB")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) /* table at 0x0a9c */
diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c
index 3821126fa57..620426fb676 100644
--- a/src/mame/drivers/ddayjlc.c
+++ b/src/mame/drivers/ddayjlc.c
@@ -94,6 +94,7 @@ public:
DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_WRITE8_MEMBER(i8257_CH0_w);
DECLARE_WRITE8_MEMBER(i8257_LMSR_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(prot_r);
};
@@ -140,10 +141,9 @@ static const UINT8 prot_data[0x10] =
0x03, 0x01, 0x00, 0x03
};
-static CUSTOM_INPUT( prot_r )
+CUSTOM_INPUT_MEMBER(ddayjlc_state::prot_r)
{
- ddayjlc_state *state = field.machine().driver_data<ddayjlc_state>();
- return prot_data[state->m_prot_addr];
+ return prot_data[m_prot_addr];
}
WRITE8_MEMBER(ddayjlc_state::prot_w)
@@ -293,7 +293,7 @@ static INPUT_PORTS_START( ddayjlc )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE1 )
- PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(prot_r, NULL)
+ PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ddayjlc_state,prot_r, NULL)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("DSW1")
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index a8bde08b84b..0c69d7d5a1d 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -105,6 +105,8 @@ public:
DECLARE_WRITE8_MEMBER(led_den2_w);
DECLARE_READ8_MEMBER(laserdisc_r);
DECLARE_WRITE8_MEMBER(laserdisc_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_status_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_command_r);
};
@@ -360,17 +362,15 @@ WRITE8_MEMBER(dlair_state::led_den2_w)
*
*************************************/
-static CUSTOM_INPUT( laserdisc_status_r )
+CUSTOM_INPUT_MEMBER(dlair_state::laserdisc_status_r)
{
- dlair_state *state = field.machine().driver_data<dlair_state>();
- return state->laserdisc_status_r();
+ return laserdisc_status_r();
}
-static CUSTOM_INPUT( laserdisc_command_r )
+CUSTOM_INPUT_MEMBER(dlair_state::laserdisc_command_r)
{
- dlair_state *state = field.machine().driver_data<dlair_state>();
- return (state->laserdisc_ready_r() == ASSERT_LINE) ? 0 : 1;
+ return (laserdisc_ready_r() == ASSERT_LINE) ? 0 : 1;
}
@@ -579,8 +579,8 @@ static INPUT_PORTS_START( dlair )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_status_r, NULL) /* status strobe */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_command_r, NULL) /* command strobe */
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_status_r, NULL) /* status strobe */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_command_r, NULL) /* command strobe */
INPUT_PORTS_END
@@ -611,8 +611,8 @@ static INPUT_PORTS_START( dleuro )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_status_r, NULL) /* status strobe */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_command_r, NULL) /* command strobe */
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_status_r, NULL) /* status strobe */
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dlair_state,laserdisc_command_r, NULL) /* command strobe */
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("A:2,1")
diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c
index 143038693f9..74117b0f23d 100644
--- a/src/mame/drivers/dorachan.c
+++ b/src/mame/drivers/dorachan.c
@@ -31,6 +31,8 @@ public:
/* devices */
device_t *m_main_cpu;
DECLARE_WRITE8_MEMBER(dorachan_ctrl_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(dorachan_protection_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(dorachan_v128_r);
};
@@ -40,19 +42,18 @@ public:
*
*************************************/
-static CUSTOM_INPUT( dorachan_protection_r )
+CUSTOM_INPUT_MEMBER(dorachan_state::dorachan_protection_r)
{
- dorachan_state *state = field.machine().driver_data<dorachan_state>();
UINT8 ret = 0;
- switch (cpu_get_previouspc(state->m_main_cpu))
+ switch (cpu_get_previouspc(m_main_cpu))
{
case 0x70ce: ret = 0xf2; break;
case 0x72a2: ret = 0xd5; break;
case 0x72b5: ret = 0xcb; break;
default:
- mame_printf_debug("unhandled $2400 read @ %x\n", cpu_get_previouspc(state->m_main_cpu));
+ mame_printf_debug("unhandled $2400 read @ %x\n", cpu_get_previouspc(m_main_cpu));
break;
}
@@ -127,12 +128,11 @@ WRITE8_MEMBER(dorachan_state::dorachan_ctrl_w)
}
-static CUSTOM_INPUT( dorachan_v128_r )
+CUSTOM_INPUT_MEMBER(dorachan_state::dorachan_v128_r)
{
- dorachan_state *state = field.machine().driver_data<dorachan_state>();
/* to avoid resetting (when player 2 starts) bit 0 need to be inverted when screen is flipped */
- return ((field.machine().primary_screen->vpos() >> 7) & 0x01) ^ state->m_flip_screen;
+ return ((machine().primary_screen->vpos() >> 7) & 0x01) ^ m_flip_screen;
}
@@ -180,7 +180,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( dorachan )
PORT_START("PROT")
- PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dorachan_protection_r, NULL)
+ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dorachan_state,dorachan_protection_r, NULL)
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
@@ -209,7 +209,7 @@ static INPUT_PORTS_START( dorachan )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
PORT_START("V128")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(dorachan_v128_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, dorachan_state,dorachan_v128_r, NULL)
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/ecoinfr.c b/src/mame/drivers/ecoinfr.c
index 14167440061..079339752ba 100644
--- a/src/mame/drivers/ecoinfr.c
+++ b/src/mame/drivers/ecoinfr.c
@@ -80,6 +80,9 @@ public:
DECLARE_WRITE8_MEMBER(ec_port16_out_w);
DECLARE_WRITE8_MEMBER(ec_port17_out_w);
DECLARE_WRITE8_MEMBER(ec_port18_out_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel1_opto_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel2_opto_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(ecoinfr_reel3_opto_r);
};
@@ -389,17 +392,17 @@ static ADDRESS_MAP_START( portmap, AS_IO, 8, ecoinfr_state )
AM_RANGE(0x18, 0x18) AM_WRITE(ec_port18_out_w) // 24 (Watchdog)
ADDRESS_MAP_END
-static CUSTOM_INPUT( ecoinfr_reel1_opto_r )
+CUSTOM_INPUT_MEMBER(ecoinfr_state::ecoinfr_reel1_opto_r)
{
return 0;
}
-static CUSTOM_INPUT( ecoinfr_reel2_opto_r )
+CUSTOM_INPUT_MEMBER(ecoinfr_state::ecoinfr_reel2_opto_r)
{
return 0;
}
-static CUSTOM_INPUT( ecoinfr_reel3_opto_r )
+CUSTOM_INPUT_MEMBER(ecoinfr_state::ecoinfr_reel3_opto_r)
{
return 0;
}
@@ -432,12 +435,12 @@ static INPUT_PORTS_START( ecoinfr_barx )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ecoinfr_reel1_opto_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ecoinfr_state,ecoinfr_reel1_opto_r, NULL)
PORT_DIPNAME( 0x02, 0x02, "IN1:02" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ecoinfr_reel3_opto_r, NULL)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ecoinfr_reel2_opto_r, NULL)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ecoinfr_state,ecoinfr_reel3_opto_r, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ecoinfr_state,ecoinfr_reel2_opto_r, NULL)
PORT_DIPNAME( 0x10, 0x10, "IN1:10" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 7d137b92fc1..28a10165d2e 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -81,6 +81,8 @@ public:
DECLARE_READ8_MEMBER(dip_switch_r);
DECLARE_WRITE8_MEMBER(sound_data_w);
DECLARE_WRITE8_MEMBER(enigma2_flip_screen_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(p1_controls_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(p2_controls_r);
};
@@ -414,19 +416,18 @@ WRITE8_MEMBER(enigma2_state::enigma2_flip_screen_w)
}
-static CUSTOM_INPUT( p1_controls_r )
+CUSTOM_INPUT_MEMBER(enigma2_state::p1_controls_r)
{
- return input_port_read(field.machine(), "P1CONTROLS");
+ return input_port_read(machine(), "P1CONTROLS");
}
-static CUSTOM_INPUT( p2_controls_r )
+CUSTOM_INPUT_MEMBER(enigma2_state::p2_controls_r)
{
- enigma2_state *state = field.machine().driver_data<enigma2_state>();
- if (state->m_flip_screen)
- return input_port_read(field.machine(), "P2CONTROLS");
+ if (m_flip_screen)
+ return input_port_read(machine(), "P2CONTROLS");
else
- return input_port_read(field.machine(), "P1CONTROLS");
+ return input_port_read(machine(), "P1CONTROLS");
}
@@ -497,14 +498,14 @@ static INPUT_PORTS_START( enigma2 )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
- PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(p1_controls_r, NULL)
+ PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p1_controls_r, NULL)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN1")
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( 0x78, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(p2_controls_r, NULL)
+ PORT_BIT( 0x78, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p2_controls_r, NULL)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("DSW")
@@ -552,7 +553,7 @@ static INPUT_PORTS_START( enigma2a )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(p1_controls_r, NULL)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p1_controls_r, NULL)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN1")
@@ -560,7 +561,7 @@ static INPUT_PORTS_START( enigma2a )
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( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(p2_controls_r, NULL)
+ PORT_BIT( 0x70, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, enigma2_state,p2_controls_r, NULL)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("DSW")
diff --git a/src/mame/drivers/famibox.c b/src/mame/drivers/famibox.c
index 6cf98e76079..d4cb4ba5596 100644
--- a/src/mame/drivers/famibox.c
+++ b/src/mame/drivers/famibox.c
@@ -99,6 +99,7 @@ public:
DECLARE_READ8_MEMBER(famibox_IN1_r);
DECLARE_READ8_MEMBER(famibox_system_r);
DECLARE_WRITE8_MEMBER(famibox_system_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(famibox_coin_r);
};
/******************************************************
@@ -424,10 +425,9 @@ static INPUT_CHANGED( coin_inserted )
}
}
-static CUSTOM_INPUT( famibox_coin_r )
+CUSTOM_INPUT_MEMBER(famibox_state::famibox_coin_r)
{
- famibox_state *state = field.machine().driver_data<famibox_state>();
- return state->m_coins > 0;
+ return m_coins > 0;
}
static INPUT_PORTS_START( famibox )
@@ -484,7 +484,7 @@ static INPUT_PORTS_START( famibox )
PORT_DIPSETTING( 0x08, "Key position 4" )
PORT_DIPSETTING( 0x10, "Key position 5" )
PORT_DIPSETTING( 0x20, "Key position 6" )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(famibox_coin_r, NULL)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, famibox_state,famibox_coin_r, NULL)
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index b10bc9ebae4..e2d118c9e38 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -86,6 +86,8 @@ public:
DECLARE_WRITE8_MEMBER(self_reset_w);
DECLARE_WRITE8_MEMBER(led_w);
DECLARE_WRITE8_MEMBER(firefox_coin_counter_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(mainflag_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(soundflag_r);
};
@@ -282,16 +284,14 @@ WRITE8_MEMBER(firefox_state::firefox_objram_bank_w)
*
*************************************/
-static CUSTOM_INPUT( mainflag_r )
+CUSTOM_INPUT_MEMBER(firefox_state::mainflag_r)
{
- firefox_state *state = field.machine().driver_data<firefox_state>();
- return state->m_main_to_sound_flag;
+ return m_main_to_sound_flag;
}
-static CUSTOM_INPUT( soundflag_r )
+CUSTOM_INPUT_MEMBER(firefox_state::soundflag_r)
{
- firefox_state *state = field.machine().driver_data<firefox_state>();
- return state->m_sound_to_main_flag;
+ return m_sound_to_main_flag;
}
READ8_MEMBER(firefox_state::sound_to_main_r)
@@ -573,8 +573,8 @@ static INPUT_PORTS_START( firefox )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("rdin1")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mainflag_r, NULL)
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(soundflag_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,mainflag_r, NULL)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, firefox_state,soundflag_r, NULL)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
diff --git a/src/mame/drivers/galaxi.c b/src/mame/drivers/galaxi.c
index 99d144a6f2f..5ca31f0b97b 100644
--- a/src/mame/drivers/galaxi.c
+++ b/src/mame/drivers/galaxi.c
@@ -79,6 +79,8 @@ public:
DECLARE_WRITE16_MEMBER(galaxi_500000_w);
DECLARE_WRITE16_MEMBER(galaxi_500002_w);
DECLARE_WRITE16_MEMBER(galaxi_500004_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(ticket_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
};
@@ -259,16 +261,14 @@ WRITE16_MEMBER(galaxi_state::galaxi_500004_w)
show_out(machine());
}
-static CUSTOM_INPUT( ticket_r )
+CUSTOM_INPUT_MEMBER(galaxi_state::ticket_r)
{
- galaxi_state *state = field.machine().driver_data<galaxi_state>();
- return state->m_ticket && !(field.machine().primary_screen->frame_number() % 10);
+ return m_ticket && !(machine().primary_screen->frame_number() % 10);
}
-static CUSTOM_INPUT( hopper_r )
+CUSTOM_INPUT_MEMBER(galaxi_state::hopper_r)
{
- galaxi_state *state = field.machine().driver_data<galaxi_state>();
- return state->m_hopper && !(field.machine().primary_screen->frame_number() % 10);
+ return m_hopper && !(machine().primary_screen->frame_number() % 10);
}
@@ -308,11 +308,11 @@ static INPUT_PORTS_START( galaxi )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM( hopper_r, (void *)0 ) // hopper sensor
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state,hopper_r, (void *)0 ) // hopper sensor
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(5) // coin a
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(5) // coin b (token)
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_COIN3 ) // pin 25LC
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( ticket_r, (void *)0 ) // ticket sensor
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state,ticket_r, (void *)0 ) // ticket sensor
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) // hopper out (pin 14LS)
PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_HIGH ) // test
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_SPECIAL ) // (pin 26LC)
@@ -328,11 +328,11 @@ static INPUT_PORTS_START( magjoker )
PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 )
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT )
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) // hopper sensor
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state,hopper_r, (void *)0 ) // hopper sensor
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(5) // coin a
PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(5) // coin b (token)
PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Hopper Refill") PORT_CODE(KEYCODE_H)
- PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( ticket_r, (void *)0 ) // ticket sensor
+ PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, galaxi_state,ticket_r, (void *)0 ) // ticket sensor
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SPECIAL ) // hopper out (pin 14LS)
PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_HIGH ) // test
PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) // (pin 26LC)
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index de1a7cf2f9a..f7feef2cc60 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -170,34 +170,36 @@ public:
DECLARE_WRITE32_MEMBER(gstream_oki_banking_w);
DECLARE_WRITE32_MEMBER(gstream_oki_4040_w);
DECLARE_READ32_MEMBER(gstream_speedup_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(gstream_mirror_service_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(gstream_mirror_r);
};
-static CUSTOM_INPUT( gstream_mirror_service_r )
+CUSTOM_INPUT_MEMBER(gstream_state::gstream_mirror_service_r)
{
int result;
/* PORT_SERVICE_NO_TOGGLE */
- result = (input_port_read(field.machine(), "IN0") & 0x8000) >> 15;
+ result = (input_port_read(machine(), "IN0") & 0x8000) >> 15;
return ~result;
}
-static CUSTOM_INPUT( gstream_mirror_r )
+CUSTOM_INPUT_MEMBER(gstream_state::gstream_mirror_r)
{
int result;
/* IPT_COIN1 */
- result = ((input_port_read(field.machine(), "IN0") & 0x200) >> 9) << 0;
+ result = ((input_port_read(machine(), "IN0") & 0x200) >> 9) << 0;
/* IPT_COIN2 */
- result |= ((input_port_read(field.machine(), "IN1") & 0x200) >> 9) << 1;
+ result |= ((input_port_read(machine(), "IN1") & 0x200) >> 9) << 1;
/* IPT_START1 */
- result |= ((input_port_read(field.machine(), "IN0") & 0x400) >> 10) << 2;
+ result |= ((input_port_read(machine(), "IN0") & 0x400) >> 10) << 2;
/* IPT_START2 */
- result |= ((input_port_read(field.machine(), "IN1") & 0x400) >> 10) << 3;
+ result |= ((input_port_read(machine(), "IN1") & 0x400) >> 10) << 3;
/* PORT_SERVICE_NO_TOGGLE */
- result |= ((input_port_read(field.machine(), "IN0") & 0x8000) >> 15) << 6;
+ result |= ((input_port_read(machine(), "IN0") & 0x8000) >> 15) << 6;
return ~result;
}
@@ -394,10 +396,10 @@ static INPUT_PORTS_START( gstream )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x7000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(gstream_mirror_service_r, NULL)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gstream_state,gstream_mirror_service_r, NULL)
PORT_START("IN2")
- PORT_BIT( 0x004f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(gstream_mirror_r, NULL)
+ PORT_BIT( 0x004f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, gstream_state,gstream_mirror_r, NULL)
PORT_BIT( 0xffb0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index bcbf613182d..827ecb39b10 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -60,6 +60,7 @@ public:
DECLARE_WRITE8_MEMBER(jingbell_magic_w);
DECLARE_READ8_MEMBER(jingbell_magic_r);
void show_out();
+ DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
};
@@ -343,10 +344,9 @@ static SCREEN_UPDATE_IND16(jingbell)
***************************************************************************/
-static CUSTOM_INPUT( hopper_r )
+CUSTOM_INPUT_MEMBER(igs009_state::hopper_r)
{
- igs009_state *state = field.machine().driver_data<igs009_state>();
- return state->m_hopper && !(field.machine().primary_screen->frame_number()%10);
+ return m_hopper && !(machine().primary_screen->frame_number()%10);
}
@@ -549,7 +549,7 @@ static INPUT_PORTS_START( jingbell )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Memory Clear") // stats, memory
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igs009_state,hopper_r, (void *)0 ) // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Pay Out")
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // test (press during boot)
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index 9a9814b1c6d..8aa91b11363 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -173,6 +173,7 @@ public:
DECLARE_WRITE16_MEMBER(vbowl_link_2_w);
DECLARE_WRITE16_MEMBER(vbowl_link_3_w);
UINT16 igs_dips_r(int NUM);
+ DECLARE_CUSTOM_INPUT_MEMBER(igs_hopper_r);
};
@@ -520,10 +521,9 @@ WRITE16_MEMBER(igs011_state::igs011_blit_flags_w)
// Inputs
-static CUSTOM_INPUT( igs_hopper_r )
+CUSTOM_INPUT_MEMBER(igs011_state::igs_hopper_r)
{
- igs011_state *state = field.machine().driver_data<igs011_state>();
- return (state->m_igs_hopper && ((field.machine().primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
+ return (m_igs_hopper && ((machine().primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
}
WRITE16_MEMBER(igs011_state::igs_dips_w)
@@ -2857,7 +2857,7 @@ static INPUT_PORTS_START( lhb2 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) // data clear
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(igs_hopper_r, (void *)0) // hopper switch
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, (void *)0) // hopper switch
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // stats
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // clear coin
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2986,7 +2986,7 @@ static INPUT_PORTS_START( wlcc )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // shown in test mode
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // clear coin
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(igs_hopper_r, (void *)0) // hopper switch
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, (void *)0) // hopper switch
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
@@ -3115,7 +3115,7 @@ static INPUT_PORTS_START( lhb )
PORT_DIPUNKNOWN( 0x80, 0x80 )
PORT_START("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(igs_hopper_r, (void *)0) // hopper switch
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, (void *)0) // hopper switch
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) // system reset
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // stats
@@ -3442,7 +3442,7 @@ static INPUT_PORTS_START( xymg )
PORT_DIPUNKNOWN( 0x80, 0x80 )
PORT_START("COIN")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(igs_hopper_r, (void *)0) // hopper switch
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, igs011_state,igs_hopper_r, (void *)0) // hopper switch
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // stats
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index 59861db9a1c..dacda10d9da 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -102,6 +102,7 @@ public:
DECLARE_WRITE8_MEMBER(custom_io_w);
DECLARE_READ8_MEMBER(exp_rom_r);
void show_out();
+ DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
};
@@ -332,11 +333,10 @@ WRITE8_MEMBER(igspoker_state::custom_io_w)
}
}
-static CUSTOM_INPUT( hopper_r )
+CUSTOM_INPUT_MEMBER(igspoker_state::hopper_r)
{
- igspoker_state *state = field.machine().driver_data<igspoker_state>();
- if (state->m_hopper) return !(field.machine().primary_screen->frame_number()%10);
- return field.machine().input().code_pressed(KEYCODE_H);
+ if (m_hopper) return !(machine().primary_screen->frame_number()%10);
+ return machine().input().code_pressed(KEYCODE_H);
}
READ8_MEMBER(igspoker_state::exp_rom_r)
@@ -481,7 +481,7 @@ static INPUT_PORTS_START( cpoker )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -615,7 +615,7 @@ static INPUT_PORTS_START( cpokerx )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Attendent")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -780,7 +780,7 @@ static INPUT_PORTS_START( csk227 )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
@@ -925,7 +925,7 @@ static INPUT_PORTS_START( csk234 )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1077,7 +1077,7 @@ static INPUT_PORTS_START( igs_ncs )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1397,7 +1397,7 @@ static INPUT_PORTS_START( cpokerpk )
PORT_DIPSETTING( 0x00, "100:1" )
PORT_START("SERVICE")
- PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1532,7 +1532,7 @@ static INPUT_PORTS_START( chleague )
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SERVICE")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
@@ -1671,7 +1671,7 @@ static INPUT_PORTS_START( pktet346 )
PORT_START("SERVICE")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,igspoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index 610ef9ed1d9..a199ff24825 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -96,6 +96,7 @@ public:
void jackie_unk_reg_lo_w( int offset, UINT8 data, int reg );
void jackie_unk_reg_hi_w( int offset, UINT8 data, int reg );
void show_out();
+ DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
};
@@ -384,11 +385,10 @@ static ADDRESS_MAP_START( jackie_io_map, AS_IO, 8, jackie_state )
AM_RANGE(0x8000, 0xffff) AM_READ(expram_r)
ADDRESS_MAP_END
-static CUSTOM_INPUT( hopper_r )
+CUSTOM_INPUT_MEMBER(jackie_state::hopper_r)
{
- jackie_state *state = field.machine().driver_data<jackie_state>();
- if (state->m_hopper) return !(field.machine().primary_screen->frame_number()%10);
- return field.machine().input().code_pressed(KEYCODE_H);
+ if (m_hopper) return !(machine().primary_screen->frame_number()%10);
+ return machine().input().code_pressed(KEYCODE_H);
}
static INPUT_PORTS_START( jackie )
@@ -464,7 +464,7 @@ static INPUT_PORTS_START( jackie )
PORT_START("SERVICE")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_9) PORT_NAME("Attendent")
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,jackie_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW ) // test (press during boot)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
diff --git a/src/mame/drivers/jankenmn.c b/src/mame/drivers/jankenmn.c
index bf5a5af8037..325b97f525c 100644
--- a/src/mame/drivers/jankenmn.c
+++ b/src/mame/drivers/jankenmn.c
@@ -151,6 +151,7 @@ public:
jankenmn_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { }
+ DECLARE_CUSTOM_INPUT_MEMBER(jankenmn_hopper_status_r);
};
@@ -214,10 +215,10 @@ static WRITE8_DEVICE_HANDLER( jankenmn_lamps3_w )
// d0, d6, d7: N/C?
}
-static CUSTOM_INPUT( jankenmn_hopper_status_r )
+CUSTOM_INPUT_MEMBER(jankenmn_state::jankenmn_hopper_status_r)
{
// temp workaround, needs hopper
- return field.machine().rand();
+ return machine().rand();
}
@@ -251,7 +252,7 @@ static INPUT_PORTS_START( jankenmn )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("Paa (Paper)")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // 100 yen coin
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(jankenmn_hopper_status_r, NULL)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, jankenmn_state,jankenmn_hopper_status_r, NULL)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 ) // 10 yen coin
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) // 10 yen coin
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 18f1aaf4072..0964b0e6de7 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -465,6 +465,9 @@ public:
int m_tank_shutter_position;
int m_cable_holder_release;
double m_pad_position[ 6 ];
+ DECLARE_CUSTOM_INPUT_MEMBER(gn845pwbb_read);
+ DECLARE_CUSTOM_INPUT_MEMBER(gunmania_tank_shutter_sensor);
+ DECLARE_CUSTOM_INPUT_MEMBER(gunmania_cable_holder_sensor);
};
INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
@@ -1668,11 +1671,10 @@ static void gn845pwbb_clk_w( running_machine &machine, int offset, int data )
state->m_stage[ offset ].state, state->m_stage[ offset ].DO, state->m_stage[ offset ].shift, state->m_stage[ offset ].bit, state->m_stage_mask );
}
-static CUSTOM_INPUT( gn845pwbb_read )
+CUSTOM_INPUT_MEMBER(ksys573_state::gn845pwbb_read)
{
- ksys573_state *state = field.machine().driver_data<ksys573_state>();
- return input_port_read(field.machine(), "STAGE") & state->m_stage_mask;
+ return input_port_read(machine(), "STAGE") & m_stage_mask;
}
static void gn845pwbb_output_callback( running_machine &machine, int offset, int data )
@@ -2896,11 +2898,10 @@ static WRITE32_HANDLER( gunmania_w )
verboselog( space->machine(), 2, "gunmania_w %08x %08x %08x\n", offset, mem_mask, data );
}
-static CUSTOM_INPUT( gunmania_tank_shutter_sensor )
+CUSTOM_INPUT_MEMBER(ksys573_state::gunmania_tank_shutter_sensor)
{
- ksys573_state *state = field.machine().driver_data<ksys573_state>();
- if( state->m_tank_shutter_position == 0 )
+ if( m_tank_shutter_position == 0 )
{
return 1;
}
@@ -2908,11 +2909,10 @@ static CUSTOM_INPUT( gunmania_tank_shutter_sensor )
return 0;
}
-static CUSTOM_INPUT( gunmania_cable_holder_sensor )
+CUSTOM_INPUT_MEMBER(ksys573_state::gunmania_cable_holder_sensor)
{
- ksys573_state *state = field.machine().driver_data<ksys573_state>();
- return state->m_cable_holder_release;
+ return m_cable_holder_release;
}
static READ32_HANDLER( gunmania_r )
@@ -3357,7 +3357,7 @@ static INPUT_PORTS_START( ddr )
PORT_INCLUDE( konami573 )
PORT_MODIFY("IN2")
- PORT_BIT( 0x00000f0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(gn845pwbb_read, NULL)
+ PORT_BIT( 0x00000f0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ksys573_state,gn845pwbb_read, NULL)
PORT_START( "STAGE" )
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_PLAYER(1)
@@ -3503,11 +3503,11 @@ static INPUT_PORTS_START( gunmania )
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(1) PORT_NAME( "Bullet Tube-1 Sensor" )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME( "Bullet Tube-2 Sensor" )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME( "Safety Sensor Under" )
- PORT_BIT( 0x00000100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( gunmania_tank_shutter_sensor, NULL )
+ PORT_BIT( 0x00000100, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,ksys573_state,gunmania_tank_shutter_sensor, NULL )
PORT_MODIFY("IN3")
PORT_BIT( 0x0d000b00, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM( gunmania_cable_holder_sensor, NULL )
+ PORT_BIT( 0x02000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,ksys573_state,gunmania_cable_holder_sensor, NULL )
PORT_START("GUNX")
PORT_BIT( 0x7f, 0x2f, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(0x00,0x5f) PORT_SENSITIVITY(100) PORT_KEYDELTA(15) PORT_PLAYER(1)
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 8147d5425f2..cf3290f334a 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -66,6 +66,7 @@ public:
DECLARE_READ32_MEMBER(legendoh_speedup_r);
DECLARE_READ32_MEMBER(sb2003_speedup_r);
DECLARE_READ32_MEMBER(spotty_speedup_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(spriteram_bit_r);
};
@@ -121,10 +122,9 @@ WRITE32_MEMBER(limenko_state::spotty_soundlatch_w)
soundlatch_w(space, 0, (data >> 16) & 0xff);
}
-static CUSTOM_INPUT( spriteram_bit_r )
+CUSTOM_INPUT_MEMBER(limenko_state::spriteram_bit_r)
{
- limenko_state *state = field.machine().driver_data<limenko_state>();
- return state->m_spriteram_bit;
+ return m_spriteram_bit;
}
WRITE32_MEMBER(limenko_state::spriteram_buffer_w)
@@ -545,7 +545,7 @@ static INPUT_PORTS_START( legendoh )
PORT_DIPNAME( 0x20000000, 0x00000000, "Sound Enable" )
PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
- PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
+ PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, limenko_state,spriteram_bit_r, NULL) //changes spriteram location
PORT_BIT( 0x4000ffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START( "EEPROMOUT" )
@@ -589,7 +589,7 @@ static INPUT_PORTS_START( sb2003 )
PORT_DIPNAME( 0x20000000, 0x00000000, "Sound Enable" )
PORT_DIPSETTING( 0x20000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
- PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
+ PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, limenko_state,spriteram_bit_r, NULL) //changes spriteram location
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 ) // checked in dynabomb I/O test, but doesn't work in game
PORT_BIT( 0x5f00ffff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -627,7 +627,7 @@ static INPUT_PORTS_START( spotty )
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(spriteram_bit_r, NULL) //changes spriteram location
+ PORT_BIT( 0x00080000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, limenko_state,spriteram_bit_r, NULL) //changes spriteram location
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_SPECIAL ) //security bit
PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit)
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 4d90225a265..e8cb948ab2c 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -106,6 +106,7 @@ public:
DECLARE_WRITE16_MEMBER(littlerb_vdp_w);
DECLARE_WRITE16_MEMBER(littlerb_l_sound_w);
DECLARE_WRITE16_MEMBER(littlerb_r_sound_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(littlerb_frame_step_r);
};
@@ -349,9 +350,9 @@ static ADDRESS_MAP_START( littlerb_main, AS_PROGRAM, 16, littlerb_state )
ADDRESS_MAP_END
/* guess according to DASM code and checking the gameplay speed, could be different */
-static CUSTOM_INPUT( littlerb_frame_step_r )
+CUSTOM_INPUT_MEMBER(littlerb_state::littlerb_frame_step_r)
{
- UINT32 ret = field.machine().primary_screen->frame_number();
+ UINT32 ret = machine().primary_screen->frame_number();
return (ret) & 7;
}
@@ -422,7 +423,7 @@ static INPUT_PORTS_START( littlerb )
PORT_DIPNAME( 0x1000, 0x1000, "???" )
PORT_DIPSETTING( 0x1000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
- PORT_BIT( 0xe000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(littlerb_frame_step_r, NULL)
+ PORT_BIT( 0xe000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, littlerb_state,littlerb_frame_step_r, NULL)
PORT_START("P2") /* 16bit */
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index cb0742802e8..67b4f9585a6 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -77,6 +77,7 @@ public:
DECLARE_READ8_MEMBER(palette_r);
DECLARE_WRITE8_MEMBER(palette_w);
DECLARE_WRITE8_MEMBER(casino5_bank_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(rndbit_r);
};
@@ -345,9 +346,9 @@ WRITE8_MEMBER(merit_state::casino5_bank_w)
}
}
-static CUSTOM_INPUT(rndbit_r)
+CUSTOM_INPUT_MEMBER(merit_state::rndbit_r)
{
- return field.machine().rand();
+ return machine().rand();
}
static ADDRESS_MAP_START( pitboss_map, AS_PROGRAM, 8, merit_state )
@@ -1024,7 +1025,7 @@ static INPUT_PORTS_START( bigappg )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(rndbit_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, merit_state,rndbit_r, NULL)
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x01, "Draw Poker enabled" )
diff --git a/src/mame/drivers/missile.c b/src/mame/drivers/missile.c
index 1e1733cc3bb..79be07f032d 100644
--- a/src/mame/drivers/missile.c
+++ b/src/mame/drivers/missile.c
@@ -369,6 +369,7 @@ public:
UINT16 m_madsel_lastpc;
DECLARE_WRITE8_MEMBER(missile_w);
DECLARE_READ8_MEMBER(missile_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(get_vblank);
};
@@ -450,10 +451,10 @@ static TIMER_CALLBACK( clock_irq )
}
-static CUSTOM_INPUT( get_vblank )
+CUSTOM_INPUT_MEMBER(missile_state::get_vblank)
{
- missile_state *state = field.machine().driver_data<missile_state>();
- int v = scanline_to_v(state, field.machine().primary_screen->vpos());
+ missile_state *state = machine().driver_data<missile_state>();
+ int v = scanline_to_v(state, machine().primary_screen->vpos());
return v < 24;
}
@@ -857,7 +858,7 @@ static INPUT_PORTS_START( missile )
PORT_BIT( 0x18, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_vblank, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, missile_state,get_vblank, NULL)
PORT_START("R10") /* IN2 */
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("R10:1,2")
@@ -939,7 +940,7 @@ static INPUT_PORTS_START( suprmatk )
PORT_BIT( 0x18, IP_ACTIVE_HIGH, IPT_SPECIAL )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT )
PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_vblank, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, missile_state,get_vblank, NULL)
PORT_START("R10") /* IN2 */
PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("R10:1,2")
diff --git a/src/mame/drivers/multfish.c b/src/mame/drivers/multfish.c
index cce894fb606..f0c1cb9703b 100644
--- a/src/mame/drivers/multfish.c
+++ b/src/mame/drivers/multfish.c
@@ -211,6 +211,7 @@ public:
DECLARE_WRITE8_MEMBER(multfish_counters_w);
DECLARE_WRITE8_MEMBER(multfish_f3_w);
DECLARE_WRITE8_MEMBER(multfish_dispenable_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(multfish_hopper_r);
};
static TILE_GET_INFO( get_multfish_tile_info )
@@ -386,14 +387,13 @@ READ8_MEMBER(multfish_state::ray_r)
return machine().primary_screen->vpos();
}
-static CUSTOM_INPUT( multfish_hopper_r )
+CUSTOM_INPUT_MEMBER(multfish_state::multfish_hopper_r)
{
- multfish_state *state = field.machine().driver_data<multfish_state>();
- if ( state->m_hopper_motor != 0 )
+ if ( m_hopper_motor != 0 )
{
- state->m_hopper++;
- return state->m_hopper>>4;
+ m_hopper++;
+ return m_hopper>>4;
}
else
{
@@ -704,7 +704,7 @@ static INPUT_PORTS_START( multfish )
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) // unused?
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM ( multfish_hopper_r, NULL )// Hopper SW (22 B)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, multfish_state,multfish_hopper_r, NULL )// Hopper SW (22 B)
PORT_DIPNAME( 0x02, 0x02, "BK Door (17 A)" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -797,7 +797,7 @@ static INPUT_PORTS_START( rollfr )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM ( multfish_hopper_r, NULL )// Hopper SW (22 B)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, multfish_state,multfish_hopper_r, NULL )// Hopper SW (22 B)
PORT_DIPNAME( 0x02, 0x02, "BK Door (17 A)" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/multigam.c b/src/mame/drivers/multigam.c
index 4fa0c8e79f0..325bc523359 100644
--- a/src/mame/drivers/multigam.c
+++ b/src/mame/drivers/multigam.c
@@ -112,6 +112,7 @@ public:
int m_vrom4k;
UINT8 m_supergm3_prg_bank;
UINT8 m_supergm3_chr_bank;
+ DECLARE_CUSTOM_INPUT_MEMBER(multigam_inputs_r);
};
@@ -261,12 +262,11 @@ static READ8_HANDLER( multigam_IN1_r )
return ((state->m_in_1 >> state->m_in_1_shift++) & 0x01) | 0x40;
}
-static CUSTOM_INPUT( multigam_inputs_r )
+CUSTOM_INPUT_MEMBER(multigam_state::multigam_inputs_r)
{
- multigam_state *state = field.machine().driver_data<multigam_state>();
/* bit 0: serial input (dsw)
bit 1: coin */
- return (state->m_in_dsw >> state->m_in_dsw_shift++) & 0x01;
+ return (m_in_dsw >> m_in_dsw_shift++) & 0x01;
}
@@ -978,7 +978,7 @@ static INPUT_PORTS_START( multigam_common )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(multigam_inputs_r, NULL)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, multigam_state,multigam_inputs_r, NULL)
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
INPUT_PORTS_END
diff --git a/src/mame/drivers/mw18w.c b/src/mame/drivers/mw18w.c
index 794335df487..efee453cced 100644
--- a/src/mame/drivers/mw18w.c
+++ b/src/mame/drivers/mw18w.c
@@ -30,6 +30,7 @@ public:
DECLARE_WRITE8_MEMBER(mw18w_lamps_w);
DECLARE_WRITE8_MEMBER(mw18w_led_display_w);
DECLARE_WRITE8_MEMBER(mw18w_irq0_clear_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(mw18w_sensors_r);
};
@@ -66,7 +67,7 @@ WRITE8_MEMBER(mw18w_state::mw18w_irq0_clear_w)
cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
}
-static CUSTOM_INPUT( mw18w_sensors_r )
+CUSTOM_INPUT_MEMBER(mw18w_state::mw18w_sensors_r)
{
// d7: off road
// d6: in dock area
@@ -114,7 +115,7 @@ static INPUT_PORTS_START( mw18w )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // left/right sw.
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(mw18w_sensors_r, NULL)
+ PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, mw18w_state,mw18w_sensors_r, NULL)
PORT_START("IN1")
PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_REMAP_TABLE(mw18w_controller_table + 0x20) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) // accelerate
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 7f5a976a8dd..a336987afe7 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -232,6 +232,7 @@ public:
DECLARE_READ8_MEMBER(peplus_bgcolor_r);
DECLARE_READ8_MEMBER(peplus_dropdoor_r);
DECLARE_READ8_MEMBER(peplus_watchdog_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(peplus_input_r);
};
@@ -804,10 +805,10 @@ ADDRESS_MAP_END
* Input ports *
*************************/
-static CUSTOM_INPUT( peplus_input_r )
+CUSTOM_INPUT_MEMBER(peplus_state::peplus_input_r)
{
UINT8 inp_ret = 0x00;
- UINT8 inp_read = input_port_read(field.machine(), (const char *)param);
+ UINT8 inp_read = input_port_read(machine(), (const char *)param);
if (inp_read & 0x01) inp_ret = 0x01;
if (inp_read & 0x02) inp_ret = 0x02;
@@ -863,9 +864,9 @@ static INPUT_PORTS_START( peplus_schip )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK1")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK2")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -891,9 +892,9 @@ static INPUT_PORTS_START( peplus_poker )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK1")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK2")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -919,9 +920,9 @@ static INPUT_PORTS_START( peplus_bjack )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK1")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK2")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -952,9 +953,9 @@ static INPUT_PORTS_START( peplus_keno )
PORT_BIT( 0xffff, 0x200, IPT_LIGHTGUN_Y ) PORT_MINMAX(0x00, 1024) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(13)
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK1")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Light Pen") PORT_CODE(KEYCODE_A)
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK2")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
@@ -980,9 +981,9 @@ static INPUT_PORTS_START( peplus_slots )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON15 ) PORT_NAME("Bill Acceptor") PORT_CODE(KEYCODE_U)
PORT_START("IN0")
- PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK1")
+ PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK1")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(peplus_input_r, "IN_BANK2")
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, peplus_state,peplus_input_r, "IN_BANK2")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
diff --git a/src/mame/drivers/peyper.c b/src/mame/drivers/peyper.c
index 8b8a943084e..d035ea1a89d 100644
--- a/src/mame/drivers/peyper.c
+++ b/src/mame/drivers/peyper.c
@@ -18,6 +18,7 @@ public:
DECLARE_WRITE8_MEMBER(lamp_w);
DECLARE_WRITE8_MEMBER(lamp7_w);
DECLARE_WRITE8_MEMBER(sol_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(wolfman_replay_hs_r);
};
@@ -166,16 +167,16 @@ WRITE8_MEMBER(peyper_state::sol_w)
}
-static CUSTOM_INPUT( wolfman_replay_hs_r )
+CUSTOM_INPUT_MEMBER(peyper_state::wolfman_replay_hs_r)
{
int bit_mask = (FPTR)param;
switch (bit_mask)
{
case 0x03:
- return ((input_port_read(field.machine(), "REPLAY") & bit_mask) >> 0);
+ return ((input_port_read(machine(), "REPLAY") & bit_mask) >> 0);
case 0x40:
- return ((input_port_read(field.machine(), "REPLAY") & bit_mask) >> 6);
+ return ((input_port_read(machine(), "REPLAY") & bit_mask) >> 6);
default:
logerror("wolfman_replay_hs_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -450,14 +451,14 @@ static INPUT_PORTS_START( wolfman )
PORT_DIPSETTING( 0x20, "01" )
// PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) ) // Partidas/Moneda - code at 0x0a69 - tables at 0x0b30 (4 * 3) - credits BCD stored at 0x6151
// PORT_DIPNAME( 0x04, 0x00, "Balls" ) // Bolas/Partida - code at 0x0a5c - stored at 0x60bd
- PORT_BIT( 0x03, 0x00, IPT_SPECIAL) PORT_CUSTOM(wolfman_replay_hs_r, (void *)0x03)
+ PORT_BIT( 0x03, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, peyper_state,wolfman_replay_hs_r, (void *)0x03)
/* DSW1 : port 0x24 - DSW1-1 is bit 7 ... DSW1-8 is bit 0 */
PORT_START("DSW1")
PORT_DIPNAME( 0x80, 0x00, "Adjust Replay" ) // Premios por Puntuacion - code at 0x0aa3 - stored at 0x60c4 and 0x60cc (0x00 NO / 0x05 YES)
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
- PORT_BIT( 0x40, 0x00, IPT_SPECIAL) PORT_CUSTOM(wolfman_replay_hs_r, (void *)0x40)
+ PORT_BIT( 0x40, 0x00, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, peyper_state,wolfman_replay_hs_r, (void *)0x40)
PORT_DIPNAME( 0x20, 0x00, "Clear RAM on Reset" ) // Borrador RAM - code at 0x0ace - range 0x6141..0x616f - 0x616d = 0x5a and 0x616e = 0xa5
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x20, DEF_STR( Yes ) )
diff --git a/src/mame/drivers/pzletime.c b/src/mame/drivers/pzletime.c
index f30aba336ac..13f2bc1862c 100644
--- a/src/mame/drivers/pzletime.c
+++ b/src/mame/drivers/pzletime.c
@@ -44,6 +44,7 @@ public:
DECLARE_WRITE16_MEMBER(txt_videoram_w);
DECLARE_WRITE16_MEMBER(ticket_w);
DECLARE_WRITE16_MEMBER(video_regs_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(ticket_status_r);
};
@@ -201,10 +202,9 @@ static WRITE16_DEVICE_HANDLER( oki_bank_w )
downcast<okim6295_device *>(device)->set_bank_base(0x40000 * (data & 0x3));
}
-static CUSTOM_INPUT( ticket_status_r )
+CUSTOM_INPUT_MEMBER(pzletime_state::ticket_status_r)
{
- pzletime_state *state = field.machine().driver_data<pzletime_state>();
- return (state->m_ticket && !(field.machine().primary_screen->frame_number() % 128));
+ return (m_ticket && !(machine().primary_screen->frame_number() % 128));
}
static ADDRESS_MAP_START( pzletime_map, AS_PROGRAM, 16, pzletime_state )
@@ -233,7 +233,7 @@ static INPUT_PORTS_START( pzletime )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_device, read_bit) /* eeprom */
- PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(ticket_status_r, NULL) /* ticket dispenser */
+ PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, pzletime_state,ticket_status_r, NULL) /* ticket dispenser */
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("INPUT")
diff --git a/src/mame/drivers/quizshow.c b/src/mame/drivers/quizshow.c
index d5a5d15a917..41da9000cf0 100644
--- a/src/mame/drivers/quizshow.c
+++ b/src/mame/drivers/quizshow.c
@@ -54,6 +54,7 @@ public:
DECLARE_READ8_MEMBER(quizshow_timing_r);
DECLARE_READ8_MEMBER(quizshow_tape_signal_r);
DECLARE_WRITE8_MEMBER(quizshow_main_ram_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(quizshow_tape_headpos_r);
};
@@ -234,10 +235,9 @@ ADDRESS_MAP_END
***************************************************************************/
-static CUSTOM_INPUT(quizshow_tape_headpos_r)
+CUSTOM_INPUT_MEMBER(quizshow_state::quizshow_tape_headpos_r)
{
- quizshow_state *state = field.machine().driver_data<quizshow_state>();
- return 1 << state->m_tape_head_pos;
+ return 1 << m_tape_head_pos;
}
static INPUT_CHANGED(quizshow_category_select)
@@ -252,7 +252,7 @@ static INPUT_CHANGED(quizshow_category_select)
static INPUT_PORTS_START( quizshow )
PORT_START("IN0") // ADR strobe 0
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(quizshow_tape_headpos_r, NULL)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, quizshow_state,quizshow_tape_headpos_r, NULL)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 )
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index 9c6a70d32ce..a6c685cea52 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -65,6 +65,7 @@ public:
DECLARE_WRITE8_MEMBER(audio_command_w);
DECLARE_READ8_MEMBER(audio_answer_r);
DECLARE_WRITE8_MEMBER(audio_answer_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(get_ttl74123_output);
};
@@ -230,10 +231,9 @@ static WRITE8_DEVICE_HANDLER( ttl74123_output_changed )
}
-static CUSTOM_INPUT( get_ttl74123_output )
+CUSTOM_INPUT_MEMBER(r2dtank_state::get_ttl74123_output)
{
- r2dtank_state *state = field.machine().driver_data<r2dtank_state>();
- return state->m_ttl74123_output;
+ return m_ttl74123_output;
}
@@ -453,7 +453,7 @@ static INPUT_PORTS_START( r2dtank )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_ttl74123_output, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, r2dtank_state,get_ttl74123_output, NULL)
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
diff --git a/src/mame/drivers/rgum.c b/src/mame/drivers/rgum.c
index 5c99a405225..8b215c40f87 100644
--- a/src/mame/drivers/rgum.c
+++ b/src/mame/drivers/rgum.c
@@ -28,6 +28,7 @@ public:
UINT8 *m_vram;
UINT8 *m_cram;
UINT8 m_hbeat;
+ DECLARE_CUSTOM_INPUT_MEMBER(rgum_heartbeat_r);
};
@@ -79,13 +80,12 @@ static ADDRESS_MAP_START( rgum_map, AS_PROGRAM, 8, rgum_state )
ADDRESS_MAP_END
-static CUSTOM_INPUT( rgum_heartbeat_r )
+CUSTOM_INPUT_MEMBER(rgum_state::rgum_heartbeat_r)
{
- rgum_state *state = field.machine().driver_data<rgum_state>();
- state->m_hbeat ^= 1;
+ m_hbeat ^= 1;
- return state->m_hbeat;
+ return m_hbeat;
}
@@ -106,7 +106,7 @@ static INPUT_PORTS_START( rgum )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(rgum_heartbeat_r, NULL)
+ PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, rgum_state,rgum_heartbeat_r, NULL)
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/scobra.c b/src/mame/drivers/scobra.c
index 5c008d10320..17781d24693 100644
--- a/src/mame/drivers/scobra.c
+++ b/src/mame/drivers/scobra.c
@@ -49,6 +49,7 @@ public:
UINT8 *m_soundram;
DECLARE_READ8_MEMBER(scobra_soundram_r);
DECLARE_WRITE8_MEMBER(scobra_soundram_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(stratgyx_coinage_r);
};
@@ -263,10 +264,10 @@ static ADDRESS_MAP_START( hustlerb_sound_io_map, AS_IO, 8, scobra_state )
ADDRESS_MAP_END
/* stratgyx coinage DIPs are spread across two input ports */
-static CUSTOM_INPUT( stratgyx_coinage_r )
+CUSTOM_INPUT_MEMBER(scobra_state::stratgyx_coinage_r)
{
int bit_mask = (FPTR)param;
- return (input_port_read(field.machine(), "IN4") & bit_mask) ? 0x01 : 0x00;
+ return (input_port_read(machine(), "IN4") & bit_mask) ? 0x01 : 0x00;
}
@@ -296,8 +297,8 @@ static INPUT_PORTS_START( stratgyx )
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x01) /* lower 2 coinage DIPs */
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x02) /* lower 2 coinage DIPs */
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x01) /* lower 2 coinage DIPs */
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x02) /* lower 2 coinage DIPs */
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x08, DEF_STR( Cocktail ) )
@@ -307,8 +308,8 @@ static INPUT_PORTS_START( stratgyx )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_COCKTAIL
PORT_START("IN3")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x04) /* upper 2 coinage DIPs */
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(stratgyx_coinage_r, (void *)0x08) /* upper 2 coinage DIPs */
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x04) /* upper 2 coinage DIPs */
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, scobra_state,stratgyx_coinage_r, (void *)0x08) /* upper 2 coinage DIPs */
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) /* none of these appear to be used */
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
diff --git a/src/mame/drivers/spoker.c b/src/mame/drivers/spoker.c
index 43a81d162ed..86387144165 100644
--- a/src/mame/drivers/spoker.c
+++ b/src/mame/drivers/spoker.c
@@ -48,6 +48,7 @@ public:
DECLARE_WRITE8_MEMBER(spoker_leds_w);
DECLARE_WRITE8_MEMBER(spoker_magic_w);
DECLARE_READ8_MEMBER(spoker_magic_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(hopper_r);
};
WRITE8_MEMBER(spoker_state::bg_tile_w)
@@ -108,13 +109,10 @@ static SCREEN_UPDATE_IND16(spoker)
Memory Maps
***************************************************************************/
-static CUSTOM_INPUT( hopper_r )
+CUSTOM_INPUT_MEMBER(spoker_state::hopper_r)
{
- running_machine &machine = field.machine();
- spoker_state *state = machine.driver_data<spoker_state>();
-
- if (state->m_hopper) return !(machine.primary_screen->frame_number()%10);
- return machine.input().code_pressed(KEYCODE_H);
+ if (m_hopper) return !(machine().primary_screen->frame_number()%10);
+ return machine().input().code_pressed(KEYCODE_H);
}
static void show_out(UINT8 *out)
@@ -331,7 +329,7 @@ static INPUT_PORTS_START( spoker )
PORT_START("SERVICE")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Memory Clear") // stats, memory
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,spoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_SERVICE_NO_TOGGLE( 0x20, IP_ACTIVE_LOW )
@@ -400,7 +398,7 @@ static INPUT_PORTS_START( 3super8 )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM( hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF,spoker_state,hopper_r, (void *)0 ) PORT_NAME("HPSW") // hopper sensor
PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Statistics")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
diff --git a/src/mame/drivers/ssingles.c b/src/mame/drivers/ssingles.c
index e48f9c2d74d..657d048d485 100644
--- a/src/mame/drivers/ssingles.c
+++ b/src/mame/drivers/ssingles.c
@@ -170,6 +170,7 @@ public:
DECLARE_WRITE8_MEMBER(c001_w);
DECLARE_READ8_MEMBER(atamanot_prot_r);
DECLARE_WRITE8_MEMBER(atamanot_prot_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(controls_r);
};
//fake palette
@@ -338,10 +339,10 @@ WRITE8_MEMBER(ssingles_state::c001_w)
m_prot_data^=data^0x11;
}
-static CUSTOM_INPUT(controls_r)
+CUSTOM_INPUT_MEMBER(ssingles_state::controls_r)
{
int data = 7;
- switch(input_port_read(field.machine(), "EXTRA")) //multiplexed
+ switch(input_port_read(machine(), "EXTRA")) //multiplexed
{
case 0x01: data = 1; break;
case 0x02: data = 2; break;
@@ -441,7 +442,7 @@ static INPUT_PORTS_START( ssingles )
PORT_START("INPUTS")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) //must be LOW
- PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(controls_r, NULL)
+ PORT_BIT( 0x1c, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ssingles_state,controls_r, NULL)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON3 )
diff --git a/src/mame/drivers/statriv2.c b/src/mame/drivers/statriv2.c
index e7bf7b79686..7709b368c49 100644
--- a/src/mame/drivers/statriv2.c
+++ b/src/mame/drivers/statriv2.c
@@ -94,6 +94,7 @@ public:
DECLARE_READ8_MEMBER(question_data_r);
DECLARE_READ8_MEMBER(laserdisc_io_r);
DECLARE_WRITE8_MEMBER(laserdisc_io_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(latched_coin_r);
};
@@ -244,10 +245,9 @@ READ8_MEMBER(statriv2_state::question_data_r)
*
*************************************/
-static CUSTOM_INPUT( latched_coin_r )
+CUSTOM_INPUT_MEMBER(statriv2_state::latched_coin_r)
{
- statriv2_state *state = field.machine().driver_data<statriv2_state>();
- return state->m_latched_coin;
+ return m_latched_coin;
}
@@ -337,7 +337,7 @@ static INPUT_PORTS_START( statusbj )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state,latched_coin_r, "COIN")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
@@ -370,7 +370,7 @@ static INPUT_PORTS_START( funcsino )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Select Game") PORT_CODE(KEYCODE_S)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state,latched_coin_r, "COIN")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_DIPNAME( 0x10, 0x10, "DIP switch? 10" )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
@@ -445,7 +445,7 @@ static INPUT_PORTS_START( statriv2 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Play 1000")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(latched_coin_r, "COIN")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, statriv2_state,latched_coin_r, "COIN")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x10, IP_ACTIVE_HIGH )
PORT_DIPNAME( 0x20, 0x20, "Show Correct Answer" )
diff --git a/src/mame/drivers/tempest.c b/src/mame/drivers/tempest.c
index f7b9750a11d..c00d0a247e5 100644
--- a/src/mame/drivers/tempest.c
+++ b/src/mame/drivers/tempest.c
@@ -292,6 +292,9 @@ public:
DECLARE_WRITE8_MEMBER(wdclr_w);
DECLARE_WRITE8_MEMBER(tempest_led_w);
DECLARE_WRITE8_MEMBER(tempest_coin_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(tempest_knob_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(tempest_buttons_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(clock_r);
};
@@ -329,25 +332,23 @@ WRITE8_MEMBER(tempest_state::wdclr_w)
*
*************************************/
-static CUSTOM_INPUT( tempest_knob_r )
+CUSTOM_INPUT_MEMBER(tempest_state::tempest_knob_r)
{
- tempest_state *state = field.machine().driver_data<tempest_state>();
- return input_port_read(field.machine(), (state->m_player_select == 0) ?
+ return input_port_read(machine(), (m_player_select == 0) ?
TEMPEST_KNOB_P1_TAG : TEMPEST_KNOB_P2_TAG);
}
-static CUSTOM_INPUT( tempest_buttons_r )
+CUSTOM_INPUT_MEMBER(tempest_state::tempest_buttons_r)
{
- tempest_state *state = field.machine().driver_data<tempest_state>();
- return input_port_read(field.machine(), (state->m_player_select == 0) ?
+ return input_port_read(machine(), (m_player_select == 0) ?
TEMPEST_BUTTONS_P1_TAG : TEMPEST_BUTTONS_P2_TAG);
}
-static CUSTOM_INPUT( clock_r )
+CUSTOM_INPUT_MEMBER(tempest_state::clock_r)
{
/* Emulate the 3kHz source on bit 7 (divide 1.5MHz by 512) */
- return (field.machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
@@ -440,10 +441,10 @@ static INPUT_PORTS_START( tempest )
/* per default (busy vector processor). */
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(avgdvg_done_r, NULL)
/* bit 7 is tied to a 3kHz (?) clock */
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(clock_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tempest_state,clock_r, NULL)
PORT_START("IN1/DSW0")
- PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(tempest_knob_r, NULL)
+ PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tempest_state,tempest_knob_r, NULL)
/* The next one is reponsible for cocktail mode.
* According to the documentation, this is not a switch, although
* it may have been planned to put it on the Math Box PCB, D/E2 )
@@ -464,7 +465,7 @@ static INPUT_PORTS_START( tempest )
PORT_DIPNAME( 0x04, 0x04, "Rating" ) PORT_DIPLOCATION("DE2:2")
PORT_DIPSETTING( 0x04, "1, 3, 5, 7, 9" )
PORT_DIPSETTING( 0x00, "tied to high score" )
- PORT_BIT(0x18, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(tempest_buttons_r, NULL)
+ PORT_BIT(0x18, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, tempest_state,tempest_buttons_r, NULL)
PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
diff --git a/src/mame/drivers/thayers.c b/src/mame/drivers/thayers.c
index e5b64e28369..32ed6fb78af 100644
--- a/src/mame/drivers/thayers.c
+++ b/src/mame/drivers/thayers.c
@@ -78,6 +78,8 @@ public:
DECLARE_WRITE8_MEMBER(den2_w);
DECLARE_WRITE8_MEMBER(ssi263_register_w);
DECLARE_READ8_MEMBER(ssi263_register_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_enter_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_ready_r);
};
@@ -618,19 +620,17 @@ ADDRESS_MAP_END
/* Input Ports */
-static CUSTOM_INPUT( laserdisc_enter_r )
+CUSTOM_INPUT_MEMBER(thayers_state::laserdisc_enter_r)
{
- thayers_state *state = field.machine().driver_data<thayers_state>();
- if (state->m_pr7820 != NULL) return state->m_pr7820_enter;
- if (state->m_ldv1000 != NULL) return (state->m_ldv1000->status_strobe_r() == ASSERT_LINE) ? 0 : 1;
+ if (m_pr7820 != NULL) return m_pr7820_enter;
+ if (m_ldv1000 != NULL) return (m_ldv1000->status_strobe_r() == ASSERT_LINE) ? 0 : 1;
return 0;
}
-static CUSTOM_INPUT( laserdisc_ready_r )
+CUSTOM_INPUT_MEMBER(thayers_state::laserdisc_ready_r)
{
- thayers_state *state = field.machine().driver_data<thayers_state>();
- if (state->m_pr7820 != NULL) return (state->m_pr7820->ready_r() == ASSERT_LINE) ? 0 : 1;
- if (state->m_ldv1000 != NULL) return (state->m_ldv1000->command_strobe_r() == ASSERT_LINE) ? 0 : 1;
+ if (m_pr7820 != NULL) return (m_pr7820->ready_r() == ASSERT_LINE) ? 0 : 1;
+ if (m_ldv1000 != NULL) return (m_ldv1000->command_strobe_r() == ASSERT_LINE) ? 0 : 1;
return 0;
}
@@ -671,8 +671,8 @@ static INPUT_PORTS_START( thayers )
PORT_START("COIN")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_enter_r, NULL)
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(laserdisc_ready_r, NULL)
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, thayers_state,laserdisc_enter_r, NULL)
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, thayers_state,laserdisc_ready_r, NULL)
PORT_START("R0")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME( "2" ) PORT_CODE( KEYCODE_F2 )
diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c
index 18233fa2d66..23d31b4e753 100644
--- a/src/mame/drivers/ultrsprt.c
+++ b/src/mame/drivers/ultrsprt.c
@@ -31,6 +31,7 @@ public:
DECLARE_WRITE32_MEMBER(int_ack_w);
DECLARE_READ16_MEMBER(K056800_68k_r);
DECLARE_WRITE16_MEMBER(K056800_68k_w);
+ DECLARE_CUSTOM_INPUT_MEMBER(analog_ctrl_r);
};
@@ -86,10 +87,10 @@ WRITE32_MEMBER(ultrsprt_state::eeprom_w)
input_port_write(machine(), "EEPROMOUT", data, 0xffffffff);
}
-static CUSTOM_INPUT( analog_ctrl_r )
+CUSTOM_INPUT_MEMBER(ultrsprt_state::analog_ctrl_r)
{
const char *tag = (const char *)param;
- return input_port_read(field.machine(), tag) & 0xfff;
+ return input_port_read(machine(), tag) & 0xfff;
}
WRITE32_MEMBER(ultrsprt_state::int_ack_w)
@@ -164,15 +165,15 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( ultrsprt )
PORT_START("P1")
- PORT_BIT( 0x00000fff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKY1")
- PORT_BIT( 0x0fff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKX1")
+ PORT_BIT( 0x00000fff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultrsprt_state,analog_ctrl_r, "STICKY1")
+ PORT_BIT( 0x0fff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultrsprt_state,analog_ctrl_r, "STICKX1")
PORT_BIT( 0x40000000, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_START1 )
PORT_START("P2")
- PORT_BIT( 0x00000fff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKY2")
- PORT_BIT( 0x0fff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(analog_ctrl_r, "STICKX2")
+ PORT_BIT( 0x00000fff, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultrsprt_state,analog_ctrl_r, "STICKY2")
+ PORT_BIT( 0x0fff0000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, ultrsprt_state,analog_ctrl_r, "STICKX2")
PORT_BIT( 0x40000000, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x20000000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_START2 )
diff --git a/src/mame/drivers/vamphalf.c b/src/mame/drivers/vamphalf.c
index 24588757e2b..f70a0b68450 100644
--- a/src/mame/drivers/vamphalf.c
+++ b/src/mame/drivers/vamphalf.c
@@ -116,6 +116,7 @@ public:
DECLARE_READ16_MEMBER(dtfamily_speedup_r);
DECLARE_READ16_MEMBER(toyland_speedup_r);
DECLARE_READ16_MEMBER(boonggab_speedup_r);
+ DECLARE_CUSTOM_INPUT_MEMBER(boonggab_photo_sensors_r);
};
static READ16_DEVICE_HANDLER( eeprom_r )
@@ -641,10 +642,10 @@ static SCREEN_UPDATE_IND16( aoh )
return 0;
}
-static CUSTOM_INPUT( boonggab_photo_sensors_r )
+CUSTOM_INPUT_MEMBER(vamphalf_state::boonggab_photo_sensors_r)
{
static const UINT16 photo_sensors_table[8] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 };
- UINT8 res = input_port_read(field.machine(), "PHOTO_SENSORS");
+ UINT8 res = input_port_read(machine(), "PHOTO_SENSORS");
switch(res)
{
@@ -790,7 +791,7 @@ static INPUT_PORTS_START( boonggab )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_SPECIAL ) // sensor 1
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SPECIAL ) // sensor 2
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_SPECIAL ) // sensor 3
- PORT_BIT( 0x3800, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(boonggab_photo_sensors_r, NULL) // photo sensors 1, 2 and 3
+ PORT_BIT( 0x3800, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, vamphalf_state,boonggab_photo_sensors_r, NULL) // photo sensors 1, 2 and 3
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
diff --git a/src/mame/drivers/zn.c b/src/mame/drivers/zn.c
index 68f35273618..c78620d7546 100644
--- a/src/mame/drivers/zn.c
+++ b/src/mame/drivers/zn.c
@@ -55,6 +55,7 @@ public:
int m_cbaj_to_z80;
int m_cbaj_to_r3k;
int m_latch_to_z80;
+ DECLARE_CUSTOM_INPUT_MEMBER(jdredd_gun_mux_read);
};
INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
@@ -2042,11 +2043,10 @@ static WRITE32_DEVICE_HANDLER( jdredd_ide_w )
}
}
-static CUSTOM_INPUT( jdredd_gun_mux_read )
+CUSTOM_INPUT_MEMBER(zn_state::jdredd_gun_mux_read)
{
- zn_state *state = field.machine().driver_data<zn_state>();
- return state->m_jdredd_gun_mux;
+ return m_jdredd_gun_mux;
}
void jdredd_vblank(zn_state *state, screen_device &screen, bool vblank_state)
@@ -2746,7 +2746,7 @@ static INPUT_PORTS_START( jdredd )
PORT_BIT( 0x6f, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_MODIFY("SERVICE")
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(jdredd_gun_mux_read, NULL)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, zn_state,jdredd_gun_mux_read, NULL)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)