1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-30 01:29:37 +00:00
Commit Graph

342 Commits

Author SHA1 Message Date
Oliver Schmidt
fe5af26f9f Express assumption about struct timespec.
We basically cast a struct timespec pointer to a time_t pointer when we pass the clock_settime() paramter to localtime(). Explicitly express that in the source code.
2018-08-18 01:29:40 +02:00
Oliver Schmidt
eb9872c684 Added clock_settime() for some CBMs.
The CIA TOD only stores the time but not the date. Therefore the date set by clock_settime() ist just stored inside the C library for retrieval via clock_gettime().

The "very special" handling of 12AM/PM is based on https://groups.google.com/d/msg/comp.sys.cbm/ysVYSX4AMbc/vHrXCWEhCOUJ saying:

==========

24hr: Wr => Rd => Nx
--------------------
  0 : 92 => 12 => 01   <= Switch from 00 to 01 (24-hour notation)
  1 : 01 => 01 => 02
  2 : 02 => 02 => 03
 11 : 11 => 11 => 92
 12 : 12 => 92 => 81   <= Switch from 12 to 13 (24-hour notation)
 13 : 81 => 81 => 82
 14 : 82 => 82 => 83
 23 : 91 => 91 => 12

1. column ("24hr"): hour to be tested (decimal)
2. column ("Wr"):   hour written to TOD register (BCD)
3. column ("Rd"):   hour read from TOD register (BCD) immediately after writing the value in column 2 to see the conversion between AM/PM, if any
4. column ("Nx"):   next hour (BCD) after the hour switch

==========

Thanks Paul!
2018-08-18 01:29:40 +02:00
Oliver Schmidt
cb7ec508f6 Fixed 12 AM/PM handling.
Midnight is 12 AM and noon is 12 PM (see https://en.wikipedia.org/wiki/12-hour_clock). Therefore we need to subtract 12 hours in exactly those two hours.
2018-08-18 01:29:40 +02: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
Olli Savia
635a99c083 TAB to space conversion 2018-06-30 16:25:43 +03:00
Olli Savia
96e6a0a114 Common include file is now cbm_kernal.inc 2018-06-29 22:58:16 +03:00
Olli Savia
42e9b971c5 Merge remote-tracking branch 'upstream/master' into cbmkernal_stage2 2018-06-29 22:50:02 +03:00
Olli Savia
f7fbac4c6b Use common include file cbmkernal.inc 2018-06-27 21:39:24 +03:00
Oliver Schmidt
86945a1270
Merge pull request #687 from polluks/patch-12
Smaller driver code
2018-06-21 22:37:29 +02:00
Stefan
6a70d1dab1
Removed unused label 2018-06-21 20:30:14 +00:00
greg-king5
4980fade74
Made LINE plot single-point lines correctly. 2018-06-21 08:18:53 -04:00
Stefan
23534beaa6
Smaller driver code 2018-06-21 00:25:33 +00:00
Stefan
472a107358
Make NMI ready 2018-05-14 23:22:09 +00:00
Stefan
b449ded176
Update c64-hi.s 2018-05-09 23:56:35 +00:00
Stefan
b81a04f157
Update c64-hi.s 2018-05-09 23:52:52 +00:00
Stefan
cdce753a09
NMI friendly c64-hi
Don't clear all vectors, see #639.
2018-05-09 23:31:42 +00:00
Marco van den Heuvel
cdebf6baa7 Harmonized the comments (as in added 1 space) ;) 2018-05-03 09:11:20 -07:00
Marco van den Heuvel
e88ac62d06 Optimized the code a bit, thanks to Greg for the suggestions/comments. 2018-05-01 14:46:57 -07:00
Marco van den Heuvel
ad7b339c44 Added C64 Turbo Master accelerator code and documentation. 2018-04-30 14:30:35 -07:00
Marco van den Heuvel
5b4929ef98 Removed obsolete bit opcode. 2018-04-29 12:13:52 -07:00
Marco van den Heuvel
d0088fbc0f Fixed a wrong branch. 2018-04-28 13:26:20 -07:00
Marco van den Heuvel
a012fab090 Added a comment to make the situation more clear. 2018-04-28 13:25:16 -07:00
Marco van den Heuvel
11629bcf99 Added C65/C64DX accelerator code and documentation. 2018-04-27 14:22:41 -07:00
Oliver Schmidt
47e4b36180
Merge pull request #631 from blackystardust/master
Added C64 Chameleon accelerator code and documentation.
2018-04-27 20:47:03 +02:00
Marco van den Heuvel
97e69952c4 Removed extern keyword from function prototypes. 2018-04-27 09:16:25 -07:00
Marco van den Heuvel
1428015158 Optimized the code a bit as suggested by Greg. 2018-04-26 09:18:54 -07:00
Greg King
c92a3c5bd5 Improved the accelerator code. Fixed an infinite loop.
Removed the execute permissions from some files.
2018-04-26 05:46:34 -04:00
Marco van den Heuvel
f2e46f0fdf Added C64 Chameleon accelerator code and documentation. 2018-04-25 12:53:29 -07:00
Marco van den Heuvel
cc2bcb8a4d Changed c128 accelerator code and documention to include both C64 and C128 support. 2018-04-23 19:25:11 -07:00
Marco van den Heuvel
28f26991ac Updated c128 accelerator code and documentation. 2018-04-21 09:52:50 -07:00
Marco van den Heuvel
3f5683b391 Added C128 in C64 mode accelerator code and documentation. 2018-04-20 12:08:28 -07:00
Marco van den Heuvel
ef73310cce Fixed more comments. 2018-04-16 11:05:52 -07:00
Marco van den Heuvel
0aa2735d4e Fixed another comment. 2018-04-15 12:15:19 -07:00
Marco van den Heuvel
c5f15fa1d5 Fixed some comment and documentation errors. 2018-04-15 11:55:58 -07:00
Marco van den Heuvel
cb04bc5465 Fixed an issue with the changing the d040 value while detecting. 2018-04-14 11:31:28 -07:00
Marco van den Heuvel
6076316f38 Added c64dtv accelerator code and documentation. 2018-04-14 10:40:13 -07:00
Marco van den Heuvel
89c3ed6d7f Added C64/C128 SuperCPU accelerator functions and started on a generic framework for accelerators. 2018-04-09 19:36:53 -07:00
Greg King
b844572159 Moved most of the tgi_colors.s files into the libsrc/common/ directory.
Only the Apple2 and Lynx platforms use different codes for the white color; they have their own files.
2018-03-27 07:28:46 -04:00
Greg King
155f3ade41 C64 TGI: LINE: Optimization: Don't check boundaries; LINE always is called by tgi_clippedline().
Submitted in Pull Request #611 by Sven Michael Klose.
2018-03-26 07:28:01 -04:00
Bob Andrews
7e6942953c
Merge pull request #604 from blackystardust/master
Improved reu size detection.
2018-03-08 19:19:35 +01:00
mrdudz
3afbed48e0 tweak driver to no more use IRQ 2018-03-07 00:20:42 +01:00
Marco van den Heuvel
b783280577 Replaced reu commands with defined constants. 2018-03-05 17:46:51 -08:00
Marco van den Heuvel
40e93dd931 Improved reu size detection. 2018-03-05 15:01:55 -08:00
Oliver Schmidt
dacee3b9ed Removed IRQ support from TGI drivers.
All but one TGI drivers didn't use IRQs. Especially when the TGI driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure.

The one driver using IRQs (the graphics driver for the 160x102x16 mode on the Lynx) now uses a library reference to set up a JMP to its IRQ handler.
2018-02-02 18:15:45 +01:00
Oliver Schmidt
1976d6cd32 Removed IRQ support from joystick drivers.
All but one joystick drivers didn't use IRQs. Espsecially when the joystick driver kernel was the only .interruptor this meant quite some unnecessary overhead because it pulled in the whole IRQ infrastructure.

I was told that the one driver using IRQs (the DXS/HIT-4 Player joystick driver for the C64) can be reworked to not do it. Until this is done that driver is defunct.
2018-02-01 22:38:36 +01:00
mrdudz
783408080c convert to petscii 2017-12-28 17:52:27 +01:00
mrdudz
f207a60365 some cleanup 2017-12-28 02:26:23 +01:00
mrdudz
0543ecabe2 added peek functions for soft80 2017-12-28 01:58:03 +01:00
Oliver Schmidt
4aa19494f5 Removed dysfunctional kbrepeatdelay() and kbrepeatrate().
As discussed in https://github.com/cc65/cc65/pull/452 after my premature merge the two functions in question don't work as expected.

Additionally I adjusted several style deviations in the pull request in question.
2017-08-30 16:37:59 +02:00
Oliver Schmidt
20c85c8a1c Minor style adjustment. 2017-08-20 17:17:38 +02:00