2022-03-22 19:29:06 +00:00
|
|
|
;
|
|
|
|
; 2022-03-15, Karri Kaksonen
|
|
|
|
;
|
|
|
|
; clock_t _clocks_per_sec (void);
|
|
|
|
;
|
|
|
|
|
|
|
|
.export __clocks_per_sec
|
|
|
|
|
|
|
|
.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.
|
|
|
|
;
|
|
|
|
.proc __clocks_per_sec
|
|
|
|
|
|
|
|
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
|
|
|
|
|