sa: add blinky cursor

not sure this is an improvement, but is accurate
This commit is contained in:
Vince Weaver 2018-05-24 10:33:05 -04:00
parent 1a559ef166
commit f1e41a1340
3 changed files with 67 additions and 39 deletions

View File

@ -25,6 +25,7 @@ have art loading properly 40col: 18910
lz4 encode the ascii art: 15529
revert because lz4 code not re-entrant: 18910
add 4-channel music (KR4): 20128
add cursor (a bit distracting) 20162
Memory Map

View File

@ -1,42 +1,3 @@
;============================
; 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
;========================================================
; display lyrics
;========================================================
@ -91,6 +52,11 @@ lyric_home:
jmp lyric_continue ; continue
lyric_char:
pha
lda #' '+$80
ldy CH
sta (BASL),Y
pla
jsr COUT1 ; output the character
lyric_continue:
@ -109,4 +75,64 @@ done_lyric:
jmp lyric_continue
all_done_lyrics:
; Blink Cursor
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
rts
;============================
; 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

View File

@ -101,6 +101,7 @@ DECOMPRESS_TIME EQU $99
TIME_TAKEN EQU $9A
LYRICS_ACTIVE EQU $9B
FORTYCOL EQU $9C
CURSOR EQU $9D
; More zero-page addresses
; we try not to conflict with anything DOS, MONITOR or BASIC related