2019-09-27 07:38:51 +00:00
|
|
|
;
|
2020-01-10 20:17:23 +00:00
|
|
|
; 2020-01-08, Greg King
|
2019-09-27 07:38:51 +00:00
|
|
|
;
|
|
|
|
; void waitvsync (void);
|
2019-12-25 15:56:32 +00:00
|
|
|
; /* Wait for the start of the next video field. */
|
2019-09-27 07:38:51 +00:00
|
|
|
;
|
2019-12-25 15:56:32 +00:00
|
|
|
; VERA's vertical sync causes IRQs which increment the jiffy timer.
|
2019-09-27 07:38:51 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
.export _waitvsync
|
|
|
|
|
|
|
|
.include "cx16.inc"
|
|
|
|
|
|
|
|
_waitvsync:
|
2020-01-10 20:17:23 +00:00
|
|
|
ldx VIA1::PRA ; (TIMER is in RAM bank 0)
|
|
|
|
stz VIA1::PRA
|
2019-12-25 15:56:32 +00:00
|
|
|
lda TIMER + 2
|
|
|
|
: cmp TIMER + 2
|
2019-09-27 07:38:51 +00:00
|
|
|
beq :- ; Wait for next jiffy
|
2020-01-10 20:17:23 +00:00
|
|
|
stx VIA1::PRA
|
2019-09-27 07:38:51 +00:00
|
|
|
rts
|