diff --git a/demos/driven/part20_credits/credits.s b/demos/driven/part20_credits/credits.s index 64ae74f1..f12e99b5 100644 --- a/demos/driven/part20_credits/credits.s +++ b/demos/driven/part20_credits/credits.s @@ -63,6 +63,8 @@ load_loop: scroll_loop: + jsr hgr_vertical_scroll + ;============================================ ; clear lines to get rid of stray old chars @@ -162,7 +164,7 @@ skip_next_text: ; do the scroll ;============================= - jsr hgr_vertical_scroll + jsr wait_vblank jsr hgr_page_flip @@ -183,8 +185,11 @@ skip_next_text: .include "../irq_wait.s" .include "../hgr_page_flip.s" + .include "../vblank.s" + final_credits: + .byte 20," ",0 .byte 16,"DRI\/EN",0 .byte 20," ",0 .byte 15,"by Desire",0 diff --git a/demos/driven/vblank.s b/demos/driven/vblank.s new file mode 100644 index 00000000..8f0d6ca3 --- /dev/null +++ b/demos/driven/vblank.s @@ -0,0 +1,26 @@ +; wait for VBLANK + +; no way to do this on II/II+ short of vapor lock / floating bus +; IIe you can read $C019 (in VBLANK when top bit 0) +; IIc you can also read $C019 (also can setup interrupt) +; IIgs you can read $C019 but reverse of IIe (in VBLANK when top bit 1) + + +VBLANK = $C019 ; + + ; wait for vblank on IIe + ; positive? during vblank + +wait_vblank: + lda APPLEII_MODEL + cmp #'e' + bne no_vblank + +wait_vblank_iie: + lda VBLANK + bmi wait_vblank_iie ; wait for positive (in vblank) +wait_vblank_done_iie: + lda VBLANK ; wait for negative (vlank done) + bpl wait_vblank_done_iie +no_vblank: + rts