1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-18 15:05:14 +00:00
cc65/asminc
Oliver Schmidt 842c151edd Replaced _systime with clock_gettime.
We want to add the capability to not only get the time but also set the time, but there's no "setter" for the "getter" time().

The first ones that come into mind are gettimeofday() and settimeofday(). However, they take a struct timezone argument that doesn't make sense - even the man pages says "The use of the timezone structure is obsolete; the tz argument should normally be specified as NULL." And POSIX says "Applications should use the clock_gettime() function instead of the obsolescent gettimeofday() function."

The ...timeofday() functions work with microseconds while the clock_...time() functions work with nanoseconds. Given that we expect our targets to support only 1/10 of seconds the microseconds look preferable at first sight. However, already microseconds require the cc65 data type 'long' so it's not such a relevant difference to nanoseconds. Additionally clock_getres() seems useful.

In order to avoid code duplication clock_gettime() takes over the role of the actual time getter from _systime(). So time() now calls clock_gettime() instead of _systime().

For some reason beyond my understanding _systime() was mentioned in time.h. _systime() worked exactly like e.g. _sysremove() and those _sys...() functions are all considered internal. The only reason I could see would be a performance gain of bypassing the time() wrapper. However, all known _systime() implementations internally called mktime(). And mktime() is implemented in C using an iterative algorithm so I really can't see what would be left to gain here. From that perspective I decided to just remove _systime().
2018-08-15 16:06:44 +02:00
..
_file.inc
_heap.inc
accelerator.inc Added C64 Turbo Master accelerator code and documentation. 2018-04-30 14:30:35 -07:00
apple2.inc
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
atari_pokey.inc
atari.inc Atari: fix lookup of default device on XDOS. 2016-09-12 23:40:25 +02:00
atari.mac
atmos.inc Fixed Oric-1 compatibility #550 2017-12-15 23:51:39 +01:00
c16.inc
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
cbm610.inc
cbm_filetype.inc
cbm_kernal.inc Added CHKOUT and CLRCHN 2018-08-15 11:53:17 +02:00
cbm.mac
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
em-error.inc
em-kernel.inc
errno.inc Implement exec() for Atari XDOS. 2016-06-13 20:40:01 +02:00
fcntl.inc
gamate.inc more cleanup 2015-11-29 20:04:10 +01:00
generic.mac
get_tv.inc
joy-error.inc
joy-kernel.inc Removed IRQ support from joystick drivers. 2018-02-01 22:38:36 +01:00
longbranch.mac
lynx.inc Fixed CPU definition of Lynx. Removed nonsense target vc20. 2016-04-12 23:58:30 +02:00
modload.inc
module.mac Create static drivers directly from source files. 2014-06-04 23:50:18 +02:00
mouse-kernel.inc
nes.inc
o65.inc
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
ser-kernel.inc
signal.inc
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
tgi-kernel.inc Removed IRQ support from TGI drivers. 2018-02-02 18:15:45 +01:00
tgi-vectorfont.inc
time.inc Replaced _systime with clock_gettime. 2018-08-15 16:06:44 +02:00
utsname.inc
vic20.inc Changed register addresses relative to the base address 2018-04-14 18:45:15 +03:00
zeropage.inc