2018-02-20 04:05:02 +00:00
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
; Draw volume bars
|
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
|
|
|
|
volume_bars:
|
|
|
|
; hline Y,V2 at A
|
|
|
|
; top line
|
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_GREY ; 2
|
|
|
|
sta COLOR ; remove for crazy effect ; 3
|
|
|
|
ldy #12 ; 2
|
|
|
|
lda #26 ; 2
|
|
|
|
sta V2 ; 3
|
|
|
|
lda #6 ; 2
|
|
|
|
jsr hlin_double ; 6
|
|
|
|
; 63+14*16=287
|
|
|
|
;=====================
|
|
|
|
; 307
|
2018-02-20 04:05:02 +00:00
|
|
|
; middle
|
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #8 ; 2
|
2018-02-20 04:05:02 +00:00
|
|
|
middle_loop:
|
2018-02-24 21:57:20 +00:00
|
|
|
pha ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
cmp #8 ; 2
|
|
|
|
beq middle_black ; 2nt/3
|
|
|
|
cmp #26 ; 2
|
|
|
|
beq middle_black ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
cmp #10 ; 2
|
|
|
|
bne not_top ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #$3B ; pink/purple ; 2
|
|
|
|
stx A_COLOR ; 3
|
|
|
|
ldx #$7E ; light-blue/aqua ; 2
|
|
|
|
stx B_COLOR ; 3
|
|
|
|
ldx #$CD ; light-green/yellow ; 2
|
|
|
|
stx C_COLOR ; 3
|
|
|
|
jmp calc_volume ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
not_top:
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #COLOR_BOTH_RED ; 2
|
|
|
|
stx A_COLOR ; 3
|
|
|
|
ldx #COLOR_BOTH_DARKBLUE ; 2
|
|
|
|
stx B_COLOR ; 3
|
|
|
|
ldx #COLOR_BOTH_DARKGREEN ; 2
|
|
|
|
stx C_COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
calc_volume:
|
|
|
|
|
|
|
|
; 10 14/15 24-x = 14 PLUS=none, zero=bottom, neg=all
|
|
|
|
; 12 12/13 12
|
|
|
|
; 14 10/11 10
|
|
|
|
; 16 8/9 8
|
|
|
|
; 18 6/7 6
|
|
|
|
; 20 4/5 4
|
|
|
|
; 22 2/3 2
|
|
|
|
; 24 0/1 0
|
|
|
|
|
|
|
|
; FIXME: there must be a way to make this faster
|
|
|
|
|
|
|
|
mod_a:
|
2018-02-24 21:57:20 +00:00
|
|
|
pha ; 3
|
|
|
|
sec ; 2
|
|
|
|
eor #$ff ; negate ; 2
|
|
|
|
adc #24 ; 24-A ; 2
|
|
|
|
sec ; 2
|
|
|
|
sbc A_VOLUME ; 2
|
|
|
|
bmi mod_b ; 2nt/3
|
|
|
|
beq mod_a_bottom ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
mod_a_zero:
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #0 ; 2
|
|
|
|
beq done_a ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
mod_a_bottom:
|
2018-02-24 21:57:20 +00:00
|
|
|
lda A_COLOR ; 2
|
|
|
|
and #$f0 ; 2
|
2018-02-20 04:05:02 +00:00
|
|
|
done_a:
|
2018-02-24 21:57:20 +00:00
|
|
|
sta A_COLOR ; 2
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
mod_b:
|
2018-02-24 21:57:20 +00:00
|
|
|
pla ; 4
|
|
|
|
pha ; 3
|
|
|
|
sec ; 2
|
|
|
|
eor #$ff ; negate ; 2
|
|
|
|
adc #24 ; 24-A ; 2
|
|
|
|
sec ; 2
|
|
|
|
sbc B_VOLUME ; 2
|
|
|
|
bmi mod_c ; 2nt/3
|
|
|
|
beq mod_b_bottom ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
mod_b_zero:
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #0 ; 2
|
|
|
|
beq done_b ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
mod_b_bottom:
|
2018-02-24 21:57:20 +00:00
|
|
|
lda B_COLOR ; 3
|
|
|
|
and #$f0 ; 2
|
2018-02-20 04:05:02 +00:00
|
|
|
done_b:
|
2018-02-24 21:57:20 +00:00
|
|
|
sta B_COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
mod_c:
|
2018-02-24 21:57:20 +00:00
|
|
|
pla ; 4
|
|
|
|
pha ; 3
|
|
|
|
sec ; 2
|
|
|
|
eor #$ff ; negate ; 2
|
|
|
|
adc #24 ; 24-A ; 2
|
|
|
|
sec ; 2
|
|
|
|
sbc C_VOLUME ; 2
|
|
|
|
bmi mod_d ; 2nt/3
|
|
|
|
beq mod_c_bottom ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
mod_c_zero:
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #0 ; 2
|
|
|
|
beq done_c ; 2nt/3
|
2018-02-20 04:05:02 +00:00
|
|
|
mod_c_bottom:
|
2018-02-24 21:57:20 +00:00
|
|
|
lda C_COLOR ; 3
|
|
|
|
and #$f0 ; 2
|
2018-02-20 04:05:02 +00:00
|
|
|
done_c:
|
2018-02-24 21:57:20 +00:00
|
|
|
sta C_COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
mod_d:
|
2018-02-24 21:57:20 +00:00
|
|
|
pla ; 4
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
jmp middle_color_done ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
middle_black:
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #COLOR_BOTH_BLACK ; 2
|
|
|
|
stx A_COLOR ; 3
|
|
|
|
stx B_COLOR ; 3
|
|
|
|
stx C_COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
middle_color_done:
|
|
|
|
|
|
|
|
; left border
|
2018-02-24 21:57:20 +00:00
|
|
|
ldy #COLOR_BOTH_GREY ; 2
|
|
|
|
sty COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldy #12 ; 2
|
|
|
|
sty V2 ; 3
|
|
|
|
ldy #12 ; 2
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
jsr hlin_double ; 6
|
|
|
|
; 63+1*16=79
|
2018-02-20 04:05:02 +00:00
|
|
|
; border space
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_BLACK ; 2
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #1 ; 2
|
|
|
|
jsr hlin_double_continue ; 10+1*16=27
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
; A volume
|
2018-02-24 21:57:20 +00:00
|
|
|
lda A_COLOR ; 3
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #3 ; 2
|
|
|
|
jsr hlin_double_continue ; 10+3*16=58
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
; A space
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_BLACK ; 2
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #1 ; 2
|
|
|
|
jsr hlin_double_continue ; 6
|
|
|
|
; 10+1*16=27
|
2018-02-20 04:05:02 +00:00
|
|
|
; B volume
|
2018-02-24 21:57:20 +00:00
|
|
|
lda B_COLOR ; 3
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #3 ; 2
|
|
|
|
jsr hlin_double_continue ; 6
|
|
|
|
; 10+3*16=58
|
2018-02-20 04:05:02 +00:00
|
|
|
; B space
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_BLACK ; 2
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #1 ; 2
|
|
|
|
jsr hlin_double_continue ; 6
|
|
|
|
; 10+1*16=27
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
; C volume
|
2018-02-24 21:57:20 +00:00
|
|
|
lda C_COLOR ; 3
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #3 ; 2
|
|
|
|
jsr hlin_double_continue ; 6
|
|
|
|
; 10+3*16=58
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
; C space
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_BLACK ; 2
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #1 ; 2
|
|
|
|
jsr hlin_double_continue ; 6
|
|
|
|
; 10+1*16=27
|
2018-02-20 04:05:02 +00:00
|
|
|
; Right border
|
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_GREY ; 2
|
|
|
|
sta COLOR ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
ldx #1 ; 2
|
|
|
|
jsr hlin_double_continue ; 6
|
|
|
|
; 10+1*16=27
|
2018-02-20 04:05:02 +00:00
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
pla ; 4
|
|
|
|
clc ; 2
|
|
|
|
adc #2 ; 2
|
|
|
|
cmp #28 ; 2
|
|
|
|
beq bottom_line ; 2nt/3
|
|
|
|
jmp middle_loop ; 3
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
bottom_line:
|
|
|
|
; bottom line
|
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
lda #COLOR_BOTH_GREY ; 2
|
|
|
|
sta COLOR ; 3
|
|
|
|
ldy #12 ; 2
|
|
|
|
lda #26 ; 2
|
|
|
|
sta V2 ; 3
|
|
|
|
lda #28 ; 2
|
|
|
|
jsr hlin_double ; 6
|
|
|
|
; 63+14*16=287
|
|
|
|
|
|
|
|
rts ; 6
|
2018-02-20 04:05:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-24 21:57:20 +00:00
|
|
|
; 309+ 684*10 + 313 = roughly worst case 7462
|