mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-06-13 14:29:27 +00:00
Seemingly working rendering with PHY added
This commit is contained in:
parent
b0588cd14f
commit
32f7d99c33
BIN
V2Make.scpt
BIN
V2Make.scpt
Binary file not shown.
|
@ -41,11 +41,11 @@ beginGameplay:
|
||||||
jsr clipTerrain
|
jsr clipTerrain
|
||||||
|
|
||||||
; Create players
|
; Create players
|
||||||
lda #40
|
lda #191
|
||||||
ldy #0
|
ldy #0
|
||||||
jsr playerCreate
|
jsr playerCreate
|
||||||
|
|
||||||
lda #191
|
lda #40
|
||||||
ldy #1
|
ldy #1
|
||||||
jsr playerCreate
|
jsr playerCreate
|
||||||
|
|
||||||
|
|
BIN
gscats.2mg
BIN
gscats.2mg
Binary file not shown.
66
terrain.s
66
terrain.s
|
@ -21,7 +21,8 @@ VISIBLETERRAINWINDOW = 80 ; In words
|
||||||
;
|
;
|
||||||
renderTerrain:
|
renderTerrain:
|
||||||
FASTGRAPHICS
|
FASTGRAPHICS
|
||||||
ldy #MAXTERRAINHEIGHT
|
lda #MAXTERRAINHEIGHT
|
||||||
|
sta SCRATCHL2 ; Row counter
|
||||||
lda #$9cff ; 4 Point stack to end of VRAM
|
lda #$9cff ; 4 Point stack to end of VRAM
|
||||||
tcs ; 2
|
tcs ; 2
|
||||||
|
|
||||||
|
@ -31,8 +32,9 @@ renderTerrain:
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
|
|
||||||
renderTerrainLoop:
|
renderTerrainLoop:
|
||||||
lda #$0000 ; Background
|
lda #$0000 ; BG/BG
|
||||||
ldx #$1111 ; Foreground
|
ldx #$1111 ; FG/FG
|
||||||
|
ldy #$1100 ; BG/FG
|
||||||
jmp (PARAML0)
|
jmp (PARAML0)
|
||||||
|
|
||||||
renderRowComplete:
|
renderRowComplete:
|
||||||
|
@ -40,7 +42,7 @@ renderRowComplete:
|
||||||
sec
|
sec
|
||||||
sbc #COMPILEDTERRAINROW
|
sbc #COMPILEDTERRAINROW
|
||||||
sta PARAML0
|
sta PARAML0
|
||||||
dey
|
dec SCRATCHL2
|
||||||
bne renderTerrainLoop
|
bne renderTerrainLoop
|
||||||
|
|
||||||
SLOWGRAPHICS
|
SLOWGRAPHICS
|
||||||
|
@ -227,9 +229,9 @@ compileTerrainDone:
|
||||||
; PARAML0 = Start of compiled row data
|
; PARAML0 = Start of compiled row data
|
||||||
; PARAML1 = Row index
|
; PARAML1 = Row index
|
||||||
;
|
;
|
||||||
; Note: DA = PHX = BGBG
|
; Note: DA = PHX = FG/FG
|
||||||
; 48 = PHA = FGFG
|
; 48 = PHA = BG/BG
|
||||||
; 5A = PHY =
|
; 5A = PHY = BG/FG
|
||||||
; 0B = PHD =
|
; 0B = PHD =
|
||||||
|
|
||||||
compileTerrainRow:
|
compileTerrainRow:
|
||||||
|
@ -240,23 +242,30 @@ compileTerrainRow:
|
||||||
compileTerrainColumnLoop:
|
compileTerrainColumnLoop:
|
||||||
stz compileTerrainOpcode
|
stz compileTerrainOpcode
|
||||||
|
|
||||||
; Right half
|
; Rightmost byte
|
||||||
lda terrainData,x
|
lda terrainData,x
|
||||||
cmp PARAML1
|
cmp PARAML1
|
||||||
bcc compileTerrainColumnBGRight
|
bcc compileTerrainColumnBG0
|
||||||
beq compileTerrainColumnBGRight
|
beq compileTerrainColumnBG0
|
||||||
|
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
lda terrainData,x
|
||||||
|
cmp PARAML1
|
||||||
|
bcc compileTerrainColumnBG1
|
||||||
|
beq compileTerrainColumnBG1
|
||||||
|
|
||||||
|
; Columns 0 and 1 are FG/FG, so PHX
|
||||||
lda #$00da
|
lda #$00da
|
||||||
|
|
||||||
compileTerrainColumnLeft:
|
compileTerrainColumn2:
|
||||||
sta compileTerrainOpcode
|
sta compileTerrainOpcode
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
inx ; Double-up for now
|
|
||||||
inx
|
|
||||||
lda terrainData,x
|
lda terrainData,x
|
||||||
cmp PARAML1
|
cmp PARAML1
|
||||||
bcc compileTerrainColumnBGLeft
|
bcc compileTerrainColumnBG2
|
||||||
beq compileTerrainColumnBGLeft
|
beq compileTerrainColumnBG2
|
||||||
lda compileTerrainOpcode
|
lda compileTerrainOpcode
|
||||||
ora #$da00
|
ora #$da00
|
||||||
|
|
||||||
|
@ -264,7 +273,7 @@ compileTerrainColumnStore:
|
||||||
sta (PARAML0),y
|
sta (PARAML0),y
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
inx ; Double-up for now
|
inx
|
||||||
inx
|
inx
|
||||||
iny
|
iny
|
||||||
iny
|
iny
|
||||||
|
@ -274,11 +283,21 @@ compileTerrainColumnStore:
|
||||||
RESTORE_AXY
|
RESTORE_AXY
|
||||||
rts
|
rts
|
||||||
|
|
||||||
compileTerrainColumnBGRight:
|
compileTerrainColumnBG0:
|
||||||
lda #$0048
|
|
||||||
bra compileTerrainColumnLeft
|
|
||||||
|
|
||||||
compileTerrainColumnBGLeft:
|
; Columns 0 and 1 are BG/BG, so PHA
|
||||||
|
lda #$0048
|
||||||
|
inx ; PHD check goes here?
|
||||||
|
inx
|
||||||
|
bra compileTerrainColumn2
|
||||||
|
|
||||||
|
compileTerrainColumnBG1:
|
||||||
|
|
||||||
|
; Columns 0 and 1 are BG/FG, so PHY
|
||||||
|
lda #$005a
|
||||||
|
bra compileTerrainColumn2
|
||||||
|
|
||||||
|
compileTerrainColumnBG2:
|
||||||
lda compileTerrainOpcode
|
lda compileTerrainOpcode
|
||||||
ora #$4800
|
ora #$4800
|
||||||
bra compileTerrainColumnStore
|
bra compileTerrainColumnStore
|
||||||
|
@ -313,16 +332,11 @@ generateTerrainLoop:
|
||||||
sta (SCRATCHL),y
|
sta (SCRATCHL),y
|
||||||
iny
|
iny
|
||||||
iny
|
iny
|
||||||
sta (SCRATCHL),y ; Double-up for now
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
|
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
inx
|
|
||||||
inx
|
|
||||||
|
|
||||||
txa
|
txa
|
||||||
and #$03ff
|
and #$03ff
|
||||||
|
@ -333,6 +347,8 @@ generateTerrainLoop:
|
||||||
|
|
||||||
lda #1
|
lda #1
|
||||||
sta terrainData
|
sta terrainData
|
||||||
|
lda #2
|
||||||
|
sta compiledTerrain-4
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user