1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00
cc65/asminc
Oliver Schmidt f40dcb5883 Added clock_getres() / clock_settime() for the Apple II.
The situation on the Apple II is rather special: There are several types of RTCs. It's not desirable to have specific code for all of them. As the OS supports file timestamps RTC owners usually use OS drivers for their RTC. Those drivers read the RTC and write the result in a "date/time location" in RAM. The OS reads the date/time from the RAM location. If there's no RTC the RAM location keeps containing zeros. The OS uses those zeros as timestamps and the files show up in a directory as "<NO DATE>".

There's no common interface to set RTCs so if an RTC _IS_ present there's just nothing to do. However, if there's _NO_ RTC present the user might very well be interest to "manually" set the RAM location in order to have timestamps. But he surely doesn't want to manually set the RAM location over an over again. Rather he wants to set it just once after booting the OS.

From that perspective it makes most sense to not set both the date and the time but rather only set the date and have the time just stay zero. Then files show up in a directory as "DD-MON-YY  0:00".

So clock_settime() checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_settime() fails with ERANGE. Otherwise clock_settime() ignores sets the date - and completely ignores the time provided as parameter.

clock_getres() too checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_getres() returns a time resolution of one minute. Otherwise clock_getres() presumes that the only one who sets the RAM location is clock_settime() and therefore returns a time resolution of one day.
2018-08-15 21:34:35 +02:00
..
_file.inc Added pushback char to struct FILE 2004-05-12 13:16:36 +00:00
_heap.inc Fixed two typos 2005-02-14 09:39:46 +00:00
accelerator.inc Added C64 Turbo Master accelerator code and documentation. 2018-04-30 14:30:35 -07:00
apple2.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
apple2.mac Added scrcode macro for the Apple II. 2016-03-27 18:26:46 +02:00
atari2600_riot.inc Add Atari2600 ASM header (.inc) files 2017-01-15 12:09:38 +01:00
atari2600_tia.inc Add Atari2600 ASM header (.inc) files 2017-01-15 12:09:38 +01:00
atari2600.inc Add Atari2600 ASM header (.inc) files 2017-01-15 12:09:38 +01:00
atari5200.inc atari5200.inc: fix formatting 2017-08-02 23:59:32 +02:00
atari_antic.inc atari_antic.inc: use "or" instead of "plus" in the usage example 2017-02-24 19:06:32 +01:00
atari_gtia.inc rename _antic.inc, _pokey.inc, _gtia.inc to atari_antic.inc, atari_pokey.inc, atari_gtia.inc 2014-05-30 22:00:18 +02:00
atari_pokey.inc rename _antic.inc, _pokey.inc, _gtia.inc to atari_antic.inc, atari_pokey.inc, atari_gtia.inc 2014-05-30 22:00:18 +02:00
atari.inc Atari: fix lookup of default device on XDOS. 2016-09-12 23:40:25 +02:00
atari.mac Replaced builtin macro packages with .mac files that are included like ordinary .inc files. 2013-04-08 00:11:05 +02:00
atmos.inc Fixed Oric-1 compatibility #550 2017-12-15 23:51:39 +01:00
c16.inc The C16 is not really a separate machine, but identical to the Plus/4, so 2010-03-06 15:17:08 +00:00
c64.inc Added missing names for the CIA registers in the C64/C128. 2017-11-25 13:29:50 -05:00
c128.inc cbm stuff from greggs pull request 2017-12-11 19:52:11 +01:00
cbm510.inc Added command-line argument parsing to the CBM510 and CBM610 targets. 2014-04-03 08:23:28 -04:00
cbm610.inc Added command-line argument parsing to the CBM510 and CBM610 targets. 2014-04-03 08:23:28 -04:00
cbm_filetype.inc According to Greg King, Vorpal files are regular files. 2012-07-01 18:10:57 +00:00
cbm_kernal.inc Added CHKOUT and CLRCHN 2018-08-15 11:53:17 +02:00
cbm.mac Made CBM scrcode assembly-macro properly handle all 256 codes. 2013-04-25 14:28:01 -04:00
cpu.mac Added comment about commented-out value. 2016-09-04 12:22:11 +02:00
creativision.inc Creativison changes. 2017-03-17 21:42:51 +01:00
ctype.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
em-error.inc Rewrote em_load_driver in assembler fixing a possible memory leak. 2012-07-22 11:36:09 +00:00
em-kernel.inc Bumped driver api versions due to recent intoduction of library references. 2013-09-01 09:46:07 +02:00
errno.inc Implement exec() for Atari XDOS. 2016-06-13 20:40:01 +02:00
fcntl.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
gamate.inc more cleanup 2015-11-29 20:04:10 +01:00
generic.mac Added two useful opcode mnemonic aliases. 2013-05-08 00:03:44 -04:00
get_tv.inc Some renaming 2004-10-26 21:03:47 +00:00
joy-error.inc New joystick API 2002-12-20 21:02:35 +00:00
joy-kernel.inc Removed IRQ support from joystick drivers. 2018-02-01 22:38:36 +01:00
longbranch.mac Replaced builtin macro packages with .mac files that are included like ordinary .inc files. 2013-04-08 00:11:05 +02:00
lynx.inc Fixed CPU definition of Lynx. Removed nonsense target vc20. 2016-04-12 23:58:30 +02:00
modload.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
module.mac Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
mouse-kernel.inc Some fine tuning of the mouse driver interface harmonization. 2014-01-17 21:09:15 +01:00
nes.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
o65.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
opcodes.inc Removed OPC_EOR_abx duplicate. 2017-12-07 20:39:28 +01:00
pce.inc fixed more flaws found by greg :) 2015-09-19 15:37:39 +02:00
pet.inc Added missing VIA register names. 2018-04-20 21:24:37 +03:00
plus4.inc Added c16/plus4 fast(), isfast() and slow() functions, and updated the documentation accordingly. 2018-03-23 14:27:15 -07:00
ser-error.inc add SER_ERR_NOT_OPEN status code 2013-12-06 20:53:49 +01:00
ser-kernel.inc add SER_BAUD_56_875 2013-12-06 20:53:49 +01:00
signal.inc Signals implemented 2003-03-14 00:09:21 +00:00
smc.inc Fix line endings (CRLF -> LF) on all affected files. 2017-03-10 11:21:14 +01:00
stdio.inc Fixing buffer overflow with cwd command (FILENAME_MAX must be at 50 +1 bytes) 2017-09-25 21:39:57 +02:00
supervision.inc Fixed CPU definition of Lynx. Removed nonsense target vc20. 2016-04-12 23:58:30 +02:00
telestrat.inc add cputc & remove 2018-04-14 21:52:11 +02:00
tgi-error.inc Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
tgi-kernel.inc Removed IRQ support from TGI drivers. 2018-02-02 18:15:45 +01:00
tgi-vectorfont.inc Small change in the vector font format. 2011-07-17 17:15:54 +00:00
time.inc Added clock_getres() / clock_settime() for the Apple II. 2018-08-15 21:34:35 +02:00
utsname.inc Use structs 2003-12-03 20:23:09 +00:00
vic20.inc Changed register addresses relative to the base address 2018-04-14 18:45:15 +03:00
zeropage.inc Change imports from "import" to "global", so the file can be used from 2012-11-04 13:54:06 +00:00