From f1e41a1340cdc5f70e92c66c7718b00546593572 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 24 May 2018 10:33:05 -0400 Subject: [PATCH] sa: add blinky cursor not sure this is an improvement, but is accurate --- still_alive/README.still_alive | 1 + still_alive/display_lyrics.s | 104 ++++++++++++++++++++------------- still_alive/zp.inc | 1 + 3 files changed, 67 insertions(+), 39 deletions(-) diff --git a/still_alive/README.still_alive b/still_alive/README.still_alive index cb13fb3b..6a9800f1 100644 --- a/still_alive/README.still_alive +++ b/still_alive/README.still_alive @@ -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 diff --git a/still_alive/display_lyrics.s b/still_alive/display_lyrics.s index 121936ee..df2ce70a 100644 --- a/still_alive/display_lyrics.s +++ b/still_alive/display_lyrics.s @@ -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 + + diff --git a/still_alive/zp.inc b/still_alive/zp.inc index d03518f0..e8010ca6 100644 --- a/still_alive/zp.inc +++ b/still_alive/zp.inc @@ -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