mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-11-25 10:30:49 +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
|
||||
pha ; Dirt explosion will need this
|
||||
sta compileTerrainRowStart ; Terrain chunk compiler will need this
|
||||
lda #TERRAINWIDTH
|
||||
sta compileTerrainRowEnd
|
||||
|
||||
lda projectileData+GO_POSY,y
|
||||
@ -927,6 +926,20 @@ processTerrainImpactStoreContinue:
|
||||
tay
|
||||
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
|
||||
tay
|
||||
phy ; We'll need the radius in a moment
|
||||
|
@ -289,14 +289,13 @@ compileTerrainDone:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; compileTerrainChunk
|
||||
;
|
||||
; Y = First row to compile (bottom-relative)
|
||||
; X = Last row to compile (bottom-relative)
|
||||
; compileTerrainRowStart = Start column to compile (logical terrainData index)
|
||||
; compileTerrainRowEnd = Ending column to compile (logical terrainData index)
|
||||
;
|
||||
; Trashes A,Y, SCRATCHL, PARAML0, PARAML1
|
||||
;
|
||||
compileTerrainChunk:
|
||||
ldy #0
|
||||
tya ; Be extra safe and make sure Y is never negative or we'll spray RAM with terrain data
|
||||
bmi compileTerrainChunkClampZero
|
||||
ldx #MAXTERRAINHEIGHT-1
|
||||
|
Loading…
Reference in New Issue
Block a user