Skip to content

Commit

Permalink
added xmacro.h
Browse files Browse the repository at this point in the history
  • Loading branch information
sehugg committed Dec 26, 2016
1 parent 69b1db6 commit 32a9ee8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions machines/atari2600/xmacro.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

;-------------------------------------------------------
; 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

0 comments on commit 32a9ee8

Please sign in to comment.