mirror of
https://github.com/holub/mame
synced 2025-05-29 09:03:08 +03:00
-sun4: Fixed timekeeper type and fixed timekeeper behavior that could cause it to miss updates. [Ryan Holtz]
This commit is contained in:
parent
4d5526d30a
commit
4e74f8c28f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user