mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-11-26 02:49:16 +00:00
Bug fix for terrain chunk recompiling
This commit is contained in:
parent
4ddb742b5f
commit
49c1b08cb0
15
projectile.s
15
projectile.s
@ -914,7 +914,6 @@ processTerrainImpactStoreContinue:
|
|||||||
sta PARAML0
|
sta PARAML0
|
||||||
pha ; Dirt explosion will need this
|
pha ; Dirt explosion will need this
|
||||||
sta compileTerrainRowStart ; Terrain chunk compiler will need this
|
sta compileTerrainRowStart ; Terrain chunk compiler will need this
|
||||||
lda #TERRAINWIDTH
|
|
||||||
sta compileTerrainRowEnd
|
sta compileTerrainRowEnd
|
||||||
|
|
||||||
lda projectileData+GO_POSY,y
|
lda projectileData+GO_POSY,y
|
||||||
@ -927,6 +926,20 @@ processTerrainImpactStoreContinue:
|
|||||||
tay
|
tay
|
||||||
PROJECTILETYPEPTR_Y
|
PROJECTILETYPEPTR_Y
|
||||||
|
|
||||||
|
sec ; Quick sidebar to calculate crater compiling extents while we have the pointers
|
||||||
|
lda #TERRAINWIDTH
|
||||||
|
sbc compileTerrainRowStart
|
||||||
|
sbc projectileTypes+PT_RADIUS,y
|
||||||
|
sbc projectileTypes+PT_RADIUS,y
|
||||||
|
sta compileTerrainRowStart
|
||||||
|
sec
|
||||||
|
lda #TERRAINWIDTH
|
||||||
|
sbc compileTerrainRowEnd
|
||||||
|
clc
|
||||||
|
adc projectileTypes+PT_RADIUS,y
|
||||||
|
adc #GAMEOBJECTWIDTH
|
||||||
|
sta compileTerrainRowEnd
|
||||||
|
;don't forget to clamp these to terrain edges'
|
||||||
lda projectileTypes+PT_RADIUS,y
|
lda projectileTypes+PT_RADIUS,y
|
||||||
tay
|
tay
|
||||||
phy ; We'll need the radius in a moment
|
phy ; We'll need the radius in a moment
|
||||||
|
@ -289,14 +289,13 @@ compileTerrainDone:
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; compileTerrainChunk
|
; compileTerrainChunk
|
||||||
;
|
;
|
||||||
; Y = First row to compile (bottom-relative)
|
|
||||||
; X = Last row to compile (bottom-relative)
|
|
||||||
; compileTerrainRowStart = Start column to compile (logical terrainData index)
|
; compileTerrainRowStart = Start column to compile (logical terrainData index)
|
||||||
; compileTerrainRowEnd = Ending column to compile (logical terrainData index)
|
; compileTerrainRowEnd = Ending column to compile (logical terrainData index)
|
||||||
;
|
;
|
||||||
; Trashes A,Y, SCRATCHL, PARAML0, PARAML1
|
; Trashes A,Y, SCRATCHL, PARAML0, PARAML1
|
||||||
;
|
;
|
||||||
compileTerrainChunk:
|
compileTerrainChunk:
|
||||||
|
ldy #0
|
||||||
tya ; Be extra safe and make sure Y is never negative or we'll spray RAM with terrain data
|
tya ; Be extra safe and make sure Y is never negative or we'll spray RAM with terrain data
|
||||||
bmi compileTerrainChunkClampZero
|
bmi compileTerrainChunkClampZero
|
||||||
ldx #MAXTERRAINHEIGHT-1
|
ldx #MAXTERRAINHEIGHT-1
|
||||||
|
Loading…
Reference in New Issue
Block a user