1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00
cc65/libsrc/atari7800/clocks_per_sec.s

35 lines
726 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);
;
.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