2000-07-25 20:06:34 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 25.07.2000
|
|
|
|
;
|
2000-07-29 21:25:43 +00:00
|
|
|
; Implemented using information from Sidney Cadot <sidney@janis.pds.twi.tudelft.nl>
|
2000-07-25 20:06:34 +00:00
|
|
|
;
|
|
|
|
; clock_t clock (void);
|
|
|
|
; unsigned _clocks_per_sec (void);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export _clock, __clocks_per_sec
|
|
|
|
.importzp sreg
|
|
|
|
|
|
|
|
.include "atari.inc"
|
|
|
|
|
|
|
|
|
|
|
|
.proc _clock
|
|
|
|
|
|
|
|
lda #0 ; Byte 3 is always zero
|
|
|
|
sta sreg+1
|
|
|
|
php ; Save current I flag value
|
2000-07-29 21:25:43 +00:00
|
|
|
sei ; Disable interrupts
|
2000-07-25 20:06:34 +00:00
|
|
|
lda RTCLOK ; Read clock
|
|
|
|
ldx RTCLOK+1
|
2000-07-30 09:30:58 +00:00
|
|
|
ldy RTCLOK+2
|
|
|
|
plp ; Restore old I bit
|
|
|
|
sty sreg
|
2000-07-25 20:06:34 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
|
|
|
.proc __clocks_per_sec
|
|
|
|
|
|
|
|
lda #50 ; Assume PAL
|
2000-07-29 21:25:43 +00:00
|
|
|
ldx PAL ; use hw register, PALNTS is only supported on XL/XE ROM
|
2000-07-25 20:06:34 +00:00
|
|
|
beq @L1
|
|
|
|
ldx #0
|
|
|
|
lda #60
|
|
|
|
@L1: rts
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|