From 4e74f8c28ffb490f04626a7210acbe06fb0b6b61 Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Sun, 16 Sep 2018 10:03:41 +0200 Subject: [PATCH] -sun4: Fixed timekeeper type and fixed timekeeper behavior that could cause it to miss updates. [Ryan Holtz] --- src/devices/machine/timekpr.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/devices/machine/timekpr.cpp b/src/devices/machine/timekpr.cpp index 9e315e4b228..aa7febbf9d4 100644 --- a/src/devices/machine/timekpr.cpp +++ b/src/devices/machine/timekpr.cpp @@ -274,9 +274,11 @@ void timekeeper_device::counters_from_ram() void timekeeper_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { + logerror("Tick\n"); if( ( m_seconds & SECONDS_ST ) != 0 || ( m_control & CONTROL_W ) != 0 ) { + logerror("No Tick\n"); return; } @@ -368,6 +370,7 @@ WRITE8_MEMBER(timekeeper_device::watchdog_write) WRITE8_MEMBER( timekeeper_device::write ) { + logerror("timekeeper_device::write: %04x = %02x\n", offset, data); if( offset == m_offset_control ) { if( ( m_control & CONTROL_W ) != 0 && @@ -375,6 +378,13 @@ WRITE8_MEMBER( timekeeper_device::write ) { counters_from_ram(); } + + if( ( m_control & CONTROL_R ) != 0 && + ( data & CONTROL_W ) == 0 ) + { + counters_to_ram(); + } + m_control = data; } else if( offset == m_offset_day ) @@ -419,6 +429,7 @@ READ8_MEMBER( timekeeper_device::read ) m_reset_cb(CLEAR_LINE); m_irq_cb(CLEAR_LINE); } + logerror("timekeeper_device::read: %04x (%02x)\n", offset, result); return result; }