1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-07 13:29:45 +00:00
cc65/libsrc/atari
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
..
emd
joy Removed IRQ support from joystick drivers. 2018-02-01 22:38:36 +01:00
mou
ser
targetutil Add issues from pull request #307. 2016-06-07 12:07:38 +02:00
tgi Removed IRQ support from TGI drivers. 2018-02-02 18:15:45 +01:00
_scrsize.s
_sys.s
break.s
carthdr.s
cartinit.s
cartstart.s
cashdr.s
casinit.s
cclear.s
cgetc.s Atari: split "setcursor" function out of cgetc.s source file into setcursor.s. 2017-10-03 21:58:52 +02:00
chline.s
clock.s
close.s
clrscr.s
color.s
cputc.s
crt0.s Implement exec() for Atari XDOS. 2016-06-13 20:40:01 +02:00
ctype.s
cvline.s
dio_cts.s
dio_stc.s Some minor cleanups. 2018-07-26 14:35:26 +02:00
diopncls.s
dioqsize.s
dioread.s
diowrite.s
diowritev.s
do_oserr.s
doesclrscr.s Fix doesclrscrafterexit() function on atarixl target. 2016-06-13 21:16:27 +02:00
dosdetect.s
exec.s A small rearrangement of instructions in Atari's exec() to let the comments 2016-06-16 00:47:13 +02:00
exehdr.s
exetrailer.s
fd.inc
fdtab.s
fdtable.s
fdtoiocb.s
findfreeiocb.inc
findfreeiocb.s
get_tv.s
getargs.s
getdefdev.s Atari: fix lookup of default device on XDOS. 2016-09-12 23:40:25 +02:00
getdevice.s Implementation of getfirstdevice/getnextdevice for Atari. 2017-12-28 04:54:18 +01:00
getfd.s
gotox.s
gotoxy.s
gotoy.s
graphics.s
initcwd.s
inviocb.s
irq.s
is_cmdline_dos.s More optimization in libsrc/atari/is_cmdline_dos.s. 2017-01-24 21:01:42 +01:00
joy_stat_stddrv.s
joy_stddrv.s
kbhit.s
libref.s
lseek.s
Makefile.inc
mcbdefault.s
mcbpm-shape.s
mcbpm.s
mcbtxtchar-char.s
mcbtxtchar.s
mouse_stat_stddrv.s
mouse_stddrv.s
mouseref.s
mul40.s
open.s Fix exec() for atarixl target. 2016-06-15 23:52:16 +02:00
oserrlist.s
oserror.s Implement exec() for Atari XDOS. 2016-06-13 20:40:01 +02:00
ostype.s
posixdirent.s
randomize.s
read.s
revers.s
romswitch.inc
rwcommon.s
save_area.inc
save_area.s
savevec.s
scrdev.s
scroll.s
serref.s
setcolor.s
setcursor.s Atari: split "setcursor" function out of cgetc.s source file into setcursor.s. 2017-10-03 21:58:52 +02:00
shadow_ram_handlers.s Atari: fix lookup of default device on XDOS. 2016-09-12 23:40:25 +02:00
shadow_ram_prepare.s
shadow_ram_timerirq1.s
siocall.s Some minor cleanups. 2018-07-26 14:35:26 +02:00
syschdir.s
sysmkdir.s
sysremove.s
sysrename.s
sysrmdir.s
system_check.s
sysuname.s
tgi_stat_stddrv.s
tgi_stddrv.s
toascii.s
ucase_fn.s Some Atari runtime library fixes. 2016-06-06 22:45:20 +02:00
wherex.s
wherey.s
write.s
xlmemchk.inc