; Closing Credits NUM_CREDITS EQU 18 ;=================== ; init credits ;=================== init_credits: ldy #0 lda (OUTL),Y ; get the first byte of credit ; which is the X-coord sta CH ; store HTAB value lda #22 ; text Y=22 sta CV ; store VTAB value lda #$f0 ; -16 sta NAMEX ; we're clicking 10 times to get to our char rts ;=========================== ;=========================== ; draw_credits ;=========================== ;=========================== draw_credits: credit_loop: inner_loop: jsr htab_vtab ; put the cursor (BASL/BASH) at CH,CV ldy #1 ; skip the x-coord to get to string print_loop: lda (OUTL),Y ; get the character beq done_print ; if 0 then end of string clc adc NAMEX ; subtract the char back ora #$80 ; convert ASCII to apple normal text sta (BASL),Y ; store it directly to screen iny ; point to next character jmp print_loop ; loop done_print: ;================== ; click ;================== lda LOOP ; get wait-at-end loop counter beq not_waiting ; if not waiting, skip ahead clc ; decrement counter adc #$ff sta LOOP bne done_click ; if not zero, skip ahead jsr next_credit ; was zero, skip to next credit jsr init_credits jmp done_click not_waiting: lda FRAME_COUNT ; slow down by x128 and #$7f beq done_click bit SPEAKER ; click the speaker ldx NAMEX ; get the mutate counter inx ; increment stx NAMEX cpx #0 ; if not 1, then continue bne done_click lda YY cmp #NUM_CREDITS-1 ; wait after NUM_CREDITS-1 bne short_loop long_loop: lda #$ff bne store_loop short_loop: lda #$40 ; set delay to show the credit before store_loop: sta LOOP ; continuing done_click: rts ;================== ; Next credit ;================== next_credit: lda #8 ; point to text line sta CH lda #22 sta CV lda OUTH ; save credits pointer pha lda OUTL pha lda #>empty ; point to empty string sta OUTH lda #thankz sta OUTH lda #