1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-15 11:05:56 +00:00
Commit Graph

29 Commits

Author SHA1 Message Date
mrdudz
6ba3deffa4 use __clocks_per_sec instead of _clocks_per_sec 2022-08-28 20:22:25 +02:00
mrdudz
3640beaa46 fix some header files to conform with C99 hopefully, should fix issue #1670 2022-05-08 19:29:57 +02:00
Greg King
bae2821d5a Added telestrat to <time.h>.
That library has clock().
2022-02-03 18:23:23 -05:00
Oliver Schmidt
07bd5089ec Define CLOCKS_PER_SEC as _clocks_per_sec() if _clocks_per_sec() is actually available.
There are programs checking for the existence of CLOCKS_PER_SEC before usage. We don't want to mislead them.
2021-05-09 19:27:33 +02:00
Oliver Schmidt
f723147f04 Streamlined clock rate handling.
* Docs say that CLK_TCK is an obsolete alias of CLOCKS_PER_SEC so there's no point in individual definitions.
* All targets determining the clock rate at runtime can use a common handling.
2020-10-25 14:06:44 +01:00
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
mrdudz
b39a8b7a61 more cleanup 2015-11-29 20:04:10 +01:00
mrdudz
60285097e3 initial import of the gamate stuff 2015-11-14 13:15:29 +01:00
mrdudz
21ef6b8510 fixed screensize, timertick, revers mode 2015-07-16 16:00:32 +02:00
mrdudz
c3d45e4c47 fixed issues found by gregg 2015-07-15 13:18:12 +02:00
Greg King
0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Christian Groessler
f54ef4efe4 provide CLK_TCK and CLOCKS_PER_SEC values for atari5200 2014-05-29 13:23:45 +02:00
Oliver Schmidt
83280e1ee2 Have __APPLE2ENH__ imply __APPLE2__ and __ATARIXL__ imply __ATARI__. 2013-06-17 21:34:08 +02:00
Oliver Schmidt
98c47d1877 Introduced target 'atarixl'.
The target 'atarixl' is to be used for Atari XL (and better) machines.
It will disable the OS ROM and enable the Shadow RAM available on
those machine.

Note: This commit is only the inital step towards for this goal that just
replicates the target 'atari' as a starting point!
2013-05-28 21:56:37 +02:00
Oliver Schmidt
85885001b1 Removed (pretty inconsistently used) tab chars from source code base. 2013-05-09 13:57:12 +02:00
uz
c03a5caf19 Added an implementation of clock() for the Lynx console. By Greg King.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5477 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-02-06 20:17:54 +00:00
izydorst
e642fbbbea Stefan Haubenthal's patch for Contiki port
git-svn-id: svn://svn.cc65.org/cc65/trunk@3529 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-07-17 11:59:46 +00:00
cuz
4df0cf8c7a Because of a typo, time.h did not define NULL as required by the standard.
git-svn-id: svn://svn.cc65.org/cc65/trunk@3451 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-04-02 16:26:55 +00:00
cuz
c52034c59a Cleanup use of predefined data types / defines
git-svn-id: svn://svn.cc65.org/cc65/trunk@2342 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-08-16 08:23:01 +00:00
cuz
4fbcb43763 NES changes
git-svn-id: svn://svn.cc65.org/cc65/trunk@2057 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-04-15 20:47:12 +00:00
cuz
21c7002bed Add CLK_TCK for atmos
git-svn-id: svn://svn.cc65.org/cc65/trunk@2050 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-04-14 08:08:14 +00:00
cuz
5dba474030 Added strftime
git-svn-id: svn://svn.cc65.org/cc65/trunk@1512 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-13 13:08:46 +00:00
cuz
2cd37d74e4 Added _systime
git-svn-id: svn://svn.cc65.org/cc65/trunk@1508 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-12 22:35:40 +00:00
cuz
cae19c1a8a More time functions
git-svn-id: svn://svn.cc65.org/cc65/trunk@1506 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-12 22:01:32 +00:00
cuz
35aaf34e20 Add the time() function
git-svn-id: svn://svn.cc65.org/cc65/trunk@1504 b7a2c559-68d2-44c3-8de9-860c34a00d81
2002-11-12 19:54:30 +00:00
cuz
cce379324d Add support for the CBM 510
git-svn-id: svn://svn.cc65.org/cc65/trunk@916 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-09-14 07:53:34 +00:00
cuz
319059d46d Added Atari stuff
git-svn-id: svn://svn.cc65.org/cc65/trunk@196 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-07-25 20:10:29 +00:00
cuz
6524692f3d Added standard copyright header, fixed a wrong macro name.
git-svn-id: svn://svn.cc65.org/cc65/trunk@191 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-07-22 19:01:53 +00:00
uz
53dd513176 This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
2000-05-28 13:40:48 +00:00