mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-20 22:33:43 +02:00
Shield after Flag bug fixed #138 . Optimizations
This commit is contained in:
@@ -219,8 +219,10 @@ AngleTable ; 16 bytes ;ba w $348b L$3350
|
|||||||
cmp #5
|
cmp #5
|
||||||
bcs EnoughEnergy
|
bcs EnoughEnergy
|
||||||
; lower than 5 units - white flag
|
; lower than 5 units - white flag
|
||||||
|
jsr ClearTankNr ; we must hide tank to erase shields (issue #138)
|
||||||
lda #ind_White_Flag_____
|
lda #ind_White_Flag_____
|
||||||
sta ActiveDefenceWeapon,x
|
sta ActiveDefenceWeapon,x
|
||||||
|
jsr PutTankNr ; and draw tank witch Flag
|
||||||
EnoughEnergy
|
EnoughEnergy
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
|
|||||||
+7
-3
@@ -613,6 +613,11 @@ DrawNextTank
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;---------
|
;---------
|
||||||
|
ClearTankNr
|
||||||
|
mva #1 Erase
|
||||||
|
bne DrawTankNr
|
||||||
|
PutTankNr
|
||||||
|
mva #0 Erase
|
||||||
.proc DrawTankNr
|
.proc DrawTankNr
|
||||||
ldx tankNr
|
ldx tankNr
|
||||||
; let's check the energy
|
; let's check the energy
|
||||||
@@ -1041,7 +1046,7 @@ TankFallsX
|
|||||||
NoFallingSound
|
NoFallingSound
|
||||||
; clear previous position
|
; clear previous position
|
||||||
mva #1 Erase
|
mva #1 Erase
|
||||||
jsr DrawTankNr
|
jsr ClearTankNr
|
||||||
; and the parachute (if present)
|
; and the parachute (if present)
|
||||||
lda Parachute
|
lda Parachute
|
||||||
and #01
|
and #01
|
||||||
@@ -1242,9 +1247,8 @@ NoParachuteWeapon
|
|||||||
beq ThereWasNoParachute
|
beq ThereWasNoParachute
|
||||||
jsr DrawTankParachute
|
jsr DrawTankParachute
|
||||||
ThereWasNoParachute
|
ThereWasNoParachute
|
||||||
mva #0 Erase
|
|
||||||
; ldx TankNr
|
; ldx TankNr
|
||||||
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
|
jsr PutTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
|
||||||
mva #sfx_silencer sfx_effect
|
mva #sfx_silencer sfx_effect
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+16
-32
@@ -835,15 +835,13 @@ ShieldCoveredTank
|
|||||||
jne EndOfDistanceCheckLoop
|
jne EndOfDistanceCheckLoop
|
||||||
ShieldEnergy0 ; deactivate if no energy. it's like use one hit shield :)
|
ShieldEnergy0 ; deactivate if no energy. it's like use one hit shield :)
|
||||||
UseShield
|
UseShield
|
||||||
mva #1 Erase
|
|
||||||
lda TankNr
|
lda TankNr
|
||||||
pha ; store TankNr
|
pha ; store TankNr
|
||||||
stx TankNr ; store X in TankNr :)
|
stx TankNr ; store X in TankNr :)
|
||||||
jsr DrawTankNr ; now erase tank with shield (to erase shield)
|
jsr ClearTankNr ; now erase tank with shield (to erase shield)
|
||||||
lda #0
|
lda #0
|
||||||
sta ActiveDefenceWeapon,x ; deactivate defense weapons
|
sta ActiveDefenceWeapon,x ; deactivate defense weapons
|
||||||
sta Erase
|
jsr PutTankNr ; draw tank without shield
|
||||||
jsr DrawTankNr ; draw tank without shield
|
|
||||||
ldx TankNr ; restore X value :)
|
ldx TankNr ; restore X value :)
|
||||||
pla
|
pla
|
||||||
sta TankNr ; restore TankNr value :)
|
sta TankNr ; restore TankNr value :)
|
||||||
@@ -1081,11 +1079,10 @@ ContinueToCheckMaxForce2
|
|||||||
lda MaxForceTableL,x
|
lda MaxForceTableL,x
|
||||||
sta ForceTableL,x
|
sta ForceTableL,x
|
||||||
@
|
@
|
||||||
mva #0 Erase
|
|
||||||
jsr PutTankNameOnScreen
|
jsr PutTankNameOnScreen
|
||||||
; jsr DisplayStatus ; There is no need anymore, it is always after PutTankNameOnScreen
|
; jsr DisplayStatus ; There is no need anymore, it is always after PutTankNameOnScreen
|
||||||
|
|
||||||
jsr DrawTankNr
|
jsr PutTankNr
|
||||||
|
|
||||||
jsr WaitOneFrame ; best after drawing a tank
|
jsr WaitOneFrame ; best after drawing a tank
|
||||||
|
|
||||||
@@ -1915,16 +1912,14 @@ RightDeflection
|
|||||||
bcs EndOfMagDeflector ; hit of course but we need RTS
|
bcs EndOfMagDeflector ; hit of course but we need RTS
|
||||||
sbw XHit #36 ; change to left
|
sbw XHit #36 ; change to left
|
||||||
EndOfMagDeflector
|
EndOfMagDeflector
|
||||||
mva #1 Erase
|
|
||||||
lda TankNr
|
lda TankNr
|
||||||
pha ; store TankNr
|
pha ; store TankNr
|
||||||
stx TankNr ; store X in TankNr :)
|
stx TankNr ; store X in TankNr :)
|
||||||
jsr DrawTankNr ; now erase tank with shield (to erase shield)
|
jsr ClearTankNr ; now erase tank with shield (to erase shield)
|
||||||
lda #0
|
lda #0
|
||||||
sta ActiveDefenceWeapon,x ; deactivate used mag deflector weapon
|
sta ActiveDefenceWeapon,x ; deactivate used mag deflector weapon
|
||||||
sta ShieldEnergy,x
|
sta ShieldEnergy,x
|
||||||
sta Erase
|
jsr PutTankNr ; draw tank without shield
|
||||||
jsr DrawTankNr ; draw tank without shield
|
|
||||||
ldx TankNr ; restore X value :)
|
ldx TankNr ; restore X value :)
|
||||||
pla
|
pla
|
||||||
sta TankNr ; restore TankNr value :)
|
sta TankNr ; restore TankNr value :)
|
||||||
@@ -1944,11 +1939,10 @@ BouncyCastle
|
|||||||
@
|
@
|
||||||
mva #sfx_shield_on sfx_effect
|
mva #sfx_shield_on sfx_effect
|
||||||
; now run defensive-aggressive weapon - Bouncy Castle (previously known as Auto Defence)!
|
; now run defensive-aggressive weapon - Bouncy Castle (previously known as Auto Defence)!
|
||||||
mva #1 Erase
|
|
||||||
lda TankNr
|
lda TankNr
|
||||||
pha ; store TankNr
|
pha ; store TankNr
|
||||||
stx TankNr ; store X in TankNr :)
|
stx TankNr ; store X in TankNr :)
|
||||||
jsr DrawTankNr ; now erase tank with shield (to erase shield)
|
jsr ClearTankNr ; now erase tank with shield (to erase shield)
|
||||||
lda #0
|
lda #0
|
||||||
sta ActiveDefenceWeapon,x ; deactivate used auto defense weapon
|
sta ActiveDefenceWeapon,x ; deactivate used auto defense weapon
|
||||||
sta ShieldEnergy,x
|
sta ShieldEnergy,x
|
||||||
@@ -1956,8 +1950,7 @@ BouncyCastle
|
|||||||
sta ytraj
|
sta ytraj
|
||||||
; sta xtraj+2
|
; sta xtraj+2
|
||||||
; sta ytraj+2
|
; sta ytraj+2
|
||||||
sta Erase
|
jsr PutTankNr ; draw tank without shield
|
||||||
jsr DrawTankNr ; draw tank without shield
|
|
||||||
; ldx TankNr ; restore X value :) ... but we don't need X now ..
|
; ldx TankNr ; restore X value :) ... but we don't need X now ..
|
||||||
pla
|
pla
|
||||||
sta TankNr ; restore TankNr value :)
|
sta TankNr ; restore TankNr value :)
|
||||||
@@ -2382,8 +2375,7 @@ NoWall
|
|||||||
; -------------------------------------------------
|
; -------------------------------------------------
|
||||||
mva #sfx_death_begin sfx_effect
|
mva #sfx_death_begin sfx_effect
|
||||||
jsr FlashTank ; first we flash tank
|
jsr FlashTank ; first we flash tank
|
||||||
mva #1 Erase
|
jsr ClearTankNr ; and erase tank
|
||||||
jsr DrawTankNr ; and erase tank
|
|
||||||
lda #0
|
lda #0
|
||||||
sta Erase
|
sta Erase
|
||||||
ldx TankNr
|
ldx TankNr
|
||||||
@@ -2531,19 +2523,17 @@ TankGoUp
|
|||||||
cmp FloatingAlt ; Floating altitude
|
cmp FloatingAlt ; Floating altitude
|
||||||
bcc ReachSky
|
bcc ReachSky
|
||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
jsr ClearTankNr
|
||||||
jsr DrawTankNr
|
|
||||||
lda modify
|
lda modify
|
||||||
cmp #5
|
cmp #5
|
||||||
bcc NoEngineClear
|
bcc NoEngineClear
|
||||||
mva #0 color
|
mva #0 color
|
||||||
jsr DrawTankRocketEngine
|
jsr DrawTankRocketEngine
|
||||||
NoEngineClear
|
NoEngineClear
|
||||||
mva #0 Erase
|
|
||||||
dec ytankstable,x
|
dec ytankstable,x
|
||||||
inc modify
|
inc modify
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr PutTankNr
|
||||||
lda modify
|
lda modify
|
||||||
cmp #5
|
cmp #5
|
||||||
bcc NoEngine
|
bcc NoEngine
|
||||||
@@ -2671,8 +2661,7 @@ pressedRight
|
|||||||
ldy #1
|
ldy #1
|
||||||
jsr DecreaseShieldEnergyX
|
jsr DecreaseShieldEnergyX
|
||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
jsr ClearTankNr
|
||||||
jsr DrawTankNr
|
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
lda XtankstableH,x
|
lda XtankstableH,x
|
||||||
cmp #>(screenwidth-TankWidth-4) ; tank width correction +4
|
cmp #>(screenwidth-TankWidth-4) ; tank width correction +4
|
||||||
@@ -2695,8 +2684,7 @@ pressedLeft
|
|||||||
ldy #1
|
ldy #1
|
||||||
jsr DecreaseShieldEnergyX
|
jsr DecreaseShieldEnergyX
|
||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
jsr ClearTankNr
|
||||||
jsr DrawTankNr
|
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
lda XtankstableH,x
|
lda XtankstableH,x
|
||||||
cmp #0
|
cmp #0
|
||||||
@@ -2793,8 +2781,7 @@ TankBelow
|
|||||||
; tank below - we must move our tank
|
; tank below - we must move our tank
|
||||||
ldx TankNr
|
ldx TankNr
|
||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
jsr ClearTankNr
|
||||||
jsr DrawTankNr
|
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
bit OverTankDir
|
bit OverTankDir
|
||||||
bmi PassLeft
|
bmi PassLeft
|
||||||
@@ -2821,8 +2808,7 @@ ItIsMe
|
|||||||
bpl CheckCollisionWithTankLoop
|
bpl CheckCollisionWithTankLoop
|
||||||
ldx TankNr
|
ldx TankNr
|
||||||
mva #sfx_shield_off sfx_effect
|
mva #sfx_shield_off sfx_effect
|
||||||
mva #1 Erase
|
jsr ClearTankNr
|
||||||
jsr DrawTankNr
|
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
; x correction for P/M
|
; x correction for P/M
|
||||||
; --
|
; --
|
||||||
@@ -2851,13 +2837,11 @@ FloatDown
|
|||||||
cmp OverTankDir
|
cmp OverTankDir
|
||||||
bcs OnGround
|
bcs OnGround
|
||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
jsr ClearTankNr
|
||||||
jsr DrawTankNr
|
|
||||||
jsr DrawTankParachute
|
jsr DrawTankParachute
|
||||||
mva #0 Erase
|
|
||||||
inc ytankstable,x
|
inc ytankstable,x
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr PutTankNr
|
||||||
jsr DrawTankParachute
|
jsr DrawTankParachute
|
||||||
jsr WaitOneFrame
|
jsr WaitOneFrame
|
||||||
jmp FloatDown
|
jmp FloatDown
|
||||||
|
|||||||
Reference in New Issue
Block a user