summaryrefslogtreecommitdiffstats
path: root/src/devices/machine/ds2404.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/ds2404.cpp')
-rw-r--r--src/devices/machine/ds2404.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/devices/machine/ds2404.cpp b/src/devices/machine/ds2404.cpp
index 6a279d80986..68845d86dc3 100644
--- a/src/devices/machine/ds2404.cpp
+++ b/src/devices/machine/ds2404.cpp
@@ -73,7 +73,7 @@ void ds2404_device::device_start()
for (auto & elem : m_state)
elem = STATE_IDLE;
- m_tick_timer = timer_alloc(0);
+ m_tick_timer = timer_alloc(FUNC(ds2404_device::timer_tick), this);
m_tick_timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
}
@@ -317,22 +317,13 @@ void ds2404_device::clk_w(uint8_t data)
}
}
-void ds2404_device::device_timer(emu_timer &timer, device_timer_id id, int param)
+TIMER_CALLBACK_MEMBER(ds2404_device::timer_tick)
{
- switch(id)
+ for(uint8_t &elem : m_rtc)
{
- case 0:
- // tick
- for(auto &elem : m_rtc)
- {
- elem++;
- if(elem != 0)
- break;
- }
+ elem++;
+ if(elem != 0)
break;
-
- default:
- throw emu_fatalerror("Unknown id in ds2404_device::device_timer");
}
}