Compare commits

...

20 Commits

Author SHA1 Message Date
Pirx 871f33f3bf Merge pull request #151 from pkali/develop
Develop
2022-12-24 10:31:30 -05:00
Pirx ffd5e558ff README updt 2022-12-24 10:31:04 -05:00
Pirx 82f26310da README updt 2022-12-24 10:29:51 -05:00
Pecusx 5d935c4379 Manuals update 2022-12-24 13:12:57 +01:00
Pecusx 4a9d8da441 New best colors by Adam :) 2022-12-24 12:40:11 +01:00
Pecusx 25490f76a3 Best colors by Adam 2022-12-24 10:55:59 +01:00
Pecusx 7b77d9714e Even better (other) colors :) 2022-12-23 19:46:20 +01:00
Pecusx 3fdc8600c6 Better second set of colors 2022-12-23 14:38:36 +01:00
Pecusx 3936b2bf8c Two sets of "gradient" selectable. 2022-12-23 14:07:22 +01:00
Pecusx d420ce06ca Smoke Tracer does not smoke when targeting by Lazy Darwin 2022-12-17 20:05:33 +01:00
Pecusx 6ec02ab3fc Lazy Boy works well with joystick (more testing needed) 2022-12-16 18:11:35 +01:00
Pecusx cf61f5075f New Lazy Darwin (with problems on 5200) 2022-12-16 15:20:10 +01:00
Pecusx 87f7e7eafa Dot does not fire MIRV :) 2022-12-16 13:41:52 +01:00
Pecusx 328a147225 Magic of the "." key :) 2022-12-16 12:39:52 +01:00
Pecusx 54a4dcf7d8 Options screen is now separate from setting the game's initial variables.
For easier porting to the C64 or others.
2022-12-14 13:11:40 +01:00
Pecusx b7a5e7c9b5 Self-destruction of shielded tank at angle 0-4. fixed! - again! 2022-12-13 17:47:42 +01:00
Pecusx 54f04ed962 Barrel start point correction 2022-12-13 09:30:11 +01:00
Pecusx 588040d9e6 Soildown after Hovercraft optimization. 2022-12-13 09:15:39 +01:00
Pecusx 2b88517167 New tanks shapes by Adam. But we maust correct start point of barrel 2022-12-12 20:42:17 +01:00
Pecusx ffcf44cabb Better Soildown after Hovercraft. 2022-12-12 14:11:09 +01:00
14 changed files with 351 additions and 358 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ On the first screen, you can configure gameplay options:
Select options with cursor keys or a joystick. Select options with cursor keys or a joystick.
The [TAB] or [SELECT] key, and on the Atari 5200 console the [5] controller key change the color of the mountains. The [TAB] or [SELECT] key, and on the Atari 5200 console the [5] controller key change the color of the mountains (3 versions to choose).
The [RETURN] key or a joystick button moves to the next screen. The [RETURN] key or a joystick button moves to the next screen.
@@ -178,7 +178,7 @@ Only these points determine the order in the summary
* **Nuclear Winter** - adds nothing, takes nothing away :) - in fact, it is not so much a defensive weapon as a double-edged one. It floods the area with "radioactive" fallout, which is ordinary soil. If you do not have at hand any weapon that digs up the terrain, and for that a shield (preferably disposable), then after such "fallout" you will have to shoot yourself - because being underground is otherwise impossible. Alternatively, **White Flag** always remains. * **Nuclear Winter** - adds nothing, takes nothing away :) - in fact, it is not so much a defensive weapon as a double-edged one. It floods the area with "radioactive" fallout, which is ordinary soil. If you do not have at hand any weapon that digs up the terrain, and for that a shield (preferably disposable), then after such "fallout" you will have to shoot yourself - because being underground is otherwise impossible. Alternatively, **White Flag** always remains.
* **Long Schlong** - a special weapon :) - Costs a lot, doesn't really help with anything (except possibly digging yourself out but only when slightly buried but it has a cool name and looks cool :) - It can be activated independently of other defensive weapons and remains active until the end of the round (it cannot be deactivated). * **Long Schlong** - a special weapon :) - Costs a lot, doesn't really help with anything (except possibly digging yourself out but only when slightly buried but it has a cool name and looks cool :) - It can be activated independently of other defensive weapons and remains active until the end of the round (it cannot be deactivated).
* **Lazy Boy** - it is not actually a defensive weapon. It is an aiming aid. When it is activated, the tank tries to aim at the nearest enemy and automatically adjusts the power of the shot and angle. If it has too little energy, it can sometimes aim wrong (it uses a method like **Cyborg** to aim). Like **Battery**, it does not deactivate other defensive weapons when used. Note: There is no point in activating this weapon before the round, targeting will not take place because there is nothing to target yet. * **Lazy Boy** - it is not actually a defensive weapon. It is an aiming aid. When it is activated, the tank tries to aim at the nearest enemy and automatically adjusts the power of the shot and angle. If it has too little energy, it can sometimes aim wrong (it uses a method like **Cyborg** to aim). Like **Battery**, it does not deactivate other defensive weapons when used. Note: There is no point in activating this weapon before the round, targeting will not take place because there is nothing to target yet.
* **Lazy Darwin** - works exactly like **Lazy Boy** but targets the weakest opponent. * **Lazy Darwin** - works just like **Lazy Boy** but targets the weakest opponent. In this weapon, after automatic targeting, "visual targeting" remains active, so you can easily change the target and independently select another opponent by seeing if you hit him.
* **Auto Defense** - activates the mode of automatic activation of defensive weapons. After its activation, the tank automatically activates the strongest shield it has (consuming it, of course) at any time when there is no shield (also between shots of other players). At the same time, if the tank's energy level drops below 30 units, it automatically activates **Battery** if it has it. This weapon remains active until the end of the round and is indicated by the "computer" symbol before the name of the active defensive weapon in the status line. It is the second defensive weapon that does not deactivate other defensive weapons when used. * **Auto Defense** - activates the mode of automatic activation of defensive weapons. After its activation, the tank automatically activates the strongest shield it has (consuming it, of course) at any time when there is no shield (also between shots of other players). At the same time, if the tank's energy level drops below 30 units, it automatically activates **Battery** if it has it. This weapon remains active until the end of the round and is indicated by the "computer" symbol before the name of the active defensive weapon in the status line. It is the second defensive weapon that does not deactivate other defensive weapons when used.
* **Spy Hard** - Help for the forgetful :) . When activated, it shows a preview of information about the next opponents one by one. Left/Right - changes the "spied" tank. Fire/Space/Return/Esc - ends the "spying". This is the last defensive weapon, which does not deactivate other defensive weapons when used. * **Spy Hard** - Help for the forgetful :) . When activated, it shows a preview of information about the next opponents one by one. Left/Right - changes the "spied" tank. Fire/Space/Return/Esc - ends the "spying". This is the last defensive weapon, which does not deactivate other defensive weapons when used.
+2 -2
View File
@@ -23,7 +23,7 @@ Na pierwszym ekranie możemy skonfigurować opcje rozgrywki:
Wybór opcji klawiszami kursora lub joystickiem. Wybór opcji klawiszami kursora lub joystickiem.
Klawisz [TAB] lub [SELECT], a na konsoli Atari 5200 klawisz [5] kontrolera zmieniają kolor gór. Klawisz [TAB] lub [SELECT], a na konsoli Atari 5200 klawisz [5] kontrolera zmieniają kolor gór (3 wersje do wyboru).
Klawisz [RETURN] lub przycisk Joysticka przechodzi do następnego ekranu. Klawisz [RETURN] lub przycisk Joysticka przechodzi do następnego ekranu.
@@ -178,7 +178,7 @@ Tylko te punkty decydują o kolejności w podsumowaniu
* **Nuclear Winter** - nic nie dodaje, nic nie zabiera :) - w zasadzie to broń nie tyle defensywna co obosieczna. Zasypuje teren opadem "radioaktywnym", który jest zwyczajną glebą. Jeśli nie mamy pod ręką żadnej broni odkopującej teren i do tego osłony (najlepiej jednorazowej), to po takim "opadzie" będzie trzeba strzelić do siebie - bo będąc pod ziemią inaczej się nie da. Ewentualnie pozostaje zawsze White Flag. * **Nuclear Winter** - nic nie dodaje, nic nie zabiera :) - w zasadzie to broń nie tyle defensywna co obosieczna. Zasypuje teren opadem "radioaktywnym", który jest zwyczajną glebą. Jeśli nie mamy pod ręką żadnej broni odkopującej teren i do tego osłony (najlepiej jednorazowej), to po takim "opadzie" będzie trzeba strzelić do siebie - bo będąc pod ziemią inaczej się nie da. Ewentualnie pozostaje zawsze White Flag.
* **Long Schlong** - broń specjalna :) - kosztuje dużo, nie bardzo w czymkolwiek pomaga (poza ewentualnym odkopaniem się ale tylko przy niewielkim przysypaniu ale fajnie się nazywa i wygląda :) - Można ją aktywować niezależnie od innych broni defensywnych i pozostaje aktywna do końca rundy (nie da się jej dezaktywować). * **Long Schlong** - broń specjalna :) - kosztuje dużo, nie bardzo w czymkolwiek pomaga (poza ewentualnym odkopaniem się ale tylko przy niewielkim przysypaniu ale fajnie się nazywa i wygląda :) - Można ją aktywować niezależnie od innych broni defensywnych i pozostaje aktywna do końca rundy (nie da się jej dezaktywować).
* **Lazy Boy** - nie jest to właściwie broń defensywna. Jest to wspomaganie celowania. Po jej aktywacji czołg stara się wycelować w najbliższego przeciwnika i automatycznie ustawia siłę strzału oraz kąt. W przypadku posiadania zbyt małej ilości energii może czasem wycelować źle (do celowania stosuje metodę taką jak **Cyborg**). Tak jak **Battery** nie dezaktywuje innych broni defensywnych w przypadku jej użycia. Uwaga! Nie ma sensu aktywacja tej broni przed rundą, celowanie nie odbędzie się bo nie ma jeszcze do czego celować. * **Lazy Boy** - nie jest to właściwie broń defensywna. Jest to wspomaganie celowania. Po jej aktywacji czołg stara się wycelować w najbliższego przeciwnika i automatycznie ustawia siłę strzału oraz kąt. W przypadku posiadania zbyt małej ilości energii może czasem wycelować źle (do celowania stosuje metodę taką jak **Cyborg**). Tak jak **Battery** nie dezaktywuje innych broni defensywnych w przypadku jej użycia. Uwaga! Nie ma sensu aktywacja tej broni przed rundą, celowanie nie odbędzie się bo nie ma jeszcze do czego celować.
* **Lazy Darwin** - działa dokładnie jak **Lazy Boy** ale celuje w najsłabszego przeciwnika. * **Lazy Darwin** - działa tak jak **Lazy Boy** ale celuje w najsłabszego przeciwnika. W tej broni po automatycznym celowaniu pozostaje aktywne "celowanie wizualne" można więc łątwo zmienić cel i samodzielnie wybrać innego przeciwnika widząc czy w niego trafimy.
* **Auto Defense** - włącza tryb automatycznej aktywacji broni defensywnych. Po jej aktywowaniu czołg automatycznie aktywuje najmocniejszą posiadaną osłonę (zużywając ją oczywiście) w każdej chwili, kiedy nie ma żadnej osłony (także pomiędzy strzałami innych graczy). Jednocześnie jeżeli poziom energii czołgu spadnie poniżej 30 jednostek, automatycznie aktywuje **Battery** jeżeli ją posiada. Ta broń pozostaje aktywna do końca rundy i jest sygnalizowana symbolem "komputera" przed nazwą aktywnej broni defensywnej w linii statusowej. Jest to druga broń defensywna, która nie dezaktywuje innych broni defensywnych w przypadku jej użycia. * **Auto Defense** - włącza tryb automatycznej aktywacji broni defensywnych. Po jej aktywowaniu czołg automatycznie aktywuje najmocniejszą posiadaną osłonę (zużywając ją oczywiście) w każdej chwili, kiedy nie ma żadnej osłony (także pomiędzy strzałami innych graczy). Jednocześnie jeżeli poziom energii czołgu spadnie poniżej 30 jednostek, automatycznie aktywuje **Battery** jeżeli ją posiada. Ta broń pozostaje aktywna do końca rundy i jest sygnalizowana symbolem "komputera" przed nazwą aktywnej broni defensywnej w linii statusowej. Jest to druga broń defensywna, która nie dezaktywuje innych broni defensywnych w przypadku jej użycia.
* **Spy Hard** - Pomoc dla zapominalskich :) . Po aktywacji pokazuje kolejno podgląd informacji o kolejnych przeciwnikach. Lewo/Prawo - zmienia "szpiegowany" czołg. Fire/Space/Return/Esc - kończy "szpiegowanie". Jest to ostatnia broń defensywna, która nie dezaktywuje innych broni defensywnych w przypadku jej użycia. * **Spy Hard** - Pomoc dla zapominalskich :) . Po aktywacji pokazuje kolejno podgląd informacji o kolejnych przeciwnikach. Lewo/Prawo - zmienia "szpiegowany" czołg. Fire/Space/Return/Esc - kończy "szpiegowanie". Jest to ostatnia broń defensywna, która nie dezaktywuje innych broni defensywnych w przypadku jej użycia.
+16
View File
@@ -51,6 +51,22 @@ With the advent of [fujinet](https://fujinet.online/) we are thinking about maki
## Changelog: ## Changelog:
###### Version 1.22
2022-12-24
Christmas colors edition! Can you carve a quarter of a page of memory from two decades old code? Sure @Pecusx can! So finally we have the most requested feature - C0L0RS on the game screen, adjusted with Adam's help.
Press [TAB] twice in the main menu to switch to a screen with colors.
Other (dubious) improvements:
- New Lazy Darwin, it is spectacular, check it out!!!
- Smoke Tracer does not smoke when targeting with Lazy Darwin
- Lazy Boy works well with joystick
- Another fix for self-destructing tanks shooting low angles (0-4 degrees)
- New, better tank shapes by Adam
- Barrel start point correction fixes very rare aiming issues
- Soil slide after Hovercraft usage optimized
###### Version 1.21 ###### Version 1.21
2022-12-10 2022-12-10
+1 -58
View File
@@ -514,64 +514,7 @@ skipThisPlayer
lda tempor2 lda tempor2
rts rts
.endp .endp
/*
;----------------------------------------------
.proc FindBestTarget1
; find farthest tank neighbour
; X - shooting tank number
; returns target tank number in Y and
; direcion of shoot in A (0 - left, >0 - right)
;----------------------------------------------
jsr MakeLowResDistances
lda #$00
sta temp2 ; max possible distance
sta tempor2 ; direction of shoot
;ldx TankNr
ldy NumberOfPlayers
dey
loop01
cpy TankNr
beq skipThisPlayer
lda eXistenZ,y
beq skipThisPlayer
lda LowResDistances,x
cmp LowResDistances,y
bcs EnemyOnTheLeft
;enemy on the right
sec
lda LowResDistances,y
sbc LowResDistances,x
cmp temp2 ; bigest
bcc bigestIsBigger
sta temp2
sty temp2+1 ; number of the farthest tank
inc tempor2 ; set direction to right
bne bigestIsBigger
EnemyOnTheLeft
sec
lda LowResDistances,x
sbc LowResDistances,y
cmp temp2 ; lowest
bcc bigestIsBigger
sta temp2
sty temp2+1 ; number of the farthest tank
bigestIsBigger
skipThisPlayer
dey
bpl loop01
; now we have number of the farthest tank in temp2+1
; and direction (0 - left, >0 - right) in tempor2
; let's move them to registers
; in temp2 we have x distance divided by 8
ldy temp2+1
lda tempor2
rts
.endp
*/
;---------------------------------------------- ;----------------------------------------------
.proc TakeAim .proc TakeAim
; targeting the tank number TargetTankNr (and Y) ; targeting the tank number TargetTankNr (and Y)
@@ -617,7 +560,7 @@ RepeatAim
lda #ind_Baby_Missile___ lda #ind_Baby_Missile___
sta ActiveWeapon,x sta ActiveWeapon,x
; now we have initial valuses ; now we have initial valuses
mva #$ff TestFlightFlag mva #%11000000 TestFlightFlag
; check targeting direction ; check targeting direction
lda tempor2 lda tempor2
jne AimingLeft jne AimingLeft
Binary file not shown.
+10
View File
@@ -62,6 +62,16 @@ lineClear
TankColoursTable .BYTE $58,$2a,$96,$ca,$7a,$ed TankColoursTable .BYTE $58,$2a,$96,$ca,$7a,$ed
;TankStatusColoursTable .BYTE $54,$24,$92,$c4,$74,$e4 ; standard order ;TankStatusColoursTable .BYTE $54,$24,$92,$c4,$74,$e4 ; standard order
TankStatusColoursTable .BYTE $74,$c4,$24,$e4,$54,$94 ; Adam's order TankStatusColoursTable .BYTE $74,$c4,$24,$e4,$54,$94 ; Adam's order
;-----------
GradientAddrL
.by <dliColorsFore, <dliColorsFore, <dliColorsFore2
GradientAddrH
.by >dliColorsFore, >dliColorsFore, >dliColorsFore2
dliColorsFore2
.by $0a ; one mountains color
.by $7e,$7a,$7c,$6a,$6c,$58,$5a,$48,$4a,$38
.by $3a,$16,$18,$e6,$e8,$d4,$d6,$b4,$b6,$b6
;----------- ;-----------
pmtableL ; addressess of the P/M memory for 6 tanks pmtableL ; addressess of the P/M memory for 6 tanks
.by <(pmgraph+$400) .by <(pmgraph+$400)
+1 -1
View File
@@ -86,7 +86,7 @@ price_Bouncy_Castle__ = 512 ;_41
price_Long_Barrel____ = 2100 ;_42 price_Long_Barrel____ = 2100 ;_42
price_Nuclear_Winter_ = 1000 ;_43 price_Nuclear_Winter_ = 1000 ;_43
price_Lazy_Boy_______ = 500 ;_44 price_Lazy_Boy_______ = 500 ;_44
price_Lazy_Darwin____ = 500 ;_45 price_Lazy_Darwin____ = 730 ;_45
price_Auto_Defense___ = 250 ;_46 price_Auto_Defense___ = 250 ;_46
price_Spy_Hard_______ = 83 ;_47 price_Spy_Hard_______ = 83 ;_47
;Weapon indexes (numbers) ;Weapon indexes (numbers)
+1 -1
View File
@@ -2088,7 +2088,7 @@ X lda XtanksTableL,x
sbc #90 sbc #90
tax tax
; barrel start offset over 90deg ; barrel start offset over 90deg
adw xdraw #5 xdraw adw xdraw #4 xdraw
mva #1 goleft mva #1 goleft
bpl @+ ; jmp @+ bpl @+ ; jmp @+
+25 -7
View File
@@ -15,7 +15,7 @@
;--------------------------------------------------- ;---------------------------------------------------
.macro build .macro build
dta d"1.21" ; number of this build (4 bytes) dta d"1.22" ; number of this build (4 bytes)
.endm .endm
.macro RMTSong .macro RMTSong
@@ -26,9 +26,11 @@
;--------------------------------------------------- ;---------------------------------------------------
icl 'definitions.asm' icl 'definitions.asm'
;--------------------------------------------------- ;---------------------------------------------------
FirstZpageVariable = $60 FirstZpageVariable = $5B
.zpvar DliColorBack .byte = FirstZpageVariable .zpvar DliColorBack .byte = FirstZpageVariable
.zpvar Gradient .byte .zpvar Gradient .byte
.zpvar GradientNr .byte
.zpvar GradientColors .word
.zpvar JoystickNumber .byte .zpvar JoystickNumber .byte
.zpvar xdraw .word ;= $64 ;variable X for plot .zpvar xdraw .word ;= $64 ;variable X for plot
.zpvar ydraw .word ;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen) .zpvar ydraw .word ;variable Y for plot (like in Atari Basic - Y=0 in upper right corner of the screen)
@@ -71,10 +73,12 @@ FirstZpageVariable = $60
.zpvar pressTimer .byte .zpvar pressTimer .byte
.zpvar NTSCcounter .byte .zpvar NTSCcounter .byte
.zpvar IsEndOfTheFallFlag .byte ; for small speedup ground falling .zpvar IsEndOfTheFallFlag .byte ; for small speedup ground falling
.zpvar sfx_effect .byte .zpvar sfx_effect .byte
.zpvar RMT_blocked .byte .zpvar RMT_blocked .byte
.zpvar ScrollFlag .byte .zpvar ScrollFlag .byte
.zpvar SkStatSimulator .byte .zpvar SkStatSimulator .byte
.zpvar FloatingAlt .byte ; floating tank altitude
.zpvar OverTankDir .byte ; (0 go right, $ff go left) direction of bypassing tanks on screen
; --------------OPTIMIZATION VARIABLES-------------- ; --------------OPTIMIZATION VARIABLES--------------
.zpvar Force .word .zpvar Force .word
@@ -248,6 +252,11 @@ FirstSTART
dey dey
bpl @- bpl @-
; initialize one Variable in zero page :)
lda #<dliColorsFore
sta GradientColors
lda #>dliColorsFore
sta GradientColors+1
; generate linetables ; generate linetables
mwa #display temp mwa #display temp
@@ -281,6 +290,12 @@ FirstSTART
mva #$10 MODUL-6+$a69 ; $12 > $10 mva #$10 MODUL-6+$a69 ; $12 > $10
mva #$04 MODUL-6+$bf8 ; $05 > $04 mva #$04 MODUL-6+$bf8 ; $05 > $04
mva #$08 MODUL-6+$e3d ; $0a > $08 mva #$08 MODUL-6+$e3d ; $0a > $08
; and colors - sorry no memory!
; mva #$c4 dliColorsFore2+16
; mva #$c6 dliColorsFore2+17
; mva #$a4 dliColorsFore2+18
; mva #$a6 dliColorsFore2+19
; sta dliColorsFore2+20
NoRMT_PALchange NoRMT_PALchange
.ELSE .ELSE
mva #$7f SkStatSimulator mva #$7f SkStatSimulator
@@ -314,6 +329,7 @@ START
RMTSong song_main_menu RMTSong song_main_menu
jsr Options ;startup screen jsr Options ;startup screen
jsr SetVariablesFromOptions
jsr MakeDarkScreen jsr MakeDarkScreen
bit escFlag bit escFlag
bmi START bmi START
@@ -675,6 +691,8 @@ ManualShooting
lda JoyNumber,x lda JoyNumber,x
sta JoystickNumber ; set joystick port for player sta JoystickNumber ; set joystick port for player
jsr WaitForKeyRelease jsr WaitForKeyRelease
lda #%00000000
sta TestFlightFlag ; set "Test Fight" off
jsr BeforeFire jsr BeforeFire
lda escFlag lda escFlag
seq:rts ; keys Esc or O seq:rts ; keys Esc or O
@@ -1191,7 +1209,7 @@ GoGradient
; nop ; nop
.ENDIF .ENDIF
sta COLPF1 sta COLPF1
lda dliColorsFore,y ; mountains colors array lda (GradientColors),y ; mountains colors array
; lda dliColorsFore ; one mauntain color ; lda dliColorsFore ; one mauntain color
sta COLPF2 sta COLPF2
inc dliCounter inc dliCounter
@@ -1977,7 +1995,7 @@ noingame
icl 'artwork/talk.asm' icl 'artwork/talk.asm'
;---------------------------------------------- ;----------------------------------------------
TankFont TankFont
ins 'artwork/tanksv3.fnt',+0,384 ; 48 characters only ins 'artwork/tanksv4.fnt',+0,384 ; 48 characters only
;---------------------------------------------- ;----------------------------------------------
font4x4 font4x4
ins 'artwork/font4x4s.bmp',+62 ins 'artwork/font4x4s.bmp',+62
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+82 -59
View File
@@ -109,73 +109,32 @@ OptionsNoLeft
OptionsNoRight OptionsNoRight
cmp #@kbcode._ret ; $c ;Return key cmp #@kbcode._ret ; $c ;Return key
bne OptionsNoReturn bne OptionsNoReturn
jmp OptionsFinished rts ; options selected
OptionsNoReturn OptionsNoReturn
cmp #@kbcode._tab ; Tab key cmp #@kbcode._tab ; Tab key
bne OptionsNoTab bne OptionsNoTab
bit Gradient
bmi NextGradientNr
lda Gradient lda Gradient
eor #$80 @ eor #$80
sta Gradient sta Gradient
NextGradientNr
ldy GradientNr
iny
cpy #$03
bne NoGradientLoop
mva #$ff GradientNr
bne @-
NoGradientLoop
sty GradientNr
lda GradientAddrL,y
sta GradientColors
lda GradientAddrH,y
sta GradientColors+1
OptionsNoTab OptionsNoTab
jmp OptionsMainLoop jmp OptionsMainLoop
.endp
OptionsFinished
;first option
ldy OptionsTable
iny
iny
sty NumberOfPlayers ;1=1 player (but minimum is 2)
;second option (cash)
ldy OptionsTable+1
ldx #0
@
lda CashOptionL,y
sta moneyL,x
lda CashOptionH,y
sta moneyH,x
inx
cpx NumberOfPlayers
bne @-
;third option (gravity)
ldy OptionsTable+2
lda GravityTable,y
sta gravity
;fourth option (wind)
ldy OptionsTable+3
lda MaxWindTable,y
sta MaxWind
;fifth option (no of rounds)
ldy OptionsTable+4
lda RoundsTable,y
sta RoundsInTheGame
;6th option (shell speed)
ldy OptionsTable+5
lda flyDelayTable,y
sta flyDelay
;7th option (Airstrike after how many missess)
ldy OptionsTable+6
lda seppukuTable,y
sta seppukuVal
;8th option (how aggressive are mountains)
ldy OptionsTable+7
lda mountainsDeltaTableH,y
sta mountainDeltaH
lda mountainsDeltaTableL,y
sta mountainDeltaL
rts
.endp
;-------- ;--------
; inversing selected option (cursor) ; inversing selected option (cursor)
;-------- ;--------
@@ -236,6 +195,66 @@ invertme
rts rts
.endp .endp
; --------------------------------------
; Sets the appropriate variables based on the options table
;
.proc SetVariablesFromOptions
;first option
ldy OptionsTable
iny
iny
sty NumberOfPlayers ;1=1 player (but minimum is 2)
;second option (cash)
ldy OptionsTable+1
ldx #0
@
lda CashOptionL,y
sta moneyL,x
lda CashOptionH,y
sta moneyH,x
inx
cpx NumberOfPlayers
bne @-
;third option (gravity)
ldy OptionsTable+2
lda GravityTable,y
sta gravity
;fourth option (wind)
ldy OptionsTable+3
lda MaxWindTable,y
sta MaxWind
;fifth option (no of rounds)
ldy OptionsTable+4
lda RoundsTable,y
sta RoundsInTheGame
;6th option (shell speed)
ldy OptionsTable+5
lda flyDelayTable,y
sta flyDelay
;7th option (Airstrike after how many missess)
ldy OptionsTable+6
lda seppukuTable,y
sta seppukuVal
;8th option (how aggressive are mountains)
ldy OptionsTable+7
lda mountainsDeltaTableH,y
sta mountainDeltaH
lda mountainsDeltaTableL,y
sta mountainDeltaL
rts
.endp
;------------------------------------------- ;-------------------------------------------
; call of the purchase (and activate) screens for each tank ; call of the purchase (and activate) screens for each tank
.proc CallPurchaseForEveryTank .proc CallPurchaseForEveryTank
@@ -886,6 +905,8 @@ NoAutoDefense
jsr FindBestTarget2 ; find nearest tank neighbour jsr FindBestTarget2 ; find nearest tank neighbour
jsr LazyAim jsr LazyAim
ply ply
lda #%00000000
sta TestFlightFlag ; set "visual aiming" off
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NoLazyBoy NoLazyBoy
cmp #ind_Lazy_Darwin____ cmp #ind_Lazy_Darwin____
@@ -897,6 +918,8 @@ NoLazyBoy
jsr FindBestTarget3 ; find target with lowest energy jsr FindBestTarget3 ; find target with lowest energy
jsr LazyAim jsr LazyAim
ply ply
lda #%10000000
sta TestFlightFlag ; set "visual aiming" on
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NoLazyDarwin NoLazyDarwin
cmp #ind_Spy_Hard_______ cmp #ind_Spy_Hard_______
+1 -1
View File
@@ -220,7 +220,7 @@ 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?
FloatingAlt .DS 1 ; floating tank altitude ;FloatingAlt .DS 1 ; floating tank altitude
FunkyWallFlag = FloatingAlt ; reuse this variable in different weapon (Funky Bomb)! FunkyWallFlag = FloatingAlt ; reuse this variable in different weapon (Funky Bomb)!
PreferHumansFlag = FloatingAlt ; second reuse in AI Aim proc PreferHumansFlag = FloatingAlt ; second reuse in AI Aim proc
;---------------------------------------------------- ;----------------------------------------------------
+208 -225
View File
@@ -76,25 +76,29 @@ CheckNextTankBFG
.proc babymissile .proc babymissile
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
mva #11 ExplosionRadius mva #11 ExplosionRadius
GoXmissile
jmp xmissile jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc missile ; .proc missile ;
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
mva #17 ExplosionRadius mva #17 ExplosionRadius
jmp xmissile bne babymissile.GoXmissile
; jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc babynuke .proc babynuke
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
mva #25 ExplosionRadius mva #25 ExplosionRadius
jmp xmissile bne babymissile.GoXmissile
; jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc nuke .proc nuke
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
mva #30 ExplosionRadius mva #30 ExplosionRadius
jmp xmissile bne babymissile.GoXmissile
; jmp xmissile
.endp .endp
; ------------------------ ; ------------------------
.proc leapfrog .proc leapfrog
@@ -104,29 +108,6 @@ CheckNextTankBFG
jsr SecondRepeat jsr SecondRepeat
/* ; soil must fall down now! there is no other way...
; hide tanks or they fall down with soil
jsr SoilDown2
; it looks like force is divided by 4 here BUT"
; in Flight routine force is multiplied by 2 and left
; so, we have Force divided by 2 here (not accurately)
lsr Force+1
ror Force
;lsr Force+1
;ror Force
mva LeapFrogAngle Angle
mva #sfx_funky_hit sfx_effect
sbw ytraj+1 #$05 ; next missiles start point goes 5 pixel UP to prevent multiple explosion at one point if tank is hit (4 pixels tank height + 1)
jsr Flight
lda HitFlag
beq EndOfLeapping
mva #15 ExplosionRadius
jsr CalculateExplosionRange0
mva #sfx_baby_missile sfx_effect
jsr xmissile.NoRangeCalc */
SecondRepeat SecondRepeat
; soil must fall down now! there is no other way... ; soil must fall down now! there is no other way...
; hide tanks or they fall down with soil ; hide tanks or they fall down with soil
@@ -221,19 +202,13 @@ NoWallsInFunky
.proc deathshead .proc deathshead
mva #30 ExplosionRadius mva #30 ExplosionRadius
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY jsr GoXmissileWithSaveXYdraw
jsr xmissile
UnSaveDrawXY
sbw xdraw #34 sbw xdraw #34
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY jsr GoXmissileWithSaveXYdraw
jsr xmissile
UnSaveDrawXY
adw xdraw #68 adw xdraw #68
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY jsr GoXmissileWithSaveXYdraw
jsr xmissile
UnSaveDrawXY
sbw xdraw #34 sbw xdraw #34
; ;
sbw ydraw #34 sbw ydraw #34
@@ -241,28 +216,22 @@ NoWallsInFunky
cpw ydraw #screenHeight cpw ydraw #screenHeight
bcs NoUpperCircle bcs NoUpperCircle
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
SaveDrawXY jsr GoXmissileWithSaveXYdraw
jsr xmissile
UnSaveDrawXY
NoUpperCircle NoUpperCircle
adw ydraw #68 adw ydraw #68
;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 GoXmissileWithSaveXYdraw
jsr xmissile
UnSaveDrawXY
NoLowerCircle NoLowerCircle
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
rts rts
.endp
.proc SaveDrawXY GoXmissileWithSaveXYdraw
mwa xdraw tempXROLLER mwa xdraw tempXROLLER
mwa ydraw modify mwa ydraw modify
rts jsr xmissile
.endp
.proc UnSaveDrawXY
mwa tempXROLLER xdraw mwa tempXROLLER xdraw
mwa modify ydraw mwa modify ydraw
rts rts
@@ -273,7 +242,7 @@ NoLowerCircle
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width) mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm mva #0 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
jmp xnapalm beq xnapalm
.endp .endp
; ------------------------ ; ------------------------
.proc hotnapalm .proc hotnapalm
@@ -281,7 +250,7 @@ NoLowerCircle
mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width) mva #(napalmRadius+4) ExplosionRadius ; real radius + 4 pixels (half characrer width)
jsr CalculateExplosionRange jsr CalculateExplosionRange
mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm mva #1 ExplosionRadius ; in this weapon - flag: 0 - napalm, 1 - hotnapalm
jmp xnapalm ; jmp xnapalm
.endp .endp
; ------------------------ ; ------------------------
.proc xnapalm .proc xnapalm
@@ -420,7 +389,7 @@ EndNurnedCheckLoop
mva #0 sandhogflag mva #0 sandhogflag
mva #13 DigLong mva #13 DigLong
mva #1 diggery ; how many branches (-1) mva #1 diggery ; how many branches (-1)
jmp xdigger bne xdigger
.endp .endp
; ------------------------ ; ------------------------
.proc digger ; .proc digger ;
@@ -428,7 +397,7 @@ EndNurnedCheckLoop
mva #0 sandhogflag mva #0 sandhogflag
mva #13 DigLong mva #13 DigLong
mva #3 diggery ; how many branches (-1) mva #3 diggery ; how many branches (-1)
jmp xdigger bne xdigger
.endp .endp
; ------------------------ ; ------------------------
.proc heavydigger .proc heavydigger
@@ -436,7 +405,31 @@ EndNurnedCheckLoop
mva #0 sandhogflag mva #0 sandhogflag
mva #13 DigLong mva #13 DigLong
mva #7 diggery ; how many branches (-1) mva #7 diggery ; how many branches (-1)
jmp xdigger bne xdigger
.endp
; ------------------------
.proc babysandhog
mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag
mva #13 DigLong
mva #1 diggery ; how many branches (-1)
bne xdigger
.endp
; ------------------------
.proc sandhog
mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag
mva #13 DigLong
mva #3 diggery ; how many branches (-1)
bne xdigger
.endp
; ------------------------
.proc heavysandhog
mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag
mva #13 DigLong
mva #5 diggery ; how many branches (-1)
; jmp xdigger
.endp .endp
; ------------------------ ; ------------------------
.proc xdigger .proc xdigger
@@ -554,46 +547,39 @@ DiggerCharacter
jmp TypeChar jmp TypeChar
.endp .endp
; ------------------------ ; ------------------------
.proc babysandhog
mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag
mva #13 DigLong
mva #1 diggery ; how many branches (-1)
jmp xdigger
.endp
; ------------------------
.proc sandhog
mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag
mva #13 DigLong
mva #3 diggery ; how many branches (-1)
jmp xdigger
.endp
; ------------------------
.proc heavysandhog
mva #sfx_sandhog sfx_effect
mva #char_sandhog_offset sandhogflag
mva #13 DigLong
mva #5 diggery ; how many branches (-1)
jmp xdigger
.endp
; ------------------------
.proc dirtclod .proc dirtclod
mva #12 ExplosionRadius mva #12 ExplosionRadius
jsr CalculateExplosionRange bne xdirt
jmp xdirt
.endp .endp
; ------------------------ ; ------------------------
.proc dirtball .proc dirtball
mva #22 ExplosionRadius mva #22 ExplosionRadius
jsr CalculateExplosionRange bne xdirt
jmp xdirt
.endp .endp
; ------------------------ ; ------------------------
.proc tonofdirt .proc tonofdirt
mva #31 ExplosionRadius mva #31 ExplosionRadius
; jmp xdirt
.endp
; -----------------
.proc xdirt ;
; -----------------
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp xdirt mva #sfx_dirt_charge sfx_effect
lda #1
sta radius
sta color
dirtLoop
jsr circle
inw ydraw
jsr circle
.nowarn dew ydraw
inc radius
lda radius
cmp ExplosionRadius
bne dirtLoop
mva #sfx_silencer sfx_effect
rts
.endp .endp
; ------------------------ ; ------------------------
.proc dirtcharge .proc dirtcharge
@@ -605,21 +591,93 @@ DiggerCharacter
.proc riotcharge .proc riotcharge
mva #sfx_riot_blast sfx_effect mva #sfx_riot_blast sfx_effect
mva #31 ExplosionRadius mva #31 ExplosionRadius
jsr CalculateExplosionRange bne cleanDirt
jmp cleanDirt
.endp .endp
; ------------------------ ; ------------------------
.proc riotblast .proc riotblast
mva #sfx_riot_blast sfx_effect mva #sfx_riot_blast sfx_effect
mva #61 ExplosionRadius mva #61 ExplosionRadius
; jmp cleanDirt
.endp
; -----------------
.proc cleanDirt
; -----------------
jsr CalculateExplosionRange jsr CalculateExplosionRange
jmp cleanDirt mva #0 color
jmp ofdirt.NoColor
.endp .endp
; ------------------------ ; ------------------------
.proc liquiddirt .proc liquiddirt
mva #sfx_liquid_dirt sfx_effect mva #sfx_liquid_dirt sfx_effect
mwa #510 FillCounter mwa #510 FillCounter
jmp xliquiddirt ; -----
mwa xdraw TempXfill
RepeatFill
mwa TempXfill xdraw
jsr checkRollDirection
; HowMuchToFall - direction
; $FF - we are in a hole (flying in missile direction)
; 1 - right, 2 - left
adw xdraw #mountaintable tempXROLLER
ldy #0
lda (tempXROLLER),y
sta HeightRol ; relative point
RollinContinuesLiquid
; new point is set
adw xdraw #mountaintable tempXROLLER
ldy #0
lda (tempXROLLER),y
sta ydraw
cmp HeightRol
beq UpNotYet2
bcc FillNow
UpNotYet2
sec ;clc
sta HeightRol
sbc #1
sta ydraw
lda HowMuchToFall
cmp #1
beq HowMuchToFallRight3
.NOWARN dew xdraw
lda xdraw
and xdraw+1
cmp #$ff ; like cpw xdraw #$ffff
;ora xdraw+1 ; like cpw xdraw #$0000
jne RollinContinuesLiquid
beq FillNow
HowMuchToFallRight3
inw xdraw
cpw xdraw #screenwidth
jne RollinContinuesLiquid
FillNow
; finally one pixel more
ldy #0
lda HowMuchToFall
bmi FillHole
cmp #1
beq FillLeft
inw xdraw
inw xdraw ; tricky but we must rollback xdraw in proper direction
FillLeft
.nowarn dew xdraw
FillHole
adw xdraw #mountaintable tempXROLLER
lda (tempXROLLER),y
sta ydraw
beq ToHighFill ; if we filled all playfield (very rare but possible)
dec ydraw ; one pixel up
lda ydraw
sta (tempXROLLER),y ;mountaintable update
mva #1 color
jsr plot.MakePlot
ToHighFill
.nowarn dew FillCounter
lda FillCounter
ora FillCounter+1
jne RepeatFill
rts
.endp .endp
; ------------------------ ; ------------------------
.proc laser .proc laser
@@ -799,25 +857,6 @@ EndOfDistanceCheckLoop
rts rts
.endp .endp
; ----------------- ; -----------------
.proc xdirt ;
; -----------------
mva #sfx_dirt_charge sfx_effect
lda #1
sta radius
sta color
dirtLoop
jsr circle
inw ydraw
jsr circle
.nowarn dew ydraw
inc radius
lda radius
cmp ExplosionRadius
bne dirtLoop
mva #sfx_silencer sfx_effect
rts
.endp
; -----------------
.proc xriotbomb ; .proc xriotbomb ;
; ----------------- ; -----------------
mva #sfx_riot_blast sfx_effect mva #sfx_riot_blast sfx_effect
@@ -964,11 +1003,6 @@ DirectionChecked
rts rts
.endp .endp
; --------------------------------------------------
.proc cleanDirt
mva #0 color
jmp ofdirt.NoColor
.endp
; -------------------------------------------------- ; --------------------------------------------------
.proc ofdirt ; .proc ofdirt ;
; -------------------------------------------------- ; --------------------------------------------------
@@ -1019,76 +1053,6 @@ EndOfTheDirt
mwa ycircle ydraw mwa ycircle ydraw
rts rts
.endp .endp
; ----------------
.proc xliquiddirt ;
mwa xdraw TempXfill
RepeatFill
mwa TempXfill xdraw
jsr checkRollDirection
; HowMuchToFall - direction
; $FF - we are in a hole (flying in missile direction)
; 1 - right, 2 - left
adw xdraw #mountaintable tempXROLLER
ldy #0
lda (tempXROLLER),y
sta HeightRol ; relative point
RollinContinuesLiquid
; new point is set
adw xdraw #mountaintable tempXROLLER
ldy #0
lda (tempXROLLER),y
sta ydraw
cmp HeightRol
beq UpNotYet2
bcc FillNow
UpNotYet2
sec ;clc
sta HeightRol
sbc #1
sta ydraw
lda HowMuchToFall
cmp #1
beq HowMuchToFallRight3
.NOWARN dew xdraw
lda xdraw
and xdraw+1
cmp #$ff ; like cpw xdraw #$ffff
;ora xdraw+1 ; like cpw xdraw #$0000
jne RollinContinuesLiquid
beq FillNow
HowMuchToFallRight3
inw xdraw
cpw xdraw #screenwidth
jne RollinContinuesLiquid
FillNow
; finally one pixel more
ldy #0
lda HowMuchToFall
bmi FillHole
cmp #1
beq FillLeft
inw xdraw
inw xdraw ; tricky but we must rollback xdraw in proper direction
FillLeft
.nowarn dew xdraw
FillHole
adw xdraw #mountaintable tempXROLLER
lda (tempXROLLER),y
sta ydraw
beq ToHighFill ; if we filled all playfield (very rare but possible)
dec ydraw ; one pixel up
lda ydraw
sta (tempXROLLER),y ;mountaintable update
mva #1 color
jsr plot.MakePlot
ToHighFill
.nowarn dew FillCounter
lda FillCounter
ora FillCounter+1
jne RepeatFill
rts
.endp
;-------------------------------------------------- ;--------------------------------------------------
.proc BeforeFire ;TankNr (byte) .proc BeforeFire ;TankNr (byte)
;-------------------------------------------------- ;--------------------------------------------------
@@ -1124,8 +1088,10 @@ ContinueToCheckMaxForce2
jsr WaitOneFrame ; best after drawing a tank jsr WaitOneFrame ; best after drawing a tank
bit TestFlightFlag
bpl @+
jsr Shoot.AfterOffensiveText ; Lazy Darwin - aiming visualisation
@
;keyboard reading ;keyboard reading
; KBCODE keeps code of last keybi ; KBCODE keeps code of last keybi
; SKSTAT $ff - nothing pressed ; SKSTAT $ff - nothing pressed
@@ -1134,6 +1100,7 @@ ContinueToCheckMaxForce2
; $f3 - shift+key ; $f3 - shift+key
notpressed notpressed
ldx TankNr ; for optimize
; Select and Option ; Select and Option
lda CONSOL lda CONSOL
tay tay
@@ -1258,10 +1225,11 @@ pressedUp
;force increaseeee! ;force increaseeee!
ldx TankNr ;ldx TankNr ; optimized
inc ForceTableL,x inc ForceTableL,x
bne CheckingMaxForce bne CheckingMaxForce
inc ForceTableH,x inc ForceTableH,x
CheckingMaxForce CheckingMaxForce
mva #sfx_set_power_1 sfx_effect mva #sfx_set_power_1 sfx_effect
@@ -1282,7 +1250,7 @@ FurtherCheckMaxForce
jmp BeforeFire jmp BeforeFire
CTRLPressedUp CTRLPressedUp
ldx TankNr ;ldx TankNr ; optimized
lda ForceTableL,x lda ForceTableL,x
clc clc
adc #10 adc #10
@@ -1300,7 +1268,7 @@ pressedDown
mva #sfx_set_power_1 sfx_effect mva #sfx_set_power_1 sfx_effect
ldx TankNr ;ldx TankNr ; optimized
dec ForceTableL,x dec ForceTableL,x
lda ForceTableL,x lda ForceTableL,x
cmp #$ff cmp #$ff
@@ -1317,7 +1285,7 @@ ForceGoesZero
CTRLPressedDown CTRLPressedDown
mva #sfx_set_power_1 sfx_effect mva #sfx_set_power_1 sfx_effect
ldx TankNr ;ldx TankNr ; optimized
sec sec
lda ForceTableL,x lda ForceTableL,x
sbc #10 sbc #10
@@ -1328,7 +1296,7 @@ CTRLPressedDown
jmp BeforeFire jmp BeforeFire
pressedRight pressedRight
ldx TankNr ;ldx TankNr ; optimized
lda pressTimer lda pressTimer
spl:mva #0 pressTimer ; if >128 then reset to 0 spl:mva #0 pressTimer ; if >128 then reset to 0
cmp #25 ; 1/2s cmp #25 ; 1/2s
@@ -1345,7 +1313,7 @@ pressedRight
jmp BeforeFire jmp BeforeFire
CTRLPressedRight CTRLPressedRight
ldx TankNr ;ldx TankNr ; optimized
mva #sfx_set_power_2 sfx_effect mva #sfx_set_power_2 sfx_effect
mva #1 Erase mva #1 Erase
jsr DrawTankNr.BarrelChange jsr DrawTankNr.BarrelChange
@@ -1361,7 +1329,7 @@ CTRLPressedRight
pressedLeft pressedLeft
ldx TankNr ;ldx TankNr ; optimized
lda pressTimer lda pressTimer
spl:mva #0 pressTimer ; if >128 then reset to 0 spl:mva #0 pressTimer ; if >128 then reset to 0
cmp #25 ; 1/2s cmp #25 ; 1/2s
@@ -1379,7 +1347,7 @@ pressedLeft
jmp BeforeFire jmp BeforeFire
CTRLPressedLeft CTRLPressedLeft
ldx TankNr ;ldx TankNr ; optimized
mva #sfx_set_power_2 sfx_effect mva #sfx_set_power_2 sfx_effect
mva #1 Erase mva #1 Erase
jsr DrawTankNr.BarrelChange jsr DrawTankNr.BarrelChange
@@ -1395,7 +1363,7 @@ CTRLPressedLeft
pressedTAB pressedTAB
mva #sfx_purchase sfx_effect mva #sfx_purchase sfx_effect
ldx TankNr ;ldx TankNr ; optimized
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #last_offensive_____ ; the last possible offensive weapon cmp #last_offensive_____ ; the last possible offensive weapon
bne ?notlasttofirst bne ?notlasttofirst
@@ -1413,7 +1381,7 @@ pressedTAB
CTRLpressedTAB CTRLpressedTAB
mva #sfx_purchase sfx_effect mva #sfx_purchase sfx_effect
ldx TankNr ;ldx TankNr ; optimized
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #first_offensive____ ; #0 cmp #first_offensive____ ; #0
bne ?notfirsttolast bne ?notfirsttolast
@@ -1444,7 +1412,6 @@ pressedS
jsr WaitForKeyRelease jsr WaitForKeyRelease
jmp BeforeFire jmp BeforeFire
pressedSpace pressedSpace
;================================= ;=================================
;we shoot here!!! ;we shoot here!!!
@@ -1469,6 +1436,8 @@ fire
;with much more separate blocks, but you know - ;with much more separate blocks, but you know -
;- do not touch it if it works... ;- do not touch it if it works...
mva #0 TestFlightFlag
;the latest addition to this routine is ;the latest addition to this routine is
;displaying offensive texts! ;displaying offensive texts!
@@ -1482,6 +1451,7 @@ RandomizeOffensiveText
mva #$ff plot4x4color mva #$ff plot4x4color
jsr DisplayOffensiveTextNr jsr DisplayOffensiveTextNr
AfterOffensiveText
mva #0 LaserFlag ; $ff - Laser mva #0 LaserFlag ; $ff - Laser
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
@@ -1499,6 +1469,8 @@ NotStrongShoot
sta Force sta Force
lda ForceTableH,x lda ForceTableH,x
sta Force+1 sta Force+1
bit TestFlightFlag
bmi AfterStrongShoot
mva #sfx_shoot sfx_effect mva #sfx_shoot sfx_effect
AfterStrongShoot AfterStrongShoot
lda AngleTable,x lda AngleTable,x
@@ -1517,7 +1489,6 @@ AfterStrongShoot
sta ytraj+2 sta ytraj+2
sta xtraj sta xtraj
sta ytraj sta ytraj
sta TestFlightFlag
; checking if the shot is underground (no Flight but Hit :) ) ; checking if the shot is underground (no Flight but Hit :) )
tay ; A=0 ! tay ; A=0 !
@@ -1538,7 +1509,9 @@ ShotUnderGround
;-------------------------------------------------- ;--------------------------------------------------
.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
; if TestFlightFlag is set ($ff) ne real flight - hit test only (for AI) ; if 7bit and 6bit of TestFlightFlag is set no real flight - hit test only (for AI)
; 7bit - fast, test flight
; 6bit - invisible bullet
;-------------------------------------------------- ;--------------------------------------------------
;g=-0.1 ;g=-0.1
;vx=Force*cos(Angle) ;vx=Force*cos(Angle)
@@ -1553,10 +1526,10 @@ ShotUnderGround
;goto begin- ;goto begin-
; smoke tracer :) ; smoke tracer :)
ldy #0 ldy #0
bit TestFlightFlag ; if test flight for AI or Lazy Darwin
bmi noSmokeTracer ; no Smoke Tracer display
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #ind_Smoke_Tracer___ ; Smoke tracer cmp #ind_Smoke_Tracer___ ; Smoke tracer
@@ -1734,10 +1707,13 @@ Loopi
bpl StillUp bpl StillUp
; where we know that the bullet starts to fall down ; where we know that the bullet starts to fall down
; 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
bit TestFlightFlag
bmi NoTestForMIRV
ldx TankNr ldx TankNr
lda ActiveWeapon,x lda ActiveWeapon,x
cmp #ind_MIRV___________ ; MIRV cmp #ind_MIRV___________ ; MIRV
jeq MIRVdownLoop jeq MIRVdownLoop
NoTestForMIRV
NoGravity NoGravity
StillUp StillUp
@@ -1820,7 +1796,7 @@ SkipCollisionCheck
mwa ytraj+1 ydraw mwa ytraj+1 ydraw
bit TestFlightFlag bit TestFlightFlag
bmi NoUnPlot bvs NoUnPlot
lda tracerflag lda tracerflag
bne NoUnPlot bne NoUnPlot
@@ -1834,7 +1810,7 @@ Hit
mwa XHit xdraw mwa XHit xdraw
mwa YHit ydraw mwa YHit ydraw
bit TestFlightFlag bit TestFlightFlag
bmi EndOfFlight bvs EndOfFlight
jsr unPlot jsr unPlot
EndOfFlight EndOfFlight
mwa xdraw xcircle ; we must store for a little while mwa xdraw xcircle ; we must store for a little while
@@ -2085,11 +2061,13 @@ MIRVcopyParameters
ldx #$FF ; it will turn 0 in a moment anyway ldx #$FF ; it will turn 0 in a moment anyway
stx MirvMissileCounter stx MirvMissileCounter
mrLoopi mrLoopi
inc:lda MirvMissileCounter ldx MirvMissileCounter
cmp #5 inx
sne:mva #0 MirvMissileCounter cpx #5
bne @+
ldx #0
@ stx MirvMissileCounter
ldx MirvMissileCounter
; Y changes only for bullet number 0 ; Y changes only for bullet number 0
; because rest of the bullets have the same Y (height) ; because rest of the bullets have the same Y (height)
@@ -2615,6 +2593,7 @@ ReachSky
sta RangeRight+1 sta RangeRight+1
; hide tanks and ... ; hide tanks and ...
jsr SoilDown2 jsr SoilDown2
jsr ClearScreenSoilRange
ldx TankNr ldx TankNr
; check keyboard/joy and move tank left/right - code copied from BeforeFire ; check keyboard/joy and move tank left/right - code copied from BeforeFire
@@ -2713,11 +2692,7 @@ RightScreenEdge
mva #sfx_dunno sfx_effect mva #sfx_dunno sfx_effect
NoREdge NoREdge
mva #18 AngleTable,x mva #18 AngleTable,x
; then draw tank on new position bne DrawFloatingTank ; then draw tank on new position
jsr DrawTankNr
jsr DisplayStatus
jsr WaitOneFrame
jmp KeyboardAndJoyCheck
pressedLeft pressedLeft
lda ShieldEnergy,x lda ShieldEnergy,x
@@ -2744,9 +2719,11 @@ LeftScreenEdge
NoLEdge NoLEdge
mva #162 AngleTable,x mva #162 AngleTable,x
; then draw tank on new position ; then draw tank on new position
DrawFloatingTank
jsr DrawTankNr jsr DrawTankNr
jsr DisplayStatus jsr DisplayStatus
jsr WaitOneFrame jsr WaitOneFrame
jsr CalculateSoildown
jmp KeyboardAndJoyCheck jmp KeyboardAndJoyCheck
pressedSpace pressedSpace
@@ -2773,7 +2750,7 @@ pressedSpace
TankOnRightSide TankOnRightSide
dey dey
TankOnLeftSide TankOnLeftSide
sty FloatingAlt ; I know, not elegant byt this variable it's free now (0 go right, $ff go left) sty OverTankDir ; (0 go right, $ff go left)
; now we have direction of bypassing tanks on screen ; now we have direction of bypassing tanks on screen
; clear "engine pixels" under tank ; clear "engine pixels" under tank
@@ -2824,7 +2801,7 @@ TankBelow
mva #1 Erase mva #1 Erase
jsr DrawTankNr jsr DrawTankNr
mva #0 Erase mva #0 Erase
bit FloatingAlt bit OverTankDir
bmi PassLeft bmi PassLeft
PassRight PassRight
inc XtankstableL,x inc XtankstableL,x
@@ -2868,10 +2845,10 @@ GoDown
adw temp #4 ; center of the tank adw temp #4 ; center of the tank
ldy #0 ldy #0
lda (temp),y lda (temp),y
sta FloatingAlt sta OverTankDir ; not elegant!!! Reuse as height of tank flight
FloatDown FloatDown
lda ytankstable,x lda ytankstable,x
cmp FloatingAlt cmp OverTankDir
bcs OnGround bcs OnGround
; first erase old tank position ; first erase old tank position
mva #1 Erase mva #1 Erase
@@ -2891,25 +2868,31 @@ OnGround
mva #0 Erase mva #0 Erase
jsr WaitForKeyRelease jsr WaitForKeyRelease
; and Soildown at the end (for correct mountaintable) ; and Soildown at the end (for correct mountaintable)
; If tank did not fly at maximum altitude there is no need to soildown to much
lda FloatingAlt
cmp #18
beq NotHighest
jsr ClearScreenSoilRange
NotHighest
; calculate range ; calculate range
sec jsr CalculateSoildown
lda XtankstableL,x
sbc #2
sta RangeLeft
lda XtankstableH,x
sbc #0
sta RangeLeft+1
clc
lda XtankstableL,x
adc #10
sta RangeRight
lda XtankstableH,x
adc #0
sta RangeRight+1
; hide tanks and ... ; hide tanks and ...
jsr SoilDown2 jsr SoilDown2
ldx TankNr ldx TankNr
rts rts
CalculateSoildown
ldx TankNr
clc
lda XtankstableL,x
adc #4
sta xdraw
lda XtankstableH,x
adc #0
sta xdraw+1
mva #$04 ExplosionRadius
jsr CalculateExplosionRange
rts
.endp .endp
; ------------------------------------------------- ; -------------------------------------------------
@@ -2931,7 +2914,7 @@ CheckCollisionWithTankLoop
lda ytankstable,x lda ytankstable,x
cmp ydraw ; check range cmp ydraw ; check range
bcc BelowTheTank ;(ytankstable,ytankstable+3) bcc BelowTheTank ;(ytankstable,ytankstable+3)
sbc #4 ; we must rewrite EndOfTheBarrelY table or remove Y correction completely to "bold" tank !!! sbc #3 ; hitbox height
cmp ydraw cmp ydraw
bcs OverTheTank bcs OverTheTank
; with or without shield ? ; with or without shield ?