mirror of
https://github.com/ares-emulator/ares.git
synced 2026-10-12 02:11:04 +00:00
n64: avoid infinite loop at boot when time goes backward
This commit is contained in:
committed by
Luke Usher
parent
e6130f66e7
commit
dee49f55ae
@@ -21,8 +21,9 @@ auto Cartridge::RTC::load() -> void {
|
||||
ram.write<Byte>(22, BCD::encode(tmm.tm_year % 100));
|
||||
ram.write<Byte>(23, BCD::encode(tmm.tm_year / 100));
|
||||
} else {
|
||||
timestamp = time(0) - timestamp;
|
||||
advance(timestamp);
|
||||
time_t now = time(0);
|
||||
time_t saved = (time_t)timestamp;
|
||||
if(now > saved) advance((int)(now - saved));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user