From 81472025b43cd9671f3dce2c8fe717e3cbc6a58a Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 2 Nov 2019 21:17:42 -0400 Subject: [PATCH] ds: working on credits --- demosplash/credits.s | 117 +++++++++++++++++++++++++++++++++++++++++-- demosplash/font.s | 10 ++-- demosplash/zp.inc | 4 ++ 3 files changed, 123 insertions(+), 8 deletions(-) diff --git a/demosplash/credits.s b/demosplash/credits.s index 41991998..23154956 100644 --- a/demosplash/credits.s +++ b/demosplash/credits.s @@ -17,6 +17,12 @@ credits: lda #0 sta DRAW_PAGE + sta FRAME + + lda #credits_text + sta CREDITS_POINTERH ;================== ; setup graphics @@ -136,14 +142,21 @@ credits_loop: ; -696 -- move+draw 4*(16+26+6+126) = 696 ; -10 -- keypress ; -12 -- call/return of draw code + ; -377 -- do_words ;======= - ; 3250 + ; 2873 pad_time: ; we erase, then draw ; doing a blanket erase of all 128 lines would cost 3459 cycles! + ;========================= + ; do words + ;========================= + + jsr draw_credits + ;========================= ; ERASE ;========================= @@ -311,10 +324,12 @@ pad_time: ; WAIT for VBLANK to finish ;============================ - ; Try X=71 Y=9 cycles=3250 + ; Try X=7 Y=70 cycles=2871 R2 - ldy #9 ; 2 -tloop1: ldx #71 ; 2 + nop + + ldy #70 ; 2 +tloop1: ldx #7 ; 2 tloop2: dex ; 2 bne tloop2 ; 2nt/3 dey ; 2 @@ -400,3 +415,97 @@ red_x: .byte $10 yellow_x: .byte $20 green_x: .byte $30 blue_x: .byte $40 + + ;================================= + ; draw credits + ;================================= + ; credits pointer +draw_credits: + inc FRAME ; 5 + lda FRAME ; 3 + and #$f ; 2 + beq credits_handle_next ; 3 +credits_long_delay: + ; -1 +credits_skip: + +credits_short_delay: + + rts + + +credits_handle_next: + ldy #0 ; 2 + lda (CREDITS_POINTERL),Y ; 5+ + cmp #$ff ; 2 + beq credits_skip ; 3 + ; -1 + cmp #'@' ; 2 + bcs credits_put_char ; bge ; 3 + +credits_check_xy: + ; -1 + sta CREDITS_Y + iny + lda (CREDITS_POINTERL),Y + sta CREDITS_X + iny + lda (CREDITS_POINTERL),Y + sta colors_hi + iny + lda (CREDITS_POINTERL),Y + sta colors_hi+1 + iny + lda (CREDITS_POINTERL),Y + sta colors_lo + iny + lda (CREDITS_POINTERL),Y + sta colors_lo+1 + + iny + clc + tya + adc CREDITS_POINTERL + sta CREDITS_POINTERL + lda #0 + adc CREDITS_POINTERH + sta CREDITS_POINTERH + + jmp credits_short_delay + +credits_put_char: + ldx CREDITS_X ; 2 + ldy CREDITS_Y ; 3 + jsr put_char ; 6+365 + + clc + lda CREDITS_X + adc #4 + sta CREDITS_X + + clc + lda #1 + adc CREDITS_POINTERL + sta CREDITS_POINTERL + lda #0 + adc CREDITS_POINTERH + sta CREDITS_POINTERH + +draw_credits_end: + rts ; 6 + +credits_text: +.byte 0,10, $C4,$CF,$FC,$4C, 'C','O','D','E','[' ; "CODE:" +.byte 4,8, $C4,$CF,$FC,$4C, 'D','E','A','T','E','R' ; "DEATER" +.byte '@','@' ; time pad +.byte 0,10, $00,$00,$00,$00, 'C','O','D','E','[' ; "CODE:" +.byte 4,8, $00,$00,$00,$00, 'D','E','A','T','E','R' ; "DEATER" + +.byte 0,8, $C4,$CF,$FC,$4C, 'M','U','S','I','C','[' ; "MUSIC:" +.byte 4,14, $C4,$CF,$FC,$4C, 'D','Y','A' ; "DYA" +.byte '@','@' ; time pad +.byte 0,8, $00,$00,$00,$00, 'M','U','S','I','C','[' ; "MUSIC:" +.byte 4,14, $00,$00,$00,$00, 'D','Y','A' ; "DYA" + + +.byte 255 ; done diff --git a/demosplash/font.s b/demosplash/font.s index 5ebc5a17..ab91f699 100644 --- a/demosplash/font.s +++ b/demosplash/font.s @@ -205,16 +205,17 @@ font_high: .byte $00,$00,$00,$00,$00,$00,$00,$00 ; X ;H0H ** ** ** ** ** -;L0H ** ** ** -;H0L ** ** ** +;L0H ** ** ** ** +;H0L ** ** ** ** ;L0L ** ** ** ** ;H1H ** ** -;L1H ** ** -;H1L ** ** +;L1H ** ** ** +;H1L ** ** ** ;L1L ** ** ** ** .byte $00,$00,$00,$00,$00,$00,$00,$00 ; Y .byte $00,$00,$00,$00,$00,$00,$00,$00 ; Z +.byte $00,$0f,$00,$00,$0f,$00,$00,$00 ; : ([) @@ -252,3 +253,4 @@ font_low: ; 2 pages later .byte $00,$00,$00,$00,$00,$00,$00,$00 ; Y .byte $00,$00,$00,$00,$00,$00,$00,$00 ; Z +.byte $00,$f0,$00,$00,$f0,$00,$00,$00 ; : ([) diff --git a/demosplash/zp.inc b/demosplash/zp.inc index 9dc547a8..41d492bb 100644 --- a/demosplash/zp.inc +++ b/demosplash/zp.inc @@ -158,14 +158,18 @@ LASER_OUT = $DB ; 2+ RASTER_X = $DB ; rasters GUN_CHARGE = $DC ; 2+ +CREDITS_POINTERL= $DC ; credits MONSTER_AI = $DD ; C1 underwater ACTION_COUNT = $DD ; C4 +CREDITS_POINTERH= $DD ; credits BG_BEAST = $DE ; C1 ACTION_TRIGGERED= $DE ; C4 +CREDITS_X = $DE ; credits ON_ELEVATOR = $DF ; ALL +CREDITS_Y = $DF ; credits LEFT_LIMIT = $E0 ; ALL RIGHT_LIMIT = $E1 ; ALL