diff --git a/README.md b/README.md index b69ae15..6d117c2 100755 --- a/README.md +++ b/README.md @@ -4,42 +4,51 @@ by Tomasz 'pecus' Pecko and Pawel 'pirx' Kalinowski Warsaw, Miami 2000, 2001, 2002, 2003, 2009, 2012, 2013, 2022 -you can contact us at pecus@poczta.fm or pirx@5oft.pl +You can contact us at pecus@poczta.fm or pirx@5oft.pl home page of this project is https://github.com/pkali/scorch_src -this source code was compiled under OMC65 crossassembler +This source code was originally compiled under OMC65 crossassembler (https://github.com/pkali/omc65) and on 2012-06-21 translated to mads -game source code is split into 5+1 parts: +Game source code is split into 5+3 parts: - scorch.asm is the main game code (with many assorted routines) - grafproc.asm - graphics routines like line or circle - textproc.asm - text routines like list of weapons and shop -- variables.asm - all non-zero page variables and constants +- variables.asm - all non-zero page variables +- constants.asm - various tables of constants - display.asm - display lists and text screen definitions - ai.asm - artificial stupidity of computer opponents +- weapons.asm - general arsenal of tankies -we were trying to use as much macros and pseudo-ops as possible -they are defined in atari.hea and macro.hea files together with many +We were trying to use as much macros and pseudo-ops as possible. +They are defined in atari.hea and macro.hea files together with many atari constants. This way it should be relatively easy to port this code to e.g. C64 After those N years of working on this piece of code we are sure it would be much wiser to write it in C, Action! or MadPascal but on the other hand it is so much fun to type 150 chars -where you want to have y=ax+b :) +where all you want to have y=ax+b :) -originally most variables were in Polish, comments were sparse +Originally most variables were in Polish, comments were sparse but we wanted to release this piece of code to public and due to being always short of time/energy (to finish the game) we decided it must go in 'English' to let other people work on it. -it never happened, but we got some encouraging comments and we are still +It never happened, but we got some encouraging comments and we are still trying to do something from time to time. -with the advent of fujinet (https://fujinet.online/) we are thinking about making the game interplanetary, err, with multiplayer over the net. we'll see. +With the advent of fujinet (https://fujinet.online/) we are thinking about making the game interplanetary, err, with multiplayer over the net. We'll see. ## Changes: +###### Build 132 +2022-03-27 +- fixed bug: https://github.com/pkali/scorch_src/issues/21 Wrong number of shells purchased +- fixed bug: https://github.com/pkali/scorch_src/issues/19 Inventory not cleared on next match. When fixing in a general way (cleaning all variables on game restart) I encountered a very old and nasty bug that made the game running basically by pure chance. +- fixed bug: https://github.com/pkali/scorch_src/issues/18 selecting players using fire sometimes selects more than one. Rewritten keyboard handling to prepare for enhancements like #17 +- tables of constants moved to a separate file, variables declared with .DS directive in preparation for memory map optimization. + ###### Build 131 2022-03-20 - fixed bug: https://github.com/pkali/scorch_src/issues/4 It was really hard one, because I had to unspaghetti our own lousy code :] diff --git a/ai.asm b/ai.asm index 04f7f63..9e13183 100755 --- a/ai.asm +++ b/ai.asm @@ -1,4 +1,4 @@ -; @com.wudsn.ide.asm.mainsourcefile=program.asm +; @com.wudsn.ide.asm.mainsourcefile=scorch.asm ; artificial intelligence of tanks goes here! ; in A there is a level of tank's intelligence diff --git a/display.asm b/display.asm index 13d8edb..1725dff 100755 --- a/display.asm +++ b/display.asm @@ -77,7 +77,7 @@ PlotLine = display + screenHeight*screenBytes ; the last line is plot pointer ;Screen displays go first to avoid crossing 4kb barrier ;----------------------------------------------- OptionsScreen - dta d"Welcome to Scorch ver. 131 (un)2000-2022" + dta d"Welcome to Scorch ver. 132 (un)2000-2022" dta d" Please select option with cursor keys " dta d" and press (Return) to proceed " OptionsHere diff --git a/grafproc.asm b/grafproc.asm index 875d278..ff81ab2 100755 --- a/grafproc.asm +++ b/grafproc.asm @@ -438,18 +438,6 @@ splot8 .proc RTS .endp -;-------------------------------------------------- -WaitForKeyRelease .proc -;-------------------------------------------------- - lda SKSTAT - cmp #$ff - beq KeyIsReleased - cmp #$f7 - bne WaitForKeyRelease -KeyIsReleased - rts -.endp - ;-------------------------------------------------- clearscreen .proc ;-------------------------------------------------- diff --git a/scorch.asm b/scorch.asm index 5d7063f..648a616 100644 --- a/scorch.asm +++ b/scorch.asm @@ -11,13 +11,14 @@ ;(https://github.com/pkali/omc65) ;and on 2012-06-21 translated to mads ; -;game source code is split into 5+1 parts: +;game source code is split into 5+2 parts: ;scorch.asm is the main game code (with many assorted routines) ;grafproc.asm - graphics routines like line or circle ;textproc.asm - text routines like list of weapons and shop ;variables.asm - all non-zero page variables and constans ;display.asm - display lists and text screen definitions ;ai.asm - artificial stupidity of computer opponents +;weapons.asm - general arsenal of tankies ;we were trying to use as much macros and pseudoops as possible ;they are defined in atari.hea and macro.hea files together with many @@ -91,6 +92,7 @@ MaxPlayers = 6 ;----------------------------------------------- icl 'display.asm' ;---------------------------------------------- + icl 'constants.asm' icl 'variables.asm' ;-------------------------------------------------- OffensiveTexts @@ -120,12 +122,11 @@ START mva #0 TankNr -loop01 - jsr EnterPlayerName - inc TankNr - lda TankNr - cmp NumberOfPlayers - bne loop01 +@ jsr EnterPlayerName + inc TankNr + lda TankNr + cmp NumberOfPlayers + bne @- mwa #dl dlptrs lda dmactls @@ -185,27 +186,12 @@ checkForHuman ; if all in skillTable other than 0 then switch to DEMO MODE beq peopleAreHere dex bpl checkForHuman - tay ; no people, just wait a bit pause 150 jmp noKey peopleAreHere - ;key ; only if there is a human player - lda SKSTAT - cmp #$ff - beq checkFire - cmp #$f7 - beq checkFire - jmp noKey ;key pressed, so go -checkFire - ;------------JOY------------- - ;happy happy joy joy - ;check for joystick now - ;fire - lda TRIG0 - bne peopleAreHere ;fire not pressed, so loop - + jsr getkey noKey ldx NumberOfPlayers dex @@ -267,11 +253,11 @@ Round .proc ; lda #0 tax -loop +@ sta previousAngle,x inx - cpx #(clearEnd-PreviousAngle) - bne loop + cpx #(singleRoundVarsEnd-PreviousAngle) + bne @- ldx #5 SettingEnergies @@ -317,11 +303,10 @@ SettingEnergies jsr drawmountains ;draw them jsr drawtanks ;finally draw tanks -.endp ; not really end of the procedure, but just for now. revisit. +.endp ; not really end of the procedure, but just for now. TODO: revisit. ;--------------------round screen is ready--------- - ;mva #0 TankNr mva #0 TankSequencePointer MainRoundLoop @@ -628,70 +613,8 @@ PlayerXdeath .proc jmp AfterExplode - -;-------------------------------------------------- -Explosion .proc -;-------------------------------------------------- - ;cleanup of the soil fall down ranges (left and right) - mwa #screenwidth RangeLeft - lda #0 - sta RangeRight - sta RangeRight+1 - - ldx TankNr - lda ActiveWeapon,x - asl -.endp -Explosion2 .proc - tax - lda ExplosionRoutines+1,x - pha - lda ExplosionRoutines,x - pha - rts -ExplosionRoutines - .word babymissile-1 - .word missile-1 - .word babynuke-1 - .word nuke-1 - .word leapfrog-1 - .word funkybomb-1 - .word mirv-1 - .word deathshead-1 - .word VOID-1 ;napalm - .word VOID-1 ;hotnapalm - .word tracer-1 - .word VOID-1 ;smoketracer - .word babyroller-1 - .word roller-1 - .word heavyroller-1 - .word VOID-1 ;riotcharge - .word VOID-1 ;riotblast - .word riotbomb-1 - .word heavyriotbomb-1 - .word babydigger-1 - .word digger-1 - .word heavydigger-1 - .word babysandhog-1 - .word sandhog-1 - .word heavysandhog-1 - .word dirtclod-1 - .word dirtball-1 - .word tonofdirt-1 - .word VOID-1 ;liquiddirt - .word dirtcharge-1 - .word VOID-1 ;earthdisrupter - .word VOID-1 ;plasmablast - .word laser-1 - -VOID - rts -.endp -; ------------------------ - icl 'weapons.asm' - ;-------------------------------------------------- DecreaseEnergyX .proc ;Decreases energy of player nr X @@ -767,7 +690,7 @@ PMoutofScreen .proc .endp ;-------------------------------------------------- -.nowarn .proc WeaponCleanup; +.proc WeaponCleanup; ; cleaning of the weapon possesion tables ; (99 of Baby Missles, all other weapons=0) ;-------------------------------------------------- @@ -792,8 +715,7 @@ loop05 Initialize .proc ;Initialization sequence ;-------------------------------------------------- - ;jsr GenerateOffensiveTextTables - ;jsr GenerateDeffensiveTextTables +deletePtr = temp lda #0 sta Erase @@ -802,6 +724,33 @@ Initialize .proc sta oldPlotPointerX+1 sta GameIsOver + + ; clean variables + tay + mwa #variablesStart deletePtr +@ tya + sta (deletePtr),y + inw deletePtr + cpw deletePtr #variablesEnd + bne @- + + lda #2 + sta OptionsTable+2 + sta OptionsTable+3 + + mwa #1024 RandBoundaryHigh + mva #$ff LastWeapon + sta HowMuchToFall + mva #1 color + mva #$40 MaxWind + mwa #$0080 Wind + mva #25 gravity + + + + jsr WeaponCleanup + + mva #$2 colpf2s mva #12 colpf3s mva #>WeaponFont chbas @@ -1121,6 +1070,61 @@ nextishigher rts .endp + +;-------------------------------------------------- +getkey .proc; waits for pressing a key and returns pressed value in A +;-------------------------------------------------- + jsr WaitForKeyRelease +@ + lda SKSTAT + cmp #$ff + beq checkJoyGetKey ; key not pressed, check Joy + + lda kbcode + and #$3f ;CTRL and SHIFT ellimination + rts +checkJoyGetKey + ;------------JOY------------- + ;happy happy joy joy + ;check for joystick now + lda JSTICK0 + and #$0f + cmp #$0f + beq notpressedJoyGetKey + tay + lda joyToKeyTable,y + rts +notpressedJoyGetKey + ;fire + lda TRIG0 + bne @- + lda #$0c ;Return key + rts +.endp +;-------------------------------------------------- +getkeynowait .proc; +;-------------------------------------------------- + jsr WaitForKeyRelease + lda kbcode + and #$3f ;CTRL and SHIFT ellimination + rts +.endp +;-------------------------------------------------- +WaitForKeyRelease .proc +;-------------------------------------------------- + lda JSTICK0 + and #$0f + cmp #$0f + bne WaitForKeyRelease + lda TRIG0 + beq WaitForKeyRelease + lda SKSTAT + cmp #$ff + bne WaitForKeyRelease +KeyIsReleased + rts +.endp + ;---------------------------------------------- icl 'textproc.asm' ;---------------------------------------------- diff --git a/scorch.xex b/scorch.xex index 784c843..8d50ce9 100644 Binary files a/scorch.xex and b/scorch.xex differ diff --git a/textproc.asm b/textproc.asm index 5fdde65..ae1847d 100755 --- a/textproc.asm +++ b/textproc.asm @@ -6,62 +6,7 @@ ; this module contains routines used in text mode ; like shop and start-up options ;---------------------------------------- -;-------------------------------------------------- -getkey .proc; waits for pressing a key and returns pressed value in A -;-------------------------------------------------- - pause 5 - lda SKSTAT - cmp #$ff - beq lopx01 - cmp #$f7 - bne getkey ; I guess it waits for RELEASING a key - lda JSTICK0 - and #$0f - cmp #$0f - bne getkey ; waits for not moving the joy - lda TRIG0 - beq getkey ; waits for releasing FIRE - -lopx01 lda SKSTAT - cmp #$ff - beq checkJoyGetKey ; key not pressed, check Joy - cmp #$f7 - beq checkJoyGetKey ; key not pressed, check Joy - - lda kbcode - and #$3f ;CTRL and SHIFT ellimination - rts -checkJoyGetKey - ;------------JOY------------- - ;happy happy joy joy - ;check for joystick now - lda JSTICK0 - and #$0f - cmp #$0f - beq notpressedJoyGetKey - tay - lda joyToKeyTable,y - rts -notpressedJoyGetKey - ;fire - lda TRIG0 - bne lopx01 - lda #$0c ;Return key - rts -.endp -;-------------------------------------------------- -getkeynowait .proc; -;-------------------------------------------------- - lda SKSTAT - cmp #$ff - beq getkeynowait - cmp #$f7 - beq getkeynowait ; I guess it waits for RELEASING a key - lda kbcode - and #$3f ;CTRL and SHIFT ellimination - rts -.endp ;-------------------------------------------------- Options .proc ;-------------------------------------------------- @@ -682,6 +627,7 @@ SecondSelected ;-------------------------------------------------- .proc PurchaseWeaponNow ;-------------------------------------------------- +weaponPtr = temp isPriceZero = tempXRoller lda WhichList @@ -718,17 +664,18 @@ PurchaseAll ; and add appropriate number of shells lda TanksWeaponsTableL,x - sta temp + sta weaponPtr lda TanksWeaponsTableH,x - sta temp+1 + sta weaponPtr+1 - lda (temp),y ; and we have number of posessed bullets of the weapon + clc + lda (weaponPtr),y ; and we have number of posessed bullets of the weapon adc WeaponUnits,y - sta (temp),y ; and we added appropriate number of bullets + sta (weaponPtr),y ; and we added appropriate number of bullets cmp #100 ; but there should be no more than 99 bullets bcc LessThan100 lda #99 - sta (temp),y + sta (weaponPtr),y LessThan100 sty LastWeapon ; store last purchased weapon ; because we must put screen pointer next to it @@ -739,7 +686,7 @@ LessThan100 lda isPriceZero bne @+ lda #0 - sta (temp),y + sta (weaponPtr),y @ jmp Purchase.AfterPurchase .endp @@ -1021,7 +968,7 @@ nextchar05 .proc SelectLevel ; this routine highlights the choosen ; level of the computer opponent - ldx #$9 ; 9 possible levels + ldx #8 ; 9 possible levels CheckNextLevel01 lda LevelNameBeginL,x ; address on the screen sta temp diff --git a/variables.asm b/variables.asm index 1961d77..99b69d5 100755 --- a/variables.asm +++ b/variables.asm @@ -1,313 +1,272 @@ ; @com.wudsn.ide.asm.mainsourcefile=scorch.asm .IF *>0 ;this is a trick that prevents compiling this file alone - ;===================================================== ; most important non-zero page variables +; used by the given subroutines +; moved to one place for easier +; compilation to e.g. cartridge ; zero page variables are declared in program.s65 module ;===================================================== -NumberOfPlayers .byte 0 ;current number of players (counted from 1) -TankSequence :MaxPlayers .by 0 ;sequence of shooting during the Round -GameIsOver .byte 0 ; 1 - it was the last round in the game +;-------------------------------------------------- +;Variables +;-------------------------------------------------- +variablesStart ; zeroing starts here + +NumberOfPlayers .DS 1 ;current number of players (counted from 1) +TankSequence .DS [MaxPlayers] ;sequence of shooting during the Round +GameIsOver .DS 1 ; 1 - it was the last round in the game ;----------------------------------- skilltable ; computer controlled players' skills (1-8), 0 - human - :MaxPlayers .by 0 + .DS [MaxPlayers] ;----------------------------------- moneyH ;we place zero at the end of prices and money ;and have range from 0 to 99990 (not too much) ;money players have (maybe one more byte is needed?) - :MaxPlayers .by 0 + .DS [MaxPlayers] moneyL - :MaxPlayers .by 0 + .DS [MaxPlayers] ;----------------------------------- gainH ;how much money player gets after the round ;it is gathered during the round basing on energy ;opponents loose after player's shoots - :MaxPlayers .by 0 + .DS [MaxPlayers] gainL - :MaxPlayers .by 0 + .DS [MaxPlayers] ;----------------------------------- looseH ;how much player looses after the round ;calculated from REAL energy loss ;(not only to zero energy) - :MaxPlayers .by 0 + .DS [MaxPlayers] looseL - :MaxPlayers .by 0 + .DS [MaxPlayers] ;----------------------------------- Energy - :MaxPlayers .by 0 -EnergyDecrease .by 0 + .DS [MaxPlayers] +EnergyDecrease .DS 1 eXistenZ - :MaxPlayers .by 0 + .DS [MaxPlayers] LASTeXistenZ ; eXistenZ before shoot - :MaxPlayers .by 0 + .DS [MaxPlayers] ResultsTable ;the results in the gameeeeee - :MaxPlayers .by 0 + .DS [MaxPlayers] TempResults - :MaxPlayers .by 0 + .DS [MaxPlayers] CurrentResult - .byte 0 + .DS 1 ;----------------------------------- EnergyTableL ;shooting Force of the tank during the round - :MaxPlayers .by 0 + .DS [MaxPlayers] EnergyTableH - :MaxPlayers .by 0 ;maxplayers=6 + .DS [MaxPlayers] ;maxplayers=6 MaxEnergyTableL ;Energy of the tank during the round ;(limes superior force of the Shoot) - :MaxPlayers .by 0 ;1000 is the default + .DS [MaxPlayers] ;1000 is the default MaxEnergyTableH - :MaxPlayers .by 0 + .DS [MaxPlayers] ;----------------------------------- AngleTable ;Angle of the barrel of each tank during the round - :MaxPlayers .by (255-90) -NewAngle - .by 0 + .DS [MaxPlayers] +NewAngle .DS 1 ;----------------------------------- ActiveWeapon ;number of the selected weapon - :MaxPlayers .by 0 -WeaponDepleted .by 0 ; if 0 deactivate the weapon and switch to Baby Missile + .DS [MaxPlayers] +WeaponDepleted .DS 1 ; if 0 deactivate the weapon and switch to Baby Missile ;----------------------------------- ;format of the 3-byte static point number used in the game ; 20203.5 => 128 : <20203 : >20203 ;----------------------------------- -L1 .by 0 ; variable used in multiplications (by 10:) -gravity .by 25 ;only the decimal part (1/10 = 25) +L1 .DS 1 ; variable used in multiplications (by 10:) +gravity .DS 1 ;only the decimal part (1/10 = 25) ;----------------------------------- -Wind .wo $0080 ;walue displayed on the screen +Wind .ds 2 ;walue displayed on the screen ;multiplied by 16 (decimal part only) ;----------------------------------- -MaxWind .byte $40 ; -WindOrientation .byte 0 ;(0-right,1-left) +MaxWind .ds 1 ; +WindOrientation .DS 1 ;(0-right,1-left) ;----------------------------------- -Counter .byte 0 ;temporary Counter for outside loops -HitFlag .byte 0 ;1 when missile hit anything +Counter .DS 1 ;temporary Counter for outside loops +HitFlag .DS 1 ;1 when missile hit anything ;----------------------------------- xtankstableL ;X positions of tanks (lower left point) - :MaxPlayers .by 0 + .DS [MaxPlayers] xtankstableH - :MaxPlayers .by 0 + .DS [MaxPlayers] ytankstable ;Y positions of tanks (lower left point) - :MaxPlayers .by 0 + .DS [MaxPlayers] LowResDistances ; coarse stank positions divided by 4 (to be in just one byte) - :MaxPlayers .by 0 + .DS [MaxPlayers] ;----------------------------------- -keycodes ;tables for calculating KeyCode to Screen Code (38 -1 characters) - .byte $3f,$15,$12,$3a,$2a,$38,$3d,$39 - .byte $0d,$01,$05,$00,$25,$23,$08,$0a - .byte $2f,$28,$3e,$2d,$0b,$10,$2e,$16 - .byte $2b,$17,$1f,$1e,$1a,$18,$1d,$1b - .byte $33,$35,$30,$32,$22 ;,$0e <-- hyphen removed from the table, sorry hyphen lovers -keycodesEnd -scrcodes - dta d"abcdefgh" - dta d"ijklmnop" - dta d"qrstuvwx" - dta d"yz123456" - dta d"7890." ; "-" -;----------------------------------- -Erase .byte 0 ; if 1 only mask of the character is printed +Erase .DS 1 ; if 1 only mask of the character is printed ; on the graphics screen. if 0 character is printed normally ;----------------------------------- -RangeLeft .wo 0 ;range of the soil to be fallen down -RangeRight .wo 0 ;it is being set by all Explosions +RangeLeft .DS 2 ;range of the soil to be fallen down +RangeRight .DS 2 ;it is being set by all Explosions ;----------------------------------- -WeaponRangeLeft .wo 0 ;Range of the Explosion of the given weapon -WeaponRangeRight .wo 0 -;-------------------------------------------------- -;-------------------------------------------------- -;Variables used by the given subroutines -;moved to one place for easier -;compilation to e.g. cartridge +WeaponRangeLeft .DS 2 ;Range of the Explosion of the given weapon +WeaponRangeRight .DS 2 ;-------------------------------------------------- ;xroller -HowMuchToFall .byte $FF -HeightRol .byte 0 +HowMuchToFall .ds 1 +HeightRol .DS 1 ;digger -digstartx .word 0 -digstarty .word 0 -diggery .byte 0 -DigLong .byte 0 -digtabxL :8 .by 0 -digtabxH :8 .by 0 -digtabyL :8 .by 0 -digtabyH :8 .by 0 +digstartx .DS 2 +digstarty .DS 2 +diggery .DS 1 +DigLong .DS 1 +digtabxL .DS [8] +digtabxH .DS [8] +digtabyL .DS [8] +digtabyH .DS [8] ;sandhog -sandhogflag .byte 0 ; (0 digger, 8 sandhog) +sandhogflag .DS 1 ; (0 digger, 8 sandhog) ;ofdirt -magic .word 0 ; was tempor2, but it was not compiling!!! (bug in OMC65) +magic .DS 2 ; was tempor2, but it was not compiling!!! (bug in OMC65) ;draw -DrawJumpAddr .word 0 -HowToDraw .byte 0 +DrawJumpAddr .DS 2 +HowToDraw .DS 1 ; bits here mean ; 0 - negative X (go up) ; 1 - negative Y (left) ; 2 - directional value > 1 (more than 45 degrees) ; if all 0 then standart routine -XHit .word 0 -YHit .word 0 -LineLength .word 0 +XHit .DS 2 +YHit .DS 2 +LineLength .DS 2 ;circle -radius .byte 0 -xcircle .word 0 -ycircle .byte 0 -tempcir .word 0 +radius .DS 1 +xcircle .DS 2 +ycircle .DS 1 +tempcir .DS 2 ;TankFalls -IfFallDown .byte 0 -PreviousFall .byte 0 -EndOfTheFallFlag .byte 0 ; in case of the infinite fall -Parachute .byte 0 ; are you insured with parachute? +IfFallDown .DS 1 +PreviousFall .DS 1 +EndOfTheFallFlag .DS 1 ; in case of the infinite fall +Parachute .DS 1 ; are you insured with parachute? ; ------------------------------------------------- ;Flight ;variables for 5 missiles (used for mirv) -xtraj00 :5 .by 0 -xtraj01 :5 .by 0 -xtraj02 :5 .by 0 -vx00 :5 .by 0 -vx01 :5 .by 0 -vx02 :5 .by 0 -vx03 :5 .by 0 -MirvDown :5 .by 0 ; is given missile down? -MirvMissileCounter .byte 0 ; missile Counter (mainly for X) -SmokeTracerFlag .byte 0 ; if Smoketracer +xtraj00 .DS [5] ; 3 bytes of xtraj times 5. Lowest byte +xtraj01 .DS [5] ; middle byte +xtraj02 .DS [5] ; high byte +vx00 .DS [5] +vx01 .DS [5] +vx02 .DS [5] +vx03 .DS [5] +MirvDown .DS [5] ; is given missile down? +MirvMissileCounter .DS 1 ; missile Counter (mainly for X) +SmokeTracerFlag .DS 1 ; if Smoketracer ; ------------------------------------------------- ;CheckCollisionWithTank -vx .byte 0,0,0,0 ;two decimal bytes, two whole bytes (DC.BA) -vy .byte 0,0,0,0 -xtraj .byte 0,0,0 -ytraj .byte 0,0,0 -xtrajold .byte 0,0,0 -ytrajold .byte 0,0,0 -Angle .byte 0 -Force .byte 0,0,0 -Multiplier .byte 0,0,0 -Multiplee .byte 0,0 -Result .byte 0,0,0 -goleft .byte 0 ;if 1 then flights left +vx .ds 4 ; 0,0,0,0 ;two decimal bytes, two whole bytes (DC.BA) +vy .ds 4 ;0,0,0,0 +xtraj .ds 3 ; 0,0,0 +ytraj .ds 3 ; 0,0,0 +xtrajold .ds 3 ; 0,0,0 +ytrajold .ds 3 ; 0,0,0 +Angle .DS 1 +Force .ds 3 ; 0,0,0 +Multiplier .ds 3 ; 0,0,0 +Multiplee .ds 2 ; 0,0 +Result .ds 3 ; 0,0,0 +goleft .DS 1 ;if 1 then flights left ;-------------------------------------------------- ;SoilDown2 -IsEndOfTheFallFlag .byte 0 +IsEndOfTheFallFlag .DS 1 ; ------------------------------------------------- ;unPlot -WhichUnPlot .byte 0 +WhichUnPlot .DS 1 ; max 5 concurrent unPlots -oldplotH :5 .by 0 -oldplotL :5 .by 0 -oldora :5 .by 0 -oldply :5 .by 0 -OldOraTemp .byte 0 -FunkyBombCounter .byte 0 -xtrajfb .word 0 -ytrajfb .word 0 +oldplotH .DS [5] +oldplotL .DS [5] +oldora .DS [5] +oldply .DS [5] +OldOraTemp .DS 1 +FunkyBombCounter .DS 1 +xtrajfb .DS 2 +ytrajfb .DS 2 ; -tracerflag .byte 0 +tracerflag .DS 1 ; ------------------------------------------------- ;TypeChar -mask1 :8 .by 0 -mask2 :8 .by 0 +mask1 .DS [8] +mask2 .DS [8] -char1 :8 .by 0 -char2 :8 .by 0 -color .byte 1 -ybit .byte 0 -tempbyte01 .byte 0 -delta .word 0 -yfloat .word 0 -deltaX .byte 0 -UpNdown .byte 0 +char1 .DS [8] +char2 .DS [8] +color .DS 1 +ybit .DS 1 +tempbyte01 .DS 1 +delta .DS 2 +yfloat .DS 2 +deltaX .DS 1 +UpNdown .DS 1 - -temptankX .word 0 -temptankNr .byte 0 +temptankX .DS 2 +temptankNr .DS 1 ; ------------------------------------------------- ;Variables from textproc.s65 ; tables with numbers of weapons on the right lists ; to be honest - I do not know at the moment what the above ; comment was supposed to mean... + ; OK (2022) so, L1 is list of offensive weapons, L2 - defensive NubersOfWeaponsL1 - :(8*5) .by $ff + .ds 8*5 ; :(8*5) .by $ff NubersOfWeaponsL2 - :(8*2) .by $ff + .ds 8*2 ; :(8*2) .by $ff ; ------------------------------------------------- ; variables storing amount of weapons on the first and second ; list and pointer position HowManyOnTheList1 - .byte 0 + .DS 1 HowManyOnTheList2 - .byte 0 + .DS 1 PositionOnTheList ; pointer position on the list being displayed - .byte 0 -LastWeapon ; number of the last previously purchased weapon + .DS 1 +LastWeapon + ; number of the last previously purchased weapon ; it is necessary when after purchase some weapon ; is removed from the list (because too expensive) ; and the cursor must be placed elsewhere - - .byte $ff + .DS 1 WhichList ; list currently on the screen ; (0-offensive, 1-defensive) - .byte 0 + .DS 1 OffsetDL1 ; offset of the list screen (how many lines).... - .byte 0 + .DS 1 ; ------------------------------------------------- -;Options -OptionsTable .byte 0,0,2,2,0 -OptionsY .byte 0 ;vertical position of cursor on Options screen -maxoptions = 5 ;number of all options (4 in 0.01) -CashOptionH ;(one zero less than on the screen) - .byte 0,>200,>500,>800,>1000 -CashOptionL - .byte 0,<200,<500,<800,<1000 -GravityTable .byte 10,20,25,30,40 -MaxWindTable .byte 5,20,40,60,80 -RoundsTable .byte 10,20,30,40,50 -RoundsInTheGame .byte 10 ;how many rounds in the current game -;------------------------------------------------ ;mark the level PositionInName ; cursor position in name of the player when name input - .byte 0 + .DS 1 DifficultyLevel ; Difficulty Level (human/cpu) - .byte 0 -LevelNameBeginL ; begins of level names - .byte NamesOfLevels,>(NamesOfLevels+10),>(NamesOfLevels+20) - .byte >(NamesOfLevels+32),>(NamesOfLevels+42),>(NamesOfLevels+52) - .byte >(NamesOfLevels+64),>(NamesOfLevels+74),>(NamesOfLevels+84) + .DS 1 ;------------------------------------------------- ;displaydecimal -decimal .word 0 -decimalresult dta d"0000" +decimal .DS 2 +decimalresult .DS 4 ;xmissile -ExplosionRadius .word 0 ;because when adding in xdraw it is double byte +ExplosionRadius .DS 2 ;because when adding in xdraw it is double byte ;round -CurrentRoundNr .byte 0 -FallDown1 .byte 0 -FallDown2 .byte 0 +CurrentRoundNr .DS 1 +FallDown1 .DS 1 +FallDown2 .DS 1 ;leapfrog -LeapFrogAngle .byte 0 +LeapFrogAngle .DS 1 ;laser -LaserCoordinate .word 0,0,0,0 -TanksNames - dta d"1st Tank" - dta d"2nd Tank" - dta d"3rd Tank" - dta d"4th Tank" - dta d"5th Tank" - dta d"6th Tank" +LaserCoordinate .DS 8 ; 2,2,2,2 ; ------------------------------------------------- ; Here go tables with weapons possesed by a given tank ; Index in the table means weapon type @@ -316,834 +275,95 @@ TanksNames ; from $30 the defensive weapons begin TanksWeapons TanksWeapon1 - .by 99 - :63 .by 0 + .DS [64] TanksWeapon2 - .by 99 - :63 .by 0 + .DS [64] TanksWeapon3 - .by 99 - :63 .by 0 + .DS [64] TanksWeapon4 - .by 99 - :63 .by 0 + .DS [64] TanksWeapon5 - .by 99 - :63 .by 0 + .DS [64] TanksWeapon6 - .by 99 - :63 .by 0 -TanksWeaponsTableL - .by TanksWeapon1,>TanksWeapon2,>TanksWeapon3,>TanksWeapon4,>TanksWeapon5,>TanksWeapon6 + .DS [64] mountaintable ;table of mountains (size=screenwidth) - :screenwidth .by 0 - .by 0 ; additional byte for fallout (sometimes 1 pixel) + .DS [screenwidth] + .DS 1 ; additional byte for fallout (sometimes 1 pixel) mountaintable2 ;table of mountains (size=screenwidth) - :screenwidth .by 0 - .by 0 ; additional byte for fallout (sometimes 1 pixel) + .DS [screenwidth] + .DS 1 ; additional byte for fallout (sometimes 1 pixel) mountaintable3 - :screenwidth .by 0 - .by 0 ; additional byte for fallout (sometimes 1 pixel) + .ds [screenwidth] + .ds 0 ; additional byte for fallout (sometimes 1 pixel) MountaintableEnd ;good for table clearing ;---------------------------------------------- -TextPositionX .word 0 -TextPositionY .byte 0 -TextAddress .word 0 -TextCounter .byte 0 -TextNumberOff .byte 0 +TextPositionX .DS 2 +TextPositionY .DS 1 +TextAddress .DS 2 +TextCounter .DS 1 +TextNumberOff .DS 1 ;-------------- TankTempY - .byte 0 + .DS 1 +;-------------- single round variables -------------- +previousAngle + .DS [MaxPlayers] +previousEnergyL + .DS [MaxPlayers] +previousLeftRange + .DS [MaxPlayers] +previousEnergyH + .DS [MaxPlayers] +previousRightAngle + .DS [MaxPlayers] +RandBoundaryLow + .ds 2 +RandBoundaryHigh + .ds 2 +AngleTablePointer + .DS 1 +singleRoundVarsEnd ;---------------------------------------------- ; 4x4 texts ;---------------------------------------------- LineAddress4x4 - .word 0 + .DS 2 LineCharNr - .byte 0 + .DS 1 LineXdraw - .word 0 + .DS 2 LineYdraw - .byte 0 -LineTop - dta d"(%%%%%%%%%%%%)" - .byte $ff -;# - vertical, () * +, % - horizontal -LineBottom - dta d"*%%%%%%%%%%%%+" - .byte $ff -LineEmpty - dta d"# #" - .byte $ff -LineHeader1 - dta d"# ROUND: " -RoundNrDisplay - dta d" #" - .byte $ff -LineHeader2 - dta d"# RESULTS #" - .byte $ff -LineGameOver - dta d"# GAME OVER #" - .byte $ff - + .DS 1 ;----------- -ResultLineBuffer - dta d" " - .byte $ff ResultX - .word 0 + .DS 2 ResultY - .byte 0 + .DS 1 ResultOfTankNr - .byte 0 + .DS 1 -;----------- -pmtableL ; addressess of the P/M memory for 5 tanks (6th is without P/M background) - .byte <(pmgraph+$400) - .byte <(pmgraph+$500) - .byte <(pmgraph+$600) - .byte <(pmgraph+$700) - .byte <(pmgraph+$300) ; this is a missile background -pmtableH - .byte >(pmgraph+$400) - .byte >(pmgraph+$500) - .byte >(pmgraph+$600) - .byte >(pmgraph+$700) - .byte >(pmgraph+$300) -;----------- -; this table changes Angle to the appropriate tank character -BarrelTableL - .byte $02,$02,$02,$02,$02,$02,$02,$02 - .byte $04,$04,$04,$04,$04,$04,$04,$04 - .byte $06,$06,$06,$06,$06,$06,$06,$06,$06 - .byte $08,$08,$08,$08,$08,$08,$08,$08 - .byte $0a,$0a,$0a,$0a,$0a,$0a,$0a,$0a - .byte $0c,$0c,$0c,$0c,$0c,$0c,$0c,$0c,$0c - .byte $0e,$0e,$0e,$0e,$0e,$0e,$0e,$0e - .byte $10,$10,$10,$10,$10,$10,$10,$10 - .byte $12,$12,$12,$12,$12,$12,$12,$12,$12 - .byte $14,$14,$14,$14,$14,$14,$14,$14 - .byte $16,$16,$16,$16,$16,$16,$16,$16 -BarrelTableR - .byte $2c,$2c,$2c,$2c,$2c,$2c,$2c,$2c - .byte $2a,$2a,$2a,$2a,$2a,$2a,$2a,$2a - .byte $28,$28,$28,$28,$28,$28,$28,$28,$28 - .byte $26,$26,$26,$26,$26,$26,$26,$26 - .byte $24,$24,$24,$24,$24,$24,$24,$24 - .byte $22,$22,$22,$22,$22,$22,$22,$22,$22 - .byte $20,$20,$20,$20,$20,$20,$20,$20 - .byte $1e,$1e,$1e,$1e,$1e,$1e,$1e,$1e - .byte $1c,$1c,$1c,$1c,$1c,$1c,$1c,$1c,$1c - .byte $1a,$1a,$1a,$1a,$1a,$1a,$1a,$1a - .byte $18,$18,$18,$18,$18,$18,$18,$18 - -sintable - .byte 0 - .byte 4 - .byte 8 - .byte 13 - .byte 17 - .byte 22 - .byte 26 - .byte 31 - .byte 35 - .byte 40 - .byte 44 - .byte 48 - .byte 53 - .byte 57 - .byte 61 - .byte 66 - .byte 70 - .byte 74 - .byte 79 - .byte 83 - .byte 87 - .byte 91 - .byte 95 - .byte 100 - .byte 104 - .byte 108 - .byte 112 - .byte 116 - .byte 120 - .byte 124 - .byte 128 - .byte 131 - .byte 135 - .byte 139 - .byte 143 - .byte 146 - .byte 150 - .byte 154 - .byte 157 - .byte 161 - .byte 164 - .byte 167 - .byte 171 - .byte 174 - .byte 177 - .byte 181 - .byte 184 - .byte 187 - .byte 190 - .byte 193 - .byte 196 - .byte 198 - .byte 201 - .byte 204 - .byte 207 - .byte 209 - .byte 212 - .byte 214 - .byte 217 - .byte 219 - .byte 221 - .byte 223 - .byte 226 - .byte 228 - .byte 230 - .byte 232 - .byte 233 - .byte 235 - .byte 237 - .byte 238 - .byte 240 - .byte 242 - .byte 243 - .byte 244 - .byte 246 - .byte 247 - .byte 248 - .byte 249 - .byte 250 - .byte 251 - .byte 252 - .byte 252 - .byte 253 - .byte 254 - .byte 254 - .byte 255 - .byte 255 - .byte 255 - .byte 255 - .byte 255 - .byte 255 ;anti self destruction byte - -costable - .byte 255 ;anti self destruction byte - .byte 255 - .byte 255 - .byte 255 - .byte 255 - .byte 255 - .byte 254 - .byte 254 - .byte 253 - .byte 252 - .byte 252 - .byte 251 - .byte 250 - .byte 249 - .byte 248 - .byte 247 - .byte 246 - .byte 244 - .byte 243 - .byte 242 - .byte 240 - .byte 238 - .byte 237 - .byte 235 - .byte 233 - .byte 232 - .byte 230 - .byte 228 - .byte 226 - .byte 223 - .byte 221 - .byte 219 - .byte 217 - .byte 214 - .byte 212 - .byte 209 - .byte 207 - .byte 204 - .byte 201 - .byte 198 - .byte 196 - .byte 193 - .byte 190 - .byte 187 - .byte 184 - .byte 181 - .byte 177 - .byte 174 - .byte 171 - .byte 167 - .byte 164 - .byte 161 - .byte 157 - .byte 154 - .byte 150 - .byte 146 - .byte 143 - .byte 139 - .byte 135 - .byte 131 - .byte 128 - .byte 124 - .byte 120 - .byte 116 - .byte 112 - .byte 108 - .byte 104 - .byte 100 - .byte 95 - .byte 91 - .byte 87 - .byte 83 - .byte 79 - .byte 74 - .byte 70 - .byte 66 - .byte 61 - .byte 57 - .byte 53 - .byte 48 - .byte 44 - .byte 40 - .byte 35 - .byte 31 - .byte 26 - .byte 22 - .byte 17 - .byte 13 - .byte 8 - .byte 4 - .byte 0 - -linetableL - :screenheight .by <(display+screenBytes*#) - ;:20 .by <(display+screenBytes*#) - .by (display+screenBytes*#) - ;:20 .by >(display+screenBytes*#) - .by >PlotLine ;---------------------------- oldPlotPointerX - .wo 0 + .ds 2 ;---------------------------- ;PutChar4x4 -LoopCounter4x4 .byte 0 -y4x4 .byte 0 -StoreA4x4 .byte 0 -Xcounter4x4 .byte 0 -nibbler4x4 .byte 0 -CharCode4x4 .byte 0 -plot4x4color .byte 0 ;1-white, 0-background +LoopCounter4x4 .DS 1 +y4x4 .DS 1 +StoreA4x4 .DS 1 +Xcounter4x4 .DS 1 +nibbler4x4 .DS 1 +CharCode4x4 .DS 1 +plot4x4color .DS 1 ;1-white, 0-background + -bittable - .byte $80,$40,$20,$10,$08,$04,$02,$01 -bittable2 - .byte $7f,$bf,$df,$ef,$f7,$fb,$fd,$fe ;---------------------------- -disktance ;tanks distance - .byte 0,0 - .byte screenwidth/3 - .byte screenwidth/4 - .byte screenwidth/5 - .byte screenwidth/6 - .byte screenwidth/7 - ;max number of players=6 +;Options +OptionsTable .ds 5 +OptionsY .DS 1 ;vertical position of cursor on Options screen -; this table is for deciding where a tank should slide -; accordingly to what is below the tank -; there are 3 bits used here -; bit 0 - go down -; bit 1 - go left -; bit 2 - go right -; position in the table equals to bit pattern of soil below tank - -WhereToSlideTable - ; we have 3 bits: 0 - go down, 1 - go right, 2 - go left - ;original table - ;.BYTE 1,5,4,4,4,4,4,4,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - ;.BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - - .BYTE 1,5,4,4,4,4,4,4,0,0,0,0,0,0,0,0 ;16 - .BYTE 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;32 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;48 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;64 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;80 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;96 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;112 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;128 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - -EndOfTheBarrelX - .byte 4,4,4,4,4,4,4,4,4,4,4 - .byte 5,5,5,5,5,5,5,5,5,5 - .byte 6,6,6,6,6,6,6,6,6 - .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7 - - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0 - - .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - .byte 1,1,1,1,1,1,1,1,1 - .byte 2,2,2,2,2,2,2,2,2,2 - .byte 3,3,3,3,3,3,3,3,3,3,3 - -EndOfTheBarrelY - .byte 7,7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 - .byte 6,6,6,6,6,6,6,6,6 - .byte 5,5,5,5,5,5,5,5,5,5 - .byte 4,4,4,4,4,4,4,4,4,4,4,4,4 - .byte 3,3,3,3,3,3,3,3,3,3,3,3,3,3 - - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0,0,0,0,0,0,0 - .byte 0,0,0,0 - - .byte 3,3,3,3,3,3,3,3,3,3,3,3,3,3 - .byte 4,4,4,4,4,4,4,4,4,4,4,4,4 - .byte 5,5,5,5,5,5,5,5,5,5 - .byte 6,6,6,6,6,6,6,6,6 - .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7 - .byte 7,7,7,7,7,7,7,7,7,7,7 -;------------------------------------------------- - -TanksNamesDefault - dta d"1st Tank" - dta d"2nd Tank" - dta d"3rd Tank" - dta d"4th Tank" - dta d"5th Tank" - dta d"6th Tank" - -;Weapon prices (*10 on screen) -price_Baby_Missile___ = 0 ;_0 -price_Missile________ = 96 ;_1 -price_Baby_Nuke______ = 111 ;_2 -price_Nuke___________ = 144 ;_3 -price_LeapFrog_______ = 192 ;_4 -price_Funky_Bomb_____ = 293 ;_5 -price_MIRV___________ = 456 ;_6 -price_Death_s_Head___ = 337 ;_7 -price_Napalm_________ = 0 ;496 ;_8 -price_Hot_Napalm_____ = 0 ;511 ;_9 -price_Tracer_________ = 102 ;_10 -price_Smoke_Tracer___ = 291 ;_11 -price_Baby_Roller____ = 689 ;_12 -price_Roller_________ = 600 ;_13 -price_Heavy_Roller___ = 592 ;_14 -price_Riot_Charge____ = 0 ;330 ;_15 -price_Riot_Blast_____ = 0 ;341 ;_16 -price_Riot_Bomb______ = 369 ;_17 -price_Heavy_Riot_Bomb = 322 ;_18 -price_Baby_Digger____ = 336 ;_19 -price_Digger_________ = 276 ;_20 -price_Heavy_Digger___ = 253 ;_21 -price_Baby_Sandhog___ = 218 ;_22 -price_Sandhog________ = 191 ;_23 -price_Heavy_Sandhog__ = 305 ;_24 -price_Dirt_Clod______ = 104 ;_25 -price_Dirt_Ball______ = 130 ;_26 -price_Ton_of_Dirt____ = 171 ;_27 -price_Liquid_Dirt____ = 0 ;530 ;_28 -price_Dirt_Charge____ = 581 ;_29 -price_Earth_Disrupter = 0 ;430 ;_30 -price_Plasma_Blast___ = 0 ;274 ;_31 -price_Laser__________ = 577 ;_32 -price______________33 = 0 -price______________34 = 0 -price______________35 = 0 -price______________36 = 0 -price______________37 = 0 -price______________38 = 0 -price______________39 = 0 -price______________40 = 0 -price______________41 = 0 -price______________42 = 0 -price______________43 = 0 -price______________44 = 0 -price______________45 = 0 -price______________46 = 0 -price______________47 = 0 -price_Heat_Guidance__ = 0 ;_48_($30) -price_Bal_Guidance___ = 0 ;_49 -price_Horz_Guidance__ = 0 ;_50 -price_Vert_Guidance__ = 0 ;_51 -price_Lazy_Boy_______ = 0 ;_52 -price_Parachute______ = 1100 ;_53 -price_Battery________ = 0 ;_54 -price_Mag_Deflector__ = 0 ;_55 -price_Shield_________ = 0 ;_56 -price_Force_Shield___ = 0 ;_57 -price_Heavy_Shield___ = 0 ;_58 -price_Super_Mag______ = 0 ;_59 -price_Auto_Defense___ = 0 ;_60 -price_Fuel_Tank______ = 0 ;_61 -price_Contact_Trigger = 0 ;_62 -price______________63 = 0 - -WeaponPriceH ; weapons prices (tables with prices of weapons) - .by >price_Baby_Missile___ - .by >price_Missile________ - .by >price_Baby_Nuke______ - .by >price_Nuke___________ - .by >price_LeapFrog_______ - .by >price_Funky_Bomb_____ - .by >price_MIRV___________ - .by >price_Death_s_Head___ - .by >price_Napalm_________ - .by >price_Hot_Napalm_____ - .by >price_Tracer_________ - .by >price_Smoke_Tracer___ - .by >price_Baby_Roller____ - .by >price_Roller_________ - .by >price_Heavy_Roller___ - .by >price_Riot_Charge____ - .by >price_Riot_Blast_____ - .by >price_Riot_Bomb______ - .by >price_Heavy_Riot_Bomb - .by >price_Baby_Digger____ - .by >price_Digger_________ - .by >price_Heavy_Digger___ - .by >price_Baby_Sandhog___ - .by >price_Sandhog________ - .by >price_Heavy_Sandhog__ - .by >price_Dirt_Clod______ - .by >price_Dirt_Ball______ - .by >price_Ton_of_Dirt____ - .by >price_Liquid_Dirt____ - .by >price_Dirt_Charge____ - .by >price_Earth_Disrupter - .by >price_Plasma_Blast___ - .by >price_Laser__________ - .by >price______________33 - .by >price______________34 - .by >price______________35 - .by >price______________36 - .by >price______________37 - .by >price______________38 - .by >price______________39 - .by >price______________40 - .by >price______________41 - .by >price______________42 - .by >price______________43 - .by >price______________44 - .by >price______________45 - .by >price______________46 - .by >price______________47 - .by >price_Heat_Guidance__ - .by >price_Bal_Guidance___ - .by >price_Horz_Guidance__ - .by >price_Vert_Guidance__ - .by >price_Lazy_Boy_______ - .by >price_Parachute______ - .by >price_Battery________ - .by >price_Mag_Deflector__ - .by >price_Shield_________ - .by >price_Force_Shield___ - .by >price_Heavy_Shield___ - .by >price_Super_Mag______ - .by >price_Auto_Defense___ - .by >price_Fuel_Tank______ - .by >price_Contact_Trigger - .by >price______________63 - -WeaponPriceL - .by 0 ;this is a trick that prevents compiling this file alone +;-------------------------------------------------- +Explosion .proc +;-------------------------------------------------- + ;cleanup of the soil fall down ranges (left and right) + mwa #screenwidth RangeLeft + lda #0 + sta RangeRight + sta RangeRight+1 + + ldx TankNr + lda ActiveWeapon,x + asl +.endp +Explosion2 .proc + tax + lda ExplosionRoutines+1,x + pha + lda ExplosionRoutines,x + pha + rts +ExplosionRoutines + .word babymissile-1 + .word missile-1 + .word babynuke-1 + .word nuke-1 + .word leapfrog-1 + .word funkybomb-1 + .word mirv-1 + .word deathshead-1 + .word VOID-1 ;napalm + .word VOID-1 ;hotnapalm + .word tracer-1 + .word VOID-1 ;smoketracer + .word babyroller-1 + .word roller-1 + .word heavyroller-1 + .word VOID-1 ;riotcharge + .word VOID-1 ;riotblast + .word riotbomb-1 + .word heavyriotbomb-1 + .word babydigger-1 + .word digger-1 + .word heavydigger-1 + .word babysandhog-1 + .word sandhog-1 + .word heavysandhog-1 + .word dirtclod-1 + .word dirtball-1 + .word tonofdirt-1 + .word VOID-1 ;liquiddirt + .word dirtcharge-1 + .word VOID-1 ;earthdisrupter + .word VOID-1 ;plasmablast + .word laser-1 + +VOID + rts +.endp +; ------------------------ ; ------------------------ .proc babymissile @@ -811,7 +870,6 @@ ContinueToCheckMaxForce2 jsr DrawTankNr wait ; best after drawing a tank - ;wait ;keyboard reading @@ -822,6 +880,8 @@ ContinueToCheckMaxForce2 ; $f3 - shift+key notpressed + lda TRIG0 + beq notpressed lda SKSTAT cmp #$ff beq checkJoy @@ -866,11 +926,9 @@ checkJoy notpressedJoy ;fire lda TRIG0 - bne JNotFire - lda #$21 - jmp jumpFromStick -JNotFire - jmp notpressed + jeq pressedSpace + jmp notpressed + ; pressedUp ;force increaseeee! @@ -1060,7 +1118,6 @@ AfterStrongShoot clc lda xtraj+1 adc EndOfTheBarrelX,y ; correction of X - ;adc #4 sta xtraj+1 lda xtraj+2 adc #0 @@ -1068,7 +1125,6 @@ AfterStrongShoot sec lda ytraj+1 sbc EndOfTheBarrelY,y ; correction of Y - ;sbc #7 sta ytraj+1 lda ytraj+2 sbc #0 @@ -1078,7 +1134,6 @@ AfterStrongShoot jsr Flight mva #1 color - ;jsr WaitForKeyRelease rts .endp