diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-14 12:41:34 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-14 12:41:34 +0000 |
commit | 180b700dc7227d454d30656662912c79ffc3a62f (patch) | |
tree | d585f0d8f553bc3610fe24d44ebbfc349a396323 /hw | |
parent | 55e4f6644e32bfb8fe84c8b8eab95ec5984679cf (diff) | |
download | qemu-180b700dc7227d454d30656662912c79ffc3a62f.tar.gz qemu-180b700dc7227d454d30656662912c79ffc3a62f.tar.bz2 qemu-180b700dc7227d454d30656662912c79ffc3a62f.zip |
clock year fix for sparc (Blue Swirl)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1963 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/m48t59.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/m48t59.c b/hw/m48t59.c index 81e64e4418..daa1c524db 100644 --- a/hw/m48t59.c +++ b/hw/m48t59.c @@ -332,7 +332,10 @@ void m48t59_write (m48t59_t *NVRAM, uint32_t addr, uint32_t val) tmp = fromBCD(val); if (tmp >= 0 && tmp <= 99) { get_time(NVRAM, &tm); - tm.tm_year = fromBCD(val); + if (NVRAM->type == 8) + tm.tm_year = fromBCD(val) + 68; // Base year is 1968 + else + tm.tm_year = fromBCD(val); set_time(NVRAM, &tm); } break; @@ -421,7 +424,10 @@ uint32_t m48t59_read (m48t59_t *NVRAM, uint32_t addr) case 0x1FFF: /* year */ get_time(NVRAM, &tm); - retval = toBCD(tm.tm_year); + if (NVRAM->type == 8) + retval = toBCD(tm.tm_year - 68); // Base year is 1968 + else + retval = toBCD(tm.tm_year); break; default: /* Check lock registers state */ |