summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/midzeus.c
diff options
context:
space:
mode:
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
commit2a88e54278acc526c11dba7961204f234f1f6e05 (patch)
tree1d78e932e47bb535e7e56ddac05232cdf551c3a1 /src/mame/drivers/midzeus.c
parent605a48921b48e0127ff0330f1e895dcf16d084fb (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/midzeus.c')
-rw-r--r--src/mame/drivers/midzeus.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index a43d6c8664e..aac5b259457 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -425,7 +425,7 @@ CUSTOM_INPUT_MEMBER(midzeus_state::custom_49way_r)
static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
const char *namex = (const char *)param;
const char *namey = namex + strlen(namex) + 1;
- return (translate49[input_port_read(machine(), namey) >> 4] << 4) | translate49[input_port_read(machine(), namex) >> 4];
+ return (translate49[ioport(namey)->read() >> 4] << 4) | translate49[ioport(namex)->read() >> 4];
}
@@ -438,7 +438,7 @@ WRITE32_MEMBER(midzeus_state::keypad_select_w)
CUSTOM_INPUT_MEMBER(midzeus_state::keypad_r)
{
- UINT32 bits = input_port_read(machine(), (const char *)param);
+ UINT32 bits = ioport((const char *)param)->read();
UINT8 select = keypad_select;
while ((select & 1) != 0)
{
@@ -461,7 +461,7 @@ READ32_MEMBER(midzeus_state::analog_r)
static const char * const tags[] = { "ANALOG0", "ANALOG1", "ANALOG2", "ANALOG3" };
if (offset < 8 || offset > 11)
logerror("%06X:analog_r(%X)\n", cpu_get_pc(&space.device()), offset);
- return input_port_read(machine(), tags[offset & 3]);
+ return ioport(tags[offset & 3])->read();
}
@@ -527,8 +527,8 @@ WRITE32_MEMBER(midzeus_state::invasn_gun_w)
{ "GUNX1", "GUNY1" },
{ "GUNX2", "GUNY2" }
};
- gun_x[player] = input_port_read(machine(), names[player][0]) * visarea.width() / 255 + visarea.min_x + BEAM_XOFFS;
- gun_y[player] = input_port_read(machine(), names[player][1]) * visarea.height() / 255 + visarea.min_y;
+ gun_x[player] = ioport(names[player][0])->read() * visarea.width() / 255 + visarea.min_x + BEAM_XOFFS;
+ gun_y[player] = ioport(names[player][1])->read() * visarea.height() / 255 + visarea.min_y;
gun_timer[player]->adjust(machine().primary_screen->time_until_pos(MAX(0, gun_y[player] - BEAM_DY), MAX(0, gun_x[player] - BEAM_DX)), player);
}
}