summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/eolith.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/eolith.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/eolith.c')
-rw-r--r--src/mame/drivers/eolith.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index c74ecf8b501..2dc54a53225 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -112,7 +112,7 @@ READ32_MEMBER(eolith_state::eolith_custom_r)
*/
eolith_speedup_read(&space);
- return (input_port_read(machine(), "IN0") & ~0x300) | (machine().rand() & 0x300);
+ return (ioport("IN0")->read() & ~0x300) | (machine().rand() & 0x300);
}
WRITE32_MEMBER(eolith_state::systemcontrol_w)
@@ -121,7 +121,7 @@ WRITE32_MEMBER(eolith_state::systemcontrol_w)
coin_counter_w(machine(), 0, data & m_coin_counter_bit);
set_led_status(machine(), 0, data & 1);
- input_port_write(machine(), "EEPROMOUT", data, 0xff);
+ ioport("EEPROMOUT")->write(data, 0xff);
// bit 0x100 and 0x040 ?
}
@@ -129,8 +129,8 @@ WRITE32_MEMBER(eolith_state::systemcontrol_w)
READ32_MEMBER(eolith_state::hidctch3_pen1_r)
{
//320 x 240
- int xpos = input_port_read(machine(), "PEN_X_P1");
- int ypos = input_port_read(machine(), "PEN_Y_P1");
+ int xpos = ioport("PEN_X_P1")->read();
+ int ypos = ioport("PEN_Y_P1")->read();
return xpos + (ypos*168*2);
}
@@ -138,8 +138,8 @@ READ32_MEMBER(eolith_state::hidctch3_pen1_r)
READ32_MEMBER(eolith_state::hidctch3_pen2_r)
{
//320 x 240
- int xpos = input_port_read(machine(), "PEN_X_P2");
- int ypos = input_port_read(machine(), "PEN_Y_P2");
+ int xpos = ioport("PEN_X_P2")->read();
+ int ypos = ioport("PEN_Y_P2")->read();
return xpos + (ypos*168*2);
}