Merge pull request #100 from pkali/develop

build 145
This commit is contained in:
2022-06-26 22:19:22 -04:00
committed by GitHub
11 changed files with 474 additions and 146 deletions
+15
View File
@@ -47,6 +47,21 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin
## Changes: ## Changes:
###### Build 145
2022-06-26
Possibly last round of weapon additions!
@Pecusx added
- working White Flag -- it is a way to give up while not making opponents richer!
- Battery - a must for every tank with low energy.
- Strong Parachute - like a normal parachute, but stronger (it has energy and can work more than once)
- Nuclear Winter - a quick and efficient solution to global worming, err, warning, WARMING!
@mikerro added new SFX and in-game-tunes.
- Pressing [S] turns on/off SFX (when aiming). Pressing [M] turns on/off in-game tunes.
Tickets closed:
- https://github.com/pkali/scorch_src/issues/54 - holding joystick up or down longer speeds up force change. It makes playing with joystick much nicer.
- https://github.com/pkali/scorch_src/issues/76 - a beginning of visual tweaks by Adam
- infinite defensive weapons purchase bug fixed, to chagrin of some...
###### Build 144 ###### Build 144
2022-06-19 2022-06-19
Father's day release comes with the most anticipated new feature: defensive weapons. Thanks to @Pecus we have 5 completely new weapons and a more reasonably working parachute. The stub of the instruction manual describing these weapons is available here: https://github.com/pkali/scorch_src/wiki/Instruction-manual. Father's day release comes with the most anticipated new feature: defensive weapons. Thanks to @Pecus we have 5 completely new weapons and a more reasonably working parachute. The stub of the instruction manual describing these weapons is available here: https://github.com/pkali/scorch_src/wiki/Instruction-manual.
BIN
View File
Binary file not shown.
+22 -17
View File
@@ -596,13 +596,13 @@ WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price______________46 .by >price______________46
.by >price______________47 .by >price______________47
.by >price_White_Flag_____ .by >price_White_Flag_____
.by >price_Heat_Guidance__ .by >price_Battery________
.by >price_Bal_Guidance___ .by >price_Bal_Guidance___
.by >price_Horz_Guidance__ .by >price_Horz_Guidance__
.by >price_Vert_Guidance__ .by >price_Vert_Guidance__
.by >price_Lazy_Boy_______ .by >price_Lazy_Boy_______
.by >price_Parachute______ .by >price_Parachute______
.by >price_Battery________ .by >price_StrongParachute
.by >price_Mag_Deflector__ .by >price_Mag_Deflector__
.by >price_Shield_________ .by >price_Shield_________
.by >price_Force_Shield___ .by >price_Force_Shield___
@@ -610,7 +610,7 @@ WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price_Super_Mag______ .by >price_Super_Mag______
.by >price_Auto_Defense___ .by >price_Auto_Defense___
.by >price_Fuel_Tank______ .by >price_Fuel_Tank______
.by >price_Contact_Trigger .by >price_Nuclear_Winter_
WeaponPriceL WeaponPriceL
.by <price_Baby_Missile___ .by <price_Baby_Missile___
@@ -662,13 +662,13 @@ WeaponPriceL
.by <price______________46 .by <price______________46
.by <price______________47 .by <price______________47
.by <price_White_Flag_____ .by <price_White_Flag_____
.by <price_Heat_Guidance__ .by <price_Battery________
.by <price_Bal_Guidance___ .by <price_Bal_Guidance___
.by <price_Horz_Guidance__ .by <price_Horz_Guidance__
.by <price_Vert_Guidance__ .by <price_Vert_Guidance__
.by <price_Lazy_Boy_______ .by <price_Lazy_Boy_______
.by <price_Parachute______ .by <price_Parachute______
.by <price_Battery________ .by <price_StrongParachute
.by <price_Mag_Deflector__ .by <price_Mag_Deflector__
.by <price_Shield_________ .by <price_Shield_________
.by <price_Force_Shield___ .by <price_Force_Shield___
@@ -676,7 +676,7 @@ WeaponPriceL
.by <price_Super_Mag______ .by <price_Super_Mag______
.by <price_Auto_Defense___ .by <price_Auto_Defense___
.by <price_Fuel_Tank______ .by <price_Fuel_Tank______
.by <price_Contact_Trigger .by <price_Nuclear_Winter_
;------------------------------------------------- ;-------------------------------------------------
; how many units (bulletd) of a given weapon we get for a given price ; how many units (bulletd) of a given weapon we get for a given price
@@ -734,13 +734,13 @@ WeaponUnits
.by 0 ;_____________46 .by 0 ;_____________46
.by 0 ;_____________47 .by 0 ;_____________47
.by 1 ;White_Flag___48 .by 1 ;White_Flag___48
.by 6 ;Heat_Guidance__ .by 3 ;Battery________
.by 2 ;Bal_Guidance___ .by 2 ;Bal_Guidance___
.by 5 ;Horz_Guidance__ .by 5 ;Horz_Guidance__
.by 5 ;Vert_Guidance__ .by 5 ;Vert_Guidance__
.by 2 ;Lazy_Boy_______ .by 2 ;Lazy_Boy_______
.by 8 ;Parachute______ .by 8 ;Parachute______
.by 10 ;Battery________ .by 2 ;StrongParachute
.by 2 ;Mag_Deflector__ .by 2 ;Mag_Deflector__
.by 3 ;Shield_________ .by 3 ;Shield_________
.by 3 ;Force_Shield___ .by 3 ;Force_Shield___
@@ -748,7 +748,7 @@ WeaponUnits
.by 2 ;Super_Mag______ .by 2 ;Super_Mag______
.by 1 ;Auto_Defense___ .by 1 ;Auto_Defense___
.by 10 ;Fuel_Tank______ .by 10 ;Fuel_Tank______
.by 25 ;Contact_Trigger .by 1 ;Nuclear_Winter_
PurchaseMeTable ;weapons good to be purchased by the robot PurchaseMeTable ;weapons good to be purchased by the robot
;the comment is an index in the tables ;the comment is an index in the tables
@@ -811,8 +811,8 @@ WeaponSymbols
.by $58,$59,$5a,$5b,$60,$7b,$7c,$7d .by $58,$59,$5a,$5b,$60,$7b,$7c,$7d
.by $20,$00,$00,$00,$00,$00,$00,$00 .by $20,$00,$00,$00,$00,$00,$00,$00
.by $00,$00,$00,$00,$00,$00,$00,$00 .by $00,$00,$00,$00,$00,$00,$00,$00
.by $5f,$02,$03,$06,$1d,$0a,$1b,$1c ; defensives .by $5f,$1c,$03,$06,$1d,$0a,$1b,$1b ; defensives
.by $1e,$3b,$3c,$3d,$3e,$3f,$5e,$00 .by $1e,$3b,$3c,$3d,$3e,$3f,$5e,$7d
; Names of weapons (16 chars long) ; Names of weapons (16 chars long)
NamesOfWeapons ;the comment is an index in the tables NamesOfWeapons ;the comment is an index in the tables
@@ -866,13 +866,13 @@ NamesOfWeapons ;the comment is an index in the tables
dta d" " ; 47 ; special (no weapon) name to simplify display dta d" " ; 47 ; special (no weapon) name to simplify display
dta d"White Flag " ; 48 ($30) dta d"White Flag " ; 48 ($30)
dta d"Heat Guidance " ; 49 dta d"Battery " ; 49
dta d"Bal Guidance " ; 50 dta d"Bal Guidance " ; 50
dta d"Horz Guidance " ; 51 dta d"Horz Guidance " ; 51
dta d"Vert Guidance " ; 52 dta d"Vert Guidance " ; 52
dta d"Lazy Boy " ; 53 dta d"Lazy Boy " ; 53
dta d"Parachute " ; 54 - no energy dta d"Parachute " ; 54 - no energy
dta d"Battery " ; 55 dta d"Strong Parachute" ; 55 - with energy (earlier Battery)
dta d"Mag Deflector " ; 56 - with shield and energy dta d"Mag Deflector " ; 56 - with shield and energy
dta d"Shield " ; 57 - shield for one shot - no energy dta d"Shield " ; 57 - shield for one shot - no energy
dta d"Force Shield " ; 58 - shield with energy and parachute dta d"Force Shield " ; 58 - shield with energy and parachute
@@ -880,7 +880,7 @@ NamesOfWeapons ;the comment is an index in the tables
dta d"Super Mag " ; 60 dta d"Super Mag " ; 60
dta d"Auto Defense " ; 61 - with shield and energy dta d"Auto Defense " ; 61 - with shield and energy
dta d"Fuel Tank " ; 62 dta d"Fuel Tank " ; 62
dta d"Contact Trigger " ; 63 dta d"Nuclear Winter " ; 63
DefensiveEnergy = * - 48 DefensiveEnergy = * - 48
.by 00 ; White Flag .by 00 ; White Flag
.by 00 ; Heat Guidance .by 00 ; Heat Guidance
@@ -889,15 +889,15 @@ DefensiveEnergy = * - 48
.by 00 ; Vert Guidance .by 00 ; Vert Guidance
.by 00 ; Lazy Boy .by 00 ; Lazy Boy
.by 00 ; Parachute .by 00 ; Parachute
.by 00 ; Battery .by 99 ; Strong Parachute
.by 90 ; Mag Deflector .by 99 ; Mag Deflector
.by 00 ; Shield .by 00 ; Shield
.by 99 ; Force Shield .by 99 ; Force Shield
.by 99 ; Heavy Shield .by 99 ; Heavy Shield
.by 00 ; Super Mag .by 00 ; Super Mag
.by 99 ; Auto Defense .by 99 ; Auto Defense
.by 00 ; Fuel Tank .by 00 ; Fuel Tank
.by 00 ; Contact Trigger .by 00 ; Nuclear Winter
weaponsOfDeath weaponsOfDeath
dta 1,2,3,7,17,18,19,20,21,22,23,24,25,26,27 dta 1,2,3,7,17,18,19,20,21,22,23,24,25,26,27
weaponsOfDeathEnd weaponsOfDeathEnd
@@ -919,5 +919,10 @@ scrcodes
dta d"qrstuvwx" dta d"qrstuvwx"
dta d"yz123456" dta d"yz123456"
dta d"7890." ; "-" dta d"7890." ; "-"
;-----------------------------------
gameOverSpritesTop
; end of the Gover sprites by number of players
; 1 2 3 4 5 6
.by 130,130,136,142,148,154
.endif .endif
+77 -3
View File
@@ -60,13 +60,13 @@ price______________45 = 0
price______________46 = 0 price______________46 = 0
price______________47 = 0 price______________47 = 0
price_White_Flag_____ = $0 ;_48_($30) price_White_Flag_____ = $0 ;_48_($30)
price_Heat_Guidance__ = $ffff ;_49 price_Battery________ = 300 ;_49
price_Bal_Guidance___ = $ffff ;_50 price_Bal_Guidance___ = $ffff ;_50
price_Horz_Guidance__ = $ffff ;_51 price_Horz_Guidance__ = $ffff ;_51
price_Vert_Guidance__ = $ffff ;_52 price_Vert_Guidance__ = $ffff ;_52
price_Lazy_Boy_______ = $ffff ;_53 price_Lazy_Boy_______ = $ffff ;_53
price_Parachute______ = 234 ;_54 price_Parachute______ = 234 ;_54
price_Battery________ = $ffff ;_55 price_StrongParachute = 1000 ;_55
price_Mag_Deflector__ = 245 ;_56 price_Mag_Deflector__ = 245 ;_56
price_Shield_________ = 112 ;_57 price_Shield_________ = 112 ;_57
price_Force_Shield___ = 268 ;_58 price_Force_Shield___ = 268 ;_58
@@ -74,7 +74,72 @@ price_Heavy_Shield___ = 375 ;_59
price_Super_Mag______ = $ffff ;_60 price_Super_Mag______ = $ffff ;_60
price_Auto_Defense___ = 512 ;_61 price_Auto_Defense___ = 512 ;_61
price_Fuel_Tank______ = $ffff ;_62 price_Fuel_Tank______ = $ffff ;_62
price_Contact_Trigger = $ffff ;_63 price_Nuclear_Winter_ = 1000 ;_63
;Weapon indexes (numbers)
ind_Baby_Missile___ = 0
ind_Missile________ = 1
ind_Baby_Nuke______ = 2
ind_Nuke___________ = 3
ind_LeapFrog_______ = 4
ind_Funky_Bomb_____ = 5
ind_MIRV___________ = 6
ind_Death_s_Head___ = 7
ind_Napalm_________ = 8
ind_Hot_Napalm_____ = 9
ind_Tracer_________ = 10
ind_Smoke_Tracer___ = 11
ind_Baby_Roller____ = 12
ind_Roller_________ = 13
ind_Heavy_Roller___ = 14
ind_Riot_Charge____ = 15
ind_Riot_Blast_____ = 16
ind_Riot_Bomb______ = 17
ind_Heavy_Riot_Bomb = 18
ind_Baby_Digger____ = 19
ind_Digger_________ = 20
ind_Heavy_Digger___ = 21
ind_Baby_Sandhog___ = 22
ind_Sandhog________ = 23
ind_Heavy_Sandhog__ = 24
ind_Dirt_Clod______ = 25
ind_Dirt_Ball______ = 26
ind_Ton_of_Dirt____ = 27
ind_Liquid_Dirt____ = 28
ind_Dirt_Charge____ = 29
ind_Earth_Disrupter = 30
ind_Plasma_Blast___ = 31
ind_Laser__________ = 32
ind______________33 = 0
ind______________34 = 0
ind______________35 = 0
ind______________36 = 0
ind______________37 = 0
ind______________38 = 0
ind______________39 = 0
ind______________40 = 0
ind______________41 = 0
ind______________42 = 0
ind______________43 = 0
ind______________44 = 0
ind______________45 = 0
ind______________46 = 0
ind______________47 = 0
ind_White_Flag_____ = 48
ind_Battery________ = 49
ind_Bal_Guidance___ = 50
ind_Horz_Guidance__ = 51
ind_Vert_Guidance__ = 52
ind_Lazy_Boy_______ = 53
ind_Parachute______ = 54
ind_StrongParachute = 55
ind_Mag_Deflector__ = 56
ind_Shield_________ = 57
ind_Force_Shield___ = 58
ind_Heavy_Shield___ = 59
ind_Super_Mag______ = 60
ind_Auto_Defense___ = 61
ind_Fuel_Tank______ = 62
ind_Nuclear_Winter_ = 63
;-------------------------------- ;--------------------------------
; names of RMT instruments (sfx) ; names of RMT instruments (sfx)
;-------------------------------- ;--------------------------------
@@ -106,3 +171,12 @@ sfx_keyclick = $18 ;y
sfx_shoot = $19 ;z sfx_shoot = $19 ;z
sfx_seppuku = $1a ;1 sfx_seppuku = $1a ;1
sfx_liquid_dirt = $1b ;2 sfx_liquid_dirt = $1b ;2
sfx_battery = $1c ;3
sfx_white_flag = $1d ;4
;--------------------------------
; RMT songs (lines)
;--------------------------------
song_silencio = $00
song_end_round = $02
song_ingame = $06
song_game_over = $0b
+27 -12
View File
@@ -587,20 +587,20 @@ UnequalTanks
;------------------------------------------------- ;-------------------------------------------------
.proc drawtanks .proc drawtanks
;------------------------------------------------- ;-------------------------------------------------
lda tanknr lda TankNr
pha pha
ldx #$00 ldx #$00
stx tanknr stx TankNr
DrawNextTank DrawNextTank
jsr drawtanknr jsr drawtanknr
inc tanknr inc TankNr
ldx tanknr ldx TankNr
Cpx NumberOfPlayers Cpx NumberOfPlayers
bne DrawNextTank bne DrawNextTank
pla pla
sta tankNr sta TankNr
rts rts
.endp .endp
@@ -654,11 +654,11 @@ DrawTankNrX
rorw xbyte ; divide by 2 (carry does not matter) rorw xbyte ; divide by 2 (carry does not matter)
lda xbyte lda xbyte
clc clc
adc #$24 ; P/M to graphics offset adc #PMOffset+1 ; P/M to graphics offset
cpx #$4 ; 5th tank are joined missiles and offset is defferent cpx #$4 ; 5th tank are joined missiles and offset is defferent
bne NoMissile bne NoMissile
clc clc
adc #$0C adc #$0C ; missile offset offset
NoMissile NoMissile
sta hposp0,x sta hposp0,x
; vertical position ; vertical position
@@ -694,16 +694,18 @@ NoPlayerMissile
; draw defensive weapons like shield ( tank number in X ) ; draw defensive weapons like shield ( tank number in X )
; in xdraw, ydraw we have coordinates left LOWER corner of Tank char ; in xdraw, ydraw we have coordinates left LOWER corner of Tank char
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #57 ; one shot shield activation cmp #ind_Shield_________ ; one shot shield
beq ShieldDraw beq ShieldDraw
cmp #58 ; shield with energy and parachute activation cmp #ind_Force_Shield___ ; shield with energy and parachute
beq ShieldDraw beq ShieldDraw
cmp #59 ; shield with energy activation cmp #ind_Heavy_Shield___ ; shield with energy
beq ShieldDraw beq ShieldDraw
cmp #61 ; Auto Defence cmp #ind_Auto_Defense___ ; Auto Defence
beq DrawTankShieldWihHorns beq DrawTankShieldWihHorns
cmp #56 ; Mag Deflector cmp #ind_Mag_Deflector__ ; Mag Deflector
beq DrawTankShieldWihHorns beq DrawTankShieldWihHorns
cmp #ind_White_Flag_____ ; White Flag
beq DrawTankFlag
bne NoShieldDraw bne NoShieldDraw
ShieldDraw ShieldDraw
jsr DrawTankShield.DrawInPosition jsr DrawTankShield.DrawInPosition
@@ -714,6 +716,19 @@ DrawTankShieldWihHorns
jsr DrawTankShield.DrawInPosition jsr DrawTankShield.DrawInPosition
jsr DrawTankShieldHorns jsr DrawTankShieldHorns
rts rts
DrawTankFlag
lda #$5E ; flag symbol
sta CharCode
lda Ytankstable,x
sec
sbc #8
sta ydraw
lda XtanksTableL,x
sta xdraw
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
rts
.endp .endp
; ------------------------------------- ; -------------------------------------
+64 -46
View File
@@ -36,7 +36,7 @@
;we decided it must go in 'English' to let other people work on it ;we decided it must go in 'English' to let other people work on it
.macro build .macro build
dta d"144" ; number of this build (3 bytes) dta d"145" ; number of this build (3 bytes)
.endm .endm
icl 'definitions.asm' icl 'definitions.asm'
@@ -136,17 +136,6 @@ START
jsr RandomizeSequence jsr RandomizeSequence
; for the round #1 shooting sequence is random ; for the round #1 shooting sequence is random
; activate mag deflector for all players (test)
; ldx numberOfPlayers
; dex
;@
; mva #56 ActiveDefenceWeapon,x
; tay
; lda DefensiveEnergy,y
; sta ShieldEnergy,x ; set energy of shield
; dex
; bpl @-
; mag deflector activated! (test)
MainGameLoop MainGameLoop
jsr CallPurchaseForEveryTank jsr CallPurchaseForEveryTank
@@ -178,7 +167,8 @@ MainGameLoop
; Results are number of other deaths ; Results are number of other deaths
; before the player dies itself ; before the player dies itself
lda #song_end_round
jsr RmtSongSelect
jsr DisplayResults jsr DisplayResults
;check demo mode ;check demo mode
@@ -251,6 +241,7 @@ skipzeroing
inc CurrentRoundNr inc CurrentRoundNr
mva #0 dmactl ; issue #72 mva #0 dmactl ; issue #72
jsr RmtSongSelect
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
jmp MainGameLoop jmp MainGameLoop
@@ -265,6 +256,9 @@ skipzeroing
; the shooting angle is randomized ; the shooting angle is randomized
; of course gains an looses are zeroed ; of course gains an looses are zeroed
lda #song_ingame
jsr RmtSongSelect
lda #0 lda #0
tax tax
@ sta singleRoundVars,x @ sta singleRoundVars,x
@@ -313,12 +307,13 @@ SettingEnergies
;jsr calculatemountains0 ;only for tests - makes mountains flat and 0 height ;jsr calculatemountains0 ;only for tests - makes mountains flat and 0 height
jsr SetMainScreen jsr SetMainScreen
jsr ColorsOfSprites
jsr drawmountains ;draw them jsr drawmountains ;draw them
jsr drawtanks ;finally draw tanks jsr drawtanks ;finally draw tanks
mva #0 TankSequencePointer mva #0 TankSequencePointer
;--------------------round screen is ready--------- ;---------round screen is ready---------
rts rts
.endp .endp
@@ -424,6 +419,22 @@ ManualShooting
seq:rts seq:rts
AfterManualShooting AfterManualShooting
; defensive weapons without flight handling
ldx TankNr
lda ActiveDefenceWeapon,x
cmp #ind_White_Flag_____ ; White Flag
beq ShootWhiteFlag
cmp #ind_Nuclear_Winter_
bne StandardShoot
ShootAtomicWinter
; --- nuclear winter ---
jsr NuclearWinter
jmp NextPlayerShoots ; and we skip shoot
ShootWhiteFlag
; --- white flag ---
jsr WhiteFlag
jmp NextPlayerShoots ; and we skip shoot
StandardShoot
inc noDeathCounter inc noDeathCounter
jsr DecreaseWeaponBeforeShoot jsr DecreaseWeaponBeforeShoot
@@ -464,14 +475,12 @@ AfterExplode
@ @
;temporary tanks removal (would fall down with soil) ;temporary tanks removal (would fall down with soil)
mva TankNr tempor2
mva #1 Erase mva #1 Erase
jsr drawtanks jsr drawtanks
mva tempor2 TankNr
mva #0 Erase mva #0 Erase
lda FallDown2 lda FallDown2
beq NoFallDown2 beq NoFallDown2
jsr SoilDown2; jsr SoilDown2
NoFallDown2 NoFallDown2
;here tanks are falling down ;here tanks are falling down
@@ -779,6 +788,20 @@ NotNegativeShieldEnergy
:8 sta hposp0+# :8 sta hposp0+#
rts rts
.endp .endp
;--------------------------------------------------
.proc ColorsOfSprites
lda TankColoursTable ; colours of sprites under tanks
sta COLPM0S
lda TankColoursTable+1
sta COLPM1S
lda TankColoursTable+2
sta COLPM2S
lda TankColoursTable+3
sta COLPM3S
LDA TankColoursTable+4
STA COLPF3S ; joined missiles (5th tank)
rts
.endp
;-------------------------------------------------- ;--------------------------------------------------
.proc WeaponCleanup; .proc WeaponCleanup;
@@ -865,18 +888,6 @@ SetunPlots
lda #$10 ; P/M priorities (bit 4 joins missiles) lda #$10 ; P/M priorities (bit 4 joins missiles)
sta gtictls sta gtictls
jsr PMoutofScreen jsr PMoutofScreen
lda TankColoursTable ; temporary colours of sprites under tanks
sta COLPM0S
lda TankColoursTable+1
sta COLPM1S
lda TankColoursTable+2
sta COLPM2S
lda TankColoursTable+3
sta COLPM3S
LDA TankColoursTable+4
STA COLPF3S ; joined missiles (5th tank)
mva #0 hscrol
;let the tanks be visible! ;let the tanks be visible!
ldx #(maxPlayers-1) ldx #(maxPlayers-1)
@@ -905,16 +916,14 @@ ClearResults
lda #$ff ;initial value lda #$ff ;initial value
sta sfx_effect sta sfx_effect
; ;
ldx #<MODUL ;low byte of RMT module to X reg lda #0
ldy #>MODUL ;hi byte of RMT module to Y reg jsr RmtSongSelect
lda #0 ;starting song line 0-255 to A reg
jsr RASTERMUSICTRACKER ;Init
; ;
VMAIN VBLinterrupt,6 ;jsr SetVBL VMAIN VBLinterrupt,6 ;jsr SetVBL
rts rts
.endp .endp
;--------------------------------------------------
.proc DLIinterruptGraph .proc DLIinterruptGraph
;sta dliA ;sta dliA
;sty dliY ;sty dliY
@@ -935,7 +944,7 @@ ClearResults
pla pla
rti rti
.endp .endp
;--------------------------------------------------
.proc DLIinterruptText .proc DLIinterruptText
;sta dliA ;sta dliA
pha pha
@@ -947,7 +956,7 @@ ClearResults
DLIinterruptNone DLIinterruptNone
rti rti
.endp .endp
;--------------------------------------------------
.proc VBLinterrupt .proc VBLinterrupt
pha pha
phx phx
@@ -968,14 +977,16 @@ itsPAL
; pressTimer is trigger tick counter. always 50 ticks / s ; pressTimer is trigger tick counter. always 50 ticks / s
bit:smi:inc pressTimer ; timer halted if >127. max time measured 2.5 s bit:smi:inc pressTimer ; timer halted if >127. max time measured 2.5 s
; ------- RMT ------- ; ------- RMT -------
lda sfx_effect lda sfx_effect
bmi lab2 bmi lab2
asl @ ; * 2 asl @ ; * 2
tay ;Y = 2,4,..,16 instrument number * 2 (0,2,4,..,126) tay ;Y = 2,4,..,16 instrument number * 2 (0,2,4,..,126)
ldx #0 ;X = 0 channel (0..3 or 0..7 for stereo module) ldx #0 ;X = 0 channel (0..3 or 0..7 for stereo module)
lda #0 ;A = 12 note (0..60) lda #0 ;A = 0 note (0..60)
jsr RASTERMUSICTRACKER+15 ;RMT_SFX start tone (It works only if FEAT_SFX is enabled !!!) bit noSfx
smi:jsr RASTERMUSICTRACKER+15 ;RMT_SFX start tone (It works only if FEAT_SFX is enabled !!!)
lda #$ff lda #$ff
sta sfx_effect ;reinit value sta sfx_effect ;reinit value
@@ -999,9 +1010,7 @@ exitVBL
bne @- bne @-
rts rts
.endp .endp
;--------------------------------------------------
.proc RandomizeSequence .proc RandomizeSequence
; in: NumberOfPlayers ; in: NumberOfPlayers
; out: TankSequence ; out: TankSequence
@@ -1119,7 +1128,6 @@ LimitForce
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc MoveBarrelToNewPosition .proc MoveBarrelToNewPosition
jsr DrawTankNr jsr DrawTankNr
@@ -1283,9 +1291,8 @@ notpressedJoyGetKey
getkeyend getkeyend
mvx #sfx_keyclick sfx_effect mvx #sfx_keyclick sfx_effect
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc getkeynowait .proc getkeynowait
;-------------------------------------------------- ;--------------------------------------------------
@@ -1294,6 +1301,7 @@ getkeyend
and #$3f ;CTRL and SHIFT ellimination and #$3f ;CTRL and SHIFT ellimination
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc WaitForKeyRelease .proc WaitForKeyRelease
;-------------------------------------------------- ;--------------------------------------------------
@@ -1309,7 +1317,16 @@ getkeyend
rts rts
.endp .endp
;--------------------------------------------------
.proc RmtSongSelect
;--------------------------------------------------
; starting song line 0-255 to A reg
bit noMusic
spl:lda #song_silencio
ldx #<MODUL ;low byte of RMT module to X reg
ldy #>MODUL ;hi byte of RMT module to Y reg
jmp RASTERMUSICTRACKER ;Init, :RTS
.endp
;---------------------------------------------- ;----------------------------------------------
icl 'weapons.asm' icl 'weapons.asm'
;---------------------------------------------- ;----------------------------------------------
@@ -1331,6 +1348,7 @@ TankFont
;---------------------------------------------- ;----------------------------------------------
icl 'variables.asm' icl 'variables.asm'
;---------------------------------------------- ;----------------------------------------------
; reserved space for RMT player ; reserved space for RMT player
.ds $0320 .ds $0320
.align $100 .align $100
@@ -1339,7 +1357,7 @@ TankFont
MODUL equ $b000 ;address of RMT module MODUL equ $b000 ;address of RMT module
opt h- ;RMT module is standard Atari binary file already opt h- ;RMT module is standard Atari binary file already
ins "artwork/sfx/scorch_trial0e_stripped.rmt" ;include music RMT module ins "artwork/sfx/scorch_trial0f_stripped.rmt" ;include music RMT module
opt h+ opt h+
; ;
; ;
BIN
View File
Binary file not shown.
+76 -16
View File
@@ -287,8 +287,8 @@ AfterPurchase
; is being processed now ; is being processed now
mwa #ListOfWeapons xbyte mwa #ListOfWeapons xbyte
ldx #$00 ; index of the checked weapon ldx #$00 ; index of the checked weapon
stx HowManyOnTheList1 ; amounts of weapons (shells, bullets) in both lists stx HowManyOnTheListOff ; amounts of weapons (shells, bullets) in both lists
stx HowManyOnTheList2 stx HowManyOnTheListDef
; Creating full list of the available weapons for displaying ; Creating full list of the available weapons for displaying
; in X there is an index of the weapon to be checked, ; in X there is an index of the weapon to be checked,
@@ -437,25 +437,25 @@ notInventory
bne NotTheSameAsLastTime bne NotTheSameAsLastTime
lda WhichList lda WhichList
bne @+ bne @+
lda HowManyOnTheList1 lda HowManyOnTheListOff
sta PositionOnTheList sta PositionOnTheList
jmp NotTheSameAsLastTime jmp NotTheSameAsLastTime
@ @
lda HowManyOnTheList2 lda HowManyOnTheListDef
sta PositionOnTheList sta PositionOnTheList
NotTheSameAsLastTime NotTheSameAsLastTime
; increase appropriate counter ; increase appropriate counter
txa txa
cpx #$30 cpx #$30
bcs DefenceList bcs DefenceList
ldy HowManyOnTheList1 ldy HowManyOnTheListOff
sta IndexesOfWeaponsL1,y sta IndexesOfWeaponsL1,y
inc HowManyOnTheList1 inc HowManyOnTheListOff
bne NextLineOfTheList bne NextLineOfTheList
DefenceList DefenceList
ldy HowManyOnTheList2 ldy HowManyOnTheListDef
sta IndexesOfWeaponsL2,y sta IndexesOfWeaponsL2,y
inc HowManyOnTheList2 inc HowManyOnTheListDef
; If everything is copied then next line ; If everything is copied then next line
NextLineOfTheList NextLineOfTheList
adw xbyte #40 adw xbyte #40
@@ -491,7 +491,7 @@ WeHaveOffset
; of the first erased char. ; of the first erased char.
; (multiplying taken from book of Ruszczyc 'Assembler 6502' ; (multiplying taken from book of Ruszczyc 'Assembler 6502'
lda HowManyOnTheList1 lda HowManyOnTheListOff
sta xbyte+1 ; multiplier (temporarily here, it will be erased anyway) sta xbyte+1 ; multiplier (temporarily here, it will be erased anyway)
lda #$00 ; higher byte of the Result lda #$00 ; higher byte of the Result
sta xbyte ; lower byte of the Result sta xbyte ; lower byte of the Result
@@ -534,7 +534,7 @@ DoNotIncHigher1
; Multiply number on list 1 by 40 and set address ; Multiply number on list 1 by 40 and set address
; of the first erased char. ; of the first erased char.
lda HowManyOnTheList2 lda HowManyOnTheListDef
sta xbyte+1 ; multiplier sta xbyte+1 ; multiplier
lda #$00 ; higher byte of the Result lda #$00 ; higher byte of the Result
sta xbyte ; lower byte of the Result sta xbyte ; lower byte of the Result
@@ -658,17 +658,17 @@ PurchaseKeyDown
lda WhichList lda WhichList
beq GoDown1 beq GoDown1
inc:lda PositionOnTheList inc:lda PositionOnTheList
cmp HowManyOnTheList2 cmp HowManyOnTheListDef
bne EndGoDownX bne EndGoDownX
ldy HowManyOnTheList2 ldy HowManyOnTheListDef
dey dey
sty PositionOnTheList sty PositionOnTheList
jmp ChoosingItemForPurchase jmp ChoosingItemForPurchase
GoDown1 GoDown1
inc:lda PositionOnTheList inc:lda PositionOnTheList
cmp HowManyOnTheList1 cmp HowManyOnTheListOff
bne MakeOffsetDown bne MakeOffsetDown
ldy HowManyOnTheList1 ldy HowManyOnTheListOff
dey dey
sty PositionOnTheList sty PositionOnTheList
MakeOffsetDown MakeOffsetDown
@@ -785,7 +785,26 @@ invSelectDef
lda IndexesOfWeaponsL2,y lda IndexesOfWeaponsL2,y
tay tay
ldx tankNr ldx tankNr
cmp #ind_Battery________
bne NotBattery
; if activate battery, we do it differently
mva #sfx_battery sfx_effect
mva #99 Energy,x
bne DecreaseDefensive ; bypass activation
NotBattery
cmp #ind_White_Flag_____
bne NotWhiteFlag
cmp ActiveDefenceWeapon,x
bne NoDeactivateWhiteFlag
mva #sfx_white_flag sfx_effect
lda #$00 ; if try to activate activated White Flag then deactivate Defence
sta ActiveDefenceWeapon,x sta ActiveDefenceWeapon,x
sta ShieldEnergy,x
beq DefActivationEnd
NotWhiteFlag
NoDeactivateWhiteFlag
sta ActiveDefenceWeapon,x
DecreaseDefensive
; decrease number of defensives ; decrease number of defensives
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
sta weaponPointer sta weaponPointer
@@ -798,6 +817,7 @@ invSelectDef
lda DefensiveEnergy,y lda DefensiveEnergy,y
sta ShieldEnergy,x sta ShieldEnergy,x
DefActivationEnd
jmp WaitForKeyRelease ; rts jmp WaitForKeyRelease ; rts
.endp .endp
@@ -819,6 +839,8 @@ invSelectDef
?noWeaponActive ?noWeaponActive
ldy #0 ldy #0
?weaponFound ?weaponFound
cpy howManyOnTheListDef
bcs ?noWeaponActive
sty positionOnTheList sty positionOnTheList
rts rts
.endp .endp
@@ -840,6 +862,8 @@ invSelectDef
?noWeaponActive ?noWeaponActive
ldy #0 ldy #0
?weaponFound ?weaponFound
cpy howManyOnTheListOff
bcs ?noWeaponActive
sty positionOnTheList sty positionOnTheList
rts rts
.endp .endp
@@ -916,7 +940,7 @@ NoArrowUp
stx MoreUpdl stx MoreUpdl
sty MoreUpdl+1 sty MoreUpdl+1
; the same, bu scrolling down ; the same, bu scrolling down
lda HowManyOnTheList1 lda HowManyOnTheListOff
ldx #<EmptyLine ldx #<EmptyLine
ldy #>EmptyLine ldy #>EmptyLine
sec sec
@@ -1578,8 +1602,9 @@ quit_seppuku
.proc DisplayResults ; .proc DisplayResults ;
;displays results of the round ;displays results of the round
;using 4x4 font ;using 4x4 font
jsr RoundOverSprites
mva #sfx_smoke_cloud sfx_effect
mva #1 plot4x4color mva #1 plot4x4color
;centering the result screen ;centering the result screen
@@ -1609,6 +1634,8 @@ quit_seppuku
beq @+ ;unconditional jump, because TypeLine4x4 ends with beq beq @+ ;unconditional jump, because TypeLine4x4 ends with beq
GameOver4x4 GameOver4x4
lda #song_game_over
jsr RmtSongSelect
mwa #LineGameOver LineAddress4x4 mwa #LineGameOver LineAddress4x4
mwa #((ScreenWidth/2)-(8*4)) LineXdraw mwa #((ScreenWidth/2)-(8*4)) LineXdraw
mva ResultY LineYdraw mva ResultY LineYdraw
@@ -1965,5 +1992,38 @@ NextChar02
rts rts
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
.proc RoundOverSprites
; fill sprites with bytes
ldy numberOfPlayers
dey
lda gameOverSpritesTop,y
sta temp
; clean the whole sprite
lda #0
tax
@ sta PMGraph+$400,x
sta PMGraph+$500,x
dex
bne @-
; set background
lda #$ff
ldx #100 ; top of the sprites
@ sta PMGraph+$400,x
sta PMGraph+$500,x
inx
cpx temp
bne @-
GOSbeg = 112
mva #GOSbeg hposp0
mva #GOSbeg+12 hposp0+1
mva #15 COLPM0S
sta COLPM1S
rts
.endp
;-------------------------------------------------
.endif .endif
+4 -2
View File
@@ -19,6 +19,8 @@ seppukuVal .by 75
skilltable ; computer controlled players' skills (1-8), 0 - human (no cleaning, ticket #30) skilltable ; computer controlled players' skills (1-8), 0 - human (no cleaning, ticket #30)
.DS [MaxPlayers] .DS [MaxPlayers]
;---------------------------------------------------- ;----------------------------------------------------
noMusic .by 0 ; 0 - play music, $ff - do not play music
noSfx .by 0 ; 0 - play SFX, $ff - do not play SFX
; 4x4 text buffer ; 4x4 text buffer
ResultLineBuffer ResultLineBuffer
dta d" ", $ff dta d" ", $ff
@@ -256,9 +258,9 @@ IndexesOfWeaponsL2
; variables storing amount of weapons on the first and second ; variables storing amount of weapons on the first and second
; list and pointer position ; list and pointer position
HowManyOnTheList1 HowManyOnTheListOff
.DS 1 .DS 1
HowManyOnTheList2 HowManyOnTheListDef
.DS 1 .DS 1
PositionOnTheList ; pointer position on the list being displayed PositionOnTheList ; pointer position on the list being displayed
.DS 1 .DS 1
+186 -47
View File
@@ -33,7 +33,7 @@ ExplosionRoutines
.word VOID-1 ;napalm .word VOID-1 ;napalm
.word VOID-1 ;hotnapalm .word VOID-1 ;hotnapalm
.word tracer-1 .word tracer-1
.word VOID-1 ;smoketracer .word tracer-1 ;smoketracer
.word babyroller-1 .word babyroller-1
.word roller-1 .word roller-1
.word heavyroller-1 .word heavyroller-1
@@ -57,6 +57,7 @@ ExplosionRoutines
.word laser-1 .word laser-1
VOID VOID
tracer
rts rts
.endp .endp
; ------------------------ ; ------------------------
@@ -264,10 +265,6 @@ NoLowerCircle
rts rts
.endp .endp
; ------------------------ ; ------------------------
.proc tracer
rts
.endp
; ------------------------
.proc babyroller .proc babyroller
inc FallDown2 inc FallDown2
mva #11 ExplosionRadius mva #11 ExplosionRadius
@@ -656,15 +653,15 @@ DistanceCheckLoop
tay tay
; check shields ; check shields
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #57 ; one hit shield cmp #ind_Shield_________ ; one hit shield
beq UseShield beq UseShield
cmp #58 ; shield with energy and parachute cmp #ind_Force_Shield___ ; shield with energy and parachute
beq UseShieldWithEnergy beq UseShieldWithEnergy
cmp #59 ; shield with energy cmp #ind_Heavy_Shield___ ; shield with energy
beq UseShieldWithEnergy beq UseShieldWithEnergy
cmp #61 ; Auto Defence (it works only if hit ground next to tank. Tank hit is handled in Flight proc) cmp #ind_Auto_Defense___ ; Auto Defence (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
beq UseShieldWithEnergy beq UseShieldWithEnergy
cmp #56 ; Mag deflector (it works only if hit ground next to tank. Tank hit is handled in Flight proc) cmp #ind_Mag_Deflector__ ; Mag deflector (it works only if hit ground next to tank. Tank hit is handled in Flight proc)
beq UseShieldWithEnergy beq UseShieldWithEnergy
jsr DecreaseEnergyX jsr DecreaseEnergyX
jmp EndOfDistanceCheckLoop jmp EndOfDistanceCheckLoop
@@ -1046,6 +1043,11 @@ notpressed
cmp #$0d ; I cmp #$0d ; I
bne @+ bne @+
callInventory callInventory
; Hide all tanks - after inventory they may have other shapes
mva #1 Erase
jsr DrawTanks
mva #0 Erase
;
mva #$ff isInventory mva #$ff isInventory
jsr Purchase jsr Purchase
mva #0 escFlag mva #0 escFlag
@@ -1076,6 +1078,10 @@ jumpFromStick
jeq pressedSpace jeq pressedSpace
cmp #$2c cmp #$2c
jeq pressedTAB jeq pressedTAB
cmp #$25 ; M
jeq pressedM
cmp #$3e ; S
jeq pressedS
jmp notpressed jmp notpressed
checkJoy checkJoy
;------------JOY------------- ;------------JOY-------------
@@ -1233,6 +1239,22 @@ CTRLpressedTAB
jsr WaitForKeyRelease jsr WaitForKeyRelease
jmp BeforeFire jmp BeforeFire
pressedM
; have you tried turning the music off and on again?
lda #$ff
eor:sta noMusic
lda #song_ingame
jsr RmtSongSelect
jsr WaitForKeyRelease
jmp BeforeFire
pressedS
; have you tried turning sfx off and on again?
lda #$ff
eor:sta noSfx
jsr WaitForKeyRelease
jmp BeforeFire
pressedSpace pressedSpace
;================================= ;=================================
@@ -1241,7 +1263,7 @@ pressedSpace
jsr WaitForKeyRelease jsr WaitForKeyRelease
lda pressTimer lda pressTimer
cmp #25 ; 1/2s cmp #25 ; 1/2s
bcs fire bcc fire
jmp callInventory jmp callInventory
fire fire
RTS RTS
@@ -1272,7 +1294,7 @@ RandomizeOffensiveText
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #$20 ; laser cmp #ind_Laser__________ ; laser
bne NotStrongShoot bne NotStrongShoot
mva #0 color mva #0 color
lda #7 lda #7
@@ -1345,9 +1367,11 @@ ShotUnderGround
; let's check if the given tank has got the parachute ; let's check if the given tank has got the parachute
ldx TankNr ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #54 ; parachute cmp #ind_Parachute______ ; parachute
beq ParachuteActive beq ParachuteActive
cmp #58 ; scheld witch energy and parachute cmp #ind_StrongParachute ; strong parachute
beq ParachuteActive
cmp #ind_Force_Shield___ ; shield witch energy and parachute
bne TankFallsX bne TankFallsX
ParachuteActive ParachuteActive
inc Parachute inc Parachute
@@ -1417,6 +1441,44 @@ ItStillFalls
FallDiagonally FallDiagonally
NoFallingDown NoFallingDown
ParachutePresent ParachutePresent
; check parachute type
lda ActiveDefenceWeapon,x
cmp #ind_StrongParachute ; strong parachute
bne OneTimeParachute
; decreasing energy of parachute - if the vertical fall, substract 2
; and if at an angle then substract 1
ldy #1 ; how much energy to substract
lda IfFallDown
and #1
beq NoFallingDown2
ldx TankNr
jsr DecreaseShieldEnergyX
cpy #0 ; is necessary to reduce tenk energy ?
beq @+
jsr DecreaseEnergyX
@
ldy #1
lda IfFallDown
and #6
bne FallDiagonally2
ldx TankNr
jsr DecreaseShieldEnergyX
cpy #0 ; is necessary to reduce tenk energy ?
beq @+
jsr DecreaseEnergyX
@
; check energy of parachute
lda ShieldEnergy,x
bne OneTimeParachute
mva #0 Parachute
mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute)
; and now we must clear parachute symbol
mva #1 Erase
jsr DrawTankParachute
FallDiagonally2
NoFallingDown2
OneTimeParachute
; we must set flag meaning that the tank was falling down ; we must set flag meaning that the tank was falling down
; because later maybe the number of parachutes will decrease ; because later maybe the number of parachutes will decrease
; (if there were parachutes and they were ON) ; (if there were parachutes and they were ON)
@@ -1424,7 +1486,7 @@ ParachutePresent
lda Parachute lda Parachute
ora #2 ; we set bit nr 1 (nr 0 means that parachute is present) ora #2 ; we set bit nr 1 (nr 0 means that parachute is present)
sta Parachute sta Parachute
testowanie
; storing last direction of falling ; storing last direction of falling
; (it is not necessarily the direction from the previous ; (it is not necessarily the direction from the previous
; iteraction, so we must check directional bits before storing) ; iteraction, so we must check directional bits before storing)
@@ -1472,17 +1534,7 @@ NotRightEdge
beq DoNotClearParachute beq DoNotClearParachute
; here we clear the parachute ; here we clear the parachute
ldx TankNr ldx TankNr
lda #$34 jsr DrawTankParachute
sta CharCode
lda Ytankstable,x
sec
sbc #8
sta ydraw
lda XtanksTableL,x
sta xdraw
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
DoNotClearParachute DoNotClearParachute
mva #0 Erase mva #0 Erase
ldx TankNr ldx TankNr
@@ -1525,17 +1577,7 @@ DoesNotFallRight
; here we draw parachute ; here we draw parachute
ldx TankNr ldx TankNr
lda #$34 jsr DrawTankParachute
sta CharCode
lda Ytankstable,x
sec
sbc #8
sta ydraw
lda XtanksTableL,x
sta xdraw
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
DoNotDrawParachute DoNotDrawParachute
lda EndOfTheFallFlag lda EndOfTheFallFlag
jeq TankFallsX jeq TankFallsX
@@ -1552,11 +1594,24 @@ EndOfFall
mva #1 Erase mva #1 Erase
ldx TankNr ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #54 ; deactivate weapon only if parachute (53) cmp #ind_Parachute______ ; deactivate weapon only if parachute (54)
bne NoParachuteWeapon bne NoParachuteWeapon
mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute) mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute)
NoParachuteWeapon NoParachuteWeapon
lda #$34 jsr DrawTankParachute
mva #0 Erase
ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
ThereWasNoParachute
mva #sfx_silencer sfx_effect
rts
.endp
;--------------------------------------------------
.proc DrawTankParachute
;Tank number in X
;--------------------------------------------------
lda #$34 ; parachute symbol
sta CharCode sta CharCode
lda Ytankstable,x lda Ytankstable,x
sec sec
@@ -1567,14 +1622,8 @@ NoParachuteWeapon
lda XtanksTableH,x lda XtanksTableH,x
sta xdraw+1 sta xdraw+1
jsr TypeChar jsr TypeChar
mva #0 Erase
ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
ThereWasNoParachute
mva #sfx_silencer sfx_effect
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc Flight ; Force(byte.byte), Wind(0.word) .proc Flight ; Force(byte.byte), Wind(0.word)
; Angle(byte) 128=0, 255=maxright, 0=maxleft ; Angle(byte) 128=0, 255=maxright, 0=maxleft
@@ -1858,9 +1907,9 @@ EndOfFlight2
tax tax
dex ; index of tank in X dex ; index of tank in X
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #61 ; Auto Defence cmp #ind_Auto_Defense___ ; Auto Defence
beq AutoDefence beq AutoDefence
cmp #56 ; Mag Deflector cmp #ind_Mag_Deflector__ ; Mag Deflector
bne NoDefence bne NoDefence
MagDeflector MagDeflector
; now run defensive-aggressive weapon - Mag Deflector! ; now run defensive-aggressive weapon - Mag Deflector!
@@ -2290,6 +2339,96 @@ MIRValreadyAll
rts rts
.endp .endp
; -------------------------------------------------
.proc WhiteFlag
; -------------------------------------------------
; This routine is run from inside of the main loop
; and replaces Shoot and Flight routines
; X and TankNr - index of shooting tank
; -------------------------------------------------
mva #sfx_death_begin sfx_effect
jsr FlashTank ; first we flash tank
mva #1 Erase
jsr DrawTankNr ; and erase tank
mva #0 Erase
ldx TankNr
sta Energy,x ; clear tank energy
sta eXistenZ,x ; erase from existence
sta LASTeXistenZ,x ; to prevent explosion
sta ActiveDefenceWeapon,x ; deactivate White Flag
jsr PMoutofScreen
jsr drawtanks ; for restore PM
mva #sfx_silencer sfx_effect
rts
.endp
; -------------------------------------------------
.proc NuclearWinter
; -------------------------------------------------
; This routine is run from inside of the main loop
; and replaces Shoot and Flight routines
; X and TankNr - index of shooting tank
; -------------------------------------------------
mva #sfx_sandhog sfx_effect
ldy #0 ; byte counter (from 0 to 39)
NextColumn
; big loop - we repat internal loops for each column of bytes
sty magic
ldx #120 ; line counter (from 0 to 60 )
; first loop - inverse column of bytes for a while
ldy magic
NextLine1
jsr InverseScreenByte
dex
dex
bpl NextLine1
;
wait ; wait uses A and Y
; second loop - inverse again and put random "snow" to column of bytes
ldx #120
ldy magic
mva #$55 magic+1
NextLine2
jsr InverseScreenByte
lda random
ora magic+1
and (temp),y
sta (temp),y
lda magic+1
eor #$ff
sta magic+1
dex
dex
bpl NextLine2
; and go to next column
iny
cpy #40
bne NextColumn
; and we have "snow" :)
lda #0
ldx TankNr
sta ActiveDefenceWeapon,x ; deactivate Nuclear Winter
sta RangeLeft ; whole screen in range of soil down
sta RangeLeft+1
mwa #screenwidth RangeRight
jsr SoilDown2
jsr drawtanks ; for restore PM
rts
; in order to optimize the fragment repeated in both internal loops
; we save 15 bytes :)
InverseScreenByte
lda LineTableL,x
sta temp
lda LineTableH,x
sta temp+1
lda (temp),y
eor #$ff
sta (temp),y
rts
.endp
; ------------------------------------------------- ; -------------------------------------------------
.proc CheckCollisionWithTank .proc CheckCollisionWithTank
; ------------------------------------------------- ; -------------------------------------------------