Commit 180b700dc7227d454d30656662912c79ffc3a62f

Authored by bellard
1 parent 55e4f664

clock year fix for sparc (Blue Swirl)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1963 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 8 additions and 2 deletions
hw/m48t59.c
... ... @@ -332,7 +332,10 @@ void m48t59_write (m48t59_t *NVRAM, uint32_t addr, uint32_t val)
332 332 tmp = fromBCD(val);
333 333 if (tmp >= 0 && tmp <= 99) {
334 334 get_time(NVRAM, &tm);
335   - tm.tm_year = fromBCD(val);
  335 + if (NVRAM->type == 8)
  336 + tm.tm_year = fromBCD(val) + 68; // Base year is 1968
  337 + else
  338 + tm.tm_year = fromBCD(val);
336 339 set_time(NVRAM, &tm);
337 340 }
338 341 break;
... ... @@ -421,7 +424,10 @@ uint32_t m48t59_read (m48t59_t *NVRAM, uint32_t addr)
421 424 case 0x1FFF:
422 425 /* year */
423 426 get_time(NVRAM, &tm);
424   - retval = toBCD(tm.tm_year);
  427 + if (NVRAM->type == 8)
  428 + retval = toBCD(tm.tm_year - 68); // Base year is 1968
  429 + else
  430 + retval = toBCD(tm.tm_year);
425 431 break;
426 432 default:
427 433 /* Check lock registers state */
... ...