Skip to content

Commit d522911

Browse files
committed
x86: Use century register value to estimate century availability
1 parent 3c78090 commit d522911

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/hw/cmos.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CMOS::Time& CMOS::Time::hw_update() {
3030
f.day_of_month = get(r_day);
3131
f.month = get(r_month);
3232
f.year = get(r_year);
33-
century = get(r_cent);
33+
if (r_cent) century = get(r_cent);
3434
} else {
3535
f.second = bcd_to_binary(get(r_sec));
3636
f.minute = bcd_to_binary(get(r_min));
@@ -39,12 +39,12 @@ CMOS::Time& CMOS::Time::hw_update() {
3939
f.day_of_month = bcd_to_binary(get(r_day));
4040
f.month = bcd_to_binary(get(r_month));
4141
f.year = bcd_to_binary(get(r_year));
42-
century = bcd_to_binary(get(r_cent));
42+
if (r_cent) century = bcd_to_binary(get(r_cent));
4343
}
4444

4545
// Insanity
4646
#define CURRENT_YEAR 2017 // Change this each year!
47-
if (century != 0) {
47+
if (r_cent != 0) {
4848
f.year += century * 100;
4949
} else {
5050
f.year += (CURRENT_YEAR / 100) * 100;

0 commit comments

Comments
 (0)