summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/upd4992.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/upd4992.cpp')
-rw-r--r--src/devices/machine/upd4992.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/devices/machine/upd4992.cpp b/src/devices/machine/upd4992.cpp
index a6c81fb9d13..79f23784c82 100644
--- a/src/devices/machine/upd4992.cpp
+++ b/src/devices/machine/upd4992.cpp
@@ -13,8 +13,7 @@
***************************************************************************/
#include "emu.h"
-#include "machine/upd4992.h"
-
+#include "upd4992.h"
//**************************************************************************
@@ -33,11 +32,12 @@ DEFINE_DEVICE_TYPE(UPD4992, upd4992_device, "upd4992", "uPD4992 RTC")
// upd4992_device - constructor
//-------------------------------------------------
-upd4992_device::upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+upd4992_device::upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, UPD4992, tag, owner, clock)
, device_rtc_interface(mconfig, *this)
, m_timer_clock(nullptr)
{
+ std::fill(std::begin(m_rtc_regs), std::end(m_rtc_regs), 0);
}
@@ -57,19 +57,14 @@ void upd4992_device::device_validity_check(validity_checker &valid) const
void upd4992_device::device_start()
{
- m_timer_clock = timer_alloc(TIMER_CLOCK);
+ m_timer_clock = timer_alloc(FUNC(upd4992_device::clock_tick), this);
m_timer_clock->adjust(attotime::from_hz(clock() / 32768), 0, attotime::from_hz(clock() / 32768));
}
-void upd4992_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(upd4992_device::clock_tick)
{
- switch (id)
- {
- case TIMER_CLOCK:
- advance_seconds();
- break;
- }
+ advance_seconds();
}
//-------------------------------------------------
@@ -114,12 +109,12 @@ xxxx ---- Mode register
// READ/WRITE HANDLERS
//**************************************************************************
-READ8_MEMBER( upd4992_device::read )
+u8 upd4992_device::read(offs_t offset)
{
return m_rtc_regs[offset];
}
-WRITE8_MEMBER( upd4992_device::write )
+void upd4992_device::write(offs_t offset, u8 data)
{
if(offset == 7)
{