summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/acefruit.c
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/mame/drivers/acefruit.c
parent0aca27ceef7dc7d9136da9319737efb48e505205 (diff)
modernization of some CUSTOM_INPUT's (no whatsnew)
Diffstat (limited to 'src/mame/drivers/acefruit.c')
-rw-r--r--src/mame/drivers/acefruit.c45
1 files changed, 24 insertions, 21 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 )