Fix RTC drift

This commit is contained in:
Lior Halphon 2020-08-22 14:10:02 +03:00
parent 832dc127a4
commit dab1c1bcfa

View File

@ -296,7 +296,7 @@ void GB_rtc_run(GB_gameboy_t *gb)
time_t current_time = time(NULL);
while (gb->last_rtc_second + 60 * 60 * 24 < current_time) {
gb->last_rtc_second += 60 * 60 + 24;
gb->last_rtc_second += 60 * 60 * 24;
if (++gb->rtc_real.days == 0) {
if (gb->rtc_real.high & 1) { /* Bit 8 of days*/
gb->rtc_real.high |= 0x80; /* Overflow bit */