diff --git a/bot_demo/Makefile b/bot_demo/Makefile index db9cfa9b..22310f3f 100644 --- a/bot_demo/Makefile +++ b/bot_demo/Makefile @@ -36,7 +36,7 @@ botdemo.o: botdemo.s \ zp.inc hardware.inc nozp.inc timeline.inc \ commands.s bg.inc \ interrupt_handler.s \ - wipe.s mock_anim.s + wipe.s mock_anim.s credits.s ca65 -o botdemo.o botdemo.s -l botdemo.lst diff --git a/bot_demo/botdemo.s b/bot_demo/botdemo.s index ad68d910..462c7863 100644 --- a/bot_demo/botdemo.s +++ b/bot_demo/botdemo.s @@ -153,6 +153,7 @@ original_stack: .byte $00 .include "wipe.s" .include "mock_anim.s" +.include "credits.s" .include "nozp.inc" @@ -161,4 +162,4 @@ original_stack: .byte $00 PT3_LOC = song .align $100 song: -.incbin "../pt3_player/music/DF.PT3" +.incbin "music/Second_Best_2_Nothing.pt3" diff --git a/bot_demo/credits.s b/bot_demo/credits.s new file mode 100644 index 00000000..7eceaac5 --- /dev/null +++ b/bot_demo/credits.s @@ -0,0 +1,113 @@ +display_credits: + ; display music bars + + lda A_VOLUME + asl + asl + sta draw_a_bar_loop+1 + + ldx #4 + lda #' ' +draw_a_bar_loop: + cpx #$4 + beq skip_a_bar + eor #$80 + sta $A50,X +skip_a_bar: + dex + bpl draw_a_bar_loop + + lda B_VOLUME + asl + asl + tax +draw_b_bar_loop: + lda #' ' + sta $Ad0,X + dex + bpl draw_b_bar_loop + + lda C_VOLUME + asl + asl + tax +draw_c_bar_loop: + lda #' ' + sta $B50,X + dex + bpl draw_c_bar_loop + + ; write credits + + lda ticks + cmp #25 + bne done_credits + + lda seconds + + cmp #0 + beq next_credit + cmp #4 + beq next_credit + cmp #8 + beq next_credit + cmp #12 + beq next_credit + cmp #16 + beq next_credit + bne done_credits + +next_credit: +write_credits: + lda which_credit + asl + tay + +write_credit_1_loop: + lda $dede,Y + beq done_credit1_loop + sta $Ad0+20,Y + iny + jmp write_credit_1_loop + +done_credit1_loop: + + inc which_credit +done_credits: + rts + +credits_table: + .word credits1 + .word credits2 + .word credits3 + .word credits4 + .word credits5 + + +credits1: + .byte "Code:",0 + .byte " ",0 + .byte "Deater",0 + +credits2: + .byte "Music:",0 + .byte " ",0 + .byte "mAZE",0 + +credits3: + .byte "Algorithms:",0 + .byte " ",0 + .byte "Hellmood",0 + +credits4: + .byte "Apple II bot",0 + .byte " ",0 + .byte "Kay Savetz",0 + +credits5: + .byte " _ ",0 + .byte " _|(_ _",0 + .byte "(_| _) | ",0 + +which_credit: + .byte $0 diff --git a/bot_demo/interrupt_handler.s b/bot_demo/interrupt_handler.s index 52b97116..fab31b59 100644 --- a/bot_demo/interrupt_handler.s +++ b/bot_demo/interrupt_handler.s @@ -75,7 +75,7 @@ no_tick_oflo: lda todo_list,x sta command cmp #DONE - beq done_match + beq handle_credits lda todo_list+1,x sta timeout @@ -102,6 +102,9 @@ no_tick_oflo: rti +handle_credits: + bit TEXTGR + jsr display_credits done_match: pla