2022-03-22 19:29:06 +00:00
|
|
|
;
|
|
|
|
; 2022-03-15, Karri Kaksonen
|
|
|
|
;
|
2022-08-28 18:22:25 +00:00
|
|
|
; clock_t __clocks_per_sec (void);
|
2022-03-22 19:29:06 +00:00
|
|
|
;
|
|
|
|
|
2022-08-28 18:22:25 +00:00
|
|
|
.export ___clocks_per_sec
|
2022-03-22 19:29:06 +00:00
|
|
|
|
|
|
|
.import sreg: zp
|
2022-04-16 16:16:14 +00:00
|
|
|
.import _paldetected
|
2022-03-22 19:29:06 +00:00
|
|
|
.include "atari7800.inc"
|
|
|
|
|
|
|
|
.macpack generic
|
|
|
|
|
2022-04-16 16:16:14 +00:00
|
|
|
.code
|
2022-03-22 19:29:06 +00:00
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
; Return the number of clock ticks in one second.
|
|
|
|
;
|
2022-08-28 18:22:25 +00:00
|
|
|
.proc ___clocks_per_sec
|
2022-03-22 19:29:06 +00:00
|
|
|
|
|
|
|
lda #0
|
2022-04-16 16:16:14 +00:00
|
|
|
tax
|
2022-03-22 19:29:06 +00:00
|
|
|
sta sreg ; return 32 bits
|
|
|
|
sta sreg+1
|
|
|
|
lda _paldetected
|
2022-04-16 16:16:14 +00:00
|
|
|
bne pal
|
|
|
|
lda #60 ; NTSC - 60Hz
|
|
|
|
rts
|
2022-03-22 19:29:06 +00:00
|
|
|
pal:
|
2022-04-16 16:16:14 +00:00
|
|
|
lda #50 ; PAL - 50Hz
|
2022-03-22 19:29:06 +00:00
|
|
|
rts
|
|
|
|
.endproc
|
|
|
|
|