dos33fsprogs/bot_demo/credits.s
2020-11-17 15:33:00 -05:00

201 lines
2.4 KiB
ArmAsm

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 music bars
; a bar
lda A_VOLUME
lsr
lsr
sta draw_a_bar_loop+1
ldx #4
lda #' '|$80
draw_a_bar_loop:
cpx #$4
bne skip_a_bar
eor #$80
skip_a_bar:
sta $A50,X
dex
bpl draw_a_bar_loop
; b bar
lda B_VOLUME
lsr
lsr
sta draw_b_bar_loop+1
ldx #4
lda #' '|$80
draw_b_bar_loop:
cpx #$4
bne skip_b_bar
eor #$80
skip_b_bar:
sta $AD0,X
dex
bpl draw_b_bar_loop
lda C_VOLUME
lsr
lsr
sta draw_c_bar_loop+1
ldx #4
lda #' '|$80
draw_c_bar_loop:
cpx #$4
bne skip_c_bar
eor #$80
skip_c_bar:
sta $B50,X
dex
bpl draw_c_bar_loop
; write credits
actual_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 the 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
asl
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:
lda $dede,Y
ora #$80
credits_address_smc:
sta $dede,Y
iny
cpy #16
bne write_credit_1_loop
done_credit1_loop:
dex
dex
bpl outer_credit_loop
inc which_credit
done_credits:
rts
credits_address:
.word $ad0+12
.word $b50+12
.word $bd0+12
credits_table:
.word credits1
.word credits2
.word credits3
.word credits4
.word credits5
credits1:
.byte " Code: "
.byte " "
.byte " Deater "
credits2:
.byte " Music: "
.byte " "
.byte " mAZE "
credits3:
.byte " Algorithms: "
.byte " Qkumba "
.byte " Hellmood "
credits4:
.byte " Apple II bot "
.byte " "
.byte " Kay Savetz "
credits5:
.byte " _ "
.byte " _|(_ _ "
.byte " (_| _) | "
which_credit:
.byte $0