]> git.sur5r.net Git - cc65/commit
Added clock_settime() for some CBMs.
authorOliver Schmidt <ol.sc@web.de>
Fri, 17 Aug 2018 23:13:02 +0000 (01:13 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 17 Aug 2018 23:29:40 +0000 (01:29 +0200)
commiteb9872c684c88d5df64e0efb2352378e47cd4428
treee3e88ee7a096cdaf716b9d744a9b64883ac3a0aa
parentcb7ec508f650e79e1d2527bd3b5fdb86e390f9ed
Added clock_settime() for some CBMs.

The CIA TOD only stores the time but not the date. Therefore the date set by clock_settime() ist just stored inside the C library for retrieval via clock_gettime().

The "very special" handling of 12AM/PM is based on https://groups.google.com/d/msg/comp.sys.cbm/ysVYSX4AMbc/vHrXCWEhCOUJ saying:

==========

24hr: Wr => Rd => Nx
--------------------
  0 : 92 => 12 => 01   <= Switch from 00 to 01 (24-hour notation)
  1 : 01 => 01 => 02
  2 : 02 => 02 => 03
 11 : 11 => 11 => 92
 12 : 12 => 92 => 81   <= Switch from 12 to 13 (24-hour notation)
 13 : 81 => 81 => 82
 14 : 82 => 82 => 83
 23 : 91 => 91 => 12

1. column ("24hr"): hour to be tested (decimal)
2. column ("Wr"):   hour written to TOD register (BCD)
3. column ("Rd"):   hour read from TOD register (BCD) immediately after writing the value in column 2 to see the conversion between AM/PM, if any
4. column ("Nx"):   next hour (BCD) after the hour switch

==========

Thanks Paul!
12 files changed:
libsrc/c128/gettime.s
libsrc/c128/settime.s [new file with mode: 0644]
libsrc/c128/tmcommon.s [new file with mode: 0644]
libsrc/c64/gettime.s
libsrc/c64/settime.s [new file with mode: 0644]
libsrc/c64/tmcommon.s [new file with mode: 0644]
libsrc/cbm510/gettime.s
libsrc/cbm510/settime.s [new file with mode: 0644]
libsrc/cbm510/tmcommon.s [new file with mode: 0644]
libsrc/cbm610/gettime.s
libsrc/cbm610/settime.s [new file with mode: 0644]
libsrc/cbm610/tmcommon.s [new file with mode: 0644]