Compare commits

..

69 Commits

Author SHA1 Message Date
Pirx 34f0bb9d49 Merge pull request #113 from pkali/develop
build 148
2022-07-17 22:05:47 -04:00
Pirx f05af218f4 build 148 2022-07-17 22:04:58 -04:00
Pecusx 00b9575bcb Besto of the best laser
And code ordering.
2022-07-17 12:42:54 +02:00
Pecusx 738faec7e2 Better laser timing 2022-07-16 21:10:45 +02:00
Pecusx 6b0d8aa287 Great Laser. #110 2022-07-16 20:15:18 +02:00
Pecusx bc0148eb0f Fix for last fix :) 2022-07-16 14:52:45 +02:00
Pecusx 25dfe09a9d Real fix for rollers bug. 2022-07-16 14:44:12 +02:00
Pecusx 9e695f8fcd Rollers bug (blast radius at right edge of the screen) 2022-07-16 00:40:41 +02:00
Pecusx 12150a47c1 Slight graphic glitches when switching screens. 2022-07-15 10:18:57 +02:00
Pirx b12ad5efed new colors try 2022-07-14 20:35:30 -04:00
Pirx 1b2988069f results sprite fix 2022-07-13 22:59:58 -04:00
Pecusx 99d08367c4 PM code optimisation 2022-07-14 00:13:36 +02:00
Pirx 9acada4e9f FOX PLOTS FASTER 2022-07-13 17:18:34 -04:00
Pirx 85fac6e6cf Merge pull request #109 from pfusik/opt-plot
Optimize plot and point
2022-07-13 17:07:04 -04:00
Pecusx 9806613f2f New PMG for 6 colored tanks
but colors not set to new scheme.
2022-07-13 22:53:54 +02:00
Piotr Fusik af797029f9 Optimize plot and point 2022-07-13 17:58:04 +02:00
Pecusx 9ece051472 IA code optimisation
and "better" shields shapes.
2022-07-13 09:06:37 +02:00
Pecusx 6868eb8626 Better Shooter strategy
Poolshark and Tosser no longer cheat :)
2022-07-11 21:43:07 +02:00
Pecusx e94a356e6d Auto Defence angle fix 2022-07-11 18:26:59 +02:00
Pirx 93b16bd55a Merge pull request #108 from pkali/develop
build 147
2022-07-10 21:14:18 -04:00
Pirx 752b84ae2e version updt 2022-07-10 21:13:18 -04:00
Pirx d751379361 README updt 2022-07-10 21:12:00 -04:00
Pirx 01d941b013 dynamic angle #75 2022-07-10 20:45:08 -04:00
Pirx b63b7a3fb1 tank names for robots #107 2022-07-10 13:17:56 -04:00
Pirx c28d243719 improved mountains heights #86 2022-07-10 12:00:53 -04:00
Pirx 51975ccfbf first cheap attempt mountains heights #86 2022-07-09 22:35:12 -04:00
Pirx 541a7566cb tank names on gfx screen when aiming #107 2022-07-09 21:42:30 -04:00
Pirx 48bfd3824d zero page loading elimination 2022-07-09 08:31:48 -04:00
Pecusx e307f1a14a "New" shape of Force Shield 2022-07-07 20:04:32 +02:00
Pecusx 2fecc8d630 Different shape of Heavy Shield 2022-07-07 19:52:30 +02:00
Pecusx 1998c98784 Leap Frog and Funky Bobmb explosion range 2022-07-07 18:32:31 +02:00
Pecusx 4dc9b4ebb0 Havy and Force Shields swap (for better AI) 2022-07-06 20:55:22 +02:00
Pecusx 8e60cfa723 Better Napalms range calculation 2022-07-06 20:43:24 +02:00
Pecusx 9ee021b1f5 Small Soildown oprimization 2022-07-06 18:21:52 +02:00
Pecusx d738e6a6e8 Small optimisation 2022-07-05 21:16:22 +02:00
Pecusx d0838fa163 Statusbar display improvements - robo-tanks. 2022-07-05 15:02:52 +02:00
Pecusx a353e3bdb9 Better display of robo-tanks names 2022-07-05 14:30:40 +02:00
Pecusx 5933b00153 AI tanks display live angle changes. 2022-07-05 13:26:10 +02:00
Pecusx a5add9d9c4 Old way of displaying angle #105 2022-07-05 13:09:29 +02:00
Pecusx f2c7b9c5a5 Napalm for AI
now with xex :)
2022-07-05 10:22:59 +02:00
Pecusx e87d875467 Revert "Napalm for AI"
This reverts commit 876ea45eaf.
2022-07-05 10:21:19 +02:00
Pecusx 876ea45eaf Napalm for AI 2022-07-05 10:20:25 +02:00
Pecusx b164a79fd4 Napalm and Hot Napalm are working!
And they have new prices.
2022-07-05 09:36:50 +02:00
Pecusx 0984aee64f Napalm and Hot Napalm added
... but something is wrong
2022-07-04 21:25:57 +02:00
Pecusx 51c257c8e8 Better Napalm flames (test)
And AI cosmetics
2022-07-04 14:49:44 +02:00
Pecusx af4eb201b2 Second Napalm test
Only display and clear from screen.
2022-07-04 14:14:23 +02:00
Pecusx 85d0fb4778 First Napalm test
Display test only!
2022-07-04 13:09:07 +02:00
Pecusx 0a7c76f74a Napalm characters (test) 2022-07-04 08:36:45 +02:00
Pirx 6d5f83195f typo 2022-07-03 23:45:40 -04:00
Pirx acd3a6abe6 Merge pull request #101 from pkali/develop
build 146
2022-07-03 23:36:12 -04:00
Pirx bb70b2495a buld 146 2022-07-03 23:35:06 -04:00
Pirx 39433a8cf4 tosser upgr and deathshead fix 2022-07-03 22:35:47 -04:00
Pirx 1765489474 weapon price balance 2022-07-03 14:36:16 -04:00
Pirx 97c01d2c61 Shooter fix 2022-07-03 14:01:51 -04:00
Pirx 3fb83583c3 AI fix and optimization 2022-07-03 13:22:44 -04:00
Pecusx 2a5595f3c9 New AI tank - Toosser and angle bugfixex 2022-07-03 16:43:43 +02:00
Pecusx a860c4dfa1 AI decreases defensive weapon used 2022-07-03 15:34:23 +02:00
Pecusx 7bd7105374 AI uses defensives 2022-07-03 15:16:58 +02:00
Pirx 00099f4c27 tank font fix 2022-07-03 00:09:23 -04:00
Pirx 4caed19cd1 new angles #87 2022-07-03 00:05:03 -04:00
Pirx e9a59b1475 sensible angles work! 2022-07-03 00:02:06 -04:00
Pecusx 011364cbeb Parachute is only shown if tank is really falling 2022-07-02 15:07:01 +02:00
Pecusx 279a47b29f Dead tanks don't fall :)
Lonely parachute bug.
2022-07-02 14:47:27 +02:00
Pirx 6ece26237c laser update 2022-07-02 08:20:32 -04:00
Pecusx 3d159f8439 Small parachute bug in falling procedure 2022-07-02 11:34:53 +02:00
Pecusx 6ac4bbe0cd Falling sfx only if Tank really falls 2022-07-02 11:29:18 +02:00
Pecusx 4583641207 Completly new tank falling procedure (70bytes saved!)
And now the tank loses 2 units of energy per pixel (vertical only)
2022-07-02 00:47:56 +02:00
Pecusx 4a32abdc83 New method of checking the tank falling direction.
New table "SlideLeftTable" (8 bytes) instead "WhereToSlideTable" (256 bytes)
But procedure is not optimal - we need to write a new version.

And now, falling diagonally doesn't take any more energy.
2022-06-28 20:01:24 +02:00
Pecusx d5c1e1e397 Battery activation bug
If you had a different defensive weapon, its energy was gone.
2022-06-28 09:02:58 +02:00
18 changed files with 1529 additions and 1291 deletions
+53 -5
View File
@@ -13,10 +13,11 @@ Contributors:
- Adam (@6502adam) - font, ideas, QA - Adam (@6502adam) - font, ideas, QA
- Bocianu (@bocianu) - important ideas, FujiNet implementation, QA - Bocianu (@bocianu) - important ideas, FujiNet implementation, QA
- Emkay - splash screen music - Emkay - splash screen music
- Fox (@pfusik) - plot and point optimization
QA: Probabilitydragon, KrzysRog, Beeblebrox, EnderDude, lopezpb, Dracon, brad-colbert QA: Probabilitydragon, KrzysRog, Beeblebrox, EnderDude, lopezpb, Dracon, brad-colbert, archon800, Shaggy the Atarian
You can contact us at pecus@poczta.fm or pirx@5oft.pl You can contact us via [AtariAge](https://atariage.com) or [AtariOnLine](https://atarionline.pl) forums.
This source code was originally compiled under [OMC65 crossassembler](https://github.com/pkali/omc65) and on 2012-06-21 translated to [mads](https://github.com/tebe6502/Mad-Assembler). This source code was originally compiled under [OMC65 crossassembler](https://github.com/pkali/omc65) and on 2012-06-21 translated to [mads](https://github.com/tebe6502/Mad-Assembler).
@@ -47,20 +48,67 @@ With the advent of fujinet (https://fujinet.online/) we are thinking about makin
## Changes: ## Changes:
###### Build 148
2022-07-17
WHAT DOES THE FOX SAY?
Fox (x0f, @pfusik) says plots and points can be optimized by 18 clock cycles each and thanks to his 6502 wizardry the game is noticeably nicer. Thank you!
Other changes:
- https://github.com/pkali/scorch_src/issues/99, https://github.com/pkali/scorch_src/issues/98 - tank number 6 has got a color now! No one is monochrome now!
- https://github.com/pkali/scorch_src/issues/110 much improved laser - previously it was almost useless, now it looks and works much better
- fixed an interesting roller bug
- Auto Defense angle fix
- multiple improvements in AI routines, preparation for the final opponents.
###### Build 147
2022-07-10
LOST build. We were watching [LOST party](https://www.lostparty.pl/2022/) streams so maybe a little less done, but still some nice improvements.
- new weapons by @Pecusx - Napalm and Hot Napalm. Fire penetrates all shields, so beware!
- status bar showing outdated info on the beginning of the round fix
- various small optimizations incl. memory usage, soildown, weapon ranges
- improved shapes of Heavy and Force Shields
Issues closed:
- revert to the old but slightly improved version of showing angles (#105)
- zero page loading eliminated (#106)
- active player name appear over his tank when aiming (#107)
- configurable mountain heights (The Netherlands, Belgium, Czechia, Switzerland, Nepal) (#86)
- angle speeds up when joystick / keyboard are pressed (#75)
###### Build 146
2022-07-03
Super heavy rewrite build.
Not much changed visually since the last build, but really large parts of the code were rewritten, optimized and improved. A fresh swath of buggies certainly introduced, too.
- completely new tank falling routine by @Pecusx - over 300 bytes saved, complexity reduced, more just energy deduction when falling.
- silly angle system rewritten to a proper, primary school angling. BTW - I had to dig into 8th grade trig to make it work. About 200 bytes saved, complexity reduced. Next build will have improved angle speed UI. I will also allow for an easier improvement of tank visuals.
- Weapon price and quantity balance - this is our honest attempt to make game more fun. We'll accept any critique and improvement proposals.
- New AI opponent - Tosser! Not much better than Poolshark, but still beats sharks most of the time.
- AI opponents can purchase defensive weapons which make playing against AI somewhat more challenging.
- Improved Laser. It is still not ideal, but better. Still hard to aim :]
- Few small parachute-related bugs fixed
- Death's Head bug fix
Issues closed:
- https://github.com/pkali/scorch_src/issues/87 Angles are reasonable now. PROFIT!!!
###### Build 145 ###### Build 145
2022-06-26 2022-06-26
Possibly last round of weapon additions! Possibly last round of weapon additions!
@Pecusx added @Pecusx added
- working White Flag -- it is a way to give up while not making opponents richer! - working White Flag -- it is a way to give up while not making opponents richer!
- Battery - a must for every tank with low energy. - 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) - 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! - Nuclear Winter - a quick and efficient solution to global worming, err, warning, WARMING!
@mikerro added new SFX and in-game-tunes. @mikerro added new SFX and in-game-tunes.
- Pressing [S] turns on/off SFX (when aiming). Pressing [M] turns on/off in-game tunes. - Pressing [S] turns on/off SFX (when aiming). Pressing [M] turns on/off in-game tunes.
Tickets closed: 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/54 - holding a joystick up or down speeds up force change. It makes playing with a joystick much nicer.
- https://github.com/pkali/scorch_src/issues/76 - a beginning of visual tweaks by Adam - https://github.com/pkali/scorch_src/issues/76 - a beginning of visual tweaks by @6502adam
- infinite defensive weapons purchase bug fixed, to chagrin of some... - infinite defensive weapons purchase bug fixed, to the chagrin of some...
###### Build 144 ###### Build 144
2022-06-19 2022-06-19
+191 -71
View File
@@ -9,7 +9,7 @@
; greeeting to myself 10 years older in 2013-11-09... still no idea ; greeeting to myself 10 years older in 2013-11-09... still no idea
;---------------------------------------------- ;----------------------------------------------
MakeLowResDistances .proc .proc MakeLowResDistances
; create low precision table of positions ; create low precision table of positions
; by dividing positions by 4 ; by dividing positions by 4
@@ -30,18 +30,25 @@ loop
.endp .endp
;---------------------------------------------- ;----------------------------------------------
ArtificialIntelligence .proc ; .proc ArtificialIntelligence ;
; A - skill of the TankNr ; A - skill of the TankNr (in X)
; returns shoot energy and angle in ; returns shoot energy and angle in
; ForceTable/L/H and AngleTable ; ForceTable/L/H and AngleTable
;---------------------------------------------- ;----------------------------------------------
asl asl
tax tay
:2 dex ;credit KK :2 dey ;credit KK
lda AIRoutines+1,x lda AIRoutines+1,y
pha pha
lda AIRoutines,x lda AIRoutines,y
pha pha
; common values used in AI routines
; address of weapons table (for future use)
lda TanksWeaponsTableL,x
sta temp
lda TanksWeaponsTableH,x
sta temp+1
rts rts
.endp .endp
;---------------- ;----------------
@@ -49,15 +56,14 @@ AIRoutines
.word Moron-1 .word Moron-1
.word Shooter-1 ;Shooter .word Shooter-1 ;Shooter
.word Poolshark-1 ;Poolshark .word Poolshark-1 ;Poolshark
.word Poolshark-1 ;Toosser .word Tosser-1 ;Tosser
.word Poolshark-1 ;Chooser .word Tosser-1 ;Chooser
.word Poolshark-1 ;Spoiler .word Tosser-1 ;Spoiler
.word Poolshark-1 ;Cyborg .word Tosser-1 ;Cyborg
.word Poolshark-1 ;Unknown .word Tosser-1 ;Unknown
;---------------------------------------------- ;----------------------------------------------
Moron .proc .proc Moron
ldx TankNr
jsr RandomizeAngle jsr RandomizeAngle
sta NewAngle sta NewAngle
mwa #80 RandBoundaryLow mwa #80 RandBoundaryLow
@@ -66,21 +72,29 @@ Moron .proc
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
Shooter .proc .proc Shooter
ldx TankNr
lda PreviousAngle,x lda PreviousAngle,x
ora PreviousEnergyL,x ora PreviousEnergyL,x
ora PreviousEnergyH,x ora PreviousEnergyH,x
beq firstShoot beq firstShoot
lda PreviousAngle,x lda PreviousAngle,x
cmp #90
bcs shootingLeftAtThisMomentOfTime
; shooting right at this moment of time
sec
sbc #5
cmp #10
bcs @+ ;not smaller than 10
bcc firstShoot ; GET THE aim againg
shootingLeftAtThisMomentOfTime
clc clc
adc #5 adc #5
bmi @+ cmp #170 ; maximum shooter angle
cmp #90 bcs firstShoot
bcc @+
lda #(-90)
@ @
sta NewAngle sta NewAngle
@@ -95,36 +109,30 @@ Shooter .proc
firstShoot firstShoot
; compare the x position with the middle of the screen ; compare the x position with the middle of the screen
lda xTanksTableL,x
sta temp
lda xTanksTableH,x lda xTanksTableH,x
sta temp+1 cmp #>(screenwidth/2)
cpw temp #(screenwidth/2) bne @+
bcs tankIsOnTheRight lda xTanksTableL,x
cmp #<(screenwidth/2)
lda RANDOM @ bcc tankIsOnTheRight
and #$1F
clc
adc #5
; enemy tank is on the left
randomize 95 125
sta NewAngle sta NewAngle
jmp forceNow bne forceNow
tankIsOnTheRight tankIsOnTheRight
lda RANDOM randomize 55 85
and #$1F
clc
adc #(-85)
;lda #-45
sta NewAngle sta NewAngle
forceNow forceNow
mwa #100 RandBoundaryLow mwa #100 RandBoundaryLow
mwa #800 RandBoundaryHigh mwa #800 RandBoundaryHigh
ldx TankNr ;this is possibly not necessary ;ldx TankNr ;this is possibly not necessary
jsr RandomizeForce jsr RandomizeForce
endo endo
ldx TankNr ;this is possibly not necessary ;ldx TankNr ;this is possibly not necessary
jsr RandomizeForce.LimitForce jsr RandomizeForce.LimitForce
lda NewAngle lda NewAngle
sta PreviousAngle,x sta PreviousAngle,x
@@ -135,28 +143,66 @@ endo
; choose the best weapon ; choose the best weapon
lda TanksWeaponsTableL,x
sta temp
lda TanksWeaponsTableH,x
sta temp+1
ldy #32 ;the last weapon ldy #32 ;the last weapon
loop loop
dey dey
lda (temp),y lda (temp),y ; this is set up before calling the routine, has address of TanksWeaponsTable
beq loop beq loop
tya tya
sta ActiveWeapon,x sta ActiveWeapon,x
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
Poolshark .proc .proc Poolshark
; defensives
; if low energy ten use battery
lda Energy,x
cmp #30
bcs EnoughEnergy
; lower than 30 units - check battery
ldy #ind_Battery________
lda (temp),y ; has address of TanksWeaponsTable
beq NoBatteries
; we have batteries - use one
clc
sbc #1
sta (temp),y
lda #99
sta Energy,x
NoBatteries
EnoughEnergy
; use best defensive :)
; but not allways
randomize 1 3
cmp #1
bne NoUseDefensive
; first check check if any is in use
lda ActiveDefenceWeapon,x
bne DefensiveInUse
ldy #ind_Nuclear_Winter_+1 ;the last defensive weapon
@
dey
cpy #ind_Battery________ ;first defensive weapon (White Flag nad Battery - never use)
beq NoUseDefensive
lda (temp),y ; has address of TanksWeaponsTable
beq @-
; decrease in inventory
clc
sbc #1
sta (temp),y ; has address of TanksWeaponsTable
; activate defensive weapon
tya ; number of selectet defensive weapon
sta ActiveDefenceWeapon,x
lda DefensiveEnergy,y
sta ShieldEnergy,x
NoUseDefensive
DefensiveInUse
firstShoot firstShoot
;find nearest tank neighbour ;find nearest tank neighbour
jsr MakeLowResDistances jsr MakeLowResDistances
mva #$ff temp2 ; min possible distance mva #$ff temp2 ; min possible distance
ldx TankNr ;ldx TankNr
ldy NumberOfPlayers ldy NumberOfPlayers
dey dey
@@ -217,7 +263,7 @@ forceNow
jsr RandomizeForce jsr RandomizeForce
endo endo
ldx TankNr ;this is possibly not necessary ;ldx TankNr ;this is possibly not necessary
; choose the best weapon ; choose the best weapon
@@ -225,7 +271,7 @@ endo
sta temp sta temp
lda TanksWeaponsTableH,x lda TanksWeaponsTableH,x
sta temp+1 sta temp+1
ldy #32 ;the last weapon ldy #ind_Laser__________ ;the last offensive weapon
loop loop
dey dey
lda (temp),y lda (temp),y
@@ -236,11 +282,39 @@ loop
;---------------------------------------------- ;----------------------------------------------
AngleTable ; 16 bytes ;ba w $348b L$3350 AngleTable ; 16 bytes ;ba w $348b L$3350
.by 178,186,194,202,210,218,226,234 .by 106,114,122,130,138,146,154,162
.by 16,24,32,40,48,56,64,72 .by 18,26,34,43,50,58,66,74
.endp .endp
;---------------------------------------------- ;----------------------------------------------
PurchaseAI .proc ; .proc Tosser
; use best defensive :)
; allways
; first check check if any is in use
lda ActiveDefenceWeapon,x
bne DefensiveInUse
ldy #ind_Nuclear_Winter_+1 ;the last defensive weapon
@
dey
cpy #ind_Battery________ ;first defensive weapon (White Flag nad Battery - never use)
beq NoUseDefensive
lda (temp),y ; has address of TanksWeaponsTable
beq @-
; decrease in inventory
clc
sbc #1
sta (temp),y ; has address of TanksWeaponsTable
; activate defensive weapon
tya ; number of selectet defensive weapon
sta ActiveDefenceWeapon,x
lda DefensiveEnergy,y
sta ShieldEnergy,x
DefensiveInUse
NoUseDefensive
; Toosser is like Poolshark but allways uses defensives
jmp Poolshark
.endp
;----------------------------------------------
.proc PurchaseAI ;
; A - skill of the TankNr ; A - skill of the TankNr
; makes purchase for AI opponents ; makes purchase for AI opponents
; results of this routine are not visible on the screen ; results of this routine are not visible on the screen
@@ -260,21 +334,22 @@ PurchaseAIRoutines
.word MoronPurchase-1 .word MoronPurchase-1
.word ShooterPurchase-1 ;ShooterPurchase .word ShooterPurchase-1 ;ShooterPurchase
.word PoolsharkPurchase-1 ;PoolsharkPurchase .word PoolsharkPurchase-1 ;PoolsharkPurchase
.word PoolsharkPurchase-1 ;ToosserPurchase .word TosserPurchase-1 ;TosserPurchase
.word PoolsharkPurchase-1 ;ChooserPurchase .word TosserPurchase-1 ;ChooserPurchase
.word PoolsharkPurchase-1 ;SpoilerPurchase .word TosserPurchase-1 ;SpoilerPurchase
.word PoolsharkPurchase-1 ;CyborgPurchase .word TosserPurchase-1 ;CyborgPurchase
.word PoolsharkPurchase-1 ;UnknownPurchase .word TosserPurchase-1 ;UnknownPurchase
;---------------------------------------------- ;----------------------------------------------
MoronPurchase .proc MoronPurchase
;Moron buys nothing ;Moron buys nothing
rts rts
.endp
;------- ;-------
TryToPurchaseOnePiece .proc .proc TryToPurchaseOnePiece
; A - weapon number, better it will be in range(1,32) ; A - weapon number, better it will be in range(1,32)
; TankNr in X ; TankNr in X
; DOES NOT CHANGE X
tay tay
lda PurchaseMeTable,y lda PurchaseMeTable,y
beq SorryNoPurchase beq SorryNoPurchase
@@ -320,28 +395,73 @@ SorryNoPurchase
;---------------------------------------------- ;----------------------------------------------
ShooterPurchase .proc .proc ShooterPurchase
mva #4 tempXroller; number of purchases to perform ; first try to buy defensives
mva #2 tempXroller; number of offensive purchases to perform
ldx TankNr ldx TankNr
loop @
randomize 1 14 randomize ind_Battery________ ind_StrongParachute
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
bne loop bne @-
; and now offensives
mva #4 tempXroller; number of offensive purchases to perform
;ldx TankNr
@
randomize ind_Missile________ ind_Heavy_Roller___
jsr TryToPurchaseOnePiece
dec tempXroller
bne @-
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
PoolsharkPurchase .proc .proc PoolsharkPurchase
mva #8 tempXroller; number of purchases to perform ; first try to buy defensives
mva #3 tempXroller; number of offensive purchases to perform
ldx TankNr ldx TankNr
loop @
randomize 1 30 randomize ind_Battery________ ind_Auto_Defense___
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
bne loop bne @-
; and now offensives
mva #8 tempXroller; number of purchases to perform
;ldx TankNr
@
randomize ind_Missile________ ind_Dirt_Charge____
jsr TryToPurchaseOnePiece
dec tempXroller
bne @-
rts
.endp
;----------------------------------------------
.proc TosserPurchase
; what is my money level
ldx TankNr
lda MoneyH,x ; money / 256
sta tempXroller ; perform this many purchase attempts
; first try to buy defensives
mva #3 tempXroller; number of defensive purchases to perform
@
randomize ind_Battery________ ind_Auto_Defense___
jsr TryToPurchaseOnePiece
dec tempXroller
bne @-
; and now offensives
lda MoneyH,x ; money / 256
asl ;*2
sta tempXroller ; perform this many purchase attempts
@
randomize ind_Missile________ ind_Dirt_Charge____
jsr TryToPurchaseOnePiece
dec tempXroller
bne @-
rts rts
.endp .endp
+19 -16
View File
@@ -23,17 +23,8 @@ bptr .ds 2
cur_pos .ds 1 cur_pos .ds 1
chn_bits .ds 1 chn_bits .ds 1
bit_data .byte 1 bit_data .ds 1
.proc get_byte
lda song_data+1
inc song_ptr
bne skip
inc song_ptr+1
skip
rts
.endp
song_ptr = get_byte + 1
fcnt .ds 2 fcnt .ds 2
@@ -86,6 +77,8 @@ buffers
; ;
.proc init_song .proc init_song
mva #1 bit_data
; Example: here initializes song pointer: ; Example: here initializes song pointer:
;mwa #song_data song_ptr ;mwa #song_data song_ptr
@@ -182,18 +175,28 @@ skip_chn:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Check for ending of song and jump to the next frame ; Check for ending of song and jump to the next frame
; ;
.proc check_end_song
lda song_ptr + 1 ; not checking really so the tune gets funky :)))
cmp #>song_end ;lda song_ptr + 1
;cmp #>song_end
;bne wait_frame ;bne wait_frame
lda song_ptr ;lda song_ptr
cmp #<song_end ;cmp #<song_end
;bne wait_frame ;bne wait_frame
.endp
end_loop end_loop
rts rts
song_ptr = get_byte + 1
.proc get_byte
lda song_data+1
inc song_ptr
bne skip
inc song_ptr+1
skip
rts
.endp
main main
jsr init_song jsr init_song
+121 -118
View File
@@ -1,125 +1,128 @@
.proc talk .proc talk
L0 dta c"IN TIMES OF TROUBLE, GO WITH WHAT YOU KNOW." L0 dta d"IN TIMES OF TROUBLE, GO WITH WHAT YOU KNOW."
L1 dta c"DIE!" L1 dta d"DIE!"
L2 dta c"EAT MY SHORTS!" L2 dta d"EAT MY SHORTS!"
L3 dta c"YOU'RE TOAST!" L3 dta d"YOU'RE TOAST!"
L4 dta c"BANZAI!" L4 dta d"BANZAI!"
L5 dta c"FROM HELL'S HEART I STAB AT THEE..." L5 dta d"FROM HELL'S HEART I STAB AT THEE..."
L6 dta c"I DIDN'T DO IT. NOBODY SAW ME DO IT." L6 dta d"I DIDN'T DO IT. NOBODY SAW ME DO IT."
L7 dta c"TAKE A HIKE!" L7 dta d"TAKE A HIKE!"
L8 dta c"YOU'RE DEAD MEAT." L8 dta d"YOU'RE DEAD MEAT."
L9 dta c"MAKE MY DAY." L9 dta d"MAKE MY DAY."
L10 dta c"CHARGE!" L10 dta d"CHARGE!"
L11 dta c"ATTACK!" L11 dta d"ATTACK!"
L12 dta c"YOU'RE OUTTA HERE." L12 dta d"YOU'RE OUTTA HERE."
L13 dta c"WATTSA MATTA YOU?" L13 dta d"WATTSA MATTA YOU?"
L14 dta c"FREEZE, OR I'LL SHOOT!" L14 dta d"FREEZE, OR I'LL SHOOT!"
L15 dta c"HA HA HA." L15 dta d"HA HA HA."
L16 dta c"WE COME IN PEACE - SHOOT TO KILL!" L16 dta d"WE COME IN PEACE - SHOOT TO KILL!"
L17 dta c"IN YOUR FACE!" L17 dta d"IN YOUR FACE!"
L18 dta c"DIE COMMIE PIG!" L18 dta d"DIE COMMIE PIG!"
L19 dta c"I LOVE THE SMELL OF NAPALM IN THE MORNING." L19 dta d"I LOVE THE SMELL OF NAPALM IN THE MORNING."
L20 dta c"VICTORY!" L20 dta d"VICTORY!"
L21 dta c"SHOW SOME RESPECT." L21 dta d"SHOW SOME RESPECT."
L22 dta c"JUST WHO DO YOU THINK YOU ARE?" L22 dta d"JUST WHO DO YOU THINK YOU ARE?"
L23 dta c"LOOK OUT BELOW!" L23 dta d"LOOK OUT BELOW!"
L24 dta c"KNOCK, KNOCK." L24 dta d"KNOCK, KNOCK."
L25 dta c"LOOK OVER THERE." L25 dta d"LOOK OVER THERE."
L26 dta c"GUESS WHAT'S COMING FOR DINNER?" L26 dta d"GUESS WHAT'S COMING FOR DINNER?"
L27 dta c"MERRY CHRISTMAS." L27 dta d"MERRY CHRISTMAS."
L28 dta c"OPEN WIDE!" L28 dta d"OPEN WIDE!"
L29 dta c"HERE GOES NOTHING..." L29 dta d"HERE GOES NOTHING..."
L30 dta c"DON'T WORRY, IT ISN'T A LIVE ROUND." L30 dta d"DON'T WORRY, IT ISN'T A LIVE ROUND."
L31 dta c"BLOOD, PAIN, VIOLENCE!" L31 dta d"BLOOD, PAIN, VIOLENCE!"
L32 dta c"TAKE THIS, SISSY!" L32 dta d"TAKE THIS, SISSY!"
L33 dta c"I SHALL FLATTEN YOU!" L33 dta d"I SHALL FLATTEN YOU!"
L34 dta c"I SHALL SMASH YOUR UGLY TANK!" L34 dta d"I SHALL SMASH YOUR UGLY TANK!"
L35 dta c"I WONDER WHAT THIS BUTTON DOES?" L35 dta d"I WONDER WHAT THIS BUTTON DOES?"
L36 dta c"DON'T TAKE THIS PERSONALLY." L36 dta d"DON'T TAKE THIS PERSONALLY."
L37 dta c"WOULD THIS MAKE YOU MAD?" L37 dta d"WOULD THIS MAKE YOU MAD?"
L38 dta c"I TOLD YOU TO LEAVE MY SISTER ALONE!" L38 dta d"I TOLD YOU TO LEAVE MY SISTER ALONE!"
L39 dta c"I COULD SPARE YOU, BUT WHY?" L39 dta d"I COULD SPARE YOU, BUT WHY?"
L40 dta c"MY BOMB IS BIGGER THAN YOURS." L40 dta d"MY BOMB IS BIGGER THAN YOURS."
L41 dta c"DON'T FORGET ABOUT ME!" L41 dta d"DON'T FORGET ABOUT ME!"
L42 dta c"HASTA LA VISTA, BABY!" L42 dta d"HASTA LA VISTA, BABY!"
L43 dta c"THIS IS YOUR BRAIN ON SCORCH." L43 dta d"THIS IS YOUR BRAIN ON SCORCH."
L44 dta c"TAKE THIS!" L44 dta d"TAKE THIS!"
L45 dta c"THIS SCREEN AIN'T BIG ENOUGH FOR THE BOTH OF US." L45 dta d"THIS SCREEN AIN'T BIG ENOUGH FOR THE BOTH OF US."
L46 dta c"DIE, ALIEN SWINE!" L46 dta d"DIE, ALIEN SWINE!"
L47 dta c"SAY ARRGGHHHHH...." L47 dta d"SAY ARRGGHHHHH...."
L48 dta c"I SHALL OIL MY TURRET WITH YOUR BLOOD." L48 dta d"I SHALL OIL MY TURRET WITH YOUR BLOOD."
L49 dta c"DIE, TANK-SCUM!" L49 dta d"DIE, TANK-SCUM!"
L50 dta c"I'M GONNA BREAK YOUR FACE!" L50 dta d"I'M GONNA BREAK YOUR FACE!"
L51 dta c"MAMA SAID KNOCK YOU OUT!" L51 dta d"MAMA SAID KNOCK YOU OUT!"
L52 dta c"I HOPE YOU ENJOY PAIN!" L52 dta d"I HOPE YOU ENJOY PAIN!"
;-------------------------------- ;--------------------------------
L53 dta c"PARTING IS SUCH SWEET SORROW... NOT!" L53 dta d"PARTING IS SUCH SWEET SORROW... NOT!"
L54 dta c"UGH!" L54 dta d"UGH!"
L55 dta c"AARGH!" L55 dta d"AARGH!"
L56 dta c"AAAGGHHH!" L56 dta d"AAAGGHHH!"
L57 dta c"I'M MELTING!" L57 dta d"I'M MELTING!"
L58 dta c"OOF.." L58 dta d"OOF.."
L59 dta c"OH!" L59 dta d"OH!"
L60 dta c"EEEK!" L60 dta d"EEEK!"
L61 dta c"AACCH!" L61 dta d"AACCH!"
L62 dta c"I HATE IT WHEN THAT HAPPENS." L62 dta d"I HATE IT WHEN THAT HAPPENS."
L63 dta c"ONE DIRECT HIT CAN RUIN YOUR WHOLE DAY." L63 dta d"ONE DIRECT HIT CAN RUIN YOUR WHOLE DAY."
L64 dta c"OH NO!" L64 dta d"OH NO!"
L65 dta c"NOT ME!" L65 dta d"NOT ME!"
L66 dta c"OUCH." L66 dta d"OUCH."
L67 dta c"OH NO, NOT AGAIN." L67 dta d"OH NO, NOT AGAIN."
L68 dta c"ANOTHER ONE BITES THE DUST." L68 dta d"ANOTHER ONE BITES THE DUST."
L69 dta c"GOODBYE." L69 dta d"GOODBYE."
L70 dta c"HELP ME!" L70 dta d"HELP ME!"
L71 dta c"FAREWELL, CRUEL WORLD." L71 dta d"FAREWELL, CRUEL WORLD."
L72 dta c"REMEMBER THE ALAMO!" L72 dta d"REMEMBER THE ALAMO!"
L73 dta c"OH MAN!" L73 dta d"OH MAN!"
L74 dta c"DOOUGH!" L74 dta d"DOOUGH!"
L75 dta c"ANOTHER DAY, ANOTHER BOMB." L75 dta d"ANOTHER DAY, ANOTHER BOMB."
L76 dta c"THIS IS THE END, MY ONLY FRIEND." L76 dta d"THIS IS THE END, MY ONLY FRIEND."
L77 dta c"IT'S ALL OVER." L77 dta d"IT'S ALL OVER."
L78 dta c"THE FAT LADY SANG." L78 dta d"THE FAT LADY SANG."
L79 dta c"WHY DOES EVERYTHING HAPPEN TO ME?" L79 dta d"WHY DOES EVERYTHING HAPPEN TO ME?"
L80 dta c"I'M GOING DOWN." L80 dta d"I'M GOING DOWN."
L81 dta c"I'VE GOT A BAD FEELING ABOUT THIS." L81 dta d"I'VE GOT A BAD FEELING ABOUT THIS."
L82 dta c"CRAPOLA." L82 dta d"CRAPOLA."
L83 dta c"POW!" L83 dta d"POW!"
L84 dta c"BIF!" L84 dta d"BIF!"
L85 dta c"BAM!" L85 dta d"BAM!"
L86 dta c"ZONK!" L86 dta d"ZONK!"
L87 dta c"I SHOULD'VE LISTENED TO MY MOTHER..." L87 dta d"I SHOULD'VE LISTENED TO MY MOTHER..."
L88 dta c"NO... A BUD LIGHT!" L88 dta d"NO... A BUD LIGHT!"
L89 dta c"WHAT WAS THAT NOISE?" L89 dta d"WHAT WAS THAT NOISE?"
L90 dta c"MAMA SAID THERE'D BE DAYS LIKE THIS." L90 dta d"MAMA SAID THERE'D BE DAYS LIKE THIS."
L91 dta c"ITS JUST ONE OF THOSE DAYS..." L91 dta d"ITS JUST ONE OF THOSE DAYS..."
L92 dta c"I SEE A BRIGHT LIGHT..." L92 dta d"I SEE A BRIGHT LIGHT..."
L93 dta c"MOMMY? IS THAT YOU?" L93 dta d"MOMMY? IS THAT YOU?"
L94 dta c"I LET YOU HIT ME!" L94 dta d"I LET YOU HIT ME!"
L95 dta c"SUCKER SHOT!" L95 dta d"SUCKER SHOT!"
L96 dta c"I DIDN'T WANT TO LIVE ANYWAY." L96 dta d"I DIDN'T WANT TO LIVE ANYWAY."
L97 dta c"-<SOB>-" L97 dta d"-<SOB>-"
L98 dta c"WAS THAT AS CLOSE AS I THINK IT WAS?" L98 dta d"WAS THAT AS CLOSE AS I THINK IT WAS?"
L99 dta c"JOIN THE ARMY, SEE THE WORLD THEY SAID." L99 dta d"JOIN THE ARMY, SEE THE WORLD THEY SAID."
L100 dta c"IT WASN'T JUST A JOB IT WAS AN ADVENTURE!" L100 dta d"IT WASN'T JUST A JOB IT WAS AN ADVENTURE!"
L101 dta c"I DIDN'T LIKE VIOLENCE ANYWAY!" L101 dta d"I DIDN'T LIKE VIOLENCE ANYWAY!"
L102 dta c"I THOUGHT YOU LIKED ME?" L102 dta d"I THOUGHT YOU LIKED ME?"
L103 dta c"SUCH SENSELESS VIOLENCE! I DON'T UNDERSTAND IT." L103 dta d"SUCH SENSELESS VIOLENCE! I DON'T UNDERSTAND IT."
L104 dta c"I THINK THIS GUY'S A LITTLE CRAZY." L104 dta d"I THINK THIS GUY'S A LITTLE CRAZY."
L105 dta c"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE." L105 dta d"SOMEHOW I DON'T FEEL LIKE KILLING ANYMORE."
L106 dta c"HEY! KILLIN' AIN'T COOL." L106 dta d"HEY! KILLIN' AIN'T COOL."
L107 dta c"GEE... THANKS." L107 dta d"GEE... THANKS."
L108 dta c"I'VE FALLEN AND I CAN'T GET UP!" L108 dta d"I'VE FALLEN AND I CAN'T GET UP!"
L109 dta c"911?" L109 dta d"911?"
L110 dta c"OH NO! HERE I BLOW AGAIN!" L110 dta d"OH NO! HERE I BLOW AGAIN!"
L111 dta c"I'LL BE BACK..." L111 dta d"I'LL BE BACK..."
L112 dta c"HEY - I'VE GOT LAWYERS." L112 dta d"HEY - I'VE GOT LAWYERS."
L113 dta c"TIME TO CALL 1-900-SUE-TANK." L113 dta d"TIME TO CALL 1-900-SUE-TANK."
LEND
OffensiveTextTableL OffensiveTextTableL
dta <L0,<L1,<L2,<L3,<L4,<L5,<L6,<L7,<L8,<L9,<L10,<L11,<L12,<L13,<L14,<L15,<L16,<L17,<L18,<L19,<L20,<L21,<L22,<L23,<L24,<L25,<L26,<L27,<L28,<L29,<L30,<L31,<L32,<L33,<L34,<L35,<L36,<L37,<L38,<L39,<L40,<L41,<L42,<L43,<L44,<L45,<L46,<L47,<L48,<L49,<L50,<L51,<L52,<L53,<L54,<L55,<L56,<L57,<L58,<L59,<L60,<L61,<L62,<L63,<L64,<L65,<L66,<L67,<L68,<L69,<L70,<L71,<L72,<L73,<L74,<L75,<L76,<L77,<L78,<L79,<L80,<L81,<L82,<L83,<L84,<L85,<L86,<L87,<L88,<L89,<L90,<L91,<L92,<L93,<L94,<L95,<L96,<L97,<L98,<L99,<L100,<L101,<L102,<L103,<L104,<L105,<L106,<L107,<L108,<L109,<L110,<L111,<L112,<L113 dta <L0,<L1,<L2,<L3,<L4,<L5,<L6,<L7,<L8,<L9,<L10,<L11,<L12,<L13,<L14,<L15,<L16,<L17,<L18,<L19,<L20,<L21,<L22,<L23,<L24,<L25,<L26,<L27,<L28,<L29,<L30,<L31,<L32,<L33,<L34,<L35,<L36,<L37,<L38,<L39,<L40,<L41,<L42,<L43,<L44,<L45,<L46,<L47,<L48,<L49,<L50,<L51,<L52
dta <L53,<L54,<L55,<L56,<L57,<L58,<L59,<L60,<L61,<L62,<L63,<L64,<L65,<L66,<L67,<L68,<L69,<L70,<L71,<L72,<L73,<L74,<L75,<L76,<L77,<L78,<L79,<L80,<L81,<L82,<L83,<L84,<L85,<L86,<L87,<L88,<L89,<L90,<L91,<L92,<L93,<L94,<L95,<L96,<L97,<L98,<L99,<L100,<L101,<L102,<L103,<L104,<L105,<L106,<L107,<L108,<L109,<L110,<L111,<L112,<L113
dta <LEND
OffensiveTextTableH OffensiveTextTableH
dta >L0,>L1,>L2,>L3,>L4,>L5,>L6,>L7,>L8,>L9,>L10,>L11,>L12,>L13,>L14,>L15,>L16,>L17,>L18,>L19,>L20,>L21,>L22,>L23,>L24,>L25,>L26,>L27,>L28,>L29,>L30,>L31,>L32,>L33,>L34,>L35,>L36,>L37,>L38,>L39,>L40,>L41,>L42,>L43,>L44,>L45,>L46,>L47,>L48,>L49,>L50,>L51,>L52,>L53,>L54,>L55,>L56,>L57,>L58,>L59,>L60,>L61,>L62,>L63,>L64,>L65,>L66,>L67,>L68,>L69,>L70,>L71,>L72,>L73,>L74,>L75,>L76,>L77,>L78,>L79,>L80,>L81,>L82,>L83,>L84,>L85,>L86,>L87,>L88,>L89,>L90,>L91,>L92,>L93,>L94,>L95,>L96,>L97,>L98,>L99,>L100,>L101,>L102,>L103,>L104,>L105,>L106,>L107,>L108,>L109,>L110,>L111,>L112,>L113 dta >L0,>L1,>L2,>L3,>L4,>L5,>L6,>L7,>L8,>L9,>L10,>L11,>L12,>L13,>L14,>L15,>L16,>L17,>L18,>L19,>L20,>L21,>L22,>L23,>L24,>L25,>L26,>L27,>L28,>L29,>L30,>L31,>L32,>L33,>L34,>L35,>L36,>L37,>L38,>L39,>L40,>L41,>L42,>L43,>L44,>L45,>L46,>L47,>L48,>L49,>L50,>L51,>L52
OffensiveTextLengths dta >L53,>L54,>L55,>L56,>L57,>L58,>L59,>L60,>L61,>L62,>L63,>L64,>L65,>L66,>L67,>L68,>L69,>L70,>L71,>L72,>L73,>L74,>L75,>L76,>L77,>L78,>L79,>L80,>L81,>L82,>L83,>L84,>L85,>L86,>L87,>L88,>L89,>L90,>L91,>L92,>L93,>L94,>L95,>L96,>L97,>L98,>L99,>L100,>L101,>L102,>L103,>L104,>L105,>L106,>L107,>L108,>L109,>L110,>L111,>L112,>L113
dta 43,4,14,13,7,35,37,12,17,12,7,7,18,17,22,9,33,13,15,42,8,18,30,15,13,16,31,16,10,20,35,22,17,20,29,31,27,24,36,27,29,22,21,29,10,48,17,20,38,15,26,24,22,36,4,6,9,12,5,3,5,6,28,39,6,7,5,17,27,8,8,22,19,7,7,26,32,14,18,33,15,34,8,4,4,4,5,36,18,20,36,29,23,19,17,12,29,7,36,39,41,30,23,48,34,42,25,14,31,4,26,15,23,28 dta >LEND
NumberOfOffensiveTexts=54 NumberOfOffensiveTexts=54
NumberOfDeffensiveTexts=60 NumberOfDeffensiveTexts=60
.endp .endp
BIN
View File
Binary file not shown.
Binary file not shown.
-48
View File
@@ -1,48 +0,0 @@
import sys
from string import strip
lineCount = 0
lengths = []
alltexts = []
for line in open("TALK1.txt"):
lineCount+=1
line = strip(line)
lengths.append(len(line))
alltexts.append(line)
off = lineCount
for line in open("TALK2.txt"):
lineCount+=1
line = strip(line)
lengths.append(len(line))
alltexts.append(line)
tmpNo = 0
for line in alltexts:
print ("L"+str(tmpNo)+' dta "'+line+'"')
tmpNo+= 1
l=""
for i in range(0,lineCount):
l+="<L"+str(i)+","
l=l[:-1]
print ("OffensiveTextTableL")
print (" dta "+l)
l=""
for i in range(0,lineCount):
l+=">L"+str(i)+","
l=l[:-1]
print ("OffensiveTextTableH")
print (" dta "+l)
l=""
for i in range(0,lineCount):
l+=str(lengths[i])+","
l=l[:-1]
print ("OffensiveTextLengths")
print (" dta "+l)
deff = lineCount-off
print ("NumberOfOffensiveTexts="+str(off))
print ("NumberOfDeffensiveTexts="+str(deff))
+127 -367
View File
@@ -5,14 +5,12 @@
;=================================================================================== ;===================================================================================
;==========================CONSTANT TABLES, do not erase!=========================== ;==========================CONSTANT TABLES, do not erase!===========================
;=================================================================================== ;===================================================================================
TankColoursTable .BYTE $88,$cc,$38,$1c,$6a,$02 TankColoursTable .BYTE $86,$46,$c6,$28,$c6,$ee
TankStatusColoursTable .BYTE $80,$c0,$30,$10,$60,$00 TankStatusColoursTable .BYTE $80,$40,$c4,$20,$c0,$e4
dliColorsBack dliColorsBack
:10 .by $02,$00 :10 .by $02,$00
dliColorsFore dliColorsFore
.by $0a .by $0a
TextBackgroundColor = $02 ; REAL constans - use: LDA #TextBackgroundColor
TextForegroundColor = $0c
CashOptionL ;(one zero less than on the screen) CashOptionL ;(one zero less than on the screen)
.by 0,<200,<800,<1200,<2000 .by 0,<200,<800,<1200,<2000
CashOptionH CashOptionH
@@ -22,6 +20,8 @@ MaxWindTable .by 5,20,40,70,99
RoundsTable .by 10,20,30,40,50 RoundsTable .by 10,20,30,40,50
flyDelayTable .by 255,150,75,35,1 flyDelayTable .by 255,150,75,35,1
seppukuTable .by 255, 45,25,15,9 seppukuTable .by 255, 45,25,15,9
mountainsDeltaTableH .by 0,1,3,5,7
mountainsDeltaTableL .by $1f, $7f, $ff, $7f, $ff
;------------------------------------------------ ;------------------------------------------------
LevelNameBeginL ; begins of level names LevelNameBeginL ; begins of level names
.by <NamesOfLevels,<(NamesOfLevels+10),<(NamesOfLevels+20) .by <NamesOfLevels,<(NamesOfLevels+10),<(NamesOfLevels+20)
@@ -57,45 +57,21 @@ lineClear
dta d" ", $ff dta d" ", $ff
;----------- ;-----------
pmtableL ; addressess of the P/M memory for 5 tanks (6th is without P/M background) pmtableL ; addressess of the P/M memory for 6 tanks
.by <(pmgraph+$400) .by <(pmgraph+$400)
.by <(pmgraph+$500) .by <(pmgraph+$500)
.by <(pmgraph+$600) .by <(pmgraph+$600)
.by <(pmgraph+$700) .by <(pmgraph+$700)
.by <(pmgraph+$300) ; this is a missile background .by <(pmgraph+$300) ; this is a missile background
.by <(pmgraph+$300) ; this is a missile background
pmtableH pmtableH
.by >(pmgraph+$400) .by >(pmgraph+$400)
.by >(pmgraph+$500) .by >(pmgraph+$500)
.by >(pmgraph+$600) .by >(pmgraph+$600)
.by >(pmgraph+$700) .by >(pmgraph+$700)
.by >(pmgraph+$300) .by >(pmgraph+$300)
.by >(pmgraph+$300)
;----------- ;-----------
; this table changes Angle to the appropriate tank character
BarrelTableL
.by $02,$02,$02,$02,$02,$02,$02,$02
.by $04,$04,$04,$04,$04,$04,$04,$04
.by $06,$06,$06,$06,$06,$06,$06,$06,$06
.by $08,$08,$08,$08,$08,$08,$08,$08
.by $0a,$0a,$0a,$0a,$0a,$0a,$0a,$0a
.by $0c,$0c,$0c,$0c,$0c,$0c,$0c,$0c,$0c
.by $0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e
.by $10,$10,$10,$10,$10,$10,$10,$10
.by $12,$12,$12,$12,$12,$12,$12,$12,$12
.by $14,$14,$14,$14,$14,$14,$14,$14
.by $16,$16,$16,$16,$16,$16,$16,$16
BarrelTableR
.by $2c,$2c,$2c,$2c,$2c,$2c,$2c,$2c
.by $2a,$2a,$2a,$2a,$2a,$2a,$2a,$2a
.by $28,$28,$28,$28,$28,$28,$28,$28,$28
.by $26,$26,$26,$26,$26,$26,$26,$26
.by $24,$24,$24,$24,$24,$24,$24,$24
.by $22,$22,$22,$22,$22,$22,$22,$22,$22
.by $20,$20,$20,$20,$20,$20,$20,$20
.by $1e,$1e,$1e,$1e,$1e,$1e,$1e,$1e
.by $1c,$1c,$1c,$1c,$1c,$1c,$1c,$1c,$1c
.by $1a,$1a,$1a,$1a,$1a,$1a,$1a,$1a
.by $18,$18,$18,$18,$18,$18,$18,$18
sintable sintable
.by 0 .by 0
.by 4 .by 4
@@ -210,332 +186,100 @@ disktance ;tanks distance
; this table is for deciding where a tank should slide ; this table is for deciding where a tank should slide
; accordingly to what is below the tank ; accordingly to what is below the tank
; there are 3 bits used here ; values in table mean that tank is moving to the left
; bit 0 - go down SlideLeftTable
; bit 1 - go left .BY %00000001
; bit 2 - go right .BY %00000010
; position in the table equals to bit pattern of soil below tank .BY %00000011
.BY %00000100
.BY %00000101
.BY %00000110
.BY %00000111
.BY %00001100
WhereToSlideTable ;-----------------------------------------------------------
; we have 3 bits, when set: 2 - go left, 1 - go right, 0 - go down ; this table changes Angle to the appropriate tank character
.BY %001 ; 00000000 BarrelTable
.BY %101 ; 00000001
.BY %100 ; 00000010 .by $2C,$2C,$2C,$2C,$2C,$2C,$2C,$2C,$2A,$2A,
.BY %100 ; 00000011 .by $2A,$2A,$2A,$2A,$2A,$2A,$28,$28,$28,$28,
.BY %100 ; 00000100 .by $28,$28,$28,$28,$28,$26,$26,$26,$26,$26,
.BY %100 ; 00000101 .by $26,$26,$26,$24,$24,$24,$24,$24,$24,$24,
.BY %100 ; 00000110 .by $24,$22,$22,$22,$22,$22,$22,$22,$22,$22,
.BY %100 ; 00000111 .by $20,$20,$20,$20,$20,$20,$20,$20,$1E,$1E,
.BY %000 ; 00001000 .by $1E,$1E,$1E,$1E,$1E,$1E,$1C,$1C,$1C,$1C,
.BY %000 ; 00001001 .by $1C,$1C,$1C,$1C,$1C,$1A,$1A,$1A,$1A,$1A,
.BY %000 ; 00001010 .by $1A,$1A,$1A,$18,$18,$18,$18,$18,$18,$18,
.BY %000 ; 00001011 ;.by $18,
.BY %100 ; 00001100
.BY %000 ; 00001101 .by $16,$16,$16,$16,$16,$16,$16,$16,$14,$14,
.BY %000 ; 00001110 .by $14,$14,$14,$14,$14,$14,$12,$12,$12,$12,
.BY %000 ; 00001111 .by $12,$12,$12,$12,$12,$10,$10,$10,$10,$10,
.BY %000 ; 00010000 .by $10,$10,$10,$0E,$0E,$0E,$0E,$0E,$0E,$0E,
.BY %000 ; 00010001 .by $0E,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,$0C,
.BY %000 ; 00010010 .by $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A,$08,$08,
.BY %000 ; 00010011 .by $08,$08,$08,$08,$08,$08,$06,$06,$06,$06,
.BY %000 ; 00010100 .by $06,$06,$06,$06,$06,$04,$04,$04,$04,$04,
.BY %000 ; 00010101 .by $04,$04,$04,$02,$02,$02,$02,$02,$02,$02,
.BY %000 ; 00010110 .by $02,
.BY %000 ; 00010111
.BY %000 ; 00011000
.BY %000 ; 00011001
.BY %000 ; 00011010
.BY %000 ; 00011011
.BY %000 ; 00011100
.BY %000 ; 00011101
.BY %000 ; 00011110
.BY %000 ; 00011111
.BY %010 ; 00100000
.BY %000 ; 00100001
.BY %000 ; 00100010
.BY %000 ; 00100011
.BY %000 ; 00100100
.BY %000 ; 00100101
.BY %000 ; 00100110
.BY %000 ; 00100111
.BY %000 ; 00101000
.BY %000 ; 00101001
.BY %000 ; 00101010
.BY %000 ; 00101011
.BY %000 ; 00101100
.BY %000 ; 00101101
.BY %000 ; 00101110
.BY %000 ; 00101111
.BY %010 ; 00110000
.BY %000 ; 00110001
.BY %000 ; 00110010
.BY %000 ; 00110011
.BY %000 ; 00110100
.BY %000 ; 00110101
.BY %000 ; 00110110
.BY %000 ; 00110111
.BY %000 ; 00111000
.BY %000 ; 00111001
.BY %000 ; 00111010
.BY %000 ; 00111011
.BY %000 ; 00111100
.BY %000 ; 00111101
.BY %000 ; 00111110
.BY %000 ; 00111111
.BY %010 ; 01000000
.BY %000 ; 01000001
.BY %000 ; 01000010
.BY %000 ; 01000011
.BY %000 ; 01000100
.BY %000 ; 01000101
.BY %000 ; 01000110
.BY %000 ; 01000111
.BY %000 ; 01001000
.BY %000 ; 01001001
.BY %000 ; 01001010
.BY %000 ; 01001011
.BY %000 ; 01001100
.BY %000 ; 01001101
.BY %000 ; 01001110
.BY %000 ; 01001111
.BY %000 ; 01010000
.BY %000 ; 01010001
.BY %000 ; 01010010
.BY %000 ; 01010011
.BY %000 ; 01010100
.BY %000 ; 01010101
.BY %000 ; 01010110
.BY %000 ; 01010111
.BY %000 ; 01011000
.BY %000 ; 01011001
.BY %000 ; 01011010
.BY %000 ; 01011011
.BY %000 ; 01011100
.BY %000 ; 01011101
.BY %000 ; 01011110
.BY %000 ; 01011111
.BY %010 ; 01100000
.BY %000 ; 01100001
.BY %000 ; 01100010
.BY %000 ; 01100011
.BY %000 ; 01100100
.BY %000 ; 01100101
.BY %000 ; 01100110
.BY %000 ; 01100111
.BY %000 ; 01101000
.BY %000 ; 01101001
.BY %000 ; 01101010
.BY %000 ; 01101011
.BY %000 ; 01101100
.BY %000 ; 01101101
.BY %000 ; 01101110
.BY %000 ; 01101111
.BY %000 ; 01110000
.BY %000 ; 01110001
.BY %000 ; 01110010
.BY %000 ; 01110011
.BY %000 ; 01110100
.BY %000 ; 01110101
.BY %000 ; 01110110
.BY %000 ; 01110111
.BY %000 ; 01111000
.BY %000 ; 01111001
.BY %000 ; 01111010
.BY %000 ; 01111011
.BY %000 ; 01111100
.BY %000 ; 01111101
.BY %000 ; 01111110
.BY %000 ; 01111111
.BY %011 ; 10000000
.BY %000 ; 10000001
.BY %000 ; 10000010
.BY %000 ; 10000011
.BY %000 ; 10000100
.BY %000 ; 10000101
.BY %000 ; 10000110
.BY %000 ; 10000111
.BY %000 ; 10001000
.BY %000 ; 10001001
.BY %000 ; 10001010
.BY %000 ; 10001011
.BY %000 ; 10001100
.BY %000 ; 10001101
.BY %000 ; 10001110
.BY %000 ; 10001111
.BY %000 ; 10010000
.BY %000 ; 10010001
.BY %000 ; 10010010
.BY %000 ; 10010011
.BY %000 ; 10010100
.BY %000 ; 10010101
.BY %000 ; 10010110
.BY %000 ; 10010111
.BY %000 ; 10011000
.BY %000 ; 10011001
.BY %000 ; 10011010
.BY %000 ; 10011011
.BY %000 ; 10011100
.BY %000 ; 10011101
.BY %000 ; 10011110
.BY %000 ; 10011111
.BY %010 ; 10100000
.BY %000 ; 10100001
.BY %000 ; 10100010
.BY %000 ; 10100011
.BY %000 ; 10100100
.BY %000 ; 10100101
.BY %000 ; 10100110
.BY %000 ; 10100111
.BY %000 ; 10101000
.BY %000 ; 10101001
.BY %000 ; 10101010
.BY %000 ; 10101011
.BY %000 ; 10101100
.BY %000 ; 10101101
.BY %000 ; 10101110
.BY %000 ; 10101111
.BY %000 ; 10110000
.BY %000 ; 10110001
.BY %000 ; 10110010
.BY %000 ; 10110011
.BY %000 ; 10110100
.BY %000 ; 10110101
.BY %000 ; 10110110
.BY %000 ; 10110111
.BY %000 ; 10111000
.BY %000 ; 10111001
.BY %000 ; 10111010
.BY %000 ; 10111011
.BY %000 ; 10111100
.BY %000 ; 10111101
.BY %000 ; 10111110
.BY %000 ; 10111111
.BY %010 ; 11000000
.BY %000 ; 11000001
.BY %000 ; 11000010
.BY %000 ; 11000011
.BY %000 ; 11000100
.BY %000 ; 11000101
.BY %000 ; 11000110
.BY %000 ; 11000111
.BY %000 ; 11001000
.BY %000 ; 11001001
.BY %000 ; 11001010
.BY %000 ; 11001011
.BY %000 ; 11001100
.BY %000 ; 11001101
.BY %000 ; 11001110
.BY %000 ; 11001111
.BY %000 ; 11010000
.BY %000 ; 11010001
.BY %000 ; 11010010
.BY %000 ; 11010011
.BY %000 ; 11010100
.BY %000 ; 11010101
.BY %000 ; 11010110
.BY %000 ; 11010111
.BY %000 ; 11011000
.BY %000 ; 11011001
.BY %000 ; 11011010
.BY %000 ; 11011011
.BY %000 ; 11011100
.BY %000 ; 11011101
.BY %000 ; 11011110
.BY %000 ; 11011111
.BY %010 ; 11100000
.BY %000 ; 11100001
.BY %000 ; 11100010
.BY %000 ; 11100011
.BY %000 ; 11100100
.BY %000 ; 11100101
.BY %000 ; 11100110
.BY %000 ; 11100111
.BY %000 ; 11101000
.BY %000 ; 11101001
.BY %000 ; 11101010
.BY %000 ; 11101011
.BY %000 ; 11101100
.BY %000 ; 11101101
.BY %000 ; 11101110
.BY %000 ; 11101111
.BY %000 ; 11110000
.BY %000 ; 11110001
.BY %000 ; 11110010
.BY %000 ; 11110011
.BY %000 ; 11110100
.BY %000 ; 11110101
.BY %000 ; 11110110
.BY %000 ; 11110111
.BY %000 ; 11111000
.BY %000 ; 11111001
.BY %000 ; 11111010
.BY %000 ; 11111011
.BY %000 ; 11111100
.BY %000 ; 11111101
.BY %000 ; 11111110
.BY %000 ; 11111111
EndOfTheBarrelX EndOfTheBarrelX
; right angles from 0 (vertically up) to 90 (horizontally to the right) ; right angles from 0 (horizontally right) to 90 (up)
.by 4,4,4,4,4,4,4,4,4,4,4
.by 5,5,5,5,5,5,5,5,5,5
.by 6,6,6,6,6,6,6,6,6
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,7,7,7,7,7,7,7,7,7,
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,7,7,7,7,7,7,7,7,7,
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,7,7,7,7,7,7,7,7,7,
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,7,7,7,7,7,7,7,7,7,
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,7,7,7,7,7,7,7,7,7,
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,7,7,7,7,7,7,7,7,7,
.by 0,0,0,0,0,0,0,0,0,0 ; not used .by 7,6,6,6,6,6,6,6,6,6,
.by 0,0,0,0 ; not used .by 5,5,5,5,5,5,5,5,5,5,
.by 4,4,4,4,4,4,4,4,4,4,
;.by 4,
; left angles from 90 (horizontally to the left) to 1 (vertically up) ; left angles from 90 (vertical) to 180 (horizontally left)
.by 0,0,0,0,0,0,0,0,0,0,0,0,0,0 .by 3,3,3,3,3,3,3,3,3,3,
.by 0,0,0,0,0,0,0,0,0,0,0,0,0 .by 3,2,2,2,2,2,2,2,2,2,
.by 0,0,0,0,0,0,0,0,0,0 .by 2,1,1,1,1,1,1,1,1,1,
.by 0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 .by 0,0,0,0,0,0,0,0,0,0,
.by 1,1,1,1,1,1,1,1,1 .by 0,0,0,0,0,0,0,0,0,0,
.by 2,2,2,2,2,2,2,2,2,2 .by 0,0,0,0,0,0,0,0,0,0,
.by 3,3,3,3,3,3,3,3,3,3,3 .by 0,0,0,0,0,0,0,0,0,0,
.by 0,0,0,0,0,0,0,0,0,0,
.by 0
EndOfTheBarrelY EndOfTheBarrelY
; right angles from 0 (vertically up) to 90 (horizontally to the right) ; right angles from 0 (horizontally right) to 90 (up)
.by 7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7 ; one pixel Up for fix problems with colision check
.by 7,7,7,7,7,7,7,7,7 ;.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 .by 4,4,4,4,4,4,4,4,4,4,
.by 6,6,6,6,6,6,6,6,6 .by 4,4,4,4,4,4,4,4,4,4,
.by 5,5,5,5,5,5,5,5,5,5 .by 4,4,4,4,4,4,4,5,5,5,
.by 4,4,4,4,4,4,4,4,4,4,4,4,4 .by 5,5,5,5,5,5,5,6,6,6,
.by 4,4,4,4,4,4,4,4,4,4,4,4,4,4 ; one pixel Up for fix problems with colision check .by 6,6,6,6,6,6,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
;.by 7,
; left angles from 90 (vertical) to 180 (horizontally left)
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,7,7,7,7,7,
.by 7,7,7,7,7,6,6,6,6,6,
.by 6,6,6,6,5,5,5,5,5,5,
.by 5,5,5,5,4,4,4,4,4,4,
.by 4,4,4,4,4,4,4,4,4,4,
.by 4,4,4,4,4,4,4,4,4,4,
.by 4,
; one pixel Up for fix problems with colision check
;.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3 ;.by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0,0,0,0,0,0,0 ; not used
.by 0,0,0,0 ; not used
; left angles from 90 (horizontally to the left) to 1 (vertically up)
; .by 3,3,3,3,3,3,3,3,3,3,3,3,3,3
.by 4,4,4,4,4,4,4,4,4,4,4,4,4,4 ; one pixel Up for fix problems with colision check
.by 4,4,4,4,4,4,4,4,4,4,4,4,4
.by 5,5,5,5,5,5,5,5,5,5
.by 6,6,6,6,6,6,6,6,6
.by 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7
.by 7,7,7,7,7,7,7,7,7,7,7
;------------------------------------------------- ;-------------------------------------------------
TanksNamesDefault TanksNamesDefault
@@ -605,8 +349,8 @@ WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price_StrongParachute .by >price_StrongParachute
.by >price_Mag_Deflector__ .by >price_Mag_Deflector__
.by >price_Shield_________ .by >price_Shield_________
.by >price_Force_Shield___
.by >price_Heavy_Shield___ .by >price_Heavy_Shield___
.by >price_Force_Shield___
.by >price_Super_Mag______ .by >price_Super_Mag______
.by >price_Auto_Defense___ .by >price_Auto_Defense___
.by >price_Fuel_Tank______ .by >price_Fuel_Tank______
@@ -671,8 +415,8 @@ WeaponPriceL
.by <price_StrongParachute .by <price_StrongParachute
.by <price_Mag_Deflector__ .by <price_Mag_Deflector__
.by <price_Shield_________ .by <price_Shield_________
.by <price_Force_Shield___
.by <price_Heavy_Shield___ .by <price_Heavy_Shield___
.by <price_Force_Shield___
.by <price_Super_Mag______ .by <price_Super_Mag______
.by <price_Auto_Defense___ .by <price_Auto_Defense___
.by <price_Fuel_Tank______ .by <price_Fuel_Tank______
@@ -687,18 +431,18 @@ WeaponPriceL
WeaponUnits WeaponUnits
.by 10 ;Baby_Missile___ .by 10 ;Baby_Missile___
.by 5 ;Missile________ .by 5 ;Missile________
.by 3 ;Baby_Nuke______ .by 2 ;Baby_Nuke______
.by 1 ;Nuke___________ .by 1 ;Nuke___________
.by 2 ;LeapFrog_______ .by 2 ;LeapFrog_______
.by 2 ;Funky_Bomb_____ .by 3 ;Funky_Bomb_____
.by 3 ;MIRV___________ .by 2 ;MIRV___________
.by 1 ;Death_s_Head___ .by 1 ;Death_s_Head___
.by 10 ;Napalm_________ .by 4 ;Napalm_________
.by 2 ;Hot_Napalm_____ .by 2 ;Hot_Napalm_____
.by 20 ;Tracer_________ .by 20 ;Tracer_________
.by 10 ;Smoke_Tracer___ .by 10 ;Smoke_Tracer___
.by 10 ;Baby_Roller____ .by 5 ;Baby_Roller____
.by 5 ;Roller_________ .by 3 ;Roller_________
.by 2 ;Heavy_Roller___ .by 2 ;Heavy_Roller___
.by 5 ;Riot_Charge____ .by 5 ;Riot_Charge____
.by 2 ;Riot_Blast_____ .by 2 ;Riot_Blast_____
@@ -710,9 +454,9 @@ WeaponUnits
.by 10 ;Baby_Sandhog___ .by 10 ;Baby_Sandhog___
.by 5 ;Sandhog________ .by 5 ;Sandhog________
.by 2 ;Heavy_Sandhog__ .by 2 ;Heavy_Sandhog__
.by 10 ;Dirt_Clod______ .by 5 ;Dirt_Clod______
.by 5 ;Dirt_Ball______ .by 3 ;Dirt_Ball______
.by 2 ;Ton_of_Dirt____ .by 1 ;Ton_of_Dirt____
.by 4 ;Liquid_Dirt____ .by 4 ;Liquid_Dirt____
.by 2 ;Dirt_Charge____ .by 2 ;Dirt_Charge____
.by 10 ;Earth_Disrupter .by 10 ;Earth_Disrupter
@@ -739,12 +483,12 @@ WeaponUnits
.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 3 ;Parachute______
.by 2 ;StrongParachute .by 2 ;StrongParachute
.by 2 ;Mag_Deflector__ .by 2 ;Mag_Deflector__
.by 3 ;Shield_________ .by 3 ;Shield_________
.by 3 ;Force_Shield___
.by 2 ;Heavy_Shield___ .by 2 ;Heavy_Shield___
.by 3 ;Force_Shield___
.by 2 ;Super_Mag______ .by 2 ;Super_Mag______
.by 1 ;Auto_Defense___ .by 1 ;Auto_Defense___
.by 10 ;Fuel_Tank______ .by 10 ;Fuel_Tank______
@@ -760,8 +504,8 @@ PurchaseMeTable ;weapons good to be purchased by the robot
dta 1 ;"Funky Bomb " ; 5 dta 1 ;"Funky Bomb " ; 5
dta 1 ;"MIRV " ; 6 dta 1 ;"MIRV " ; 6
dta 1 ;"Death's Head " ; 7 dta 1 ;"Death's Head " ; 7
dta 0 ;"Napalm " ; 8 dta 1 ;"Napalm " ; 8
dta 0 ;"Hot Napalm " ; 9 dta 1 ;"Hot Napalm " ; 9
dta 0 ;"Tracer " ; 10 dta 0 ;"Tracer " ; 10
dta 0 ;"Smoke Tracer " ; 11 dta 0 ;"Smoke Tracer " ; 11
dta 1 ;"Baby Roller " ; 12 dta 1 ;"Baby Roller " ; 12
@@ -800,6 +544,22 @@ PurchaseMeTable ;weapons good to be purchased by the robot
dta 0 ;"----------------" ; 45 dta 0 ;"----------------" ; 45
dta 0 ;"----------------" ; 46 dta 0 ;"----------------" ; 46
dta 0 ;"----------------" ; 47 dta 0 ;"----------------" ; 47
dta 0 ;"White Flag " ; 48
dta 1 ;"Battery " ; 49
dta 0 ;"Bal Guidance " ; 50
dta 0 ;"Horz Guidance " ; 51
dta 0 ;"Vert Guidance " ; 52
dta 0 ;"Lazy Boy " ; 53
dta 1 ;"Parachute " ; 54
dta 1 ;"Strong Parachute" ; 55
dta 1 ;"Mag Deflector " ; 56
dta 1 ;"Shield " ; 57
dta 1 ;"Heavy Shield " ; 58
dta 1 ;"Force Shield " ; 59
dta 0 ;"Super Mag " ; 60
dta 1 ;"Auto Defense " ; 61
dta 0 ;"Fuel Tank " ; 62
dta 0 ;"Nuclear Winter " ; 63
;------------------------------------------------- ;-------------------------------------------------
@@ -812,7 +572,7 @@ WeaponSymbols
.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,$1c,$03,$06,$1d,$0a,$1b,$1b ; defensives .by $5f,$1c,$03,$06,$1d,$0a,$1b,$1b ; defensives
.by $1e,$3b,$3c,$3d,$3e,$3f,$5e,$7d .by $1e,$3b,$3d,$3c,$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
@@ -875,8 +635,8 @@ NamesOfWeapons ;the comment is an index in the tables
dta d"Strong Parachute" ; 55 - with energy (earlier Battery) 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"Heavy Shield " ; 58 - shield with energy
dta d"Heavy Shield " ; 59 - shield with energy dta d"Force Shield " ; 59 - shield with energy and parachute
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
@@ -892,8 +652,8 @@ DefensiveEnergy = * - 48
.by 99 ; Strong Parachute .by 99 ; Strong Parachute
.by 99 ; Mag Deflector .by 99 ; Mag Deflector
.by 00 ; Shield .by 00 ; Shield
.by 99 ; Force Shield
.by 99 ; Heavy Shield .by 99 ; Heavy Shield
.by 99 ; Force 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
+30 -26
View File
@@ -3,12 +3,16 @@
screenheight = 200 screenheight = 200
screenBytes = 40 screenBytes = 40
screenwidth = screenBytes*8 ; Max screenwidth = 512!!! screenwidth = screenBytes*8 ; Max screenwidth = 512!!!
margin = 48 ;mountain drawing Y variable margin margin = 40 ;mountain drawing Y variable margin
display = $1010 ;screen takes $2K due to clearing routine display = $1010 ;screen takes $2K due to clearing routine
MaxPlayers = 6 MaxPlayers = 6
maxOptions = 7 ;number of all options maxOptions = 8 ;number of all options
PMOffset = $23 ; P/M to graphics offset PMOffsetX = $2C ; P/M to graphics offset
PMOffsetY = $23 ; P/M to graphics offset
napalmRadius = 10
TextBackgroundColor = $02 ; REAL constans - use: LDA #TextBackgroundColor
TextForegroundColor = $0c
;Weapon prices (*10 on screen) ;Weapon prices (*10 on screen)
price_Baby_Missile___ = 0 ;_0 price_Baby_Missile___ = 0 ;_0
@@ -19,31 +23,31 @@ price_LeapFrog_______ = 192 ;_4
price_Funky_Bomb_____ = 293 ;_5 price_Funky_Bomb_____ = 293 ;_5
price_MIRV___________ = 456 ;_6 price_MIRV___________ = 456 ;_6
price_Death_s_Head___ = 337 ;_7 price_Death_s_Head___ = 337 ;_7
price_Napalm_________ = $ffff ;496 ;_8 price_Napalm_________ = 125 ;_8
price_Hot_Napalm_____ = $ffff ;511 ;_9 price_Hot_Napalm_____ = 162 ;_9
price_Tracer_________ = 102 ;_10 price_Tracer_________ = 102 ;_10
price_Smoke_Tracer___ = 291 ;_11 price_Smoke_Tracer___ = 291 ;_11
price_Baby_Roller____ = 689 ;_12 price_Baby_Roller____ = 211 ;_12
price_Roller_________ = 600 ;_13 price_Roller_________ = 244 ;_13
price_Heavy_Roller___ = 592 ;_14 price_Heavy_Roller___ = 326 ;_14
price_Riot_Charge____ = 330 ;_15 price_Riot_Charge____ = 230 ;_15
price_Riot_Blast_____ = 341 ;_16 price_Riot_Blast_____ = 241 ;_16
price_Riot_Bomb______ = 369 ;_17 price_Riot_Bomb______ = 259 ;_17
price_Heavy_Riot_Bomb = 322 ;_18 price_Heavy_Riot_Bomb = 272 ;_18
price_Baby_Digger____ = 336 ;_19 price_Baby_Digger____ = 136 ;_19
price_Digger_________ = 276 ;_20 price_Digger_________ = 176 ;_20
price_Heavy_Digger___ = 253 ;_21 price_Heavy_Digger___ = 207 ;_21
price_Baby_Sandhog___ = 218 ;_22 price_Baby_Sandhog___ = 158 ;_22
price_Sandhog________ = 191 ;_23 price_Sandhog________ = 191 ;_23
price_Heavy_Sandhog__ = 305 ;_24 price_Heavy_Sandhog__ = 223 ;_24
price_Dirt_Clod______ = 104 ;_25 price_Dirt_Clod______ = 104 ;_25
price_Dirt_Ball______ = 130 ;_26 price_Dirt_Ball______ = 130 ;_26
price_Ton_of_Dirt____ = 171 ;_27 price_Ton_of_Dirt____ = 171 ;_27
price_Liquid_Dirt____ = 530 ;_28 price_Liquid_Dirt____ = 330 ;_28
price_Dirt_Charge____ = 581 ;_29 price_Dirt_Charge____ = 343 ;_29
price_Earth_Disrupter = $ffff ;430 ;_30 price_Earth_Disrupter = $ffff ;430 ;_30
price_Plasma_Blast___ = $ffff ;274 ;_31 price_Plasma_Blast___ = $ffff ;274 ;_31
price_Laser__________ = 577 ;_32 price_Laser__________ = 277 ;_32
price______________33 = 0 price______________33 = 0
price______________34 = 0 price______________34 = 0
price______________35 = 0 price______________35 = 0
@@ -67,10 +71,10 @@ price_Vert_Guidance__ = $ffff ;_52
price_Lazy_Boy_______ = $ffff ;_53 price_Lazy_Boy_______ = $ffff ;_53
price_Parachute______ = 234 ;_54 price_Parachute______ = 234 ;_54
price_StrongParachute = 1000 ;_55 price_StrongParachute = 1000 ;_55
price_Mag_Deflector__ = 245 ;_56 price_Mag_Deflector__ = 745 ;_56
price_Shield_________ = 112 ;_57 price_Shield_________ = 224 ;_57
price_Force_Shield___ = 268 ;_58 price_Heavy_Shield___ = 628 ;_58
price_Heavy_Shield___ = 375 ;_59 price_Force_Shield___ = 1100 ;_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
@@ -134,8 +138,8 @@ ind_Parachute______ = 54
ind_StrongParachute = 55 ind_StrongParachute = 55
ind_Mag_Deflector__ = 56 ind_Mag_Deflector__ = 56
ind_Shield_________ = 57 ind_Shield_________ = 57
ind_Force_Shield___ = 58 ind_Heavy_Shield___ = 58
ind_Heavy_Shield___ = 59 ind_Force_Shield___ = 59
ind_Super_Mag______ = 60 ind_Super_Mag______ = 60
ind_Auto_Defense___ = 61 ind_Auto_Defense___ = 61
ind_Fuel_Tank______ = 62 ind_Fuel_Tank______ = 62
+2 -3
View File
@@ -89,7 +89,7 @@ dl ; MAIN game display list
.by $0f+$80 ; DLI (black to end);1 .by $0f+$80 ; DLI (black to end);1
:38 .byte $0f ;35 ..... = 200 :38 .byte $0f ;35 ..... = 200
.by $4f .by $4f
.wo LastLine ; additional line of ground .wo EmptyLine ; additional line of ground
.byte $41 .byte $41
.word dl .word dl
;----------------------------------------------- ;-----------------------------------------------
@@ -110,6 +110,7 @@ OptionsHere
dta d"Rounds : 10 20 30 40 50 " dta d"Rounds : 10 20 30 40 50 "
dta d"Missiles : slug slow norm fast hare " dta d"Missiles : slug slow norm fast hare "
dta d"Seppuku : nevr rare norm oftn alws " dta d"Seppuku : nevr rare norm oftn alws "
dta d"Mountains: NL BE CZ CH NP "
OptionsScreenEnd OptionsScreenEnd
;----------------------------------------------- ;-----------------------------------------------
MoreUp MoreUp
@@ -143,8 +144,6 @@ purchaseActivate
dta d" - Finish " dta d" - Finish "
EmptyLine EmptyLine
dta d" " dta d" "
LastLine
:40 dta $00
; ------------------------------------------------- ; -------------------------------------------------
.ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!! .ALIGN $1000 ; WARNING!!!! 4KiB barrier crossing here, might need reassignment!!!
NameScreen NameScreen
+398 -82
View File
@@ -28,7 +28,7 @@
; begin: xdraw,ydraw - end: xbyte,ybyte ; begin: xdraw,ydraw - end: xbyte,ybyte
; let's store starting coordinates ; let's store starting coordinates
; will be needed, because everything is calculated relatively ; will be needed, because everything is calculated relatively
mwa #0 LineLength mwa #$ffff LineLength
mwa xdraw xtempDRAW mwa xdraw xtempDRAW
mwa ydraw ytempDRAW mwa ydraw ytempDRAW
@@ -609,29 +609,31 @@ DrawNextTank
ldx tankNr ldx tankNr
; let's check the energy ; let's check the energy
lda eXistenZ,x lda eXistenZ,x
bne SkipRemovigPM ; if energy=0 then no tank bne SkipHidingPM ; if energy=0 then no tank
; hide P/M ; hide P/M
lda #0 lda #0
cpx #$4 ; 5th tank is defferent
bne No5thTankHide
sta hposp0+4
sta hposp0+5
beq @+
No5thTankHide
cpx #$5 ; 6th tank is defferent
bne No6thTankHide
sta hposp0+6
sta hposp0+7
beq @+
No6thTankHide
sta hposp0,x sta hposp0,x
@
jmp DoNotDrawTankNr jmp DoNotDrawTankNr
SkipRemovigPM SkipHidingPM
lda AngleTable,x lda AngleTable,x
bmi AngleToLeft01
lda #90
sec
sbc AngleTable,x
tay tay
lda BarrelTableR,y lda BarrelTable,y
jmp CharacterAlreadyKnown
AngleToLeft01
sec
sbc #(255-90)
tay
lda BarrelTableL,y
CharacterAlreadyKnown
sta CharCode sta CharCode
DrawTankNrX DrawTankNrX
ldx tanknr ldx tanknr
@@ -647,20 +649,31 @@ DrawTankNrX
; now P/M graphics on the screen (only for 5 tanks) ; now P/M graphics on the screen (only for 5 tanks)
; horizontal position ; horizontal position
ldx TankNr
mwa xdraw xbyte mwa xdraw xbyte
ldx tanknr
cpx #$5
bcs NoPlayerMissile
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 #PMOffset+1 ; P/M to graphics offset adc #PMOffsetX ; 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 No5thTank
clc clc
adc #$0C ; missile offset offset adc #$04 ; missile offset offset
NoMissile sta hposp0+4
sta hposp0+5
bne NoMissile
No5thTank
cpx #$5 ; 6th tank are joined missiles and offset is defferent
bne Tanks1to4
clc
adc #$04 ; missile offset offset
sta hposp0+6
sta hposp0+7
bne NoMissile
Tanks1to4
sta hposp0,x sta hposp0,x
NoMissile
; vertical position ; vertical position
lda pmtableL,x lda pmtableL,x
sta xbyte sta xbyte
@@ -670,36 +683,61 @@ NoMissile
; calculate start position of the tank ; calculate start position of the tank
lda ydraw lda ydraw
clc clc
adc #PMOffset adc #PMOffsetY
sta temp sta temp
; clear sprite and put 3 lines on the tank at the same time
ldy #$00 ldy #$00
tya cpx #$5
bcs PMForTank6
; clear sprite and put 3 lines on the tank at the same time
ldx #3 ; three lines of PM
ClearPM ClearPM
cpy temp cpy temp
bne ZeroesToGo bne ZeroesToGo
lda #$03 ; (2 bits set) we set on two pixels in three lines @ lda (xbyte),y
and #%11110000
ora #%00001111 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y sta (xbyte),y
dey dey
sta (xbyte),y dex
dey bne @-
sta (xbyte),y
dey
lda #$00
ZeroesToGo ZeroesToGo
lda (xbyte),y
and #%11110000
sta (xbyte),y sta (xbyte),y
dey dey
bne ClearPM bne ClearPM
beq NoPlayerMissile
PMForTank6
; clear sprite and put 3 lines on the tank at the same time
ldx #3 ; three lines of PM
ClearPM6
cpy temp
bne ZeroesToGo6
@ lda (xbyte),y
and #%00001111
ora #%11110000 ; (2 bits set) we set on two pixels in three lines
sta (xbyte),y
dey
dex
bne @-
ZeroesToGo6
lda (xbyte),y
and #%00001111
sta (xbyte),y
dey
bne ClearPM6
NoPlayerMissile 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
ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #ind_Shield_________ ; one shot shield cmp #ind_Shield_________ ; one shot shield
beq ShieldDraw beq DrawTankShield
cmp #ind_Force_Shield___ ; shield with energy and parachute cmp #ind_Force_Shield___ ; shield with energy and parachute
beq ShieldDraw beq DrawTankShieldBold
cmp #ind_Heavy_Shield___ ; shield with energy cmp #ind_Heavy_Shield___ ; shield with energy
beq ShieldDraw beq DrawTankShieldBold
cmp #ind_Auto_Defense___ ; Auto Defence cmp #ind_Auto_Defense___ ; Auto Defence
beq DrawTankShieldWihHorns beq DrawTankShieldWihHorns
cmp #ind_Mag_Deflector__ ; Mag Deflector cmp #ind_Mag_Deflector__ ; Mag Deflector
@@ -707,15 +745,14 @@ NoPlayerMissile
cmp #ind_White_Flag_____ ; White Flag cmp #ind_White_Flag_____ ; White Flag
beq DrawTankFlag beq DrawTankFlag
bne NoShieldDraw bne NoShieldDraw
ShieldDraw DrawTankShield
jsr DrawTankShield.DrawInPosition jmp DrawTankShield.DrawInPosition
NoShieldDraw
DoNotDrawTankNr
rts
DrawTankShieldWihHorns DrawTankShieldWihHorns
jsr DrawTankShield.DrawInPosition jsr DrawTankShield.DrawInPosition
jsr DrawTankShieldHorns jmp DrawTankShieldHorns
rts DrawTankShieldBold
jsr DrawTankShield.DrawInPosition
jmp DrawTankShieldBoldLine
DrawTankFlag DrawTankFlag
lda #$5E ; flag symbol lda #$5E ; flag symbol
sta CharCode sta CharCode
@@ -728,6 +765,8 @@ DrawTankFlag
lda XtanksTableH,x lda XtanksTableH,x
sta xdraw+1 sta xdraw+1
jsr TypeChar jsr TypeChar
NoShieldDraw
DoNotDrawTankNr
rts rts
.endp .endp
@@ -742,11 +781,11 @@ tankflash_loop
sne:mva #1 fs ; finish it sne:mva #1 fs ; finish it
mva #1 Erase mva #1 Erase
ldx TankNr ldx TankNr
jsr DrawTankNr.SkipRemovigPM ; it's necessary becouse DrawTankNr skips tanks with no energy ! jsr DrawTankNr.SkipHidingPM ; it's necessary becouse DrawTankNr skips tanks with no energy !
PAUSE 2 PAUSE 2
mva #0 Erase mva #0 Erase
ldx TankNr ldx TankNr
jsr DrawTankNr.SkipRemovigPM jsr DrawTankNr.SkipHidingPM
PAUSE 2 PAUSE 2
dec fs dec fs
jne tankflash_loop jne tankflash_loop
@@ -784,7 +823,7 @@ ShieldVisible
dec temp dec temp
bne @- bne @-
; draw left oblique line of shield ( / ) ; draw left oblique line of shield ( / )
mva #4 temp mva #3 temp
@ @
jsr plot jsr plot
.nowarn dew ydraw .nowarn dew ydraw
@@ -792,14 +831,14 @@ ShieldVisible
dec temp dec temp
bne @- bne @-
; draw top horizontal line of shield ( _ ) ; draw top horizontal line of shield ( _ )
mva #5 temp mva #7 temp
@ @
jsr plot jsr plot
inw xdraw inw xdraw
dec temp dec temp
bne @- bne @-
; draw right oblique line of shield ( \ ) ; draw right oblique line of shield ( \ )
mva #4 temp mva #3 temp
@ @
jsr plot jsr plot
inw ydraw inw ydraw
@@ -834,6 +873,290 @@ ShieldVisible
jsr plot jsr plot
rts rts
.endp .endp
;--------------------------------------------------
.proc DrawTankShieldBoldLine
; use only directly after DrawTankShield
; this proc draws bold top on shield.
; Symbol of ablative shield ? :)
;--------------------------------------------------
sbw xdraw #$04 ; 5 pixels left
sbw ydraw #$0b ; 11 pixels up
; draw additional top horizontal line of shield ( _ )
mva #6 temp
@
jsr plot
.nowarn dew xdraw
dec temp
bne @-
rts
.endp
;--------------------------------------------------
.proc DrawTankParachute
;Tank number in X
;--------------------------------------------------
lda #$34 ; parachute 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
;--------------------------------------------------
.proc TankFalls;
;--------------------------------------------------
lda #0
sta PreviousFall ; bit 7 - left, bit 6 - right
sta EndOfTheFallFlag
sta Parachute
mva #2 FallingSoundBit ; another trick for only one sfx initialization in loop
; let's check if the given tank has got the parachute
ldx TankNr
lda ActiveDefenceWeapon,x
cmp #ind_Parachute______ ; parachute
beq ParachuteActive
cmp #ind_StrongParachute ; strong parachute
beq ParachuteActive
cmp #ind_Force_Shield___ ; shield witch energy and parachute
bne TankFallsX
ParachuteActive
inc Parachute
TankFallsX
; sound only if really falls
lda Parachute
and FallingSoundBit ; bit 1
beq NoFallingSound
mva #0 FallingSoundBit
mva #sfx_shield_off sfx_effect
NoFallingSound
; clear previous position
mva #1 Erase
jsr DrawTankNr
; and the parachute (if present)
lda Parachute
and #01
beq DoNotClearParachute
; here we clear the parachute
ldx TankNr
jsr DrawTankParachute
DoNotClearParachute
mva #0 Erase
ldx TankNr
lda EndOfTheFallFlag ; We only get byte below the tank if still falling
bne NoGroundCheck
; coordinates of the first pixel under the tank
ldx TankNr
lda XtankstableL,x
sta xdraw
lda XtankstableH,x
sta xdraw+1
lda Ytankstable,x
clc
adc #1 ; in this point the comment helped us! For the very first
; time in our lives! Tada! It opens a new chapter!!!
sta ydraw
;
; UnderTank1 ; byte under tank
; UnderTank2 ; byte under tank reversed (for simple check right direction)
lda #08
sta temp ; Loop Counter
ByteBelowTank
jsr point
beq EmptyPoint2
sec
ror UnderTank2
sec
bcs ROLPoint2
EmptyPoint2
clc
ror UnderTank2
clc
ROLPoint2
rol UnderTank1
inw xdraw
dec temp
bne ByteBelowTank
NoGroundCheck
ldx TankNr
lda UnderTank1
bne NoFallingDown
; Tank falling down ----
lda Parachute
and #1
bne ParachutePresent
; decreasing energy
ldy #2 ; how much energy to substract
jsr DecreaseEnergyX
ParachutePresent
; check parachute type
lda ActiveDefenceWeapon,x
cmp #ind_StrongParachute ; strong parachute
bne OneTimeParachute
; decreasing energy of parachute
ldy #2 ; how much energy to substract
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
OneTimeParachute
lda Parachute
ora #2 ; we set bit nr 1 (nr 0 means that parachute is present)
sta Parachute
; tank is falling down - modify coorinates
lda Ytankstable,x
clc
adc #1
sta Ytankstable,x
jmp EndOfFCycle
NoFallingDown
; check direction (left or right)
ldy #7 ; SlideLeftTable length -1 (from 0 to 7)
@ lda SlideLeftTable,y
cmp UnderTank1
beq FallingRight
cmp UnderTank2
beq FallingLeft
dey
bpl @-
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 XtanksTableL,x
bne NotLeftEdge
lda XtanksTableH,x
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
; tank is falling right
bit PreviousFall ; bit 7 - left
bmi EndRightFall
; we finish falling right if the tank reached the edge of the screen
clc
lda XtanksTableL,x
adc #$08 ; we'll check right side of the char
sta temp
lda XtanksTableH,x
adc #0
sta temp+1
cpw temp #screenwidth
beq EndRightFall
; tank is falling right - modify coorinates
sec
lda XtankstableL,x
sbc #1
sta XtankstableL,x
lda XtankstableH,x
sbc #0
sta XtankstableH,x
mva #%01000000 PreviousFall ; set bit 6 - right
bne EndOfFCycle
EndLeftFall
EndRightFall
NoLeftOrRight
inc EndOfTheFallFlag ; after this is shouldn't fall
EndOfFCycle
; draw tank on new position
jsr DrawTankNr ; ew have TankNr in X (I hope :) )
; checking is parachute present and if so, draw it
lda Parachute
cmp #3 ; parachute and falling
bne DoNotDrawParachute
; here we draw parachute
ldx TankNr
jsr DrawTankParachute
wait ; onli if tank with patachute
RapidFalling
DoNotDrawParachute
lda EndOfTheFallFlag
jeq TankFallsX
; Tank falling down already finished, but it is not sure that
; the horizontal coordinate is even.
; If it is odd then it must be corrected because otherwise
; P/M graphics background would not look OK
ldx TankNr
lda XtanksTableL,x
and #$01
beq EndOfFall ; if it is even then it is the end
; and if not, we push it one pixel the way it was falling before
lda #%10000000 ; set "virtual ground" for right falling
ldy #%00000001
bit PreviousFall
bmi ForceFallLeft
tay ; tricky - replaces ldy #%10000000
lda #%00000001 ; set "virtual ground" for left falling
ForceFallLeft
sta UnderTank1
sty UnderTank2
jne TankFallsX
EndOfFall
mva #1 Erase
ldx TankNr
; if tank was falling down having parachute,
; we must deduct one parachute
lda Parachute
cmp #$03 ; was falling down and the parachute
bne NoParachuteWeapon
; first we check type of parachute
lda ActiveDefenceWeapon,x
cmp #ind_Parachute______ ; deactivate weapon only if parachute (54)
bne NoParachuteWeapon
mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute)
NoParachuteWeapon
; now we clear parachute on the screen if present
lda Parachute
and #01
beq ThereWasNoParachute
jsr DrawTankParachute
ThereWasNoParachute
mva #0 Erase
ldx TankNr
jsr DrawTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
mva #sfx_silencer sfx_effect
rts
.endp
;--------------------------------------------------
.proc ClearPMmemory
;--------------------------------------------------
lda #$00
tay
@ sta pmgraph+$300,y
sta pmgraph+$400,y
sta pmgraph+$500,y
sta pmgraph+$600,y
sta pmgraph+$700,y
iny
bne @-
rts
.endp
;-------------------------------------------------- ;--------------------------------------------------
.proc drawmountains .proc drawmountains
@@ -933,7 +1256,6 @@ StillNothing
lda ydraw lda ydraw
sta (tempor2),y sta (tempor2),y
sta (temp),y sta (temp),y
jmp FoundPeek1
FoundPeek1 FoundPeek1
inw tempor2 inw tempor2
inw temp inw temp
@@ -1001,7 +1323,7 @@ ColumnIsReady
; level of the mountains ; level of the mountains
jeq MainFallout2 jeq MainFallout2
; now correct heights are in the mountaintable ; now correct heights are in the mountaintable
mva #1 color sta color ; Pozor! :) we know - now A=1
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
rts rts
.endp .endp
@@ -1022,6 +1344,8 @@ getrandomY ;getting random Y coordinate
sta ydraw sta ydraw
sta yfloat+1 sta yfloat+1
mva #0 yfloat ;yfloat equals to e.g. 140.0 mva #0 yfloat ;yfloat equals to e.g. 140.0
mva #screenheight-margin-5 yfloat+1
sta ydraw
; how to make nice looking mountains? ; how to make nice looking mountains?
; randomize points and join them with lines ; randomize points and join them with lines
@@ -1030,9 +1354,10 @@ getrandomY ;getting random Y coordinate
NextPart NextPart
lda random lda random
and mountainDeltaL
sta delta ; it is after the dot (xxx.delta) sta delta ; it is after the dot (xxx.delta)
lda random lda random
and #$03 ;(max delta) and mountainDeltaH ;(max delta)
sta delta+1 ; before the dot (delta+1.delta) sta delta+1 ; before the dot (delta+1.delta)
lda random lda random
@@ -1247,8 +1572,8 @@ EndOfUnPlot
; game. If you are going to speed up the game, start with ; game. If you are going to speed up the game, start with
; plot - it is used by every single effect starting from explosions ; plot - it is used by every single effect starting from explosions
; through line drawing and small text output!!! ; through line drawing and small text output!!!
; We tried to keep it clear and therefore it is far from ;
; optimal speed. ; Optimized by 0xF (Fox) THXXXX!!!
; ----------------------------------------- ; -----------------------------------------
; is it not over the screen ??? ; is it not over the screen ???
@@ -1259,28 +1584,24 @@ CheckX02
bcs EndOfPlot ;nearest RTS bcs EndOfPlot ;nearest RTS
MakePlot MakePlot
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
mwa xdraw xbyte
lda xbyte
and #$7
sta ybit
;xbyte = xbyte/8 ;xbyte = xbyte/8
lda xbyte lda xdraw+1
lsr xbyte+1 lsr
lda xdraw
ror ;just one bit over 256. Max screenwidth = 512!!! ror ;just one bit over 256. Max screenwidth = 512!!!
lsr lsr
lsr lsr
tay ;save sta xbyte
;--- ;---
ldx ydraw ldx ydraw
lda linetableL,x ldy linetableL,x
sta xbyte
lda linetableH,x lda linetableH,x
sta xbyte+1 sta xbyte+1
ldx ybit lda xdraw
and #$7
tax
lda color lda color
bne ClearPlot bne ClearPlot
@@ -1303,35 +1624,30 @@ ClearPlot
; result is in A (zero or appropriate bit is set) ; result is in A (zero or appropriate bit is set)
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
mwa xdraw xbyte
lda xbyte
and #$7
sta ybit
;xbyte = xbyte/8 ;xbyte = xbyte/8
lda xbyte lda xdraw+1
lsr xbyte+1 lsr
lda xdraw
ror ;just one bit over 256. Max screenwidht = 512!!! ror ;just one bit over 256. Max screenwidht = 512!!!
lsr lsr
lsr lsr
tay ;save sta xbyte
;--- ;---
ldx ydraw ldx ydraw
lda linetableL,x ldy linetableL,x
sta xbyte
lda linetableH,x lda linetableH,x
sta xbyte+1 sta xbyte+1
ldx ybit lda xdraw
and #$7
tax
lda (xbyte),y lda (xbyte),y
eor #$ff
and bittable,x and bittable,x
eor bittable,x
rts rts
.endp .endp;--------------------------------------------------
;--------------------------------------------------
.proc DrawLine .proc DrawLine
;-------------------------------------------------- ;--------------------------------------------------
mva #0 ydraw+1 mva #0 ydraw+1
@@ -1583,12 +1899,12 @@ EndPut4x4
.endp .endp
.proc SetMainScreen .proc SetMainScreen
mva #0 dmactl ; mva #0 dmactls
VDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen VDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen
mwa #dl dlptrs ; issue #72 (glitches when switches) mwa #dl dlptrs ; issue #72 (glitches when switches)
lda dmactls lda #%00111110
and #$fc ; and #$fc
ora #$02 ; 2=normal, 3 = wide screen width ; ora #$02 ; 2=normal, 3 = wide screen width
sta dmactls sta dmactls
rts rts
.endp .endp
+3 -3
View File
@@ -10,9 +10,9 @@
dma = %100000 dma = %100000
.ende .ende
scr48 = @dmactl(wide|dma|players|missiles|lineX1) ;screen 48b scr48 = @dmactl(wide|dma|players|missiles|lineX1)
scr40 = @dmactl(standard|dma|players|missiles|lineX1) ;screen 40b scr40 = @dmactl(standard|dma|players|missiles|lineX1)
scr32 = @dmactl(narrow|dma|players|missiles|lineX1) ;screen 32b scr32 = @dmactl(narrow|dma|players|missiles|lineX1)
.enum @pmcntl .enum @pmcntl
missiles= %1 missiles= %1
+3
View File
@@ -104,6 +104,9 @@
.macro randomize .macro randomize
;usage: randomize floor ceiling ;usage: randomize floor ceiling
;returns (in A) a random .byte between "floor" and "ceiling" ;returns (in A) a random .byte between "floor" and "ceiling"
.if :2 < :1
.error "floor higher than ceiling"
.endif
?rand ?rand
lda random lda random
cmp #:1 ;floor cmp #:1 ;floor
+86 -54
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"145" ; number of this build (3 bytes) dta d"148" ; number of this build (3 bytes)
.endm .endm
icl 'definitions.asm' icl 'definitions.asm'
@@ -73,11 +73,15 @@
.zpvar dd .word .zpvar dd .word
.zpvar di .word .zpvar di .word
.zpvar dp .word .zpvar dp .word
;----------------------------
.zpvar UnderTank1 .byte
.zpvar UnderTank2 .byte
;---------------------------- ;----------------------------
.zpvar weaponPointer .word .zpvar weaponPointer .word
.zpvar dliCounter .byte .zpvar dliCounter .byte
.zpvar pressTimer .byte .zpvar pressTimer .byte
.zpvar NTSCcounter .byte .zpvar NTSCcounter .byte
.zpvar IsEndOfTheFallFlag .byte ; for small speedup ground falling
;.zpvar dliA .byte ;.zpvar dliA .byte
;.zpvar dliX .byte ;.zpvar dliX .byte
;.zpvar dliY .byte ;.zpvar dliY .byte
@@ -140,7 +144,7 @@ MainGameLoop
jsr CallPurchaseForEveryTank jsr CallPurchaseForEveryTank
; issue #72 (glitches when switches) ; issue #72 (glitches when switches)
mva #0 dmactl mva #0 dmactls
jsr GetRandomWind jsr GetRandomWind
@@ -209,22 +213,22 @@ CalculateGains
lda moneyH,x lda moneyH,x
adc gainH,x adc gainH,x
sta moneyH,x sta moneyH,x
; substract loose ; substract lose
; if loose is greater than money then zero money ; if lose is greater than money then zero money
lda moneyH,x lda moneyH,x
cmp looseH,x cmp loseH,x
bcc zeromoney bcc zeromoney
bne substractloose bne substractlose
lda moneyL,x lda moneyL,x
cmp looseL,x cmp loseL,x
bcc zeromoney bcc zeromoney
substractloose substractlose
sec sec
lda moneyL,x lda moneyL,x
sbc looseL,x sbc loseL,x
sta moneyL,x sta moneyL,x
lda moneyH,x lda moneyH,x
sbc looseH,x sbc loseH,x
sta moneyH,x sta moneyH,x
jmp skipzeroing jmp skipzeroing
zeromoney zeromoney
@@ -240,9 +244,12 @@ skipzeroing
jne START jne START
inc CurrentRoundNr inc CurrentRoundNr
mva #0 dmactl ; issue #72 lda #$0
sta dmactls ; issue #72
jsr RmtSongSelect jsr RmtSongSelect
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
jsr PMoutofscreen
jmp MainGameLoop jmp MainGameLoop
@@ -254,12 +261,15 @@ skipzeroing
; the maximum shooting energy to 990 (it is 10*energy) ; the maximum shooting energy to 990 (it is 10*energy)
; the default shooting energy to 350 ; the default shooting energy to 350
; the shooting angle is randomized ; the shooting angle is randomized
; of course gains an looses are zeroed ; of course gains an loses are zeroed
lda #song_ingame lda #song_ingame
jsr RmtSongSelect jsr RmtSongSelect
lda #0 lda #0
sta sizep0 ; P0-P1 widths
sta sizep0+1
tax tax
@ sta singleRoundVars,x @ sta singleRoundVars,x
inx inx
@@ -271,8 +281,8 @@ SettingEnergies
lda #$00 lda #$00
sta gainL,x sta gainL,x
sta gainH,x sta gainH,x
sta looseL,x sta loseL,x
sta looseH,x sta loseH,x
lda #99 lda #99
sta Energy,x sta Energy,x
sta eXistenZ,x sta eXistenZ,x
@@ -302,18 +312,23 @@ SettingEnergies
;generating the new landscape ;generating the new landscape
jsr PMoutofScreen ;let P/M disappear jsr PMoutofScreen ;let P/M disappear
jsr clearscreen ;let the screen be clean jsr clearscreen ;let the screen be clean
jsr ClearPMmemory
jsr placetanks ;let the tanks be evenly placed jsr placetanks ;let the tanks be evenly placed
jsr calculatemountains ;let mountains be easy for the eye jsr calculatemountains ;let mountains be easy for the eye
;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 ColorsOfSprites
lda #0
sta colpf2s ; status line "off"
sta colpf1s
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---------
mva #TextForegroundColor colpf1s ; status line "on"
rts rts
.endp .endp
@@ -373,6 +388,7 @@ DoNotFinishTheRound
mva #0 noDeathCounter mva #0 noDeathCounter
mva #sfx_seppuku sfx_effect mva #sfx_seppuku sfx_effect
jsr DisplaySeppuku jsr DisplaySeppuku
jmp Seppuku jmp Seppuku
@@ -385,8 +401,13 @@ DoNotFinishTheRound
jeq NextPlayerShoots jeq NextPlayerShoots
mva #1 plot4x4color
jsr DisplayTankNameAbove
mva #1 color ;to display flying point mva #1 color ;to display flying point
ldx tankNr
lda TankStatusColoursTable,x lda TankStatusColoursTable,x
sta colpf2s ; set color of status line sta colpf2s ; set color of status line
@@ -395,10 +416,13 @@ DoNotFinishTheRound
RoboTanks RoboTanks
; robotanks shoot here ; robotanks shoot here
; TankNr still in X
jsr ArtificialIntelligence jsr ArtificialIntelligence
jsr MoveBarrelToNewPosition
jsr DisplayStatus ;all digital values like force, angle, wind, etc.
jsr PutTankNameOnScreen jsr PutTankNameOnScreen
jsr DisplayStatus
pause 30
ldx TankNr
jsr MoveBarrelToNewPosition
lda kbcode lda kbcode
cmp #28 ; ESC cmp #28 ; ESC
bne @+ bne @+
@@ -419,6 +443,8 @@ ManualShooting
seq:rts seq:rts
AfterManualShooting AfterManualShooting
mva #0 plot4x4color
jsr DisplayTankNameAbove
; defensive weapons without flight handling ; defensive weapons without flight handling
ldx TankNr ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
@@ -427,8 +453,8 @@ AfterManualShooting
cmp #ind_Nuclear_Winter_ cmp #ind_Nuclear_Winter_
bne StandardShoot bne StandardShoot
ShootAtomicWinter ShootAtomicWinter
; --- nuclear winter --- ; --- atomic winter ---
jsr NuclearWinter jsr AtomicWinter
jmp NextPlayerShoots ; and we skip shoot jmp NextPlayerShoots ; and we skip shoot
ShootWhiteFlag ShootWhiteFlag
; --- white flag --- ; --- white flag ---
@@ -485,12 +511,15 @@ AfterExplode
NoFallDown2 NoFallDown2
;here tanks are falling down ;here tanks are falling down
mva tankNr tempor2 mva tankNr tempor2
mva #0 TankNr mvx #0 TankNr
TanksFallDown TanksFallDown
lda eXistenZ,x
beq NoExistNoFall
jsr TankFalls jsr TankFalls
inc:lda TankNr NoExistNoFall
cmp NumberOfPlayers inc:ldx TankNr
cpx NumberOfPlayers
bne TanksFallDown bne TanksFallDown
mva tempor2 TankNr mva tempor2 TankNr
missed missed
@@ -659,6 +688,20 @@ MetodOfDeath
jsr ExplosionDirect jsr ExplosionDirect
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
; Clear current Shooter settings. After that, Shooter will "search" for the target again
ldx NumberOfPlayers
dex
@ lda skillTable,x
cmp #2 ; clear variables only if Shooter
bne NotShooter
lda #0
sta PreviousAngle,x
sta PreviousEnergyL,x
sta PreviousEnergyH,x
NotShooter
dex
bpl @-
; jump to after explosion routines (soil fallout, etc.) ; jump to after explosion routines (soil fallout, etc.)
; After going through these routines we are back ; After going through these routines we are back
; to checking if a tank exploded and maybe we have ; to checking if a tank exploded and maybe we have
@@ -673,14 +716,14 @@ MetodOfDeath
;increases gain of tank TankNr ;increases gain of tank TankNr
;-------------------------------------------------- ;--------------------------------------------------
sty EnergyDecrease sty EnergyDecrease
; Loose increase ; Lose increase
lda looseL,x lda loseL,x
clc clc
adc EnergyDecrease adc EnergyDecrease
sta looseL,x sta loseL,x
lda looseH,x lda loseH,x
adc #$00 adc #$00
sta looseH,x sta loseH,x
; Energy now, not less than 0 ; Energy now, not less than 0
lda Energy,x lda Energy,x
cmp EnergyDecrease cmp EnergyDecrease
@@ -741,6 +784,9 @@ NotNegativeShieldEnergy
sta ydraw+1 sta ydraw+1
; get position of the tank ; get position of the tank
ldx TankNr ldx TankNr
lda #0 ; turn off defense weapons when hara-kiring
sta ActiveDefenceWeapon,x
sta ShieldEnergy,x
lda xtankstableL,x lda xtankstableL,x
sta xdraw sta xdraw
lda xtankstableH,x lda xtankstableH,x
@@ -874,18 +920,19 @@ SetunPlots
;setting up P/M graphics ;setting up P/M graphics
lda #>pmgraph lda #>pmgraph
sta pmbase sta pmbase
lda dmactls ; lda dmactls
ora #$38 ; Players and Missiles single lined ; ora #$38 ; Players and Missiles single lined
sta dmactls ; sta dmactls
lda #$03 ; P/M on lda #$03 ; P/M on
sta pmcntl sta pmcntl
lda #$01 lda #$00
sta sizem ; there will be only M0, double width
sta sizep0 ; P0-P3 widths sta sizep0 ; P0-P3 widths
sta sizep0+1 sta sizep0+1
sta sizep0+2 sta sizep0+2
sta sizep0+3 sta sizep0+3
lda #$10 ; P/M priorities (bit 4 joins missiles) lda #%01010101
sta sizem ; all missiles, double width
lda #%00100000 ; P/M priorities (multicolor players on)
sta gtictls sta gtictls
jsr PMoutofScreen jsr PMoutofScreen
@@ -1076,9 +1123,9 @@ UsageLoop
bcs RandomizeAngle bcs RandomizeAngle
sta temp ;sta temp
lda #90 ; CARRY=0 here ;lda #90 ; CARRY=0 here
sbc temp ;sbc temp
rts rts
.endp .endp
@@ -1131,33 +1178,18 @@ LimitForce
;---------------------------------------------- ;----------------------------------------------
.proc MoveBarrelToNewPosition .proc MoveBarrelToNewPosition
jsr DrawTankNr jsr DrawTankNr
jsr DisplayStatus.displayAngle
ldx TankNr ldx TankNr
lda AngleTable,x
clc
adc #90 ;shift angle to the positive values
sta temp
lda NewAngle lda NewAngle
clc cmp AngleTable,x
adc #90
cmp temp
beq BarrelPositionIsFine beq BarrelPositionIsFine
bcc rotateLeft ; older is bigger bcc rotateLeft ; older is bigger
rotateRight;older is lower rotateRight;older is lower
inc angleTable,x inc angleTable,x
bne MoveBarrelToNewPosition
mva #$30 CharCode ; if angle goes through 0 we clear the barrel
jsr DrawTankNr.drawtankNrX
jmp MoveBarrelToNewPosition jmp MoveBarrelToNewPosition
rotateLeft rotateLeft
dec angleTable,x dec angleTable,x
bpl MoveBarrelToNewPosition
mva #$2e CharCode
jsr DrawTankNr.drawtankNrX
jmp MoveBarrelToNewPosition jmp MoveBarrelToNewPosition
BarrelPositionIsFine BarrelPositionIsFine
rts rts
@@ -1344,7 +1376,7 @@ font4x4
ins 'artwork/font4x4s.bmp',+62 ins 'artwork/font4x4s.bmp',+62
;---------------------------------------------- ;----------------------------------------------
TankFont TankFont
ins 'artwork/tanks.fnt' ins 'artwork/tanksv2.fnt'
;---------------------------------------------- ;----------------------------------------------
icl 'variables.asm' icl 'variables.asm'
;---------------------------------------------- ;----------------------------------------------
@@ -1364,7 +1396,7 @@ MODUL equ $b000 ;address of RMT module
TheEnd TheEnd
.ECHO 'TheEnd: ',TheEnd .ECHO 'TheEnd: ',TheEnd
.if TheEnd > PMGraph + $300 .if TheEnd > PMGraph + $300
.error memory conflict .error "memory conflict"
.endif .endif
;---------------------------------------------- ;----------------------------------------------
BIN
View File
Binary file not shown.
+150 -86
View File
@@ -17,9 +17,10 @@
; - and I am sure maxwind, gravity, no_of_rounds in a game, speed of shell flight ; - and I am sure maxwind, gravity, no_of_rounds in a game, speed of shell flight
mwa #OptionsDL dlptrs mwa #OptionsDL dlptrs
lda dmactls ; lda dmactls
and #$fc ; and #$fc
ora #$02 ; normal screen width ; ora #$02 ; normal screen width
lda #%00110010 ; normal screen width, DL on, P/M off
sta dmactls sta dmactls
VDLI DLIinterruptText.DLIinterruptNone ; jsr SetDLI for text screen without DLIs VDLI DLIinterruptText.DLIinterruptNone ; jsr SetDLI for text screen without DLIs
@@ -124,6 +125,14 @@ OptionsFinished
lda seppukuTable,y lda seppukuTable,y
sta seppukuVal sta seppukuVal
;8th option (how aggressive are mountains)
ldy OptionsTable+7
lda mountainsDeltaTableH,y
sta mountainDeltaH
lda mountainsDeltaTableL,y
sta mountainDeltaL
rts rts
;-------- ;--------
; inversing selected option (cursor) ; inversing selected option (cursor)
@@ -233,13 +242,14 @@ AfterManualPurchase
; Rest of the data is taken from appropriate tables ; Rest of the data is taken from appropriate tables
; and during the purchase these tables are modified. ; and during the purchase these tables are modified.
mva #0 dmactl ; mva #0 dmactl
VDLI DLIinterruptText ; jsr SetDLI for text (purchase) screen VDLI DLIinterruptText ; jsr SetDLI for text (purchase) screen
jsr PMoutofScreen jsr PMoutofScreen
mwa #PurchaseDL dlptrs mwa #PurchaseDL dlptrs
lda dmactls ; lda dmactls
and #$fc ; and #$fc
ora #$02 ; normal screen width ; ora #$02 ; normal screen width
lda #%00110010 ; normal screen width, DL on, P/M off
sta dmactls sta dmactls
mwa #ListOfWeapons WeaponsListDL ;switch to the list of offensive weapons mwa #ListOfWeapons WeaponsListDL ;switch to the list of offensive weapons
@@ -803,7 +813,11 @@ NotBattery
beq DefActivationEnd beq DefActivationEnd
NotWhiteFlag NotWhiteFlag
NoDeactivateWhiteFlag NoDeactivateWhiteFlag
; activate new defensive
sta ActiveDefenceWeapon,x sta ActiveDefenceWeapon,x
; set defensive energy
lda DefensiveEnergy,y
sta ShieldEnergy,x
DecreaseDefensive DecreaseDefensive
; decrease number of defensives ; decrease number of defensives
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
@@ -815,8 +829,6 @@ DecreaseDefensive
sbc #1 sbc #1
sta (weaponPointer),y sta (weaponPointer),y
lda DefensiveEnergy,y
sta ShieldEnergy,x
DefActivationEnd DefActivationEnd
jmp WaitForKeyRelease ; rts jmp WaitForKeyRelease ; rts
@@ -959,9 +971,10 @@ NoArrowDown
.proc EnterPlayerNames .proc EnterPlayerNames
;entering names of players ;entering names of players
mwa #NameDL dlptrs mwa #NameDL dlptrs
lda dmactls ; lda dmactls
and #$fc ; and #$fc
ora #$01 ; narrow screen (32 chars) ; ora #$01 ; narrow screen (32 chars)
lda #%00110001 ; narrow screen width, DL on, P/M off
sta dmactls sta dmactls
VDLI DLIinterruptText ; jsr SetDLI for text (names) screen VDLI DLIinterruptText ; jsr SetDLI for text (names) screen
@@ -1203,7 +1216,7 @@ CheckNextLevel
.proc displaydec ;decimal (word), displayposition (word) .proc displaydec ;decimal (word), displayposition (word)
;-------------------------------------------------- ;--------------------------------------------------
; displays decimal number as in parameters (in text mode) ; displays decimal number as in parameters (in text mode)
; leading zeores are removed ; leading zeroes are removed
; the range is (0000..9999 - two bytes) ; the range is (0000..9999 - two bytes)
ldy #3 ; there will be 4 digits ldy #3 ; there will be 4 digits
@@ -1318,26 +1331,27 @@ nineplus dta d"9"+1
space dta d" " space dta d" "
;-------------------------------------------------------- ;--------------------------------------------------------
.proc DisplayOffensiveTextNr ; .proc Display4x4AboveTank ;
;This routine displays texts using PutChar4x4 ; Displays texts using PutChar4x4 above tank and mountains.
;pretty cool, eh ; Pretty cool, eh!
;parameters are: ;parameters are:
;Y - number of tank above which text is displayed ;Y - number of tank above which text is displayed
;TextNumber - number of offensive text to display ;fx - length of text
;textAddress - address of the text
;lets calculate position of the text first! ;lets calculate position of the text first!
;that's easy because we have number of tank ;that's easy because we have number of tank
;and xtankstableL and H keep X position of a given tank ;and xtankstableL and H keep X position of a given tank
;save vars (messed when printing...)
lda xtankstableL,y lda xtankstableL,y
sta temp sta temp
lda xtankstableH,y lda xtankstableH,y
sta temp+1 sta temp+1
;now we should substract length of the text ;now we should substract length of the text-1
ldx TextNumberOff
lda talk.OffensiveTextLengths,x ldy fx
dey
tya
asl asl
sta temp2 sta temp2
mva #0 temp2+1 mva #0 temp2+1
@@ -1348,7 +1362,7 @@ space dta d" "
;stored in temp2 ;stored in temp2
sbw temp temp2 ; here begin of the text is in TEMP !!!! sbw temp temp2 ; here begin of the text is in TEMP !!!!
;now we should check overflows ;now we should check overflows
lda temp+1 ;lda temp+1 ; opty
bpl DOTNnotLessThanZero bpl DOTNnotLessThanZero
;less than zero, so should be zero ;less than zero, so should be zero
mwa #0 temp mwa #0 temp
@@ -1358,7 +1372,7 @@ DOTNnotLessThanZero
;so check if end larger than screenwidth ;so check if end larger than screenwidth
lda talk.OffensiveTextLengths,x lda fx
asl asl
asl asl
;length in pixels - ;length in pixels -
@@ -1379,7 +1393,7 @@ DOTNnotLessThanZero
;then screenwidth - length is fine ;then screenwidth - length is fine
lda talk.OffensiveTextLengths,x lda fx
asl asl
asl asl
sta temp sta temp
@@ -1399,7 +1413,7 @@ DOTNnoOverflow
;now let's get y position ;now let's get y position
;we will try to put text as low as possible ;we will try to put text as low as possible
;just above mountains (so mountaintable will be checked) ;just above mountains (so mountaintable will be checked)
lda talk.OffensiveTextLengths,x lda fx
asl asl
asl asl
tay tay
@@ -1431,19 +1445,13 @@ DOTOldLowestValue
sbc #(4+9) ;9 pixels above ground (and tanks...) sbc #(4+9) ;9 pixels above ground (and tanks...)
sta TextPositionY sta TextPositionY
lda talk.OffensiveTextTableL,x
sta TextAddress
lda talk.OffensiveTextTableH,x
sta TextAddress+1
mva #0 TextCounter mva #0 TextCounter
DOTNcharloop
mwa TextAddress temp mwa TextAddress temp
DOTNcharloop
ldy TextCounter ldy TextCounter
lda (temp),y lda (temp),y
SEC and #$3f ;always CAPITAL letters
sbc #32 ;conversion from ASCII to .sbyte
sta CharCode4x4 sta CharCode4x4
lda TextCounter lda TextCounter
@@ -1460,13 +1468,63 @@ DOTNcharloop
jsr PutChar4x4 jsr PutChar4x4
inc TextCounter inc TextCounter
ldx TextNumberOff lda fx
lda talk.OffensiveTextLengths,x
cmp TextCounter cmp TextCounter
bne DOTNcharloop bne DOTNcharloop
rts rts
.endp .endp
;--------------------------------------------------------
.proc DisplayOffensiveTextNr ;
ldx TextNumberOff
lda talk.OffensiveTextTableL,x
sta TextAddress
lda talk.OffensiveTextTableH,x
sta TextAddress+1
inx ; the next text
lda talk.OffensiveTextTableH,x
sta temp+1
lda talk.OffensiveTextTableL,x
sta temp ; opty possible
; substract address of the next text from previous to get text length
sbw temp TextAddress temp2
mva temp2 fx
jsr Display4x4AboveTank
rts
.endp
;--------------------------------------------------------
.proc DisplayTankNameAbove ;
lda tankNr
:3 asl ; *8
clc
adc #<TanksNames
sta temp ; TextAddress
lda #0
adc #>Tanksnames
sta temp+1 ; TextAddress+1
mwa temp TextAddress
;find length of the tank's name
ldy #0
@
lda (temp),y
beq end_found
iny
cpy #8
bne @-
dey
end_found
iny
sty fx
ldy tankNr
jsr Display4x4AboveTank
rts
.endp
;------------------------------- ;-------------------------------
.proc TypeLine4x4 ; .proc TypeLine4x4 ;
;------------------------------- ;-------------------------------
@@ -1477,6 +1535,7 @@ DOTNcharloop
ldy #0 ldy #0
sty LineCharNr sty LineCharNr
mva #1 plot4x4color
TypeLine4x4Loop TypeLine4x4Loop
ldy LineCharNr ldy LineCharNr
@@ -1489,7 +1548,6 @@ TypeLine4x4Loop
sta CharCode4x4 sta CharCode4x4
mwa LineXdraw dx mwa LineXdraw dx
mva LineYdraw dy mva LineYdraw dy
mva #1 plot4x4color
jsr PutChar4x4 ;type empty pixels as well! jsr PutChar4x4 ;type empty pixels as well!
adw LineXdraw #4 adw LineXdraw #4
inc LineCharNr inc LineCharNr
@@ -1789,7 +1847,6 @@ FinishResultDisplay
;--------------------- ;---------------------
;displaying quantity of the given weapon ;displaying quantity of the given weapon
;--------------------- ;---------------------
ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
jsr HowManyBullets jsr HowManyBullets
sta decimal sta decimal
@@ -1886,53 +1943,6 @@ ActiveDefence
NoDefenceWeapon NoDefenceWeapon
NoShieldEnergy NoShieldEnergy
;=========================
;display Force
;=========================
ldx TankNr
lda ForceTableL,x
sta decimal
lda ForceTableH,x
sta decimal+1
mwa #textbuffer+40+36 displayposition
jsr displaydec
;=========================
;display Angle
;=========================
; additionally we are getting charcode of the tank
; (for future display)
ldx TankNr
lda AngleTable,x
bmi AngleToLeft
lda #$7f ; (tab) character
sta textbuffer+40+25
lda #0 ;space
sta textbuffer+40+22
lda #90
sec
sbc AngleTable,x
sta decimal
tay
lda BarrelTableR,y
sta CharCode
bne AngleDisplay ;like jmp, because code always <>0
AngleToLeft
sec
sbc #(255-90)
sta decimal
tay
lda BarrelTableL,y
sta CharCode
lda #$7e ;(del) char
sta textbuffer+40+22
lda #0 ;space
sta textbuffer+40+25
AngleDisplay
mwa #textbuffer+40+23 displayposition
jsr displaybyte
;========================= ;=========================
;display Wind ;display Wind
;========================= ;=========================
@@ -1971,11 +1981,61 @@ DisplayWindValue
mwa #textbuffer+80+7 displayposition mwa #textbuffer+80+7 displayposition
jsr displaybyte ;decimal (byte), displayposition (word) jsr displaybyte ;decimal (byte), displayposition (word)
;=========================
;display Force
;=========================
ldx TankNr
lda ForceTableL,x
sta decimal
lda ForceTableH,x
sta decimal+1
mwa #textbuffer+40+36 displayposition
jsr displaydec
;=========================
;display Angle
;=========================
displayAngle
ldx TankNr
lda AngleTable,x
cmp #90
beq VerticallyUp
bcs AngleToLeft
AngleToRight
; now we have values from 0 to 89 and right angle
sta decimal
lda #$7f ; (tab) character
sta textbuffer+40+25
lda #0 ;space
sta textbuffer+40+22
beq AngleDisplay
AngleToLeft
sec
lda #180
sbc AngleTable,x
; angles 180 - 91 converted to 0 - 89
sta decimal
lda #$7e ;(del) char
sta textbuffer+40+22
lda #0 ;space
sta textbuffer+40+25
beq AngleDisplay
VerticallyUp
; now we have value 90
sta decimal
lda #0 ;space
sta textbuffer+40+25
sta textbuffer+40+22
AngleDisplay
mwa #textbuffer+40+23 displayposition
jsr displaybyte
rts rts
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
.proc PutTankNameOnScreen .proc PutTankNameOnScreen
; puts name of the tan on the screen ; puts name of the tank on the screen
ldy #$00 ldy #$00
lda tanknr lda tanknr
asl asl
@@ -2007,6 +2067,10 @@ NextChar02
dex dex
bne @- bne @-
lda #$01
sta sizep0 ; P0-P1 widths
sta sizep0+1
; set background ; set background
lda #$ff lda #$ff
ldx #100 ; top of the sprites ldx #100 ; top of the sprites
+8 -8
View File
@@ -12,9 +12,11 @@ TanksNames ; DO NOT ZERO - ticket #24
:6 dta d" " :6 dta d" "
;---------------------------------------------------- ;----------------------------------------------------
;Options DO NOT ZERO - ticket #27 ;Options DO NOT ZERO - ticket #27
OptionsTable .by 0,0,2,2,0,1,3 OptionsTable .by 0,1,2,2,0,1,3,2
RoundsInTheGame .by 10 ;how many rounds in the current game RoundsInTheGame .by 10 ;how many rounds in the current game
seppukuVal .by 75 seppukuVal .by 75
mountainDeltaH .by 3
mountainDeltaL .by $ff
;---------------------------------------------------- ;----------------------------------------------------
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]
@@ -56,16 +58,16 @@ moneyL
;---------------------------------------------------- ;----------------------------------------------------
gainH ;how much money player gets after the round gainH ;how much money player gets after the round
;it is gathered during the round basing on energy ;it is gathered during the round basing on energy
;opponents loose after player's shoots ;opponents lose after player's shoots
.DS [MaxPlayers] .DS [MaxPlayers]
gainL gainL
.DS [MaxPlayers] .DS [MaxPlayers]
;---------------------------------------------------- ;----------------------------------------------------
looseH ;how much player looses after the round loseH ;how much player looses after the round
;calculated from REAL energy loss ;calculated from REAL energy loss
;(not only to zero energy) ;(not only to zero energy)
.DS [MaxPlayers] .DS [MaxPlayers]
looseL loseL
.DS [MaxPlayers] .DS [MaxPlayers]
;---------------------------------------------------- ;----------------------------------------------------
Energy Energy
@@ -178,7 +180,7 @@ xcircle .DS 2
ycircle .DS 2 ycircle .DS 2
tempcir .DS 2 tempcir .DS 2
;TankFalls ;TankFalls
IfFallDown .DS 1 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?
@@ -195,6 +197,7 @@ vx03 .DS [5]
MirvDown .DS [5] ; is given missile down? MirvDown .DS [5] ; is given missile down?
MirvMissileCounter .DS 1 ; missile Counter (mainly for X) MirvMissileCounter .DS 1 ; missile Counter (mainly for X)
SmokeTracerFlag .DS 1 ; if Smoketracer SmokeTracerFlag .DS 1 ; if Smoketracer
LaserFlag .DS 1 ; $ff if Laser
XposFlag .DS 1 ; bullet positon X (0 - on screen , %1000000 - off-screen) XposFlag .DS 1 ; bullet positon X (0 - on screen , %1000000 - off-screen)
YposFlag .DS 1 ; bullet positon Y (0 - on screen , %1000000 - over the screen , %0100000 - under the screen) YposFlag .DS 1 ; bullet positon Y (0 - on screen , %1000000 - over the screen , %0100000 - under the screen)
;---------------------------------------------------- ;----------------------------------------------------
@@ -211,9 +214,6 @@ Multiplier .ds 3 ; 0,0,0
Multiplee .ds 2 ; 0,0 Multiplee .ds 2 ; 0,0
goleft .DS 1 ;if 1 then flights left goleft .DS 1 ;if 1 then flights left
;---------------------------------------------------- ;----------------------------------------------------
;SoilDown2
IsEndOfTheFallFlag .DS 1
;----------------------------------------------------
;unPlot ;unPlot
WhichUnPlot .DS 1 WhichUnPlot .DS 1
; max 5 concurrent unPlots ; max 5 concurrent unPlots
+288 -354
View File
@@ -30,8 +30,8 @@ ExplosionRoutines
.word funkybomb-1 .word funkybomb-1
.word mirv-1 .word mirv-1
.word deathshead-1 .word deathshead-1
.word VOID-1 ;napalm .word napalm-1 ;napalm
.word VOID-1 ;hotnapalm .word hotnapalm-1 ;hotnapalm
.word tracer-1 .word tracer-1
.word tracer-1 ;smoketracer .word tracer-1 ;smoketracer
.word babyroller-1 .word babyroller-1
@@ -202,11 +202,8 @@ FunkyBombLoop
lda random lda random
sta Force sta Force
mva #1 Force+1 mva #1 Force+1
;Angle randomization Range: (-16..+16) ;Angle randomization Range: (70-110 degrees)
lda random randomize 70 110
lsr
and #%00011111
scc:eor #$ff
sta Angle sta Angle
lda #0 lda #0
@@ -236,15 +233,21 @@ NoExplosionInFunkyBomb
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY
sbw xdraw #35 sbw xdraw #35
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY
adw xdraw #70 adw xdraw #70
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY
sbw xdraw #35 sbw xdraw #35
; ;
sbw ydraw #35 sbw ydraw #35
@@ -252,18 +255,153 @@ NoExplosionInFunkyBomb
cpw ydraw #screenHeight cpw ydraw #screenHeight
bcs NoUpperCircle bcs NoUpperCircle
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY
NoUpperCircle NoUpperCircle
adw ydraw #70 adw ydraw #70
;jsr CalculateExplosionRange ;jsr CalculateExplosionRange
cpw ydraw #screenHeight cpw ydraw #screenHeight
bcs NoLowerCircle bcs NoLowerCircle
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY
jsr xmissile jsr xmissile
UnSaveDrawXY
NoLowerCircle NoLowerCircle
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
rts rts
.endp .endp
.proc SaveDrawXY
mwa xdraw tempXROLLER
mwa ydraw modify
rts
.endp
.proc UnSaveDrawXY
mwa tempXROLLER xdraw
mwa modify ydraw
rts
.endp
; ------------------------
.proc napalm
inc FallDown2
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
jsr CalculateExplosionRange
mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
jmp xnapalm
.endp
; ------------------------
.proc hotnapalm
inc FallDown2
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
jsr CalculateExplosionRange
mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
jmp xnapalm
.endp
; ------------------------
.proc xnapalm
mwa xdraw xcircle ; store hitpoint for future repeats
ldy #30 ; repeat 30 times
sty magic
RepeatNapalm ; external loop (for fire animation)
mwa xcircle xdraw
sbw xdraw #(napalmRadius) ; 10 pixels on left side hit point
ldy #0
sty magic+1
RepeatFlame ; internal loop (draw flames)
ldy #0
adw xdraw #mountaintable temp
sty ydraw+1
lda (temp),y
sec
sbc #1 ; over ground
sta ydraw
lda xdraw
and ExplosionRadius ; if hotnapalm and x is odd:
:2 asl ; modify y position 4 pixels up
ldy ydraw
sta ydraw
tya
sec
sbc ydraw
sta ydraw
sbw xdraw #4 ; half character correction
; draw flame symbol
lda magic ; if last repeat - clear flames
beq LastNapalmRepeat
lda random
and #%00000110
clc
adc #$46
bne PutFlameChar
LastNapalmRepeat
lda #$4e ; clear flame symbol
PutFlameChar
sta CharCode
; check coordinates
cpw xdraw #(screenwidth-7)
bcs CharOffTheScreen
lda ydraw
cmp #7
bcc CharOffTheScreen
cmp #(screenHeight-1)
bcs CharOffTheScreen
jsr TypeChar
CharOffTheScreen
adw xdraw #4 ; reverse half character correction (we need positon of character center)
adw xdraw #1 ; next char 1 pixels to right
inc magic+1
lda magic+1
cmp #(2*napalmRadius+1) ; 10 pixels on left, 10 pixels on right and 1 in center
jne RepeatFlame
dec magic
jpl RepeatNapalm
; after napalm
inc FallDown2
;now we must check tanks in range
ldx NumberOfPlayers
dex
BurnedCheckLoop
lda eXistenZ,x
beq EndNurnedCheckLoop
;here the tank exist
; calculate right edge of the fire
adw xcircle #(napalmRadius+4+4) xdraw ; 10 pixels on right side hit point + half character width + correction
; now we compare tank position with right edge of the fire (napalm)
lda XtankstableH,x
cmp xdraw+1
bne @+
lda XtankstableL,x
cmp xdraw
@
bcs TankOutOfFire
; let's calculate left edge of the fire
sbw xcircle #(napalmRadius+8+4-4) xdraw ; 10 pixels on left + character width (tank) + half character - correction
bpl @+
mwa #0 xdraw ; left screen edge
@
; now we compare tank position with left edge of the fire (napalm)
lda XtankstableH,x
cmp xdraw+1
bne @+
lda XtankstableL,x
cmp xdraw
@
bcc TankOutOfFire
ldy #40 ; energy decrease (napalm) - but if hotnapalm:
lda ExplosionRadius
beq NotHot
ldy #80 ; energy decrease (hotnapalm)
NotHot
; check shields ( joke :) )
jsr DecreaseEnergyX
TankOutOfFire
EndNurnedCheckLoop
dex
bpl BurnedCheckLoop
mva #sfx_silencer sfx_effect
rts
.endp
; ------------------------ ; ------------------------
.proc babyroller .proc babyroller
inc FallDown2 inc FallDown2
@@ -517,7 +655,8 @@ DiggerCharacter
.endp .endp
; ------------------------ ; ------------------------
.proc laser .proc laser
; but where are xdraw and ydraw ???? !!!! ; in xdraw and ydraw we have hit point coordinates
; from Shoot/Flight procedures (invisible flight)
; ------------------------ ; ------------------------
ldx TankNr ldx TankNr
lda AngleTable,x lda AngleTable,x
@@ -536,39 +675,44 @@ DiggerCharacter
lda #$00 lda #$00
sbc #$00 sbc #$00
sta ybyte+1 sta ybyte+1
mva #0 drawFunction
mwa xdraw LaserCoordinate mwa xdraw LaserCoordinate
mwa ydraw LaserCoordinate+2 mwa ydraw LaserCoordinate+2
mwa xbyte LaserCoordinate+4 mwa xbyte LaserCoordinate+4
mwa ybyte LaserCoordinate+6 mwa ybyte LaserCoordinate+6
mva #sfx_lightning sfx_effect mva #sfx_lightning sfx_effect
mva #%10000000 drawFunction
;the above switches Draw to measuring length
jsr draw jsr draw
mva #0 color mva #0 drawFunction
lsr LineLength+1 ; LineLength / 8
ror LineLength
lsr LineLength ; max line lenght is about 380 (9 bits)
lsr LineLength
sec
lda #60
sbc LineLength
sta yc ; laser blink counter 60-(LineLength/8)
@
lda yc
and #$01
eor #$01
sta color
mwa LaserCoordinate xdraw mwa LaserCoordinate xdraw
mwa LaserCoordinate+2 ydraw mwa LaserCoordinate+2 ydraw
mwa LaserCoordinate+4 xbyte mwa LaserCoordinate+4 xbyte
mwa LaserCoordinate+6 ybyte mwa LaserCoordinate+6 ybyte
mva #sfx_lightning sfx_effect mva #sfx_lightning sfx_effect
jsr draw jsr draw
dec yc
bne @-
mva #1 color mva #1 color
mwa LaserCoordinate xdraw mwa LaserCoordinate xdraw
mwa LaserCoordinate+2 ydraw mwa LaserCoordinate+2 ydraw
mwa LaserCoordinate+4 xbyte
mwa LaserCoordinate+6 ybyte
mva #sfx_lightning sfx_effect
jsr draw
mva #0 color
mwa LaserCoordinate xdraw
mwa LaserCoordinate+2 ydraw
mwa LaserCoordinate+4 xbyte
mwa LaserCoordinate+6 ybyte
mva #sfx_lightning sfx_effect
jsr draw
mva #1 color
mwa LaserCoordinate xdraw
mwa LaserCoordinate+2 ydraw
jsr plot
mva #0 HitFlag mva #0 HitFlag
jsr CheckCollisionWithTank jsr CheckCollisionWithTank
lda HitFlag lda HitFlag
@@ -768,9 +912,8 @@ UpNotYet
beq HowMuchToFallRight2 beq HowMuchToFallRight2
.nowarn dew xdraw .nowarn dew xdraw
lda xdraw lda xdraw
ora xdraw+1
jne RollinContinues ; like cpw xdraw #0 jne RollinContinues ; like cpw xdraw #0
lda xdraw+1
jne RollinContinues
beq ExplodeNow beq ExplodeNow
HowMuchToFallRight2 HowMuchToFallRight2
inw xdraw inw xdraw
@@ -944,7 +1087,9 @@ UpNotYet2
cmp #1 cmp #1
beq HowMuchToFallRight3 beq HowMuchToFallRight3
.NOWARN dew xdraw .NOWARN dew xdraw
cpw xdraw #$ffff lda xdraw
and xdraw+1
cmp #$ff ; like cpw xdraw #$ffff
jne RollinContinuesLiquid jne RollinContinuesLiquid
beq FillNow beq FillNow
HowMuchToFallRight3 HowMuchToFallRight3
@@ -978,7 +1123,6 @@ ToHighFill
jne RepeatFill jne RepeatFill
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc BeforeFire ;TankNr (byte) .proc BeforeFire ;TankNr (byte)
;-------------------------------------------------- ;--------------------------------------------------
@@ -1014,6 +1158,7 @@ ContinueToCheckMaxForce2
wait ; best after drawing a tank wait ; best after drawing a tank
;keyboard reading ;keyboard reading
; KBCODE keeps code of last keybi ; KBCODE keeps code of last keybi
; SKSTAT $ff - nothing pressed ; SKSTAT $ff - nothing pressed
@@ -1179,34 +1324,62 @@ CTRLPressedDown
bmi ForceGoesZero bmi ForceGoesZero
jmp BeforeFire jmp BeforeFire
pressedLeft pressedRight
lda pressTimer
spl:mva #0 pressTimer ; if >128 then reset to 0
cmp #25 ; 1/2s
bcs CTRLPressedRight
mva #sfx_set_power_2 sfx_effect mva #sfx_set_power_2 sfx_effect
ldx TankNr ldx TankNr
dec AngleTable,x dec AngleTable,x
lda AngleTable,x lda AngleTable,x
cmp #$ff ; if angle goes through 0 we clear the barrel cmp #255 ; -1
bne NotThrough90DegreesLeft
mva #$2e CharCode
jsr DrawTankNr.drawtankNrX
NotThrough90DegreesLeft
cmp #(255-91)
jne BeforeFire jne BeforeFire
lda #90 lda #180
sta AngleTable,x sta AngleTable,x
jmp BeforeFire jmp BeforeFire
pressedRight CTRLPressedRight
mva #sfx_set_power_2 sfx_effect
ldx TankNr
lda AngleTable,x
sec
sbc #4
sta AngleTable,x
cmp #4 ; smalles angle for speed rotating
jcs BeforeFire
lda #180
sta AngleTable,x
jmp BeforeFire
pressedLeft
lda pressTimer
spl:mva #0 pressTimer ; if >128 then reset to 0
cmp #25 ; 1/2s
bcs CTRLPressedLeft
mva #sfx_set_power_2 sfx_effect mva #sfx_set_power_2 sfx_effect
ldx TankNr ldx TankNr
INC AngleTable,x INC AngleTable,x
lda AngleTable,x lda AngleTable,x
bne NotThrough90DegreesRight cmp #181
mva #$30 CharCode ; if angle goes through 0 we clear the barrel
jsr DrawTankNr.drawtankNrX
NotThrough90DegreesRight
cmp #91
jne BeforeFire jne BeforeFire
lda #(255-90) lda #0
sta AngleTable,x
jmp BeforeFire
CTRLPressedLeft
mva #sfx_set_power_2 sfx_effect
ldx TankNr
lda AngleTable,x
clc
adc #4
sta AngleTable,x
cmp #181-4
jcc BeforeFire
lda #0
sta AngleTable,x sta AngleTable,x
jmp BeforeFire jmp BeforeFire
@@ -1259,6 +1432,7 @@ pressedS
pressedSpace pressedSpace
;================================= ;=================================
;we shoot here!!! ;we shoot here!!!
mva #0 pressTimer ; reset mva #0 pressTimer ; reset
jsr WaitForKeyRelease jsr WaitForKeyRelease
lda pressTimer lda pressTimer
@@ -1291,21 +1465,24 @@ RandomizeOffensiveText
mva #1 plot4x4color mva #1 plot4x4color
jsr DisplayOffensiveTextNr jsr DisplayOffensiveTextNr
mva #0 LaserFlag ; $ff - Laser
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #ind_Laser__________ ; laser cmp #ind_Laser__________ ; laser
bne NotStrongShoot bne NotStrongShoot
; Laser: (not)very strong - invisible - shot for laser beam end coordinates
mva #0 color mva #0 color
lda #7 lda #1
sta Force sta Force
sta Force+1 sta Force+1
mva #$ff LaserFlag ; $ff - Laser
bne AfterStrongShoot bne AfterStrongShoot
NotStrongShoot NotStrongShoot
lda ForceTableL,x lda ForceTableL,x
sta Force sta Force
lda ForceTableH,x lda ForceTableH,x
sta Force+1 sta Force+1
mva #sfx_shoot sfx_effect
AfterStrongShoot AfterStrongShoot
lda #$0 lda #$0
sta Force+2 sta Force+2
@@ -1316,7 +1493,6 @@ AfterStrongShoot
sta xtraj sta xtraj
sta ytraj sta ytraj
mva #sfx_shoot sfx_effect
; Shoots tank nr X !!! :) ; Shoots tank nr X !!! :)
; set the starting coordinates of bullet with correction ; set the starting coordinates of bullet with correction
; to start where the tank's barrel ends ; to start where the tank's barrel ends
@@ -1354,283 +1530,13 @@ ShotUnderGround
rts rts
.endp .endp
;--------------------------------------------------
.proc TankFalls;
;--------------------------------------------------
mva #sfx_shield_off sfx_effect
lda #0
sta PreviousFall
sta EndOfTheFallFlag
sta Parachute
; let's check if the given tank has got the parachute
ldx TankNr
lda ActiveDefenceWeapon,x
cmp #ind_Parachute______ ; parachute
beq ParachuteActive
cmp #ind_StrongParachute ; strong parachute
beq ParachuteActive
cmp #ind_Force_Shield___ ; shield witch energy and parachute
bne TankFallsX
ParachuteActive
inc Parachute
TankFallsX
; coordinates of the first pixel under the tank
ldx TankNr
lda XtankstableL,x
sta xdraw
lda XtankstableH,x
sta xdraw+1
lda Ytankstable,x
clc
adc #1 ; in this point the comment helped us! For the very first
; time in our lives! Tada! It opens a new chapter!!!
sta ydraw
;
lda #08
sta mask2 ; Loop Counter
ByteBelowTank
jsr point
beq EmptyPoint2
sec
bcs ROLPoint2
EmptyPoint2
clc
ROLPoint2
rol mask1
inw xdraw
dec mask2
bne ByteBelowTank
ldx mask1
lda WhereToSlideTable,x
sta IfFallDown ; taking directions of falling down from the table
bne ItStillFalls
; Tank falling down already finished, but it is not sure that
; the horizontal coordinate is even.
; If it is odd then it must be corrected because otherwise
; P/M graphics background would not look OK
ldx TankNr
lda XtanksTableL,x
and #$01
jeq EndOfFall ; if it is even then it is the end
; and if not, we push it one pixel the way it was falling before
lda PreviousFall
sta IfFallDown
inc EndOfTheFallFlag ; because after this correction is shouldn't fall anymore
; we have 3 bits: 0 - go down, 1 - go right, 2 - go left
;---
ItStillFalls
lda Parachute
and #1
bne ParachutePresent
; decreasing energy - 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 NoFallingDown
ldx TankNr
jsr DecreaseEnergyX
lda IfFallDown
and #6
bne FallDiagonally
ldx TankNr
jsr DecreaseEnergyX
FallDiagonally
NoFallingDown
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
; because later maybe the number of parachutes will decrease
; (if there were parachutes and they were ON)
lda Parachute
ora #2 ; we set bit nr 1 (nr 0 means that parachute is present)
sta Parachute
testowanie
; storing last direction of falling
; (it is not necessarily the direction from the previous
; iteraction, so we must check directional bits before storing)
lda IfFallDown
and #$06
beq FallStraightDown
sta PreviousFall
FallStraightDown
lda Parachute
and #01
beq RapidFalling
wait
RapidFalling
; we finish falling down if the tank reached the edge of the screen
; but if it falls straight down or the other way than the edge,
; then continue falling!
ldx TankNr
lda XtanksTableL,x
bne NotLeftEdge
lda XtanksTableH,x
bne NotLeftEdge
lda IfFallDown
and #$04 ; check if it does not fall left
jne EndOfFall ; if so then maybe we finish
NotLeftEdge
clc
lda XtanksTableL,x
adc #$08 ; we'll check right side of the char
sta temp
lda XtanksTableH,x
adc #0
sta temp+1
cpw temp #screenwidth
bne NotRightEdge
lda IfFallDown
and #$02 ; check if it does not fall right
jne EndOfFall ; if so then maybe we finish
NotRightEdge
; clear previous position
mva #1 Erase
jsr DrawTankNr
; and the parachute (if present)
lda Parachute
and #01
beq DoNotClearParachute
; here we clear the parachute
ldx TankNr
jsr DrawTankParachute
DoNotClearParachute
mva #0 Erase
ldx TankNr
lsr IfFallDown ; bit nr 0 (down)
bcc DoesNotFallDown
; tank is falling down
lda Ytankstable,x
clc
adc #1
sta Ytankstable,x
DoesNotFallDown
lsr IfFallDown ; bit nr 1 (right)
bcc DoesNotFallLeft
; tank is falling left
clc
lda XtankstableL,x
adc #1
sta XtankstableL,x
lda XtankstableH,x
adc #0
sta XtankstableH,x
DoesNotFallLeft
lsr IfFallDown ; bit nr 2 (left)
bcc DoesNotFallRight
; tank is falling right
sec
lda XtankstableL,x
sbc #1
sta XtankstableL,x
lda XtankstableH,x
sbc #0
sta XtankstableH,x
DoesNotFallRight
jsr DrawTankNr
; checking is parachute present and if so, draw it
lda Parachute
and #01
beq DoNotDrawParachute
; here we draw parachute
ldx TankNr
jsr DrawTankParachute
DoNotDrawParachute
lda EndOfTheFallFlag
jeq TankFallsX
EndOfFall
jsr DrawTankNr
; if tank was falling down having parachute,
; we must deduct one parachute
lda Parachute
cmp #$03 ; was falling down and the parachute
bne ThereWasNoParachute
; first we clear parachute on the screen
mva #1 Erase
ldx TankNr
lda ActiveDefenceWeapon,x
cmp #ind_Parachute______ ; deactivate weapon only if parachute (54)
bne NoParachuteWeapon
mva #0 ActiveDefenceWeapon,x ; deactivate defence weapon (parachute)
NoParachuteWeapon
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
lda Ytankstable,x
sec
sbc #8
sta ydraw
lda XtanksTableL,x
sta xdraw
lda XtanksTableH,x
sta xdraw+1
jsr TypeChar
rts
.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
;-------------------------------------------------- ;--------------------------------------------------
;g=-0.1 ;g=-0.1
;vx=Force*sin(Angle) ;vx=Force*cos(Angle)
;vy=Force*cos(Angle) ;vy=Force*sin(Angle)
; ;
;:begin ;:begin
;ytraj=ytray-vy ;ytraj=ytray-vy
@@ -1640,11 +1546,14 @@ ThereWasNoParachute
;plot xtraj,ytraj - there is clearing in plot ;plot xtraj,ytraj - there is clearing in plot
;goto begin ;goto begin
; smoke tracer :) ; smoke tracer :)
ldy #0 ldy #0
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #11 ; Smoke tracer cmp #ind_Smoke_Tracer___ ; Smoke tracer
bne noSmokeTracer bne noSmokeTracer
iny iny
noSmokeTracer noSmokeTracer
@@ -1667,45 +1576,41 @@ RepeatFlight
sta ydraw+1 sta ydraw+1
;vx calculation ;vx calculation
;vx = sin(90-Angle) for Angle <=90
;vx = -sin(Angle-90) for 90 < Angle <= 180
aslw Force ;Force = Force * 2 aslw Force ;Force = Force * 2
;sin(Angle) ;cos(Angle) (but we use sin table only so some shenanigans happen)
ldx Angle ldx Angle
stx LeapFrogAngle ; we will need it later stx LeapFrogAngle ; we will need it later
;Angle works like this: ;Angle works like this:
;0 'degrees' is straight up ;0 'degrees' is horizontally right
;90 'degrees' is horizontally right ;90 'degrees' is straight up
;255 is straight up (same as 0) ;180 horizontally left
;255-90 (165) horizontally left
bpl FlightRight ; (we have to set goleft used in rolling weapons)
;and if the highest bit is set then cpx #91
;Flight to LEFT bcc angleUnder90
;calculate Angle with this formula:
;Angle=90-(Angle-165)
sec ;over 90
txa
sbc #165 ;(Angle-165)
sta temp
lda #90
sbc temp ;90-(Angle-165)
;and we have rady angle here ... and we go LEFT!
tax
sta Angle
; and now we contine as if nothing happened
; (but we have goleft set to 1!!!)
mva #1 goleft mva #1 goleft
bne @+ sec
txa ; lda # Angle
sbc #90
tax
jmp @+
FlightRight angleUnder90
mva #0 goleft mva #0 goleft
sec ; X = 90-Angle
lda #90
sbc Angle
tax
@ @
lda sintable,x ;sin(Angle) lda sintable,x ; cos(X)
sta Multiplee ;sin(Angle)*Force sta Multiplee ; *Force
mwa Force Multiplier mwa Force Multiplier
lda #$0 lda #$0
sta Multiplier+2 sta Multiplier+2
@@ -1744,18 +1649,27 @@ DoNotAdd
.endr .endr
@ @
;======vy ;======vy
lda #0 ;cos(Angle) ;vy = sin(Angle) for Angle <=90
;vy = sin(180-Angle) for 90 < Angle <= 180
lda #0
sta vy sta vy
sta vy+1 sta vy+1
sta vy+2 sta vy+2
;-- ;--
lda #90 ldx Angle
cpx #91
bcc YangleUnder90
lda #180
sec sec
sbc Angle sbc Angle
tax tax
YangleUnder90
lda sintable,x lda sintable,x
sta Multiplee ;cos(Angle)*Force sta Multiplee ;sin(Angle)*Force
mwa Force Multiplier mwa Force Multiplier
lda #$0 lda #$0
sta Multiplier+2 sta Multiplier+2
@@ -1798,6 +1712,8 @@ Loopi
sbc vy+3 sbc vy+3
sta ytraj+2 sta ytraj+2
bit LaserFlag ; no gravity if Laser
bmi NoGravity
;vy=vy-g (again without least significant byte of vy) ;vy=vy-g (again without least significant byte of vy)
sec sec
lda vy+1 lda vy+1
@@ -1814,11 +1730,11 @@ Loopi
; we check if it is MIRV and if so, jump to MIRV routine ; we check if it is MIRV and if so, jump to MIRV routine
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #6 ; MIRV cmp #ind_MIRV___________ ; MIRV
jeq MIRVdownLoop jeq MIRVdownLoop
NoGravity
StillUp StillUp
clc ;xtraj=xtraj+vx (skipping least significant byte of vx) clc ;xtraj=xtraj+vx (skipping least significant byte of vx)
lda xtraj ;here of course Fight to right lda xtraj ;here of course Fight to right
adc vx+1 adc vx+1
@@ -1830,12 +1746,15 @@ StillUp
adc vx+3 adc vx+3
sta xtraj+2 sta xtraj+2
bit LaserFlag ; no wind if Laser
bmi NoWind
clc clc
.rept 4 .rept 4
lda vx+# lda vx+#
adc Wind+# adc Wind+#
sta vx+# sta vx+#
.endr .endr
NoWind
mwa xtrajold+1 xdraw mwa xtrajold+1 xdraw
mwa ytrajold+1 ydraw mwa ytrajold+1 ydraw
mwa xtraj+1 xbyte mwa xtraj+1 xbyte
@@ -1855,6 +1774,22 @@ StillUp
nowait nowait
lda HitFlag lda HitFlag
bne Hit bne Hit
; --- only for Laser
bit LaserFlag
bpl NoCheckEdgesForLaser
; If laser fires, edges of the screen finish "flying" and laser hits.
lda ytraj+2
bmi LaserHitEdge
cpw xtraj+1 #screenwidth+1
bcc LaserNoHitEdge
LaserHitEdge
mwa xdraw XHit
mwa ydraw YHit
mva #$ff HitFlag ; screen edgs like ground (only for Laser)
jmp EndOfFlight
LaserNoHitEdge
; ------------------
NoCheckEdgesForLaser
cpw ytraj+1 #screenheight+1 cpw ytraj+1 #screenheight+1
bcc YTrayLowerThanScreenHeight bcc YTrayLowerThanScreenHeight
@@ -1944,7 +1879,7 @@ NoDefence
rts ; END !!! rts ; END !!!
AutoDefence AutoDefence
; now run defensive-aggressive weapon - Auto Defence! ; now run defensive-aggressive weapon - Auto Defence!
sbb #255 LeapFrogAngle Angle ; swap angle (LeapFrogAngle - because we have strored angle in this variable) sbb #180 LeapFrogAngle Angle ; swap angle (LeapFrogAngle - because we have strored angle in this variable)
lsrw Force ; Force = Force / 2 - becouse earlier we multiplied by 2 lsrw Force ; Force = Force / 2 - becouse earlier we multiplied by 2
mva #1 Erase ; now erase shield mva #1 Erase ; now erase shield
phx phx
@@ -2363,7 +2298,7 @@ MIRValreadyAll
.endp .endp
; ------------------------------------------------- ; -------------------------------------------------
.proc NuclearWinter .proc AtomicWinter
; ------------------------------------------------- ; -------------------------------------------------
; This routine is run from inside of the main loop ; This routine is run from inside of the main loop
; and replaces Shoot and Flight routines ; and replaces Shoot and Flight routines
@@ -2529,7 +2464,6 @@ CalculateExplosionRange0
lda #0 lda #0
sta RangeRight sta RangeRight
sta RangeRight+1 sta RangeRight+1
mva #11 ExplosionRadius ; what is this magic value?
;-------------------------------------------------- ;--------------------------------------------------
.proc CalculateExplosionRange .proc CalculateExplosionRange
;-------------------------------------------------- ;--------------------------------------------------