diff options
author | Aaron Giles <aaron@aarongiles.com> | 2012-05-03 09:00:08 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2012-05-03 09:00:08 +0000 |
commit | 2a88e54278acc526c11dba7961204f234f1f6e05 (patch) | |
tree | 1d78e932e47bb535e7e56ddac05232cdf551c3a1 /src/mame/drivers/dynduke.c | |
parent | 605a48921b48e0127ff0330f1e895dcf16d084fb (diff) |
ioport.c C++ conversion. Mostly internal changes, with no
intended differences from previous behavior. For drivers,
the main change is that input_port_read() no longer exists.
Instead, the port must be fetched from the appropriate device,
and then read() is called.
For member functions, this is actually simpler/cleaner:
value = ioport("tag")->read()
For legacy functions which have a driver_data state, it goes:
value = state->ioport("tag")->read()
For other legacy functions, they need to fetch the root device:
value = machine.root_device().ioport("tag")->read()
The other big change for drivers is that IPT_VBLANK is gone.
Instead, it has been replaced by a device line callback on the
screen device. There's a new macro PORT_VBLANK("tag") which
automatically points things to the right spot.
Here's a set of imperfect search & replace strings to convert
the input_port_read calls and fix up IPT_VBLANK:
input_port_read( *\( *)(machine\(\)) *, *([^)]+ *\))
ioport\1\3->read\(\)
input_port_read( *\( *)(.*machine[()]*) *, *([^)]+ *\))
\2\.root_device\(\)\.ioport\1\3->read\(\)
(state = .*driver_data[^}]+)space->machine\(\)\.root_device\(\)\.
\1state->
(state = .*driver_data[^}]+)device->machine\(\)\.root_device\(\)\.
\1state->
input_port_read_safe( *\( *)(machine\(\)) *, *([^,]+), *([^)]+\))
ioport\1\3->read_safe\(\4\)
IPT_VBLANK( *\))
IPT_CUSTOM\1 PORT_VBLANK("screen")
Diffstat (limited to 'src/mame/drivers/dynduke.c')
-rw-r--r-- | src/mame/drivers/dynduke.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mame/drivers/dynduke.c b/src/mame/drivers/dynduke.c index 40e3eae7ae3..66a73903534 100644 --- a/src/mame/drivers/dynduke.c +++ b/src/mame/drivers/dynduke.c @@ -139,18 +139,18 @@ static INPUT_PORTS_START( dynduke ) PORT_DIPNAME( 0x0001, 0x0001, "Coin Mode" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x0001, "Mode 1" ) PORT_DIPSETTING( 0x0000, "Mode 2" ) - PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0000) + PORT_DIPNAME( 0x0006, 0x0006, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0000) PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0006, DEF_STR( 1C_1C ) ) - PORT_DIPNAME( 0x0018, 0x0008, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0000) + PORT_DIPNAME( 0x0018, 0x0008, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:4,5") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0000) PORT_DIPSETTING( 0x0018, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0010, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0008, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( 1C_6C ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW", 0x0001, PORTCOND_EQUALS, 0x0001) + PORT_DIPNAME( 0x001e, 0x001e, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:2,3,4,5") PORT_CONDITION("DSW", 0x0001, EQUALS, 0x0001) PORT_DIPSETTING( 0x0018, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x001a, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x001c, DEF_STR( 2C_1C ) ) |