1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-01 15:54:59 +00:00
cc65/libsrc/c64
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 Make NMI ready 2018-05-14 23:22:09 +00:00
extra added peek functions for soft80 2017-12-28 01:58:03 +01:00
joy
mou
ser
tgi Merge pull request #687 from polluks/patch-12 2018-06-21 22:37:29 +02:00
_scrsize.s
acc_c64dtv_speed.s Merge pull request #631 from blackystardust/master 2018-04-27 20:47:03 +02:00
acc_c65_speed.s Removed obsolete bit opcode. 2018-04-29 12:13:52 -07:00
acc_c128_speed.s Improved the accelerator code. Fixed an infinite loop. 2018-04-26 05:46:34 -04:00
acc_chameleon_speed.s Removed extern keyword from function prototypes. 2018-04-27 09:16:25 -07:00
acc_detect_c64dtv.s Improved the accelerator code. Fixed an infinite loop. 2018-04-26 05:46:34 -04:00
acc_detect_c65.s Fixed a wrong branch. 2018-04-28 13:26:20 -07:00
acc_detect_c128.s Improved the accelerator code. Fixed an infinite loop. 2018-04-26 05:46:34 -04:00
acc_detect_chameleon.s Optimized the code a bit as suggested by Greg. 2018-04-26 09:18:54 -07:00
acc_detect_scpu.s Added C64/C128 SuperCPU accelerator functions and started on a generic framework for accelerators. 2018-04-09 19:36:53 -07:00
acc_detect_turbomaster.s Harmonized the comments (as in added 1 space) ;) 2018-05-03 09:11:20 -07:00
acc_scpu_speed.s Removed extern keyword from function prototypes. 2018-04-27 09:16:25 -07:00
acc_turbomaster_speed.s Optimized the code a bit, thanks to Greg for the suggestions/comments. 2018-05-01 14:46:57 -07:00
bordercolor.s
break.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
cgetc.s
clrscr.s
color.s
conio.s
cputc.s
crt0.s
devnum.s
get_ostype.s
get_tv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
gettime.s Replaced _systime with clock_gettime. 2018-08-15 16:06:44 +02:00
irq.s
joy_stat_stddrv.s
joy_stddrv.s Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
kbhit.s
kbrepeat.s
kernal.s TAB to space conversion 2018-06-30 16:25:43 +03:00
kplot.s
libref.s Cleaned 2 source files by removing commented-out lines that are active in other files. 2013-08-23 07:36:11 -04:00
mainargs.s
mcbdefault.s
mcbspritedata.s
mouse_stat_stddrv.s
mouse_stddrv.s
mouseref.s
pencalib.c
randomize.s
revers.s
soft80_cgetc.s
soft80_charset.s
soft80_color.s updated comments 2015-10-19 02:47:40 +02:00
soft80_conio.s
soft80_cpeekc.s
soft80_cpeekcolor.s
soft80_cpeekrevers.s some cleanup 2017-12-28 02:26:23 +01:00
soft80_cpeeks.s
soft80_cputc.s Introduced internal gotoxy that pops both parameters. 2016-06-05 14:58:38 +02:00
soft80_kclrscr.s
soft80_kplot.s
soft80_scrsize.s
soft80.inc
soft80mono_cgetc.s
soft80mono_color.s
soft80mono_conio.s Renamed INITBSS to INIT and INIT to ONCE. 2016-03-06 21:27:19 +01:00
soft80mono_cpeekcolor.s
soft80mono_cputc.s Introduced internal gotoxy that pops both parameters. 2016-06-05 14:58:38 +02:00
soft80mono_kclrscr.s added size optimized monochrom soft80 driver 2015-10-19 02:49:32 +02:00
soft80mono_kplot.s
status.s
sysuname.s
tgi_stat_stddrv.s
tgi_stddrv.s
waitvsync.s