Split clock file to components

This commit is contained in:
Karri Kaksonen
2022-03-22 21:29:06 +02:00
committed by mrdudz
parent 218c98d4d5
commit cf8c7ee28d
2 changed files with 35 additions and 21 deletions

View File

@@ -0,0 +1,34 @@
;
; 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