forked from munsie/dasm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|