Previous 199869 Revisions Next

r19722 Friday 21st December, 2012 at 23:03:35 UTC by hap
rtc_clock_updated day_of_week is 1-7 (fix wrong day shown, and possible array out of bounds access)
[src/emu/machine]rtc4543.c

trunk/src/emu/machine/rtc4543.c
r19721r19722
9696    m_regs[0] = make_bcd(second);               // seconds (BCD, 0-59) in bits 0-6, bit 7 = battery low
9797    m_regs[1] = make_bcd(minute);               // minutes (BCD, 0-59)
9898    m_regs[2] = make_bcd(hour);                 // hour (BCD, 0-23)
99    m_regs[3] = make_bcd(weekday[day_of_week]);   // low nibble = day of the week
99    m_regs[3] = make_bcd(weekday[day_of_week-1]);   // low nibble = day of the week
100100    m_regs[3] |= (make_bcd(day) & 0x0f)<<4;       // high nibble = low digit of day
101101    m_regs[4] = (make_bcd(day) >> 4);         // low nibble = high digit of day
102102    m_regs[4] |= (make_bcd(month & 0x0f)<<4);   // high nibble = low digit of month

Previous 199869 Revisions Next


© 1997-2024 The MAME Team