mirror of
https://github.com/cc65/cc65.git
synced 2024-11-04 17:04:58 +00:00
f40dcb5883
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. |
||
---|---|---|
.. | ||
apple2 | ||
atari | ||
atari2600 | ||
atari5200 | ||
atmos | ||
c16 | ||
c64 | ||
c128 | ||
cbm | ||
cbm510 | ||
cbm610 | ||
common | ||
conio | ||
creativision | ||
dbg | ||
em | ||
gamate | ||
geos-apple | ||
geos-cbm | ||
geos-common | ||
joystick | ||
lynx | ||
mouse | ||
nes | ||
none | ||
osic1p | ||
pce | ||
pet | ||
plus4 | ||
runtime | ||
serial | ||
sim6502 | ||
supervision | ||
telestrat | ||
tgi | ||
vic20 | ||
zlib | ||
Makefile |