mirror of
https://github.com/pkali/scorch_src.git
synced 2026-05-20 22:34:21 +02:00
Hovercraft animations and Tank falls bugfix
This commit is contained in:
+77
-29
@@ -914,6 +914,54 @@ ToHighToParachute
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
|
|
||||||
|
;--------------------------------------------------
|
||||||
|
.proc DrawTankRocketEngine
|
||||||
|
; X - tank number
|
||||||
|
;
|
||||||
|
; this proc change xdraw, ydraw and temp!
|
||||||
|
;--------------------------------------------------
|
||||||
|
clc
|
||||||
|
lda Ytankstable,x
|
||||||
|
adc #2 ; 1 pixel down
|
||||||
|
sta ydraw
|
||||||
|
mva #0 ydraw+1
|
||||||
|
|
||||||
|
clc
|
||||||
|
lda XtanksTableL,x
|
||||||
|
adc #2 ; 2 pixels to right
|
||||||
|
sta xdraw
|
||||||
|
lda XtanksTableH,x
|
||||||
|
adc #0
|
||||||
|
sta xdraw+1
|
||||||
|
|
||||||
|
; draw first horizontal line
|
||||||
|
mva #5 temp
|
||||||
|
@
|
||||||
|
jsr plot
|
||||||
|
inw xdraw
|
||||||
|
dec temp
|
||||||
|
bne @-
|
||||||
|
|
||||||
|
sbw xdraw #2 ; 2 pixels left
|
||||||
|
inw ydraw ; 1 pixel down
|
||||||
|
|
||||||
|
; draw second horizontal line
|
||||||
|
mva #3 temp
|
||||||
|
@
|
||||||
|
jsr plot
|
||||||
|
.nowarn dew xdraw
|
||||||
|
dec temp
|
||||||
|
bne @-
|
||||||
|
|
||||||
|
adw xdraw #2 ; 2 pixels right
|
||||||
|
inw ydraw ; 1 pixel down
|
||||||
|
|
||||||
|
; and last pixel
|
||||||
|
jsr plot
|
||||||
|
|
||||||
|
ldx TankNr
|
||||||
|
rts
|
||||||
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc TankFalls;
|
.proc TankFalls;
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
@@ -995,7 +1043,7 @@ NoGroundCheck
|
|||||||
and #1
|
and #1
|
||||||
bne ParachutePresent
|
bne ParachutePresent
|
||||||
; decreasing energy
|
; decreasing energy
|
||||||
ldy #2 ; how much energy to substract
|
ldy #2 ; how much energy to substract if no parachute
|
||||||
jsr DecreaseEnergyX
|
jsr DecreaseEnergyX
|
||||||
ParachutePresent
|
ParachutePresent
|
||||||
; check parachute type
|
; check parachute type
|
||||||
@@ -1003,7 +1051,7 @@ ParachutePresent
|
|||||||
cmp #ind_StrongParachute ; strong parachute
|
cmp #ind_StrongParachute ; strong parachute
|
||||||
bne OneTimeParachute
|
bne OneTimeParachute
|
||||||
; decreasing energy of parachute
|
; decreasing energy of parachute
|
||||||
ldy #2 ; how much energy to substract
|
ldy #1 ; how much parachute energy to substract
|
||||||
jsr DecreaseShieldEnergyX
|
jsr DecreaseShieldEnergyX
|
||||||
cpy #0 ; is necessary to reduce tenk energy ?
|
cpy #0 ; is necessary to reduce tenk energy ?
|
||||||
beq @+
|
beq @+
|
||||||
@@ -1029,37 +1077,16 @@ NoFallingDown
|
|||||||
ldy #7 ; SlideLeftTable length -1 (from 0 to 7)
|
ldy #7 ; SlideLeftTable length -1 (from 0 to 7)
|
||||||
@ lda SlideLeftTable,y
|
@ lda SlideLeftTable,y
|
||||||
cmp UnderTank1
|
cmp UnderTank1
|
||||||
beq FallingRight
|
|
||||||
cmp UnderTank2
|
|
||||||
beq FallingLeft
|
beq FallingLeft
|
||||||
|
cmp UnderTank2
|
||||||
|
beq FallingRight
|
||||||
dey
|
dey
|
||||||
bpl @-
|
bpl @-
|
||||||
bmi NoLeftOrRight
|
bmi NoLeftOrRight
|
||||||
FallingLeft
|
|
||||||
; tank is falling left
|
|
||||||
bit PreviousFall ; bit 6 - right
|
|
||||||
bvs EndLeftFall
|
|
||||||
; we finish falling left if the tank reached the edge of the screen
|
|
||||||
lda XtanksTableH,x
|
|
||||||
bne NotLeftEdge
|
|
||||||
lda XtanksTableL,x
|
|
||||||
cmp #2 ; 2 pixels correction due to a barrel wider than tank
|
|
||||||
beq EndLeftFall
|
|
||||||
NotLeftEdge
|
|
||||||
; tank is falling left - modify coorinates
|
|
||||||
clc
|
|
||||||
lda XtankstableL,x
|
|
||||||
adc #1
|
|
||||||
sta XtankstableL,x
|
|
||||||
lda XtankstableH,x
|
|
||||||
adc #0
|
|
||||||
sta XtankstableH,x
|
|
||||||
mva #%10000000 PreviousFall ; set bit 7 - left
|
|
||||||
bne EndOfFCycle
|
|
||||||
FallingRight
|
FallingRight
|
||||||
; tank is falling right
|
; tank is falling right
|
||||||
bit PreviousFall ; bit 7 - left
|
bit PreviousFall ; bit 6 - left
|
||||||
bmi EndRightFall
|
bvs EndRightFall
|
||||||
; we finish falling right if the tank reached the edge of the screen
|
; we finish falling right if the tank reached the edge of the screen
|
||||||
clc
|
clc
|
||||||
lda XtanksTableL,x
|
lda XtanksTableL,x
|
||||||
@@ -1069,8 +1096,29 @@ FallingRight
|
|||||||
adc #0
|
adc #0
|
||||||
sta temp+1
|
sta temp+1
|
||||||
cpw temp #screenwidth-2 ; 2 pixels correction due to a barrel wider than tank
|
cpw temp #screenwidth-2 ; 2 pixels correction due to a barrel wider than tank
|
||||||
beq EndRightFall
|
bcs EndRightFall
|
||||||
|
NotLeftEdge
|
||||||
; tank is falling right - modify coorinates
|
; tank is falling right - modify coorinates
|
||||||
|
clc
|
||||||
|
lda XtankstableL,x
|
||||||
|
adc #1
|
||||||
|
sta XtankstableL,x
|
||||||
|
lda XtankstableH,x
|
||||||
|
adc #0
|
||||||
|
sta XtankstableH,x
|
||||||
|
mva #%10000000 PreviousFall ; set bit 7 - right
|
||||||
|
bne EndOfFCycle
|
||||||
|
FallingLeft
|
||||||
|
; tank is falling left
|
||||||
|
bit PreviousFall ; bit 7 - right
|
||||||
|
bmi EndLeftFall
|
||||||
|
; we finish falling left if the tank reached the edge of the screen
|
||||||
|
lda XtanksTableH,x
|
||||||
|
bne NotLeftEdge
|
||||||
|
lda XtanksTableL,x
|
||||||
|
cmp #3 ; 2 pixels correction due to a barrel wider than tank
|
||||||
|
bcc EndLeftFall
|
||||||
|
; tank is falling left - modify coorinates
|
||||||
sec
|
sec
|
||||||
lda XtankstableL,x
|
lda XtankstableL,x
|
||||||
sbc #1
|
sbc #1
|
||||||
@@ -1078,7 +1126,7 @@ FallingRight
|
|||||||
lda XtankstableH,x
|
lda XtankstableH,x
|
||||||
sbc #0
|
sbc #0
|
||||||
sta XtankstableH,x
|
sta XtankstableH,x
|
||||||
mva #%01000000 PreviousFall ; set bit 6 - right
|
mva #%01000000 PreviousFall ; set bit 6 - left
|
||||||
bne EndOfFCycle
|
bne EndOfFCycle
|
||||||
EndLeftFall
|
EndLeftFall
|
||||||
EndRightFall
|
EndRightFall
|
||||||
|
|||||||
BIN
Binary file not shown.
+65
-11
@@ -2424,26 +2424,45 @@ InverseScreenByte
|
|||||||
; Let's designate the flight altitude.
|
; Let's designate the flight altitude.
|
||||||
mva #17 FloatingAlt ; for testing
|
mva #17 FloatingAlt ; for testing
|
||||||
; mwa #mountaintable temp
|
; mwa #mountaintable temp
|
||||||
mva #sfx_plasma_1_2 sfx_effect
|
mva #sfx_plasma_2_2 sfx_effect
|
||||||
|
|
||||||
; display text 4x4 - fuel full
|
; display text 4x4 - fuel full
|
||||||
|
|
||||||
; TankNr in X reg.
|
; TankNr in X reg.
|
||||||
; now animate Up
|
; now animate Up
|
||||||
|
mva #0 FloatingAlt ; now it's a counter
|
||||||
TankGoUp
|
TankGoUp
|
||||||
lda ytankstable,x
|
lda ytankstable,x
|
||||||
cmp FloatingAlt
|
cmp #17 ; Floating altitude
|
||||||
beq ReachSky
|
beq ReachSky
|
||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
mva #1 Erase
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
|
lda FloatingAlt
|
||||||
|
cmp #5
|
||||||
|
bcc NoEngineClear
|
||||||
|
mva #0 color
|
||||||
|
jsr DrawTankRocketEngine
|
||||||
|
NoEngineClear
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
dec ytankstable,x
|
dec ytankstable,x
|
||||||
|
inc FloatingAlt
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
|
lda FloatingAlt
|
||||||
|
cmp #5
|
||||||
|
bcc NoEngine
|
||||||
|
lda random
|
||||||
|
and #%00000001
|
||||||
|
sta color
|
||||||
|
jsr DrawTankRocketEngine
|
||||||
|
NoEngine
|
||||||
; jsr WaitOneFrame
|
; jsr WaitOneFrame
|
||||||
jmp TankGoUp
|
jmp TankGoUp
|
||||||
ReachSky
|
ReachSky
|
||||||
|
; engine symbol erase
|
||||||
|
mva #0 color
|
||||||
|
jsr DrawTankRocketEngine
|
||||||
|
|
||||||
; display text 4x4 - fuel full (clear text)
|
; display text 4x4 - fuel full (clear text)
|
||||||
|
|
||||||
@@ -2464,6 +2483,36 @@ KeyboardAndJoyCheck
|
|||||||
; display text 4x4 - low fuel
|
; display text 4x4 - low fuel
|
||||||
|
|
||||||
notpressed
|
notpressed
|
||||||
|
; let's animate "engine"
|
||||||
|
; one pixel under tank
|
||||||
|
clc
|
||||||
|
lda Ytankstable,x
|
||||||
|
adc #1
|
||||||
|
sta ydraw
|
||||||
|
mva #0 ydraw+1
|
||||||
|
lda XtankstableL,x
|
||||||
|
sta xdraw
|
||||||
|
lda XtankstableH,x
|
||||||
|
sta xdraw+1
|
||||||
|
; clear first pixel under tank
|
||||||
|
mva #0 color
|
||||||
|
jsr plot
|
||||||
|
inw xdraw
|
||||||
|
; plot 6 random color pixels
|
||||||
|
mva #6 FloatingAlt ; sorry reuse!
|
||||||
|
@ lda random
|
||||||
|
and #%00000001
|
||||||
|
sta color
|
||||||
|
jsr plot
|
||||||
|
inw xdraw
|
||||||
|
dec FloatingAlt
|
||||||
|
bne @-
|
||||||
|
; clear last pixel under tank
|
||||||
|
mva #0 color
|
||||||
|
jsr plot
|
||||||
|
ldx TankNr
|
||||||
|
; enimation ends
|
||||||
|
|
||||||
lda SKSTAT
|
lda SKSTAT
|
||||||
cmp #$ff
|
cmp #$ff
|
||||||
jeq checkJoy
|
jeq checkJoy
|
||||||
@@ -2504,8 +2553,7 @@ notpressedJoy
|
|||||||
;fire
|
;fire
|
||||||
lda STRIG0
|
lda STRIG0
|
||||||
jeq pressedSpace
|
jeq pressedSpace
|
||||||
mva #$ff pressTimer ; stop counting frames
|
jmp notpressed
|
||||||
jmp notpressed
|
|
||||||
|
|
||||||
|
|
||||||
pressedRight
|
pressedRight
|
||||||
@@ -2518,10 +2566,10 @@ pressedRight
|
|||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
lda XtankstableH,x
|
lda XtankstableH,x
|
||||||
cmp #>(screenwidth-10) ; tank width correction +2
|
cmp #>(screenwidth-12) ; tank width correction +4
|
||||||
bne @+
|
bne @+
|
||||||
lda XtankstableL,x
|
lda XtankstableL,x
|
||||||
cmp #<(screenwidth-10) ; tank width correction +2 pixels
|
cmp #<(screenwidth-12) ; tank width correction +4 pixels
|
||||||
@ bcs RightScreenEdge
|
@ bcs RightScreenEdge
|
||||||
inc XtankstableL,x
|
inc XtankstableL,x
|
||||||
sne:inc XtankstableH,x
|
sne:inc XtankstableH,x
|
||||||
@@ -2529,7 +2577,7 @@ pressedRight
|
|||||||
RightScreenEdge
|
RightScreenEdge
|
||||||
mva #sfx_dunno sfx_effect
|
mva #sfx_dunno sfx_effect
|
||||||
NoREdge
|
NoREdge
|
||||||
mva #25 AngleTable,x
|
mva #18 AngleTable,x
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
jsr DisplayStatus
|
jsr DisplayStatus
|
||||||
@@ -2549,7 +2597,7 @@ pressedLeft
|
|||||||
cmp #0
|
cmp #0
|
||||||
bne @+
|
bne @+
|
||||||
lda XtankstableL,x
|
lda XtankstableL,x
|
||||||
cmp #5 ; 2 pixles from left edge
|
cmp #5 ; 4 pixles from left edge
|
||||||
@ bcc LeftScreenEdge
|
@ bcc LeftScreenEdge
|
||||||
dec XtankstableL,x
|
dec XtankstableL,x
|
||||||
lda XtankstableL,x
|
lda XtankstableL,x
|
||||||
@@ -2559,7 +2607,7 @@ pressedLeft
|
|||||||
LeftScreenEdge
|
LeftScreenEdge
|
||||||
mva #sfx_dunno sfx_effect
|
mva #sfx_dunno sfx_effect
|
||||||
NoLEdge
|
NoLEdge
|
||||||
mva #155 AngleTable,x
|
mva #162 AngleTable,x
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
jsr DisplayStatus
|
jsr DisplayStatus
|
||||||
@@ -2632,14 +2680,14 @@ TankBelow
|
|||||||
PassRight
|
PassRight
|
||||||
inc XtankstableL,x
|
inc XtankstableL,x
|
||||||
sne:inc XtankstableH,x
|
sne:inc XtankstableH,x
|
||||||
mva #25 AngleTable,x
|
mva #18 AngleTable,x
|
||||||
bne Bypassing
|
bne Bypassing
|
||||||
PassLeft
|
PassLeft
|
||||||
dec XtankstableL,x
|
dec XtankstableL,x
|
||||||
lda XtankstableL,x
|
lda XtankstableL,x
|
||||||
cmp #$ff
|
cmp #$ff
|
||||||
sne:dec XtankstableH,x
|
sne:dec XtankstableH,x
|
||||||
mva #155 AngleTable,x
|
mva #162 AngleTable,x
|
||||||
Bypassing
|
Bypassing
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
@@ -2681,13 +2729,19 @@ FloatDown
|
|||||||
; first erase old tank position
|
; first erase old tank position
|
||||||
mva #1 Erase
|
mva #1 Erase
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
|
jsr DrawTankParachute
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
inc ytankstable,x
|
inc ytankstable,x
|
||||||
; then draw tank on new position
|
; then draw tank on new position
|
||||||
jsr DrawTankNr
|
jsr DrawTankNr
|
||||||
|
jsr DrawTankParachute
|
||||||
jsr WaitOneFrame
|
jsr WaitOneFrame
|
||||||
jmp FloatDown
|
jmp FloatDown
|
||||||
OnGround
|
OnGround
|
||||||
|
; clear parachute
|
||||||
|
mva #1 Erase
|
||||||
|
jsr DrawTankParachute
|
||||||
|
mva #0 Erase
|
||||||
jsr WaitForKeyRelease
|
jsr WaitForKeyRelease
|
||||||
; and Soildown at the end (for correct mountaintable)
|
; and Soildown at the end (for correct mountaintable)
|
||||||
; calculate range
|
; calculate range
|
||||||
|
|||||||
Reference in New Issue
Block a user