summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/astrocde/lightpen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/astrocde/lightpen.cpp')
-rw-r--r--src/devices/bus/astrocde/lightpen.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/devices/bus/astrocde/lightpen.cpp b/src/devices/bus/astrocde/lightpen.cpp
index 07c5c7480ee..7758b850c73 100644
--- a/src/devices/bus/astrocde/lightpen.cpp
+++ b/src/devices/bus/astrocde/lightpen.cpp
@@ -31,7 +31,7 @@ astrocade_lightpen_device::~astrocade_lightpen_device()
void astrocade_lightpen_device::device_start()
{
- m_pen_timer = timer_alloc(TIMER_TRIGGER);
+ m_pen_timer = timer_alloc(FUNC(astrocade_lightpen_device::trigger_tick), this);
save_item(NAME(m_retrigger));
}
@@ -42,20 +42,17 @@ void astrocade_lightpen_device::device_reset()
m_retrigger = false;
}
-void astrocade_lightpen_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(astrocade_lightpen_device::trigger_tick)
{
- if (id == TIMER_TRIGGER)
- {
- write_ltpen(1);
- write_ltpen(0);
- if (m_retrigger)
- m_pen_timer->adjust(m_screen->time_until_pos(m_lighty->read(), m_lightx->read()));
- else
- m_pen_timer->adjust(attotime::never);
- }
+ write_ltpen(1);
+ write_ltpen(0);
+ if (m_retrigger)
+ m_pen_timer->adjust(m_screen->time_until_pos(m_lighty->read(), m_lightx->read()));
+ else
+ m_pen_timer->adjust(attotime::never);
}
-INPUT_CHANGED_MEMBER( astrocade_lightpen_device::trigger )
+INPUT_CHANGED_MEMBER(astrocade_lightpen_device::trigger)
{
if (newval)
{
@@ -71,7 +68,7 @@ INPUT_CHANGED_MEMBER( astrocade_lightpen_device::trigger )
static INPUT_PORTS_START( astrocade_lightpen )
PORT_START("TRIGGER")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, astrocade_lightpen_device, trigger, 0)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(astrocade_lightpen_device::trigger), 0)
PORT_BIT( 0xfe, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("LIGHTX")