2 ; Piotr Fusik, 04.11.2001
3 ; originally by Ullrich von Bassewitz and Sidney Cadot
5 ; clock_t clock (void);
6 ; unsigned _clocks_per_sec (void);
9 .export _clock, __clocks_per_sec
17 ldx #5 ; Synchronize with Antic, so the interrupt won't change RTCLOK
18 stx WSYNC ; while we're reading it. The synchronization is done same as
19 @L1: dex ; in SETVBLV function in Atari OS.
21 stx sreg+1 ; Byte 3 is always zero
31 .proc __clocks_per_sec
33 lda PAL ; use hw register, PALNTS is only supported on XL/XE ROM