1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-02 15:29:33 +00:00
cc65/libsrc/cx16/waitvsync.s

25 lines
528 B
ArmAsm
Raw Normal View History

;
; 2021-04-01, Greg King
;
; void waitvsync (void);
; /* Wait for the start of the next video field. */
;
; VERA's vertical sync causes IRQs which increment the jiffy timer.
;
; Updated by ZeroByteOrg to use Kernal API RDTIM to retreive the TIMER variable
;
.export _waitvsync
.importzp tmp1
.proc _waitvsync: near
RDTIM = $FFDE ; Kernal API for reading the jiffy timer
jsr RDTIM
sta tmp1
keep_waiting:
jsr RDTIM
cmp tmp1
beq keep_waiting
rts
.endproc