2018-06-04 17:53:25 +00:00
|
|
|
;========================================================
|
|
|
|
; display lyrics electric duet
|
|
|
|
;========================================================
|
|
|
|
|
|
|
|
display_lyrics_ed:
|
|
|
|
|
|
|
|
;========================
|
|
|
|
; Check if new lyric ready
|
|
|
|
;========================
|
|
|
|
lda FRAME_COUNT ; get current frame count
|
2018-06-05 18:30:01 +00:00
|
|
|
ldy #0
|
2018-06-04 17:53:25 +00:00
|
|
|
cmp (LYRICSL),Y ; compare to next-trigger
|
2018-06-04 20:46:32 +00:00
|
|
|
bne all_done_lyrics_ed ; not same, so skip
|
2018-06-04 17:53:25 +00:00
|
|
|
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb2_ed
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb2_ed:
|
|
|
|
|
|
|
|
;==================================
|
|
|
|
; Print lyric
|
|
|
|
;==================================
|
|
|
|
handle_lyrics_ed:
|
2018-06-05 18:30:01 +00:00
|
|
|
ldy #0
|
2018-06-04 17:53:25 +00:00
|
|
|
lda (LYRICSL),Y ; load value
|
|
|
|
|
|
|
|
handle_lyrics_loop_ed:
|
|
|
|
|
|
|
|
cmp #11 ; check if in range 1-10
|
|
|
|
bcs lyric_home_ed ; if not, skip ahead
|
|
|
|
|
|
|
|
go_draw_ascii_ed:
|
|
|
|
jsr draw_ascii_art ; draw proper ascii art
|
|
|
|
|
|
|
|
jmp lyric_continue_ed ; and continue
|
|
|
|
|
|
|
|
lyric_home_ed:
|
|
|
|
cmp #12 ; check if form feed char
|
|
|
|
bne lyric_char_ed ; if not skip ahead
|
|
|
|
|
|
|
|
jsr HOME ; call HOME
|
|
|
|
|
|
|
|
jmp lyric_continue_ed ; continue
|
|
|
|
|
|
|
|
lyric_char_ed:
|
|
|
|
|
2018-06-05 14:07:19 +00:00
|
|
|
ldy FORTYCOL ; if 40 column, uppercase it
|
|
|
|
beq just_output_already_ed
|
|
|
|
|
2018-06-04 17:53:25 +00:00
|
|
|
; Uppercase it
|
|
|
|
|
|
|
|
cmp #'a'+$80
|
|
|
|
bcc just_output_already_ed
|
|
|
|
cmp #'z'+$80
|
|
|
|
bcs just_output_already_ed
|
|
|
|
|
|
|
|
and #$DF
|
|
|
|
|
|
|
|
just_output_already_ed:
|
|
|
|
jsr COUT1 ; output the character
|
|
|
|
|
|
|
|
lyric_continue_ed:
|
|
|
|
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb_ed
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb_ed:
|
2018-06-05 18:30:01 +00:00
|
|
|
ldy #0
|
2018-06-04 17:53:25 +00:00
|
|
|
lda (LYRICSL),Y ; load value
|
|
|
|
bne handle_lyrics_loop_ed
|
|
|
|
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb_ed2
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb_ed2:
|
|
|
|
|
2018-06-04 20:46:32 +00:00
|
|
|
; skip MB offset
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb_ed8
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb_ed8:
|
2018-06-04 17:53:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
all_done_lyrics_ed:
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-24 13:48:48 +00:00
|
|
|
;========================================================
|
2018-06-04 20:46:32 +00:00
|
|
|
; display lyrics mockingboard
|
2018-05-24 13:48:48 +00:00
|
|
|
;========================================================
|
|
|
|
|
|
|
|
display_lyrics:
|
|
|
|
|
|
|
|
;=====================
|
|
|
|
; See if lyrics already printing
|
|
|
|
;=====================
|
2018-06-05 18:30:01 +00:00
|
|
|
ldy #0
|
2018-05-24 13:48:48 +00:00
|
|
|
lda LYRICS_ACTIVE ; see if lyric is ready
|
|
|
|
bne handle_lyrics ; if so handle it
|
|
|
|
|
|
|
|
;========================
|
|
|
|
; Check if new lyric ready
|
|
|
|
;========================
|
|
|
|
lda FRAME_COUNT ; get current frame count
|
|
|
|
cmp (LYRICSL),Y ; compare to next-trigger
|
|
|
|
bne all_done_lyrics ; not same, so skip
|
|
|
|
|
|
|
|
lda #1 ; matches, set lyrics active
|
|
|
|
sta LYRICS_ACTIVE
|
|
|
|
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb2
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb2:
|
|
|
|
|
2018-06-04 20:46:32 +00:00
|
|
|
; skip ED data
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb5
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb5:
|
|
|
|
|
2018-05-24 13:48:48 +00:00
|
|
|
;==================================
|
|
|
|
; Lyric active, print current char
|
|
|
|
;==================================
|
|
|
|
handle_lyrics:
|
|
|
|
lda (LYRICSL),Y ; load value
|
|
|
|
beq done_lyric ; if 0, done lyric
|
|
|
|
|
|
|
|
cmp #11 ; check if in range 1-10
|
|
|
|
bcs lyric_home ; if not, skip ahead
|
|
|
|
|
|
|
|
go_draw_ascii:
|
|
|
|
jsr draw_ascii_art ; draw proper ascii art
|
|
|
|
|
|
|
|
jmp lyric_continue ; and continue
|
|
|
|
|
|
|
|
lyric_home:
|
|
|
|
cmp #12 ; check if form feed char
|
|
|
|
bne lyric_char ; if not skip ahead
|
|
|
|
|
|
|
|
jsr HOME ; call HOME
|
|
|
|
|
|
|
|
jmp lyric_continue ; continue
|
|
|
|
|
|
|
|
lyric_char:
|
2018-05-24 18:40:21 +00:00
|
|
|
|
|
|
|
; clear cursor
|
|
|
|
cursor_clear:
|
2018-05-24 14:33:05 +00:00
|
|
|
pha
|
|
|
|
lda #' '+$80
|
2018-05-24 18:40:21 +00:00
|
|
|
ldy FORTYCOL
|
|
|
|
beq eightyclear
|
|
|
|
fortyclear:
|
|
|
|
ldy CH
|
|
|
|
sta (BASL),Y
|
|
|
|
jmp cursor_clear_done
|
|
|
|
eightyclear:
|
2018-05-24 18:31:14 +00:00
|
|
|
jsr COUT
|
|
|
|
lda #$8
|
|
|
|
jsr COUT
|
2018-05-24 18:40:21 +00:00
|
|
|
cursor_clear_done:
|
2018-05-24 14:33:05 +00:00
|
|
|
pla
|
2018-05-24 14:46:22 +00:00
|
|
|
|
|
|
|
ldy FORTYCOL ; if 40col, convert to UPPERCASE
|
|
|
|
beq just_output_already
|
|
|
|
cmp #'a'+$80
|
|
|
|
bcc just_output_already
|
|
|
|
cmp #'z'+$80
|
|
|
|
bcs just_output_already
|
|
|
|
|
|
|
|
and #$DF
|
|
|
|
|
|
|
|
just_output_already:
|
2018-05-24 13:48:48 +00:00
|
|
|
jsr COUT1 ; output the character
|
|
|
|
|
|
|
|
lyric_continue:
|
|
|
|
|
|
|
|
; adjust pointer 16-bit
|
|
|
|
inc LYRICSL
|
|
|
|
bne lc_sb
|
|
|
|
inc LYRICSH
|
|
|
|
lc_sb:
|
|
|
|
jmp all_done_lyrics
|
|
|
|
|
|
|
|
|
|
|
|
done_lyric:
|
|
|
|
lda #0
|
|
|
|
sta LYRICS_ACTIVE
|
|
|
|
jmp lyric_continue
|
|
|
|
|
|
|
|
all_done_lyrics:
|
2018-05-24 14:33:05 +00:00
|
|
|
|
2018-05-24 18:31:14 +00:00
|
|
|
lda FORTYCOL
|
|
|
|
beq blink_cursor80
|
2018-05-24 14:33:05 +00:00
|
|
|
|
2018-05-24 18:31:14 +00:00
|
|
|
; Blink Cursor
|
|
|
|
blink_cursor40:
|
2018-05-24 14:33:05 +00:00
|
|
|
inc CURSOR
|
|
|
|
lda CURSOR
|
|
|
|
and #$10
|
|
|
|
|
|
|
|
beq cursor_space
|
|
|
|
cursor_underscore:
|
|
|
|
lda #'_'+$80
|
|
|
|
|
|
|
|
jmp cursor_done
|
|
|
|
cursor_space:
|
|
|
|
lda #' '+$80
|
|
|
|
cursor_done:
|
|
|
|
ldy CH
|
|
|
|
sta (BASL),Y
|
|
|
|
|
2018-05-24 13:48:48 +00:00
|
|
|
rts
|
2018-05-24 14:33:05 +00:00
|
|
|
|
|
|
|
|
2018-05-24 18:31:14 +00:00
|
|
|
blink_cursor80:
|
|
|
|
inc CURSOR
|
|
|
|
lda CURSOR
|
|
|
|
and #$10
|
|
|
|
|
|
|
|
beq cursor_space80
|
|
|
|
cursor_underscore80:
|
|
|
|
lda #'_'+$80
|
|
|
|
jsr COUT
|
|
|
|
lda #$8 ; BS (backspace)
|
|
|
|
jsr COUT
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
cursor_space80:
|
|
|
|
lda #' '+$80
|
|
|
|
jsr COUT
|
|
|
|
lda #$8 ; BS (backspace)
|
|
|
|
jsr COUT
|
|
|
|
|
|
|
|
cursor_done80:
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2018-05-24 14:33:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
;============================
|
|
|
|
; Setup Word Bounds
|
|
|
|
;============================
|
|
|
|
word_bounds:
|
|
|
|
|
|
|
|
lda FORTYCOL
|
|
|
|
bne fortycol_word_bounds
|
|
|
|
|
|
|
|
eightycol_word_bounds:
|
|
|
|
|
|
|
|
; on 80 column, words go from 2,1 to 35,21
|
|
|
|
|
|
|
|
lda #2
|
|
|
|
sta WNDLFT
|
|
|
|
lda #35
|
|
|
|
sta WNDWDTH
|
|
|
|
lda #1
|
|
|
|
sta WNDTOP
|
|
|
|
lda #21
|
|
|
|
sta WNDBTM
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
fortycol_word_bounds:
|
|
|
|
; on 40 column, words go from 1,0 to 35,4
|
|
|
|
|
|
|
|
lda #1
|
|
|
|
sta WNDLFT
|
|
|
|
lda #35
|
|
|
|
sta WNDWDTH
|
|
|
|
lda #0
|
|
|
|
sta WNDTOP
|
|
|
|
lda #4
|
|
|
|
sta WNDBTM
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|