Top to bottom terrain rendering

This commit is contained in:
blondie7575 2017-11-01 12:42:52 -07:00
parent cd38f829a7
commit 2319adb9f5
2 changed files with 33 additions and 7 deletions

View File

@ -155,6 +155,20 @@ drawNumber:
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; BORDER_COLOR
;
; Trashes A
;
.macro BORDER_COLOR color
BITS8
lda BORDERCOLOR
and #$f0
ora color
sta BORDERCOLOR
BITS16
.endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Vertical blank checkers
;

View File

@ -21,9 +21,9 @@ VISIBLETERRAINWINDOW = 80 ; In words
;
renderTerrain:
FASTGRAPHICS
lda #MAXTERRAINHEIGHT
lda #0
sta SCRATCHL2 ; Row counter
lda #$9cff ; 4 Point stack to end of VRAM
lda #$5f1f ; 4 Point stack to end of VRAM
tcs ; 2
sec
@ -43,9 +43,20 @@ renderRowComplete:
sec
sbc #COMPILEDTERRAINROW
sta PARAML0
dec SCRATCHL2
bne renderTerrainLoop
tsc
clc
adc #320
tcs
lda SCRATCHL2
inc
cmp #MAXTERRAINHEIGHT
beq renderTerrainDone
sta SCRATCHL2
bra renderTerrainLoop
renderTerrainDone:
SLOWGRAPHICS
rts
@ -216,15 +227,16 @@ unclipTerrainLoop:
compileTerrain:
SAVE_AY
ldy #MAXTERRAINHEIGHT-1
ldy #0
lda #compiledTerrain
sta PARAML0
compileTerrainLoop:
sty PARAML1
jsr compileTerrainRow
dey
bmi compileTerrainDone
iny
cpy #MAXTERRAINHEIGHT
beq compileTerrainDone
clc
lda #COMPILEDTERRAINROW