Soildown after Hovercraft optimization.

This commit is contained in:
Pecusx
2022-12-13 09:15:39 +01:00
parent 2b88517167
commit 588040d9e6
5 changed files with 17 additions and 9 deletions
+6 -4
View File
@@ -26,7 +26,7 @@
;--------------------------------------------------- ;---------------------------------------------------
icl 'definitions.asm' icl 'definitions.asm'
;--------------------------------------------------- ;---------------------------------------------------
FirstZpageVariable = $60 FirstZpageVariable = $5E
.zpvar DliColorBack .byte = FirstZpageVariable .zpvar DliColorBack .byte = FirstZpageVariable
.zpvar Gradient .byte .zpvar Gradient .byte
.zpvar JoystickNumber .byte .zpvar JoystickNumber .byte
@@ -71,10 +71,12 @@ FirstZpageVariable = $60
.zpvar pressTimer .byte .zpvar pressTimer .byte
.zpvar NTSCcounter .byte .zpvar NTSCcounter .byte
.zpvar IsEndOfTheFallFlag .byte ; for small speedup ground falling .zpvar IsEndOfTheFallFlag .byte ; for small speedup ground falling
.zpvar sfx_effect .byte .zpvar sfx_effect .byte
.zpvar RMT_blocked .byte .zpvar RMT_blocked .byte
.zpvar ScrollFlag .byte .zpvar ScrollFlag .byte
.zpvar SkStatSimulator .byte .zpvar SkStatSimulator .byte
.zpvar FloatingAlt .byte ; floating tank altitude
.zpvar OverTankDir .byte ; (0 go right, $ff go left) direction of bypassing tanks on screen
; --------------OPTIMIZATION VARIABLES-------------- ; --------------OPTIMIZATION VARIABLES--------------
.zpvar Force .word .zpvar Force .word
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -220,7 +220,7 @@ FallingSoundBit .DS 1
PreviousFall .DS 1 PreviousFall .DS 1
EndOfTheFallFlag .DS 1 ; in case of the infinite fall EndOfTheFallFlag .DS 1 ; in case of the infinite fall
;Parachute .DS 1 ; are you insured with parachute? ;Parachute .DS 1 ; are you insured with parachute?
FloatingAlt .DS 1 ; floating tank altitude ;FloatingAlt .DS 1 ; floating tank altitude
FunkyWallFlag = FloatingAlt ; reuse this variable in different weapon (Funky Bomb)! FunkyWallFlag = FloatingAlt ; reuse this variable in different weapon (Funky Bomb)!
PreferHumansFlag = FloatingAlt ; second reuse in AI Aim proc PreferHumansFlag = FloatingAlt ; second reuse in AI Aim proc
;---------------------------------------------------- ;----------------------------------------------------
+10 -4
View File
@@ -2772,7 +2772,7 @@ pressedSpace
TankOnRightSide TankOnRightSide
dey dey
TankOnLeftSide TankOnLeftSide
sty FloatingAlt ; I know, not elegant byt this variable it's free now (0 go right, $ff go left) sty OverTankDir ; (0 go right, $ff go left)
; now we have direction of bypassing tanks on screen ; now we have direction of bypassing tanks on screen
; clear "engine pixels" under tank ; clear "engine pixels" under tank
@@ -2823,7 +2823,7 @@ TankBelow
mva #1 Erase mva #1 Erase
jsr DrawTankNr jsr DrawTankNr
mva #0 Erase mva #0 Erase
bit FloatingAlt bit OverTankDir
bmi PassLeft bmi PassLeft
PassRight PassRight
inc XtankstableL,x inc XtankstableL,x
@@ -2867,10 +2867,10 @@ GoDown
adw temp #4 ; center of the tank adw temp #4 ; center of the tank
ldy #0 ldy #0
lda (temp),y lda (temp),y
sta FloatingAlt sta OverTankDir ; not elegant!!! Reuse as height of tank flight
FloatDown FloatDown
lda ytankstable,x lda ytankstable,x
cmp FloatingAlt cmp OverTankDir
bcs OnGround bcs OnGround
; first erase old tank position ; first erase old tank position
mva #1 Erase mva #1 Erase
@@ -2890,6 +2890,12 @@ OnGround
mva #0 Erase mva #0 Erase
jsr WaitForKeyRelease jsr WaitForKeyRelease
; and Soildown at the end (for correct mountaintable) ; and Soildown at the end (for correct mountaintable)
; If tank did not fly at maximum altitude there is no need to soildown to much
lda FloatingAlt
cmp #18
beq NotHighest
jsr ClearScreenSoilRange
NotHighest
; calculate range ; calculate range
jsr CalculateSoildown jsr CalculateSoildown
; hide tanks and ... ; hide tanks and ...