1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-11 05:29:33 +00:00
cc65 - a freeware C compiler for 6502 based systems
Go to file
Oliver Schmidt f40dcb5883 Added clock_getres() / clock_settime() for the Apple II.
The situation on the Apple II is rather special: There are several types of RTCs. It's not desirable to have specific code for all of them. As the OS supports file timestamps RTC owners usually use OS drivers for their RTC. Those drivers read the RTC and write the result in a "date/time location" in RAM. The OS reads the date/time from the RAM location. If there's no RTC the RAM location keeps containing zeros. The OS uses those zeros as timestamps and the files show up in a directory as "<NO DATE>".

There's no common interface to set RTCs so if an RTC _IS_ present there's just nothing to do. However, if there's _NO_ RTC present the user might very well be interest to "manually" set the RAM location in order to have timestamps. But he surely doesn't want to manually set the RAM location over an over again. Rather he wants to set it just once after booting the OS.

From that perspective it makes most sense to not set both the date and the time but rather only set the date and have the time just stay zero. Then files show up in a directory as "DD-MON-YY  0:00".

So clock_settime() checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_settime() fails with ERANGE. Otherwise clock_settime() ignores sets the date - and completely ignores the time provided as parameter.

clock_getres() too checks if the current time equals 0:00. If it does _NOT_ then an RTC is supposed to be active and clock_getres() returns a time resolution of one minute. Otherwise clock_getres() presumes that the only one who sets the RAM location is clock_settime() and therefore returns a time resolution of one day.
2018-08-15 21:34:35 +02:00
asminc Added clock_getres() / clock_settime() for the Apple II. 2018-08-15 21:34:35 +02:00
cfg Switched Apple II output format to AppleSingle. 2018-03-07 23:05:21 +01:00
doc Replaced _systime with clock_gettime. 2018-08-15 16:06:44 +02:00
include Replaced _systime with clock_gettime. 2018-08-15 16:06:44 +02:00
libsrc Added clock_getres() / clock_settime() for the Apple II. 2018-08-15 21:34:35 +02:00
samples Support --print-target-path with spaces. 2018-06-10 18:12:09 +02:00
src sim65: Fix "$2C: BIT abs" to access the correct address. 2018-08-10 12:58:48 -07:00
test Increased consistency. 2018-08-02 15:45:57 +02:00
testcode Followed the discussions in the Pull request #682. 2018-06-14 02:02:16 +09:00
util dont use that silly buffer 2015-11-29 21:15:10 +01:00
.gitattributes Added .gitattributes to force LF line endings on commit. 2017-03-12 18:13:18 +01:00
.gitignore Don't ignore more than necessary. 2016-06-01 22:36:38 +02:00
.travis.yml Migrate 'encrypted variables' variables to 'repository settings'. 2017-05-17 20:56:21 +02:00
LICENSE Simplified license. 2015-05-05 21:56:23 +02:00
Makefile Added "html" and "info" goals to the top-level Makefile. 2017-05-24 18:49:02 -04:00
Makefile.travis Fixed file name of Windows binary snapshot. 2015-01-20 21:00:44 +01:00
README.md Added console 2018-03-13 22:19:19 +00:00

Windows Snapshot

Documentation

Wiki

Build Status

cc65 is a complete cross development package for 65(C)02 systems, including a powerful macro assembler, a C compiler, linker, librarian and several other tools.

cc65 has C and runtime library support for many of the old 6502 machines, including

  • the following Commodore machines:
    • VIC20
    • C16/C116 and Plus/4
    • C64
    • C128
    • CBM 510 (aka P500)
    • the 600/700 family
    • newer PET machines (not 2001).
  • the Apple ][+ and successors.
  • the Atari 8 bit machines.
  • the Atari 2600 console.
  • the Atari 5200 console.
  • GEOS for the C64, C128 and Apple //e.
  • the Bit Corporation Gamate console.
  • the NEC PC-Engine (aka TurboGrafx-16) console.
  • the Nintendo Entertainment System (NES) console.
  • the Watara Supervision console.
  • the VTech Creativision console.
  • the Oric Atmos.
  • the Oric Telestrat.
  • the Lynx console.
  • the Ohio Scientific Challenger 1P.

The libraries are fairly portable, so creating a version for other 6502s shouldn't be too much work.