1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-07-02 14:29:39 +00:00
8bitworkshop/presets/vcs/xmacro.h
2018-08-17 13:44:00 -04:00

25 lines
671 B
C

;-------------------------------------------------------
; Usage: TIMER_SETUP lines
; where lines is the number of scanlines to skip (> 2).
; The timer will be set so that it expires before this number
; of scanlines. A WSYNC will be done first.
MAC TIMER_SETUP
.lines SET {1}
lda #(((.lines-1)*76-14)/64)
sta WSYNC
sta TIM64T
ENDM
;-------------------------------------------------------
; Use with TIMER_SETUP to wait for timer to complete.
; You may want to do a WSYNC afterwards, since the timer
; is not accurate to the beginning/end of a scanline.
MAC TIMER_WAIT
.waittimer
lda INTIM
bne .waittimer
ENDM