From 283784c94a581decf9b64b23a4a0fa42c27070b0 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 18 Apr 2021 14:48:26 -0400 Subject: [PATCH] ootw: credits: working a bit better --- games/ootw/ending/credits.s | 149 +++++++++++++++++++++--------------- games/ootw/ending/ending.s | 15 ++-- 2 files changed, 99 insertions(+), 65 deletions(-) diff --git a/games/ootw/ending/credits.s b/games/ootw/ending/credits.s index 25f65661..f6e8e93c 100644 --- a/games/ootw/ending/credits.s +++ b/games/ootw/ending/credits.s @@ -7,12 +7,6 @@ end_credits: lda KEYRESET bit SET_TEXT ; switch to text mode - ; 0@24 - ; 0@23,1@24 - ; 0@22,1@23,2@24... - ; 0@0... - - ; clear to space lda #$a0 @@ -21,17 +15,37 @@ end_credits: ; X is starting YPOS to print at - ldx #46 + ldx #48 + stx YPOS scroll_loop: -; jsr HOME jsr clear_all ; trashes A,Y - ldy #0 - stx XPOS ; X is YPOS to print at + ldy #0 ; credit offset + ldx YPOS print_loop: + cpx #48 + bcs after_print + + cpy #48 + bcs after_print + + ; write next line + + + ;============================ + ; set BASL/BASH to offset w Y + + lda gr_offsets,X + sta BASL + lda gr_offsets+1,X + clc + adc DRAW_PAGE + sta BASH + + ; get credit line lda credit_list,Y sta OUTL lda credit_list+1,Y @@ -40,60 +54,46 @@ print_loop: tya pha - ldy XPOS ; YPOS on screen - - ;============================ - ; set BASL/BASH to offset w Y - - lda gr_offsets,Y - sta BASL - lda gr_offsets+1,Y - clc - adc DRAW_PAGE - sta BASH - ;============================ ; print the string - jsr print_string + jsr print_string ; trashes Y pla tay - iny ; move to next line +after_print: + + inx + inx + + iny iny - inc XPOS - inc XPOS - lda XPOS - - cmp #48 ; if off screen, don't print + cpx #48 ; if off screen, don't print bne print_loop ;==================== ; done printing - jsr page_flip ; flip to page + jsr page_flip ; flip page ;==================== ; delay a bit + ;==================== + ; 400ms normally + ; if credits on screen, wait much longer - txa - pha + ldx YPOS + cpx #0 + beq credits_long_pause + +credits_short_pause: ldx #40 ; time to sleep (X*10ms) jsr long_wait ; trashes A,X - pla - tax + jmp credits_done_pause - ;=================== - ; scroll - - dex - dex - bpl scroll_loop - - ;============================================ +credits_long_pause: ; actual games pauses 10s, then scrolls again - ;============================================ ; delay 6s? ldx #200 @@ -105,15 +105,43 @@ print_loop: ldx #200 jsr long_wait - jsr HOME +credits_done_pause: + + bit KEYRESET + + + ;=================== + ; scroll + + dec YPOS + dec YPOS + lda YPOS + cmp #256-48 ; scroll until all off screen + bne scroll_loop + + + ;============================================ + ; actual games pauses 10s, then scrolls again + ;============================================ + ; delay 6s? + +; ldx #200 +; jsr long_wait + +; ldx #200 +; jsr long_wait + +; ldx #200 +; jsr long_wait + +; jsr HOME bit KEYRESET ;====================== - ; print end message + ; print final message ;====================== - lda #0 - sta DRAW_PAGE + jsr clear_all lda #