-sun4: Fixed timekeeper type and fixed timekeeper behavior that could cause it to miss updates. [Ryan Holtz]

This commit is contained in:
mooglyguy 2018-09-16 10:03:41 +02:00
parent 4d5526d30a
commit 4e74f8c28f

View File

@ -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) 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 || if( ( m_seconds & SECONDS_ST ) != 0 ||
( m_control & CONTROL_W ) != 0 ) ( m_control & CONTROL_W ) != 0 )
{ {
logerror("No Tick\n");
return; return;
} }
@ -368,6 +370,7 @@ WRITE8_MEMBER(timekeeper_device::watchdog_write)
WRITE8_MEMBER( timekeeper_device::write ) WRITE8_MEMBER( timekeeper_device::write )
{ {
logerror("timekeeper_device::write: %04x = %02x\n", offset, data);
if( offset == m_offset_control ) if( offset == m_offset_control )
{ {
if( ( m_control & CONTROL_W ) != 0 && if( ( m_control & CONTROL_W ) != 0 &&
@ -375,6 +378,13 @@ WRITE8_MEMBER( timekeeper_device::write )
{ {
counters_from_ram(); counters_from_ram();
} }
if( ( m_control & CONTROL_R ) != 0 &&
( data & CONTROL_W ) == 0 )
{
counters_to_ram();
}
m_control = data; m_control = data;
} }
else if( offset == m_offset_day ) else if( offset == m_offset_day )
@ -419,6 +429,7 @@ READ8_MEMBER( timekeeper_device::read )
m_reset_cb(CLEAR_LINE); m_reset_cb(CLEAR_LINE);
m_irq_cb(CLEAR_LINE); m_irq_cb(CLEAR_LINE);
} }
logerror("timekeeper_device::read: %04x (%02x)\n", offset, result);
return result; return result;
} }