sa: have 80column art mostly working

a bit slow, can hear slight pause in music
This commit is contained in:
Vince Weaver 2018-05-24 13:25:35 -04:00
parent 267f1dca2e
commit fe4ab8f2ba
2 changed files with 113 additions and 9 deletions

View File

@ -82,14 +82,6 @@ dal_loop:
; A is which one to draw
draw_ascii_art:
lda FORTYCOL
bne fortycol_ascii_art
eightycol_ascii_art:
rts
fortycol_ascii_art:
sty TEMPY
@ -103,6 +95,97 @@ fortycol_ascii_art:
lda ascii_art+1,Y
sta OUTH
lda FORTYCOL
bne fortycol_ascii_art
;======================================================================
;======================================================================
eightycol_ascii_art:
ldy #2 ; put it at line 1 (2-byte addresses)
art_line_loop80:
lda #0
sta DRAW_PAGE
clc
lda gr_offsets,Y ; load offset of line
adc #20 ; start second half of screen
sta GBASL
lda gr_offsets+1,Y
sta GBASH
iny
iny
sty YY
ldy #0
ascii_loop80:
lda (OUTL),Y ; see if done
beq done_ascii_total80
cmp #13+$80 ; see if line feed
beq done_ascii_line80
jsr store80
iny
jmp ascii_loop80
done_ascii_line80:
iny
tya ; bump art pointer by Y
clc
adc OUTL
sta OUTL
lda #0
adc OUTH
sta OUTH
lda #' '+$80
ascii_pad80: ; pad out with spaces for 40 columns
cpy #41
bcs done_pad80
jsr store80
iny
jmp ascii_pad80
done_pad80:
ldy YY ; load Y value
jmp art_line_loop80
done_ascii_total80:
ldy TEMPY
rts
;======================
store80:
pha
sty DISP_PAGE
ldy #0
lda DRAW_PAGE
and #$1
bne store80_odd
store80_even:
pla
bit PAGE1
sta (GBASL),Y
jmp store80_done
store80_odd:
pla
bit PAGE0
sta (GBASL),Y
inc GBASL
store80_done:
inc DRAW_PAGE
ldy DISP_PAGE
rts
;======================================================================
;======================================================================
fortycol_ascii_art:
ldy #8 ; put it at line 4 (2-byte addresses)
art_line_loop:
@ -155,6 +238,25 @@ done_ascii_total:
ldy TEMPY
rts
.if 0

View File

@ -15,7 +15,6 @@ UNPACK_BUFFER EQU $5E00 ; $5E00 - $9600, 14k, $3800
; init variables
lda #0
sta DRAW_PAGE
sta CH
sta CV
sta DONE_PLAYING
@ -107,6 +106,9 @@ switch_to_80:
; Initialize 80 column firmware
jsr $C300 ; same as PR#3
sta SET80COL ; 80store C001
; makes pageflip switch between
; regular/aux memory
only_forty: