mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 19:29:37 +00:00
35 lines
729 B
ArmAsm
35 lines
729 B
ArmAsm
;
|
|
; 2022-03-15, Karri Kaksonen
|
|
;
|
|
; clock_t __clocks_per_sec (void);
|
|
;
|
|
|
|
.export ___clocks_per_sec
|
|
|
|
.import sreg: zp
|
|
.import _paldetected
|
|
.include "atari7800.inc"
|
|
|
|
.macpack generic
|
|
|
|
.code
|
|
|
|
;-----------------------------------------------------------------------------
|
|
; Return the number of clock ticks in one second.
|
|
;
|
|
.proc ___clocks_per_sec
|
|
|
|
lda #0
|
|
tax
|
|
sta sreg ; return 32 bits
|
|
sta sreg+1
|
|
lda _paldetected
|
|
bne pal
|
|
lda #60 ; NTSC - 60Hz
|
|
rts
|
|
pal:
|
|
lda #50 ; PAL - 50Hz
|
|
rts
|
|
.endproc
|
|
|