botdemo: credits sorta working

This commit is contained in:
Vince Weaver 2020-11-17 15:33:00 -05:00
parent 374600e9eb
commit a96e78ac0f
4 changed files with 167 additions and 52 deletions

View File

@ -8,10 +8,12 @@
STROUT = $db3a STROUT = $db3a
DONE = 0 NONE = 0
DO_LOAD = 1 DO_LOAD = 1
DO_LIST = 2 DO_LIST = 2
DO_RUN = 3 DO_RUN = 3
DO_CREDITS = 4
DONE = 5
;========================================== ;==========================================
; we are loaded at $6000 ; we are loaded at $6000
@ -123,10 +125,16 @@ not_do_list:
not_do_load: not_do_load:
cmp #DO_RUN ; if command is run cmp #DO_RUN ; if command is run
bne not_trigger bne not_do_run
jmp do_run ; then do it jmp do_run ; then do it
not_do_run:
; cmp #DO_CREDITS
; bne not_trigger
; jmp switch_to_credits
not_trigger: not_trigger:
jmp command_loop jmp command_loop

View File

@ -1,44 +1,90 @@
switch_to_credits:
; clear bottom of page2 and set split
bit TEXTGR
ldx #39
lda #' '|$80
clear_bottom_loop:
sta $A50,X
sta $AD0,X
sta $B50,X
sta $BD0,X
dex
bpl clear_bottom_loop
; set "done"
lda #DONE
sta command
; clear time
lda #0
sta seconds
sta ticks
rts
display_credits: display_credits:
; display music bars ; display music bars
; a bar
lda A_VOLUME lda A_VOLUME
asl lsr
asl lsr
sta draw_a_bar_loop+1 sta draw_a_bar_loop+1
ldx #4 ldx #4
lda #' ' lda #' '|$80
draw_a_bar_loop: draw_a_bar_loop:
cpx #$4 cpx #$4
beq skip_a_bar bne skip_a_bar
eor #$80 eor #$80
sta $A50,X
skip_a_bar: skip_a_bar:
sta $A50,X
dex dex
bpl draw_a_bar_loop bpl draw_a_bar_loop
; b bar
lda B_VOLUME lda B_VOLUME
asl lsr
asl lsr
tax sta draw_b_bar_loop+1
ldx #4
lda #' '|$80
draw_b_bar_loop: draw_b_bar_loop:
lda #' ' cpx #$4
sta $Ad0,X bne skip_b_bar
eor #$80
skip_b_bar:
sta $AD0,X
dex dex
bpl draw_b_bar_loop bpl draw_b_bar_loop
lda C_VOLUME lda C_VOLUME
asl lsr
asl lsr
tax sta draw_c_bar_loop+1
ldx #4
lda #' '|$80
draw_c_bar_loop: draw_c_bar_loop:
lda #' ' cpx #$4
bne skip_c_bar
eor #$80
skip_c_bar:
sta $B50,X sta $B50,X
dex dex
bpl draw_c_bar_loop bpl draw_c_bar_loop
; write credits
; write credits
actual_credits:
lda ticks lda ticks
cmp #25 cmp #25
bne done_credits bne done_credits
@ -58,24 +104,65 @@ draw_c_bar_loop:
bne done_credits bne done_credits
next_credit: next_credit:
;========================
; write the credits
write_credits: write_credits:
ldx #4
outer_credit_loop:
; X is proper line
; point to start of proper output line
lda credits_address,X
sta credits_address_smc+1
lda credits_address+1,X
sta credits_address_smc+2
; load proper input location
lda which_credit lda which_credit
asl asl
tay tay
txa
asl
asl
asl ; *16 (already *2)
clc
adc credits_table,Y
sta write_credit_1_loop+1
lda credits_table+1,Y
adc #0
sta write_credit_1_loop+2
ldy #0
write_credit_1_loop: write_credit_1_loop:
lda $dede,Y lda $dede,Y
beq done_credit1_loop ora #$80
sta $Ad0+20,Y credits_address_smc:
sta $dede,Y
iny iny
jmp write_credit_1_loop cpy #16
bne write_credit_1_loop
done_credit1_loop: done_credit1_loop:
dex
dex
bpl outer_credit_loop
inc which_credit inc which_credit
done_credits: done_credits:
rts rts
credits_address:
.word $ad0+12
.word $b50+12
.word $bd0+12
credits_table: credits_table:
.word credits1 .word credits1
.word credits2 .word credits2
@ -85,29 +172,29 @@ credits_table:
credits1: credits1:
.byte "Code:",0 .byte " Code: "
.byte " ",0 .byte " "
.byte "Deater",0 .byte " Deater "
credits2: credits2:
.byte "Music:",0 .byte " Music: "
.byte " ",0 .byte " "
.byte "mAZE",0 .byte " mAZE "
credits3: credits3:
.byte "Algorithms:",0 .byte " Algorithms: "
.byte " ",0 .byte " Qkumba "
.byte "Hellmood",0 .byte " Hellmood "
credits4: credits4:
.byte "Apple II bot",0 .byte " Apple II bot "
.byte " ",0 .byte " "
.byte "Kay Savetz",0 .byte " Kay Savetz "
credits5: credits5:
.byte " _ ",0 .byte " _ "
.byte " _|(_ _",0 .byte " _|(_ _ "
.byte "(_| _) | ",0 .byte " (_| _) | "
which_credit: which_credit:
.byte $0 .byte $0

View File

@ -65,7 +65,7 @@ no_tick_oflo:
lda seconds lda seconds
cmp timeout cmp timeout
bne done_match bne handle_credits
inc trigger inc trigger
@ -74,6 +74,14 @@ no_tick_oflo:
tax tax
lda todo_list,x lda todo_list,x
sta command sta command
cmp #DO_CREDITS
bne itsnot
jsr switch_to_credits
lda command
itsnot:
cmp #DONE cmp #DONE
beq handle_credits beq handle_credits
@ -103,7 +111,10 @@ no_tick_oflo:
rti rti
handle_credits: handle_credits:
bit TEXTGR lda command
cmp #DONE
bne done_match
jsr display_credits jsr display_credits
done_match: done_match:

View File

@ -12,43 +12,52 @@
todo_list: todo_list:
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,5 ; flame .byte DO_LOAD,1, DO_LIST,4, DO_RUN,5 ; flame
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; autumn
.byte DO_CREDITS,$FF
.byte DONE,$FF
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; a2 .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; a2
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; flyer .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; flyer
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; nyan .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; nyan
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; rle ; .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; rle
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; raster .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; raster
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; qr .byte DO_LOAD,1, DO_LIST,4, DO_RUN,15 ; qr
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; dhgr .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; dhgr
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; circles .byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; circles
.byte DO_LOAD,1, DO_LIST,4, DO_RUN,10 ; autumn
.byte DONE,$FF
file_list: file_list:
.word flame,flame_end .word flame,flame_end
.word autumn,autumn_end
.word a2,a2_end .word a2,a2_end
.word flyer,flyer_end .word flyer,flyer_end
.word nyan,nyan_end .word nyan,nyan_end
.word rle,rle_end ; .word rle,rle_end
.word raster,raster_end .word raster,raster_end
.word qr,qr_end .word qr,qr_end
.word dhgr,dhgr_end .word dhgr,dhgr_end
.word circles,circles_end .word circles,circles_end
.word autumn,autumn_end
title_list: title_list:
.word flame_title .word flame_title
.word autumn_title
.word a2_title .word a2_title
.word flyer_title .word flyer_title
.word nyan_title .word nyan_title
.word rle_title ; .word rle_title
.word raster_title .word raster_title
.word qr_title .word qr_title
.word dhgr_title .word dhgr_title
.word circles_title .word circles_title
.word autumn_title
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
flame_title: flame_title:
@ -63,8 +72,8 @@ qr_title:
.byte " BAR CODE WILL NEVER LET YOU DOWN " .byte " BAR CODE WILL NEVER LET YOU DOWN "
autumn_title: autumn_title:
.byte " HI-RES FRACTAL " .byte " HI-RES FRACTAL "
rle_title: ;rle_title:
.byte " RLE SHAPES " ; .byte " RLE SHAPES "
circles_title: circles_title:
.byte " HYPNOTIC CIRCLES " .byte " HYPNOTIC CIRCLES "
dhgr_title: dhgr_title:
@ -97,9 +106,9 @@ autumn:
.incbin "AUTUMN.BAS" .incbin "AUTUMN.BAS"
autumn_end: autumn_end:
rle: ;rle:
.incbin "RLE.BAS" ;.incbin "RLE.BAS"
rle_end: ;rle_end:
raster: raster:
.incbin "RASTER4.BAS" .incbin "RASTER4.BAS"