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/decocass.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/decocass.c')
-rw-r--r-- | src/mame/drivers/decocass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c index 62b23f275ac..4bc90931622 100644 --- a/src/mame/drivers/decocass.c +++ b/src/mame/drivers/decocass.c @@ -239,7 +239,7 @@ static INPUT_PORTS_START( decocass ) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen") PORT_START("DSW2") /* Start with all Unknown as each can change per game, except for Country Code */ PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1") /* Most Dipswitch Settings sheets show this as "Number of Players" (Lives) */ @@ -1475,8 +1475,8 @@ static DRIVER_INIT( decocass ) static DRIVER_INIT( decocrom ) { decocass_state *state = machine.driver_data<decocass_state>(); - int romlength = machine.root_device().memregion("user3")->bytes(); - UINT8 *rom = machine.root_device().memregion("user3")->base(); + int romlength = state->memregion("user3")->bytes(); + UINT8 *rom = state->memregion("user3")->base(); int i; state->m_decrypted2 = auto_alloc_array(machine, UINT8, romlength); |