mm58167: day/month counters reset to 1

This commit is contained in:
Patrick Mackinlay 2022-07-18 11:28:48 +07:00
parent 9d4b31b479
commit df01d83952

View File

@ -227,10 +227,14 @@ void mm58167_device::write(offs_t offset, uint8_t data)
case R_CTL_RESETCOUNTERS:
if (data == 0xff)
{
for (int i = R_CNT_MILLISECONDS; i <= R_CNT_MONTH; i++)
{
m_regs[i] = 0;
}
m_regs[R_CNT_MILLISECONDS] = 0;
m_regs[R_CNT_HUNDTENTHS] = 0;
m_regs[R_CNT_SECONDS] = 0;
m_regs[R_CNT_MINUTES] = 0;
m_regs[R_CNT_HOURS] = 0;
m_regs[R_CNT_DAYOFWEEK] = 1;
m_regs[R_CNT_DAYOFMONTH] = 1;
m_regs[R_CNT_MONTH] = 1;
update_rtc();
}