mirror of
https://github.com/Pecusx/scorch_src.git
synced 2026-05-21 06:39:40 +02:00
Optimizations - 69 bytes saved!
This commit is contained in:
+17
-29
@@ -239,22 +239,20 @@ GoXmissileWithSaveXYdraw
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc napalm
|
||||
mva #sfx_napalm sfx_effect
|
||||
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
|
||||
jsr CalculateExplosionRange
|
||||
mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
|
||||
mva #0 HotNapalmFlag ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
|
||||
beq xnapalm
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc hotnapalm
|
||||
mva #sfx_napalm sfx_effect
|
||||
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
|
||||
jsr CalculateExplosionRange
|
||||
mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
|
||||
mva #1 HotNapalmFlag ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
|
||||
; jmp xnapalm
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc xnapalm
|
||||
mva #sfx_napalm sfx_effect
|
||||
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
|
||||
jsr CalculateExplosionRange
|
||||
;
|
||||
mwa xdraw xcircle ; store hitpoint for future repeats
|
||||
ldy #30 ; repeat 30 times
|
||||
sty magic
|
||||
@@ -272,7 +270,7 @@ RepeatFlame ; internal loop (draw flames)
|
||||
sbc #1 ; over ground
|
||||
sta ydraw
|
||||
lda xdraw
|
||||
and ExplosionRadius ; if hotnapalm and x is odd:
|
||||
and HotNapalmFlag ; if hotnapalm and x is odd:
|
||||
:2 asl ; modify y position 4 pixels up
|
||||
ldy ydraw
|
||||
sta ydraw
|
||||
@@ -344,7 +342,7 @@ BurnedCheckLoop
|
||||
bcc TankOutOfFire
|
||||
|
||||
ldy #40 ; energy decrease (napalm) - but if hotnapalm:
|
||||
lda ExplosionRadius
|
||||
lda HotNapalmFlag
|
||||
beq NotHot
|
||||
ldy #80 ; energy decrease (hotnapalm)
|
||||
NotHot
|
||||
@@ -386,50 +384,40 @@ EndNurnedCheckLoop
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc babydigger
|
||||
mva #sfx_digger sfx_effect
|
||||
mva #1 diggery ; how many branches (-1)
|
||||
GoBabydiggerSFX
|
||||
mva #sfx_digger sfx_effect
|
||||
mva #0 sandhogflag
|
||||
mva #13 DigLong
|
||||
mva #1 diggery ; how many branches (-1)
|
||||
bne xdigger
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc digger ;
|
||||
mva #sfx_digger sfx_effect
|
||||
mva #0 sandhogflag
|
||||
mva #13 DigLong
|
||||
mva #3 diggery ; how many branches (-1)
|
||||
bne xdigger
|
||||
bne babydigger.GoBabydiggerSFX
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc heavydigger
|
||||
mva #sfx_digger sfx_effect
|
||||
mva #0 sandhogflag
|
||||
mva #13 DigLong
|
||||
mva #7 diggery ; how many branches (-1)
|
||||
bne xdigger
|
||||
bne babydigger.GoBabydiggerSFX
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc babysandhog
|
||||
mva #sfx_sandhog sfx_effect
|
||||
mva #char_sandhog_offset sandhogflag
|
||||
mva #13 DigLong
|
||||
mva #1 diggery ; how many branches (-1)
|
||||
bne xdigger
|
||||
bne heavysandhog.GoHeavysandhogSFX
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc sandhog
|
||||
mva #sfx_sandhog sfx_effect
|
||||
mva #char_sandhog_offset sandhogflag
|
||||
mva #13 DigLong
|
||||
mva #3 diggery ; how many branches (-1)
|
||||
bne xdigger
|
||||
bne heavysandhog.GoHeavysandhogSFX
|
||||
.endp
|
||||
; ------------------------
|
||||
.proc heavysandhog
|
||||
mva #5 diggery ; how many branches (-1)
|
||||
GoHeavysandhogSFX
|
||||
mva #sfx_sandhog sfx_effect
|
||||
mva #char_sandhog_offset sandhogflag
|
||||
mva #13 DigLong
|
||||
mva #5 diggery ; how many branches (-1)
|
||||
; jmp xdigger
|
||||
.endp
|
||||
; ------------------------
|
||||
|
||||
Reference in New Issue
Block a user