1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-11 20:29:36 +00:00
cc65/libsrc/atari7800/clocks_per_sec.s

35 lines
729 B
ArmAsm
Raw Normal View History

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