sa: clean up 40col support

This commit is contained in:
Vince Weaver 2018-05-23 12:50:12 -04:00
parent 92bd667381
commit 6cd1a8e424
3 changed files with 119 additions and 38 deletions

View File

@ -4,12 +4,12 @@ Challenges:
+ Printing the ASCII art simple code (takes longer than 50Hz)
Goal: Everything inside of 16k
initial: 2078
add ascii art: 9142
initial music player: 2078
add raw ascii art: 9142
add 3-channel music+lyrics,then slim a bit: 18787
initial 40 col support: 18864
Memory Map

View File

@ -19,11 +19,14 @@ UNPACK_BUFFER EQU $5E00 ; $5E00 - $9600, 14k, $3800
sta CH
sta CV
sta DONE_PLAYING
sta XPOS
sta MB_CHUNK_OFFSET
sta DECODE_ERROR
sta LYRICS_ACTIVE
; Testing, let's get 40col working first
lda #1
sta FORTYCOL
; print detection message
lda #<mocking_message ; load loading message
@ -107,9 +110,14 @@ mockingboard_found:
;============================
; Draw title screen
; Draw Lineart around edges
;============================
lda FORTYCOL
bne fortycol_lineart
eightycol_lineart:
; Draw top line
lda #' '+$80
@ -139,18 +147,16 @@ line_loop:
sta dal_second+1
jsr draw_ascii_line
;============================
; Setup bounds
;============================
jsr word_bounds
jmp done_lineart
fortycol_lineart:
jsr word_bounds
done_lineart:
lda #2
sta WNDLFT
lda #35
sta WNDWDTH
lda #1
sta WNDTOP
lda #21
sta WNDBTM
jsr HOME
@ -434,6 +440,81 @@ done_ascii:
ldy TEMPY
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
;============================
; Setup Art Bounds
;============================
art_bounds:
lda FORTYCOL
bne fortycol_art_bounds
eightycol_art_bounds:
; on 80 column, art goes from 39,1 to 40,23 (????)
lda #2
sta WNDLFT
lda #35
sta WNDWDTH
lda #1
sta WNDTOP
lda #21
sta WNDBTM
rts
fortycol_art_bounds:
; on 40 column, art goes from 0,4 to 39,24
lda #2
sta WNDLFT
lda #35
sta WNDWDTH
lda #1
sta WNDTOP
lda #21
sta WNDBTM
rts
;=========
;routines
;=========

View File

@ -100,34 +100,34 @@ COPY_TIME EQU $98
DECOMPRESS_TIME EQU $99
TIME_TAKEN EQU $9A
LYRICS_ACTIVE EQU $9B
FORTYCOL EQU $9C
; More zero-page addresses
; we try not to conflict with anything DOS, MONITOR or BASIC related
;COLOR1 EQU $E0
COLOR2 EQU $E1
;MATCH EQU $E2
XX EQU $E3
;YY EQU $E4
;SHIPY EQU $E4
;YADD EQU $E5
;LOOP EQU $E6
;MEMPTRL EQU $E7
;MEMPTRH EQU $E8
;NAMEL EQU $E9
;NAMEH EQU $EA
;NAMEX EQU $EB
;CHAR EQU $EC
;COLOR1 EQU $E0
;COLOR2 EQU $E1
;MATCH EQU $E2
;XX EQU $E3
;YY EQU $E4
;SHIPY EQU $E4
;YADD EQU $E5
;LOOP EQU $E6
;MEMPTRL EQU $E7
;MEMPTRH EQU $E8
;NAMEL EQU $E9
;NAMEH EQU $EA
;NAMEX EQU $EB
;CHAR EQU $EC
DISP_PAGE EQU $ED
DRAW_PAGE EQU $EE
;FIRST EQU $F0
LASTKEY EQU $F1
;PADDLE_STATUS EQU $F2
XPOS EQU $F3
YPOS EQU $F4
;FIRST EQU $F0
;LASTKEY EQU $F1
;PADDLE_STATUS EQU $F2
;XPOS EQU $F3
;YPOS EQU $F4
TEMP EQU $FA
;TEMP2 EQU $FB
TEMPY EQU $FB
INL EQU $FC
INH EQU $FD