source clean-up

This commit is contained in:
2023-05-20 09:48:28 -04:00
parent 401d94eec9
commit 4fa861af3d
23 changed files with 805 additions and 12540 deletions
+2 -4
View File
@@ -1,7 +1,5 @@
.project .project
*.bak *.bak
scorch.lab *.lab
scorch.lst *.lst
textproc.lab
textproc.lst
artwork/talk.as_ artwork/talk.as_
+1 -1
View File
@@ -4,7 +4,7 @@
;----------------------------------------------- ;-----------------------------------------------
; start of "variables" (RAM) ; start of "variables" (RAM)
;----------------------------------------------- ;-----------------------------------------------
OptionsHere OptionsHere
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
dta d"Players : 2 3 4 5 6 " dta d"Players : 2 3 4 5 6 "
dta d"Cash : none 2K 8K 12K 20K " dta d"Cash : none 2K 8K 12K 20K "
+55 -60
View File
@@ -8,54 +8,54 @@
;----------------------------------------------- ;-----------------------------------------------
OptionsScreen OptionsScreen
dta d"Welcome to Scorch v. " dta d"Welcome to Scorch v. "
build ; 4 bytes from scorch.asm (fancy method) :) build ; 4 bytes from scorch.asm (fancy method) :)
dta d" (un)2000-2023" dta d" (un)2000-2023"
.IF TARGET = 800 .IF TARGET = 800
dta d" Please select option with " dta d" Please select option with "
dta $fe,$dc,$dd,$ff ; cursors in inverse dta $fe,$dc,$dd,$ff ; cursors in inverse
dta d" and " dta d" and "
dta d"Tab"* dta d"Tab"*
dta d" " dta d" "
dta d" Press " dta d" Press "
dta d"Return"* dta d"Return"*
dta d" to proceed " dta d" to proceed "
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d" Please select option with joystick one " dta d" Please select option with joystick one "
dta d" and press FIRE to proceed " dta d" and press FIRE to proceed "
.ENDIF .ENDIF
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
;----------------------------------------------- ;-----------------------------------------------
NameScreen NameScreen
.IF TARGET = 800 .IF TARGET = 800
dta d" Enter names of players " dta d" Enter names of players "
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d"Hold " dta d"Hold "
dta d "FIRE"* dta d "FIRE"*
dta d " to enter player names " dta d " to enter player names "
.ENDIF .ENDIF
NameScreen3 NameScreen3
dta d" Human/Atari (difficulty level) " dta d" Human/Atari (difficulty level) "
NameScreen5 NameScreen5
.IF TARGET = 800 .IF TARGET = 800
dta d"TAB"* dta d"TAB"*
dta d" - Port nr " dta d" - Port nr "
dta $fe,$dc,$dd,$ff ; cursors in inverse dta $fe,$dc,$dd,$ff ; cursors in inverse
dta d" - Difficulty" dta d" - Difficulty"
dta d" " dta d" "
dta d"INV"* dta d"INV"*
dta d" - Shape " dta d" - Shape "
dta d"Return"* dta d"Return"*
dta d" - Proceed " dta d" - Proceed "
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d" " dta d" "
dta d"(5)"* dta d"(5)"*
dta d" - Port/Shape " dta d" - Port/Shape "
dta d"Joy"* dta d"Joy"*
dta d" - Diffic. " dta d" - Diffic. "
dta d" " dta d" "
dta d"FIRE"* dta d"FIRE"*
dta d" - Proceed " dta d" - Proceed "
.ENDIF .ENDIF
;----------------------------------------------- ;-----------------------------------------------
MoreUp MoreUp
@@ -73,51 +73,46 @@ MoreDown
WeaponsDescription WeaponsDescription
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
.IF TARGET = 800 .IF TARGET = 800
dta d"Tab"* dta d"Tab"*
dta d ": Defensive/Offensive weapon " dta d ": Defensive/Offensive weapon "
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d"Left"* dta d"Left"*
dta d ": Defensive/Offensive weapon" dta d ": Defensive/Offensive weapon"
.ENDIF .ENDIF
PurchaseDescription PurchaseDescription
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
.IF TARGET = 800 .IF TARGET = 800
dta d"Space"* dta d"Space"*
dta d": Purchase " dta d": Purchase "
dta d"Return"* dta d"Return"*
dta d": Finish " dta d": Finish "
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d"Right"* dta d"Right"*
dta d": Purchase " dta d": Purchase "
dta d"FIRE"* dta d"FIRE"*
dta d": Finish " dta d": Finish "
.ENDIF .ENDIF
ActivateDescription ActivateDescription
; 0123456789012345678901234567890123456789 ; 0123456789012345678901234567890123456789
.IF TARGET = 800 .IF TARGET = 800
dta d"Space"* dta d"Space"*
dta d": Activate " dta d": Activate "
dta d"Return"* dta d"Return"*
dta d": Finish " dta d": Finish "
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d"Right"* dta d"Right"*
dta d": Activate " dta d": Activate "
dta d"FIRE"* dta d"FIRE"*
dta d": Finish " dta d": Finish "
.ENDIF .ENDIF
EmptyLine EmptyLine
dta d" " dta d" "
;--------------------------------------------------- ;---------------------------------------------------
OptionsTitle OptionsTitle
.IF TARGET = 800 .IF TARGET = 800
dta d" scorch "* dta d" scorch "*
.ELIF TARGET = 5200 .ELIF TARGET = 5200
dta d" scorch supersystem "* dta d" scorch supersystem "*
; dta d" scorch "*
; dta d"5"
; dta d"k"*
; dta d"2"
; dta d" "*
.ENDIF .ENDIF
DifficultyTitle DifficultyTitle
dta d" difficulty "* dta d" difficulty "*
@@ -135,7 +130,7 @@ GameOverTitle2
dl ; MAIN game display list dl ; MAIN game display list
.byte $70 .byte $70
.byte $42 .byte $42
.word statusBuffer .word statusBuffer
.byte $02, $02 .byte $02, $02
.byte $10+$80 ; 2 blank lines + DLI .byte $10+$80 ; 2 blank lines + DLI
+14 -14
View File
@@ -113,7 +113,7 @@ EndOfUnPlot
; game. If you are going to speed up the game, start with ; game. If you are going to speed up the game, start with
; plot - it is used by every single effect starting from explosions ; plot - it is used by every single effect starting from explosions
; through line drawing and small text output!!! ; through line drawing and small text output!!!
; ;
; Optimized by 0xF (Fox) THXXXX!!! ; Optimized by 0xF (Fox) THXXXX!!!
; ----------------------------------------- ; -----------------------------------------
@@ -122,7 +122,7 @@ EndOfUnPlot
bcs unPlot.EndOfUnPlot ;nearest RTS bcs unPlot.EndOfUnPlot ;nearest RTS
CheckX02 CheckX02
cpw xdraw #screenwidth cpw xdraw #screenwidth
bcs EndOfPlot bcs EndOfPlot
MakePlot MakePlot
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
@@ -190,7 +190,7 @@ ClearPlot
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc drawmountains .proc drawmountains
;-------------------------------------------------- ;--------------------------------------------------
mwa #0 xdraw mwa #0 xdraw
mwa #mountaintable modify mwa #mountaintable modify
@@ -204,7 +204,7 @@ drawmountainsloop
sta ydraw sta ydraw
sty ydraw+1 sty ydraw+1
.IF FASTER_GRAF_PROCS = 1 .IF FASTER_GRAF_PROCS = 1
; there was Drawline proc ; there was Drawline proc
lda #screenheight lda #screenheight
sec sec
sbc ydraw sbc ydraw
@@ -223,7 +223,7 @@ drawmountainsloop
bne @- bne @-
; end of Drawline proc ; end of Drawline proc
.ELSE .ELSE
; there was Drawline proc ; there was Drawline proc
drawline drawline
jsr plot.MakePlot jsr plot.MakePlot
inc ydraw inc ydraw
@@ -331,12 +331,12 @@ EmptyChar
ldx #0 ldx #0
CharLoopi CharLoopi
lda (xbyte),y lda (xbyte),y
ora mask1,x ora mask1,x
and char1,x and char1,x
sta (xbyte),y sta (xbyte),y
iny iny
lda (xbyte),y lda (xbyte),y
ora mask2,x ora mask2,x
and char2,x and char2,x
sta (xbyte),y sta (xbyte),y
dey dey
@@ -398,7 +398,7 @@ EndPutChar
cpw dy #(screenheight-1) cpw dy #(screenheight-1)
jcs TypeChar.EndPutChar ;nearest RTS jcs TypeChar.EndPutChar ;nearest RTS
cpw dy #(4) cpw dy #(4)
jcc TypeChar.EndPutChar ;nearest RTS jcc TypeChar.EndPutChar ;nearest RTS
cpw dx #(screenwidth-4) cpw dx #(screenwidth-4)
jcs TypeChar.EndPutChar ;nearest RTS jcs TypeChar.EndPutChar ;nearest RTS
; checks ommited. ; checks ommited.
@@ -414,7 +414,7 @@ Upper4bits
sta fontind sta fontind
lda #$00 lda #$00
sta fontind+1 sta fontind+1
adw fontind #font4x4 adw fontind #font4x4
; and 4 bytes to the table ; and 4 bytes to the table
@@ -480,7 +480,7 @@ MaskOK01
ldx #0 ldx #0
CharLoopi4x4 CharLoopi4x4
lda (xbyte),y lda (xbyte),y
ora mask1,x ora mask1,x
bit plot4x4color bit plot4x4color
bpl PutInColor0_1 ; only mask - no char bpl PutInColor0_1 ; only mask - no char
and char1,x and char1,x
@@ -488,7 +488,7 @@ PutInColor0_1
sta (xbyte),y sta (xbyte),y
iny iny
lda (xbyte),y lda (xbyte),y
ora mask2,x ora mask2,x
bit plot4x4color bit plot4x4color
bpl PutInColor0_2 ; only mask - no char bpl PutInColor0_2 ; only mask - no char
and char2,x and char2,x
@@ -555,7 +555,7 @@ EndPut4x4
inw temp inw temp
cpw temp #display+screenheight*screenBytes+1 cpw temp #display+screenheight*screenBytes+1
bne @- bne @-
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
@@ -577,14 +577,14 @@ EndPut4x4
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc SetMainScreen .proc SetMainScreen
; mva #0 dmactls ; mva #0 dmactls
SetDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen SetDLI DLIinterruptGraph ; jsr SetDLI for graphics (game) screen
mwa #dl dlptrs ; issue #72 (glitches when switches) mwa #dl dlptrs ; issue #72 (glitches when switches)
lda #%00111110 lda #%00111110
; and #$fc ; and #$fc
; ora #$02 ; 2=normal, 3 = wide screen width ; ora #$02 ; 2=normal, 3 = wide screen width
sta dmactls sta dmactls
mva WallsType COLBAKS ; set color of background mva WallsType COLBAKS ; set color of background
jsr WaitOneFrame jsr WaitOneFrame
rts rts
.endp .endp
+21 -21
View File
@@ -98,13 +98,13 @@ EndOfDLI_Text
pla pla
DLIinterruptNone DLIinterruptNone
rti rti
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc VBLinterrupt .proc VBLinterrupt
mva #0 dliCounter mva #0 dliCounter
mva #$02 DliColorBack mva #$02 DliColorBack
lda PAL lda PAL
and #%00001110 and #%00001110
beq itsPAL beq itsPAL
@@ -118,7 +118,7 @@ DLIinterruptNone
itsPAL itsPAL
; pressTimer is trigger tick counter. always 50 ticks / s ; pressTimer is trigger tick counter. always 50 ticks / s
bit:smi:inc pressTimer ; timer halted if >127. max time measured 2.5 s bit:smi:inc pressTimer ; timer halted if >127. max time measured 2.5 s
SkippedIfNTSC SkippedIfNTSC
bit RMT_blocked bit RMT_blocked
@@ -138,7 +138,7 @@ SkippedIfNTSC
lab2 lab2
jsr RASTERMUSICTRACKER+3 ;1 play jsr RASTERMUSICTRACKER+3 ;1 play
; ------- RMT ------- ; ------- RMT -------
SkipRMTVBL SkipRMTVBL
bit ScrollFlag bit ScrollFlag
bpl EndOfCreditsVBI bpl EndOfCreditsVBI
CreditsVBI CreditsVBI
@@ -170,7 +170,15 @@ nextlinedisplay
; bne EndOfCreditsVBI ; bne EndOfCreditsVBI
mwa #Credits DLCreditsAddr mwa #Credits DLCreditsAddr
EndOfCreditsVBI EndOfCreditsVBI
.IF TARGET = 5200 .IF TARGET = 800
; support for joysticks :)
ldx JoystickNumber
lda STICK0,x
sta STICK0
lda STRIG0,x
sta STRIG0
jmp XITVBV
.ELIF TARGET = 5200
lda SkStatSimulator lda SkStatSimulator
bmi @+ bmi @+
inc SkStatSimulator inc SkStatSimulator
@@ -181,7 +189,7 @@ EndOfCreditsVBI
center = 114 ;Read analog stick and make it look like a digital stick center = 114 ;Read analog stick and make it look like a digital stick
threshold = 60 threshold = 60
lda JoystickNumber lda JoystickNumber
asl asl
tax tax
@@ -190,28 +198,28 @@ EndOfCreditsVBI
rol stick0 ;Feed carry into digital stick value rol stick0 ;Feed carry into digital stick value
cmp #center-threshold ;Compare with left threshold cmp #center-threshold ;Compare with left threshold
rol stick0 ;Feed carry into digital stick value rol stick0 ;Feed carry into digital stick value
lda paddl1,x ;Read POT1 value (vertical position) lda paddl1,x ;Read POT1 value (vertical position)
cmp #center+threshold ;Compare with down threshold cmp #center+threshold ;Compare with down threshold
rol stick0 ;Feed carry into digital stick value rol stick0 ;Feed carry into digital stick value
cmp #center-threshold ;Compare with down threshold cmp #center-threshold ;Compare with down threshold
rol stick0 ;Feed carry into digital stick value rol stick0 ;Feed carry into digital stick value
lda stick0 ;0 indicates a press so the right/down values need to be inverted lda stick0 ;0 indicates a press so the right/down values need to be inverted
eor #2+8 eor #2+8
and #$0f and #$0f
sta stick0 sta stick0
ldx JoystickNumber ldx JoystickNumber
; check shift key (5200 second fire button) ; check shift key (5200 second fire button)
lda SKSTAT lda SKSTAT
:3 lsr ; third bit :3 lsr ; third bit
and trig0,x ; and first button and trig0,x ; and first button
;lda trig0,x ;lda trig0,x
sta strig0 ;Move hardware to shadow sta strig0 ;Move hardware to shadow
mva chbas chbase mva chbas chbase
lda skstat ;Reset consol key shadow is no key is pressed anymore lda skstat ;Reset consol key shadow is no key is pressed anymore
and #4 and #4
beq @+ beq @+
@@ -225,14 +233,6 @@ EndOfCreditsVBI
tax tax
pla pla
rti rti
.ELSE
; support for joysticks :)
ldx JoystickNumber
lda STICK0,x
sta STICK0
lda STRIG0,x
sta STRIG0
jmp XITVBV
.ENDIF .ENDIF
.endp .endp
.IF TARGET = 5200 .IF TARGET = 5200
@@ -245,7 +245,7 @@ exit pla
tax tax
pla pla
rti rti
.endp .endp
.ENDIF .ENDIF
;-------------------------------------------------- ;--------------------------------------------------
+69 -69
View File
@@ -32,7 +32,7 @@
jsr ColorsOfSprites jsr ColorsOfSprites
mva #$ca COLOR1 mva #$ca COLOR1
mva #$00 COLBAKS ; set color of background mva #$00 COLBAKS ; set color of background
SetDLI DLIinterruptOptions ; jsr SetDLI for Options text screen SetDLI DLIinterruptOptions ; jsr SetDLI for Options text screen
; -------- setup bottom (tanks) line ; -------- setup bottom (tanks) line
@@ -70,7 +70,7 @@ OptionsMainLoop
jsr getkey jsr getkey
bit escFlag bit escFlag
spl:rts spl:rts
cmp #@kbcode._down ; $f ;cursor down cmp #@kbcode._down ; $f ;cursor down
bne OptionsNoDown bne OptionsNoDown
inc:lda OptionsY inc:lda OptionsY
@@ -113,7 +113,7 @@ OptionsNoRight
cmp #@kbcode._ret ; $c ;Return key cmp #@kbcode._ret ; $c ;Return key
bne OptionsNoReturn bne OptionsNoReturn
rts ; options selected rts ; options selected
OptionsNoReturn OptionsNoReturn
cmp #@kbcode._tab ; Tab key cmp #@kbcode._tab ; Tab key
bne OptionsNoTab bne OptionsNoTab
@@ -141,7 +141,7 @@ NoGradientLoop
lda GradientAddrL,y lda GradientAddrL,y
sta GradientColors sta GradientColors
lda GradientAddrH,y lda GradientAddrH,y
sta GradientColors+1 sta GradientColors+1
rts rts
.endp .endp
@@ -174,7 +174,7 @@ OptionsLoop
cpy #optionWidth ; width of the option highlight cpy #optionWidth ; width of the option highlight
bne OptionsLoop bne OptionsLoop
ldy #0 ldy #0
; next X position of the ; next X position of the
adw temp #optionWidth ; width of the option highlight adw temp #optionWidth ; width of the option highlight
inc:lda XPos inc:lda XPos
cmp #5 ; number of options in a row cmp #5 ; number of options in a row
@@ -191,12 +191,12 @@ OptionsLoop
_inverter _inverter
beq invertme beq invertme
; clean inversion otherwise ; clean inversion otherwise
lda (temp),y lda (temp),y
and #$7f ; clear the top bit and #$7f ; clear the top bit
sta (temp),y sta (temp),y
bpl @+ ; JMP bpl @+ ; JMP
invertme invertme
lda (temp),y lda (temp),y
ora #$80 ; set the top bit ora #$80 ; set the top bit
sta (temp),y sta (temp),y
@ @
@@ -227,7 +227,7 @@ ManualPurchase
spl:rts spl:rts
jsr DefensivesActivate ; activate weapons jsr DefensivesActivate ; activate weapons
bit escFlag bit escFlag
spl:rts spl:rts
AfterManualPurchase AfterManualPurchase
inc:lda TankNr inc:lda TankNr
cmp NumberOfPlayers cmp NumberOfPlayers
@@ -238,8 +238,8 @@ AfterManualPurchase
.proc DefensivesActivate .proc DefensivesActivate
;-------------------------------------------------- ;--------------------------------------------------
; This proc call Inventory and set Defensives activation first ; This proc call Inventory and set Defensives activation first
mwa #ListOfDefensiveWeapons WeaponsListDL ;switch to the list of offensive weapons mwa #ListOfDefensiveWeapons WeaponsListDL ;switch to the list of offensive weapons
mva #$ff IsInventory mva #$ff IsInventory
mva #%10000000 WhichList mva #%10000000 WhichList
; offensive weapon - 0, defensive - %10000000 ; offensive weapon - 0, defensive - %10000000
@@ -265,7 +265,7 @@ AfterManualPurchase
jsr CopyFromPurchaseAndGameOver jsr CopyFromPurchaseAndGameOver
mwa #ListOfWeapons WeaponsListDL ;switch to the list of offensive weapons mwa #ListOfWeapons WeaponsListDL ;switch to the list of offensive weapons
; we are clearing list of the weapons ; we are clearing list of the weapons
mva #$00 WhichList mva #$00 WhichList
; offensive weapon - 0, deffensive - %10000000 ; offensive weapon - 0, deffensive - %10000000
@@ -283,7 +283,7 @@ GoToActivation
bpl @+ bpl @+
lda #song_inventory lda #song_inventory
@ jsr RmtSongSelect @ jsr RmtSongSelect
ldx tankNr ldx tankNr
lda TankStatusColoursTable,x lda TankStatusColoursTable,x
sta COLOR2 sta COLOR2
@@ -331,15 +331,15 @@ AfterPurchase
ldx #$00 ; index of the checked weapon ldx #$00 ; index of the checked weapon
stx HowManyOnTheListOff ; amounts of weapons (shells, bullets) in both lists stx HowManyOnTheListOff ; amounts of weapons (shells, bullets) in both lists
stx HowManyOnTheListDef stx HowManyOnTheListDef
jsr CreateList jsr CreateList
bit isInventory ; bit isInventory ;
bpl ChoosingItemForPurchase bpl ChoosingItemForPurchase
lda whichList lda whichList
bne PositionDefensive bne PositionDefensive
; calculate positionOnTheList from the activeWeapon (offensives) ; calculate positionOnTheList from the activeWeapon (offensives)
ldx tankNr ldx tankNr
lda activeWeapon,x lda activeWeapon,x
@@ -356,7 +356,7 @@ AfterPurchase
beq ?weaponFound ; jmp beq ?weaponFound ; jmp
PositionDefensive PositionDefensive
jsr calcPosDefensive jsr calcPosDefensive
?weaponFound ?weaponFound
; weapon index in Y ; weapon index in Y
@@ -368,7 +368,7 @@ PositionDefensive
;-------------------------------------------------- ;--------------------------------------------------
ChoosingItemForPurchase ChoosingItemForPurchase
;-------------------------------------------------- ;--------------------------------------------------
jsr PutLitteChar ; Places pointer at the right position jsr PutLitteChar ; Places pointer at the right position
jsr getkey jsr getkey
bit escFlag bit escFlag
@@ -497,11 +497,11 @@ CreateList
lda WeaponUnits,x lda WeaponUnits,x
jeq NoWeapon jeq NoWeapon
ldy tanknr ldy tanknr
bit isInventory bit isInventory
jmi itIsInventory jmi itIsInventory
; put "Purchase" on the screen ; put "Purchase" on the screen
mwa #PurchaseDescription PurActDescAddr mwa #PurchaseDescription PurActDescAddr
; and Title ; and Title
@@ -516,7 +516,7 @@ CreateList
cmp WeaponPriceL,x cmp WeaponPriceL,x
@ @
jcc TooLittleCash jcc TooLittleCash
; we have enough cash and the weapon can be ; we have enough cash and the weapon can be
; added to the list ; added to the list
@@ -585,7 +585,7 @@ notInventory
jsr HowManyBullets jsr HowManyBullets
sta decimal sta decimal
adw xbyte #1 displayposition adw xbyte #1 displayposition
jsr displaybyte jsr displaybyte
ldx temp ;weapon index ldx temp ;weapon index
@@ -665,7 +665,7 @@ NoWeapon
mwa #ListOfDefensiveWeapons xbyte mwa #ListOfDefensiveWeapons xbyte
NoDefense NoDefense
cpx #last_defensive +1 cpx #last_defensive +1
jne CreateList jne CreateList
; offset may be only too big ; offset may be only too big
@@ -686,14 +686,14 @@ WeHaveOffset
lda HowManyOnTheListOff lda HowManyOnTheListOff
sta xbyte ; multiplier (temporarily here, it will be erased anyway) sta xbyte ; multiplier (temporarily here, it will be erased anyway)
lda #$00 ; lda #$00 ;
sta xbyte+1 ; higher byte of the Result sta xbyte+1 ; higher byte of the Result
ldx #$05 ; 2^5 ldx #$05 ; 2^5
@ asl xbyte @ asl xbyte
rol xbyte+1 rol xbyte+1
dex dex
bne @- bne @-
; add to the address of the list ; add to the address of the list
adw xbyte #ListOfWeapons adw xbyte #ListOfWeapons
ldy #0 ldy #0
@@ -711,7 +711,7 @@ ListCleared1
; of the first erased char. ; of the first erased char.
lda HowManyOnTheListDef lda HowManyOnTheListDef
sta xbyte ; multiplier (temporarily here, it will be erased anyway) sta xbyte ; multiplier (temporarily here, it will be erased anyway)
lda #$00 ; lda #$00 ;
sta xbyte+1 ; higher byte of the Result sta xbyte+1 ; higher byte of the Result
ldx #$05 ; 2^5 ldx #$05 ; 2^5
@ asl xbyte @ asl xbyte
@@ -766,36 +766,36 @@ PurchaseAll
lda moneyH,x lda moneyH,x
sbc WeaponPriceH,y sbc WeaponPriceH,y
sta moneyH,x sta moneyH,x
positiveMoney positiveMoney
; now we have to get address of ; now we have to get address of
; the table of the weapon of the tank ; the table of the weapon of the tank
; and add appropriate number of shells ; and add appropriate number of shells
sty LastWeapon ; store last purchased weapon sty LastWeapon ; store last purchased weapon
; because we must put screen pointer next to it ; because we must put screen pointer next to it
; but if we purchasing "Buy me!" then we must draw the winning weapon. ; but if we purchasing "Buy me!" then we must draw the winning weapon.
cpy #ind_Buy_me cpy #ind_Buy_me
bne NoSuprise bne NoSuprise
Suprise ; get a random weapon Suprise ; get a random weapon
lda random lda random
cmp #51 ; defensive weapons are less likely because they are more expensive - probability 255:51 (5:1) cmp #51 ; defensive weapons are less likely because they are more expensive - probability 255:51 (5:1)
bcc GetRandomDefensive bcc GetRandomDefensive
GetRandomOffensive GetRandomOffensive
randomize ind_Missile last_offensive randomize ind_Missile last_offensive
;cmp #ind_Buy_me ; buy me do not buy buy me :) ;cmp #ind_Buy_me ; buy me do not buy buy me :)
;beq GetRandomOffensive ;beq GetRandomOffensive
tay tay
bne NoSuprise ; Y always <> 0 bne NoSuprise ; Y always <> 0
GetRandomDefensive GetRandomDefensive
randomize ind_Battery last_defensive randomize ind_Battery last_defensive
tay tay
; lda WeaponUnits,y ; check if weapon exist ; lda WeaponUnits,y ; check if weapon exist
; beq GetRandomDefensive ; beq GetRandomDefensive
NoSuprise NoSuprise
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
sta weaponPointer sta weaponPointer
@@ -824,13 +824,13 @@ inventorySelect
ldx tankNr ldx tankNr
sta activeWeapon,x sta activeWeapon,x
jmp WaitForKeyRelease ; rts jmp WaitForKeyRelease ; rts
invSelectDef invSelectDef
ldy PositionOnTheList ldy PositionOnTheList
lda IndexesOfWeaponsL2,y lda IndexesOfWeaponsL2,y
tay tay
ldx tankNr ldx tankNr
cmp #ind_Battery cmp #ind_Battery
bne NotBattery bne NotBattery
; if activate battery, we do it differently ; if activate battery, we do it differently
mva #sfx_battery sfx_effect mva #sfx_battery sfx_effect
@@ -840,38 +840,38 @@ invSelectDef
ply ply
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NotBattery NotBattery
cmp #ind_Auto_Defense cmp #ind_Auto_Defense
bne NoAutoDefense bne NoAutoDefense
; Auto Defense - do it like battery ; Auto Defense - do it like battery
mva #sfx_auto_defense sfx_effect mva #sfx_auto_defense sfx_effect
mva #$A1 AutoDefenseFlag,x ; this is "A" in inverse - for status line :) mva #$A1 AutoDefenseFlag,x ; this is "A" in inverse - for status line :)
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NoAutoDefense NoAutoDefense
cmp #ind_Lazy_Boy cmp #ind_Lazy_Boy
bne NoLazyBoy bne NoLazyBoy
; Lazy Boy - do it like battery ; Lazy Boy - do it like battery
mva #%01000000 LazyFlag mva #%01000000 LazyFlag
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NoLazyBoy NoLazyBoy
cmp #ind_Lazy_Darwin cmp #ind_Lazy_Darwin
bne NoLazyDarwin bne NoLazyDarwin
; Lazy Darwin - do it like battery ; Lazy Darwin - do it like battery
mva #%11000000 LazyFlag mva #%11000000 LazyFlag
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NoLazyDarwin NoLazyDarwin
cmp #ind_Spy_Hard cmp #ind_Spy_Hard
bne NotSpy bne NotSpy
mva #$ff SpyHardFlag mva #$ff SpyHardFlag
jmp DecreaseDefensive ; bypass activation jmp DecreaseDefensive ; bypass activation
NotSpy NotSpy
cmp #ind_Long_Barrel cmp #ind_Long_Barrel
bne NotBarrel bne NotBarrel
; if activate long barrel, we do it differently too ; if activate long barrel, we do it differently too
mva #sfx_long_barrel sfx_effect mva #sfx_long_barrel sfx_effect
mva #LongBarrel BarrelLength,x mva #LongBarrel BarrelLength,x
bne DecreaseDefensive ; bypass activation bne DecreaseDefensive ; bypass activation
NotBarrel NotBarrel
cmp #ind_White_Flag cmp #ind_White_Flag
bne NotWhiteFlag bne NotWhiteFlag
cmp ActiveDefenceWeapon,x cmp ActiveDefenceWeapon,x
bne NoDeactivateWhiteFlag bne NoDeactivateWhiteFlag
@@ -897,7 +897,7 @@ DecreaseDefensive
sec sec
sbc #1 sbc #1
sta (weaponPointer),y sta (weaponPointer),y
DefActivationEnd DefActivationEnd
jmp WaitForKeyRelease ; rts jmp WaitForKeyRelease ; rts
.endp .endp
@@ -1084,7 +1084,7 @@ NoArrowDown
lda TankNr lda TankNr
:3 asl :3 asl
tax tax
ldy #0 ldy #0
@ lda TanksNames,x @ lda TanksNames,x
sta NameAdr,y sta NameAdr,y
@@ -1114,12 +1114,12 @@ CheckKeys
lda TankShape,x lda TankShape,x
tay tay
lda digits+1,y lda digits+1,y
sta NameScreen2+15 ; display tank shape number sta NameScreen2+15 ; display tank shape number
jsr CursorDisplay jsr CursorDisplay
jsr getkey jsr getkey
bit escFlag bit escFlag
spl:rts spl:rts
.IF TARGET = 800 ; only the A800 has a keyboard .IF TARGET = 800 ; only the A800 has a keyboard
; is the char to be recorded? ; is the char to be recorded?
ldx #keycodesEnd-keycodes ;table was 38 chars long ldx #keycodesEnd-keycodes ;table was 38 chars long
@@ -1256,7 +1256,7 @@ NotRobot
; check if all chars are empty (" ") ; check if all chars are empty (" ")
ldy #7 ldy #7
lda #0 lda #0
@ ora NameAdr,y @ ora NameAdr,y
and #$7F ; remove inverse (Cursor) and #$7F ; remove inverse (Cursor)
dey dey
bpl @- bpl @-
@@ -1333,7 +1333,7 @@ CharacterFound
beq checkjoy beq checkjoy
bit pressTimer ; trick (no A change) bit pressTimer ; trick (no A change)
bpl @- bpl @-
checkjoy checkjoy
lda STICK0 lda STICK0
and #$0f and #$0f
cmp #$0f cmp #$0f
@@ -1543,7 +1543,7 @@ displayloop1
sta dmactls sta dmactls
lda #%00100100 ; playfield before P/M lda #%00100100 ; playfield before P/M
sta GPRIOR sta GPRIOR
jsr SetPMWidth jsr SetPMWidth
jsr ColorsOfSprites jsr ColorsOfSprites
mva #0 COLOR1 mva #0 COLOR1
sta COLBAKS ; set color of background sta COLBAKS ; set color of background
@@ -1628,7 +1628,7 @@ ThisIsAI
NotAItank NotAItank
tya tya
ldy #38 ldy #38
sta (temp),y sta (temp),y
; put earned money on the screen ; put earned money on the screen
lda EarnedMoneyL,x lda EarnedMoneyL,x
sta decimal sta decimal
@@ -1669,10 +1669,10 @@ MakeAllTanksVisible
jsr RandomizeTankPos jsr RandomizeTankPos
dex dex
bpl @- bpl @-
MainTanksFloatingLoop MainTanksFloatingLoop
; main tanks floating loop ; main tanks floating loop
ldx #(MaxPlayers-1) ;maxNumberOfPlayers-1 ldx #(MaxPlayers-1) ;maxNumberOfPlayers-1
AllTanksFloatingDown AllTanksFloatingDown
stx TankNr stx TankNr
lda Ytankstable,x lda Ytankstable,x
cmp #(72-7) ; tank under screen - no erase cmp #(72-7) ; tank under screen - no erase
@@ -1842,7 +1842,7 @@ ThisIsAI
;------------------------------------------------- ;-------------------------------------------------
ldx TankNr ldx TankNr
;========================= ;=========================
;displaying symbol of the weapon ;displaying symbol of the weapon
;========================= ;=========================
@@ -1872,7 +1872,7 @@ ThisIsAI
aslw temp aslw temp
dey dey
bpl @- bpl @-
adw temp #NamesOfWeapons adw temp #NamesOfWeapons
ldy #15 ldy #15
@ @
@@ -1900,7 +1900,7 @@ ThisIsAI
sta statusBuffer+80+22 sta statusBuffer+80+22
sta statusBuffer+80+39 sta statusBuffer+80+39
mwa #emptyLine temp mwa #emptyLine temp
jmp ClearingOnly jmp ClearingOnly
ActiveDefence ActiveDefence
sta temp ;get back number of the weapon sta temp ;get back number of the weapon
mva #0 temp+1 mva #0 temp+1
@@ -1910,7 +1910,7 @@ ActiveDefence
aslw temp aslw temp
dey dey
bpl @- bpl @-
adw temp #NamesOfWeapons adw temp #NamesOfWeapons
ClearingOnly ClearingOnly
ldy #15 ldy #15
@@ -1950,7 +1950,7 @@ ClearingOnly
jsr displaybyte jsr displaybyte
lda #$09 ; ) lda #$09 ; )
sta statusBuffer+40+13 sta statusBuffer+40+13
NoDefenceWeapon NoDefenceWeapon
NoShieldEnergy NoShieldEnergy
;========================= ;=========================
@@ -1981,7 +1981,7 @@ DisplayWindValue
sta decimal sta decimal
mwa #statusBuffer+80+18 displayposition mwa #statusBuffer+80+18 displayposition
jsr displaybyte jsr displaybyte
;========================= ;=========================
;display round number ;display round number
;========================= ;=========================
@@ -2027,7 +2027,7 @@ AngleToLeft
sty statusBuffer+40+25 ; (space) character sty statusBuffer+40+25 ; (space) character
lda #$7e ;(del) char lda #$7e ;(del) char
sta statusBuffer+40+22 sta statusBuffer+40+22
bne AngleDisplay bne AngleDisplay
VerticallyUp VerticallyUp
; now we have value 90 ; now we have value 90
sta decimal sta decimal
@@ -2037,7 +2037,7 @@ VerticallyUp
AngleDisplay AngleDisplay
mwa #statusBuffer+40+23 displayposition mwa #statusBuffer+40+23 displayposition
jsr displaybyte jsr displaybyte
ldx TankNr ldx TankNr
rts rts
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
@@ -2047,7 +2047,7 @@ AngleDisplay
dey dey
lda gameOverSpritesTop,y lda gameOverSpritesTop,y
sta temp sta temp
; clean the whole sprite ; clean the whole sprite
lda #0 lda #0
tax tax
@@ -2055,11 +2055,11 @@ AngleDisplay
sta PMGraph+$500,x sta PMGraph+$500,x
dex dex
bne @- bne @-
lda #$01 lda #$01
sta sizep0 ; P0-P1 widths sta sizep0 ; P0-P1 widths
sta sizep0+1 sta sizep0+1
; set background ; set background
lda #$ff lda #$ff
ldx #100+7 ; top of the sprites ldx #100+7 ; top of the sprites
@@ -2071,10 +2071,10 @@ AngleDisplay
GOSbeg = 112 GOSbeg = 112
mva #GOSbeg hposp0 mva #GOSbeg hposp0
mva #GOSbeg+12 hposp0+1 mva #GOSbeg+12 hposp0+1
mva #15 PCOLR0 mva #15 PCOLR0
sta PCOLR1 sta PCOLR1
rts rts
.endp .endp
+14 -14
View File
@@ -103,7 +103,7 @@ EndOfUnPlot
; game. If you are going to speed up the game, start with ; game. If you are going to speed up the game, start with
; plot - it is used by every single effect starting from explosions ; plot - it is used by every single effect starting from explosions
; through line drawing and small text output!!! ; through line drawing and small text output!!!
; ;
; Optimized by 0xF (Fox) THXXXX!!! ; Optimized by 0xF (Fox) THXXXX!!!
; ----------------------------------------- ; -----------------------------------------
@@ -112,7 +112,7 @@ EndOfUnPlot
bcs unPlot.EndOfUnPlot ;nearest RTS bcs unPlot.EndOfUnPlot ;nearest RTS
CheckX02 CheckX02
cpw xdraw #screenwidth cpw xdraw #screenwidth
bcs EndOfPlot bcs EndOfPlot
MakePlot MakePlot
; let's calculate coordinates from xdraw and ydraw ; let's calculate coordinates from xdraw and ydraw
@@ -177,7 +177,7 @@ ClearPlot
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc drawmountains .proc drawmountains
;-------------------------------------------------- ;--------------------------------------------------
mwa #0 xdraw mwa #0 xdraw
mwa #mountaintable modify mwa #mountaintable modify
@@ -191,7 +191,7 @@ drawmountainsloop
sta ydraw sta ydraw
sty ydraw+1 sty ydraw+1
.IF FASTER_GRAF_PROCS = 1 .IF FASTER_GRAF_PROCS = 1
; there was Drawline proc ; there was Drawline proc
lda #screenheight lda #screenheight
sec sec
sbc ydraw sbc ydraw
@@ -217,12 +217,12 @@ drawmountainsloop
lda linetableH,y lda linetableH,y
adc xdraw+1 adc xdraw+1
sta xbyte+1 sta xbyte+1
ldy #0 ldy #0
dec tempbyte01 dec tempbyte01
bne @- bne @-
; end of Drawline proc ; end of Drawline proc
.ELSE .ELSE
; there was Drawline proc ; there was Drawline proc
drawline drawline
jsr plot.MakePlot jsr plot.MakePlot
inc ydraw inc ydraw
@@ -326,12 +326,12 @@ CharLoopi
;-- ;--
ldy #0 ldy #0
lda (xbyte),y lda (xbyte),y
ora mask1,x ora mask1,x
and char1,x and char1,x
sta (xbyte),y sta (xbyte),y
ldy #8 ldy #8
lda (xbyte),y lda (xbyte),y
ora mask2,x ora mask2,x
and char2,x and char2,x
sta (xbyte),y sta (xbyte),y
inc ydraw inc ydraw
@@ -392,7 +392,7 @@ EndPutChar
cpw dy #(screenheight-1) cpw dy #(screenheight-1)
jcs TypeChar.EndPutChar ;nearest RTS jcs TypeChar.EndPutChar ;nearest RTS
cpw dy #(4) cpw dy #(4)
jcc TypeChar.EndPutChar ;nearest RTS jcc TypeChar.EndPutChar ;nearest RTS
cpw dx #(screenwidth-4) cpw dx #(screenwidth-4)
jcs TypeChar.EndPutChar ;nearest RTS jcs TypeChar.EndPutChar ;nearest RTS
; checks ommited. ; checks ommited.
@@ -408,7 +408,7 @@ Upper4bits
sta fontind sta fontind
lda #$00 lda #$00
sta fontind+1 sta fontind+1
adw fontind #font4x4 adw fontind #font4x4
; and 4 bytes to the table ; and 4 bytes to the table
@@ -471,7 +471,7 @@ CharLoopi4x4
;-- ;--
ldy #0 ldy #0
lda (xbyte),y lda (xbyte),y
ora mask1,x ora mask1,x
bit plot4x4color bit plot4x4color
bpl PutInColor0_1 ; only mask - no char bpl PutInColor0_1 ; only mask - no char
and char1,x and char1,x
@@ -479,7 +479,7 @@ PutInColor0_1
sta (xbyte),y sta (xbyte),y
ldy #8 ldy #8
lda (xbyte),y lda (xbyte),y
ora mask2,x ora mask2,x
bit plot4x4color bit plot4x4color
bpl PutInColor0_2 ; only mask - no char bpl PutInColor0_2 ; only mask - no char
and char2,x and char2,x
@@ -545,7 +545,7 @@ EndPut4x4
inw temp inw temp
cpw temp #displayC64+screenheight*screenBytes+1 cpw temp #displayC64+screenheight*screenBytes+1
bne @- bne @-
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
@@ -581,7 +581,7 @@ next8lines
:4 rol :4 rol
sta $d020 sta $d020
sta $d021 sta $d021
lda $dd00 ; Set video bank to start at 0 lda $dd00 ; Set video bank to start at 0
and #252 and #252
ora #3 ora #3
+10 -10
View File
@@ -2,7 +2,7 @@
.IF *>0 .IF *>0
WeaponsListDL = 0 WeaponsListDL = 0
NamesOfLevels = 0 NamesOfLevels = 0
;---------------------------------------- ;----------------------------------------
@@ -27,7 +27,7 @@ NamesOfLevels = 0
bpl @- bpl @-
rts rts
Autoplay_OptionsTable .by 4,4,2,2,4,1,3,2,4 Autoplay_OptionsTable .by 4,4,2,2,4,1,3,2,4
.endp .endp
@@ -51,7 +51,7 @@ NoGradientLoop
lda GradientAddrL,y lda GradientAddrL,y
sta GradientColors sta GradientColors
lda GradientAddrH,y lda GradientAddrH,y
sta GradientColors+1 sta GradientColors+1
rts rts
.endp .endp
@@ -76,7 +76,7 @@ ManualPurchase
spl:rts spl:rts
jsr DefensivesActivate ; activate weapons jsr DefensivesActivate ; activate weapons
bit escFlag bit escFlag
spl:rts spl:rts
AfterManualPurchase AfterManualPurchase
inc:lda TankNr inc:lda TankNr
cmp NumberOfPlayers cmp NumberOfPlayers
@@ -87,8 +87,8 @@ AfterManualPurchase
.proc DefensivesActivate .proc DefensivesActivate
;-------------------------------------------------- ;--------------------------------------------------
; This proc call Inventory and set Defensives activation first ; This proc call Inventory and set Defensives activation first
mwa #ListOfDefensiveWeapons WeaponsListDL ;switch to the list of offensive weapons mwa #ListOfDefensiveWeapons WeaponsListDL ;switch to the list of offensive weapons
mva #$ff IsInventory mva #$ff IsInventory
mva #%10000000 WhichList mva #%10000000 WhichList
; offensive weapon - 0, defensive - %10000000 ; offensive weapon - 0, defensive - %10000000
@@ -104,13 +104,13 @@ AfterManualPurchase
; Rest of the data is taken from appropriate tables ; Rest of the data is taken from appropriate tables
; and during the purchase these tables are modified. ; and during the purchase these tables are modified.
; we are clearing list of the weapons ; we are clearing list of the weapons
mva #$00 WhichList mva #$00 WhichList
; offensive weapon - 0, deffensive - %10000000 ; offensive weapon - 0, deffensive - %10000000
GoToActivation GoToActivation
rts rts
.endp .endp
; ----------------------------------------------------- ; -----------------------------------------------------
@@ -173,7 +173,7 @@ NotRobot
; check if all chars are empty (" ") ; check if all chars are empty (" ")
ldy #7 ldy #7
lda #0 lda #0
@ ora #0 ; NameAdr,y @ ora #0 ; NameAdr,y
and #$7F ; remove inverse (Cursor) and #$7F ; remove inverse (Cursor)
dey dey
bpl @- bpl @-
@@ -306,7 +306,7 @@ displayloop1
.endp .endp
;------------------------------------------------- ;-------------------------------------------------
.proc RoundOverSprites .proc RoundOverSprites
; fill sprites with bytes ; fill sprites with bytes
rts rts
.endp .endp
+79 -79
View File
@@ -25,9 +25,9 @@
; it's no necessary - PrepareAIShoot is next proc :) ; it's no necessary - PrepareAIShoot is next proc :)
; jsr PrepareAIShoot ; jsr PrepareAIShoot
; rts ; rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc PrepareAIShoot .proc PrepareAIShoot
; create low precision table of positions ; create low precision table of positions
; by dividing positions by 4 ; by dividing positions by 4
ldy #MaxPlayers-1 ldy #MaxPlayers-1
@@ -76,11 +76,11 @@ AIRoutines
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc Moron .proc Moron
jsr RandomizeAngle jsr RandomizeAngle
sta NewAngle sta NewAngle
mwa #80 RandBoundaryLow mwa #80 RandBoundaryLow
mwa #800 RandBoundaryHigh mwa #800 RandBoundaryHigh
jsr RandomizeForce jsr RandomizeForce
; choose the best weapon ; choose the best weapon
ldy #ind_Buy_me +1 ; if the cheat is active it will fire the BFG :) ldy #ind_Buy_me +1 ; if the cheat is active it will fire the BFG :)
@@ -88,13 +88,13 @@ AIRoutines
;rts ;rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc Shooter .proc Shooter
lda PreviousAngle,x lda PreviousAngle,x
ora PreviousEnergyL,x ora PreviousEnergyL,x
ora PreviousEnergyH,x ora PreviousEnergyH,x
beq firstShoot beq firstShoot
lda PreviousAngle,x lda PreviousAngle,x
cmp #90 cmp #90
bcs shootingLeftAtThisMomentOfTime bcs shootingLeftAtThisMomentOfTime
@@ -104,9 +104,9 @@ AIRoutines
cmp #10 cmp #10
bcs @+ ;not smaller than 10 bcs @+ ;not smaller than 10
bcc firstShoot ; GET THE aim againg bcc firstShoot ; GET THE aim againg
shootingLeftAtThisMomentOfTime shootingLeftAtThisMomentOfTime
clc clc
adc #5 adc #5
cmp #170 ; maximum shooter angle cmp #170 ; maximum shooter angle
@@ -115,7 +115,7 @@ shootingLeftAtThisMomentOfTime
sta NewAngle sta NewAngle
sec sec
lda PreviousEnergyL,x lda PreviousEnergyL,x
sbc #5 sbc #5
sta ForceTableL,x sta ForceTableL,x
lda PreviousEnergyH,x lda PreviousEnergyH,x
@@ -140,10 +140,10 @@ firstShoot
tankIsOnTheRight tankIsOnTheRight
randomize 55 85 randomize 55 85
sta NewAngle sta NewAngle
forceNow forceNow
mwa #100 RandBoundaryLow mwa #100 RandBoundaryLow
mwa #800 RandBoundaryHigh mwa #800 RandBoundaryHigh
;ldx TankNr ;this is possibly not necessary ;ldx TankNr ;this is possibly not necessary
jsr RandomizeForce jsr RandomizeForce
@@ -153,12 +153,12 @@ endo
lda NewAngle lda NewAngle
sta PreviousAngle,x sta PreviousAngle,x
lda ForceTableL,x lda ForceTableL,x
sta PreviousEnergyL,x sta PreviousEnergyL,x
lda ForceTableH,x lda ForceTableH,x
sta PreviousEnergyH,x sta PreviousEnergyH,x
; choose the best weapon ; choose the best weapon
jmp ChooseBestOffensive jmp ChooseBestOffensive
;rts ;rts
.endp .endp
@@ -172,40 +172,40 @@ firstShoot
jsr FindBestTarget2 jsr FindBestTarget2
beq EnemyOnLeft beq EnemyOnLeft
; calculate index to shotangle table ; calculate index to shotangle table
; in temp2 we have x distance divided by 8 ; in temp2 we have x distance divided by 8
lda temp2 lda temp2
:3 lsr @ :3 lsr @
and #%00000111 and #%00000111
clc clc
adc #8 adc #8
sta AngleTablePointer sta AngleTablePointer
bne AngleIsSet bne AngleIsSet
EnemyOnLeft EnemyOnLeft
lda temp2 lda temp2
:3 lsr @ :3 lsr @
and #%00000111 and #%00000111
eor #%00000111 eor #%00000111
sta AngleTablePointer sta AngleTablePointer
AngleIsSet AngleIsSet
randomize 0 8 randomize 0 8
ldy AngleTablePointer ldy AngleTablePointer
clc clc
adc AngleTable,y adc AngleTable,y
sta NewAngle sta NewAngle
forceNow forceNow
mwa #300 RandBoundaryLow mwa #300 RandBoundaryLow
mwa #700 RandBoundaryHigh mwa #700 RandBoundaryHigh
ldx TankNr ldx TankNr
jsr RandomizeForce jsr RandomizeForce
endo endo
; choose the best weapon ; choose the best weapon
jsr ChooseBestOffensive jsr ChooseBestOffensive
rts rts
;---------------------------------------------- ;----------------------------------------------
AngleTable ; 16 bytes ;ba w $348b L$3350 AngleTable ; 16 bytes ;ba w $348b L$3350
.by 106,114,122,130,138,146,154,162 .by 106,114,122,130,138,146,154,162
@@ -220,7 +220,7 @@ AngleTable ; 16 bytes ;ba w $348b L$3350
bcs EnoughEnergy bcs EnoughEnergy
; lower than 5 units - white flag ; lower than 5 units - white flag
jsr ClearTankNr ; we must hide tank to erase shields (issue #138) jsr ClearTankNr ; we must hide tank to erase shields (issue #138)
lda #ind_White_Flag lda #ind_White_Flag
sta ActiveDefenceWeapon,x sta ActiveDefenceWeapon,x
jsr PutTankNr ; and draw tank witch Flag jsr PutTankNr ; and draw tank witch Flag
EnoughEnergy EnoughEnergy
@@ -233,7 +233,7 @@ EnoughEnergy
cmp #30 cmp #30
bcs EnoughEnergy bcs EnoughEnergy
; lower than 30 units - check battery ; lower than 30 units - check battery
ldy #ind_Battery ldy #ind_Battery
lda (temp),y ; has address of TanksWeaponsTable lda (temp),y ; has address of TanksWeaponsTable
beq NoBatteries beq NoBatteries
; we have batteries - use one ; we have batteries - use one
@@ -263,7 +263,7 @@ NoBatteries
cpy #ind_Hovercraft ;first defensive weapon (White Flag, Battery and Hovercraft - never use) cpy #ind_Hovercraft ;first defensive weapon (White Flag, Battery and Hovercraft - never use)
beq NoUseDefensive beq NoUseDefensive
lda (temp),y ; has address of TanksWeaponsTable lda (temp),y ; has address of TanksWeaponsTable
beq @- beq @-
; decrease in inventory ; decrease in inventory
sec sec
sbc #1 sbc #1
@@ -292,13 +292,13 @@ DefensiveInUse
; first check check if any is in use ; first check check if any is in use
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
bne DefensiveInUse bne DefensiveInUse
ldy #last_real_defensive+1 ;the last defensive weapon ldy #last_real_defensive+1 ;the last defensive weapon
@ @
dey dey
cpy #ind_Hovercraft ;first defensive weapon (White Flag, Battery and Hovercraft - never use) cpy #ind_Hovercraft ;first defensive weapon (White Flag, Battery and Hovercraft - never use)
beq NoUseDefensive beq NoUseDefensive
lda (temp),y ; has address of TanksWeaponsTable lda (temp),y ; has address of TanksWeaponsTable
beq @- beq @-
; decrease in inventory ; decrease in inventory
sec sec
sbc #1 sbc #1
@@ -324,7 +324,7 @@ NoUseDefensive
sty TargetTankNr sty TargetTankNr
; aiming ; aiming
jsr TakeAim ; direction still in A (0 - left, >0 - right) jsr TakeAim ; direction still in A (0 - left, >0 - right)
; choose the best weapon ; choose the best weapon
jsr ChooseBestOffensive jsr ChooseBestOffensive
@@ -335,11 +335,11 @@ NoUseDefensive
NotNegativeEnergy NotNegativeEnergy
adw Force #100 RandBoundaryHigh adw Force #100 RandBoundaryHigh
jsr RandomizeForce jsr RandomizeForce
; if target distance lower than 24 - set weapon to Baby Missile (for security :) ; if target distance lower than 24 - set weapon to Baby Missile (for security :)
jsr GetDistance jsr GetDistance
cmp #6 ; 24/4 cmp #6 ; 24/4
bcs HighForce bcs HighForce
lda #ind_Baby_Missile lda #ind_Baby_Missile
sta ActiveWeapon,x sta ActiveWeapon,x
HighForce HighForce
rts rts
@@ -356,7 +356,7 @@ HighForce
sty TargetTankNr sty TargetTankNr
; aiming ; aiming
jsr TakeAim ; direction still in A (0 - left, >0 - right) jsr TakeAim ; direction still in A (0 - left, >0 - right)
; choose the best weapon ; choose the best weapon
jsr ChooseBestOffensive jsr ChooseBestOffensive
@@ -367,11 +367,11 @@ HighForce
NotNegativeEnergy NotNegativeEnergy
adw Force #50 RandBoundaryHigh adw Force #50 RandBoundaryHigh
jsr RandomizeForce jsr RandomizeForce
; if target distance lower than 24 - set weapon to Baby Missile (for security :) ; if target distance lower than 24 - set weapon to Baby Missile (for security :)
jsr GetDistance jsr GetDistance
cmp #6 ; 24/4 cmp #6 ; 24/4
bcs HighForce bcs HighForce
lda #ind_Baby_Missile lda #ind_Baby_Missile
sta ActiveWeapon,x sta ActiveWeapon,x
HighForce HighForce
rts rts
@@ -387,7 +387,7 @@ HighForce
sty TargetTankNr sty TargetTankNr
; aiming ; aiming
jsr TakeAim ; direction still in A (0 - left, >0 - right) jsr TakeAim ; direction still in A (0 - left, >0 - right)
; choose the best weapon ; choose the best weapon
ldy #ind_Nuke +1 ldy #ind_Nuke +1
jsr ChooseBestOffensive.NotFromAll jsr ChooseBestOffensive.NotFromAll
@@ -396,11 +396,11 @@ HighForce
sta ForceTableL,x sta ForceTableL,x
lda Force+1 lda Force+1
sta ForceTableH,x sta ForceTableH,x
; if target distance lower than 32 - set weapon to Baby Missile (for security :) ; if target distance lower than 32 - set weapon to Baby Missile (for security :)
jsr GetDistance jsr GetDistance
cmp #8 ;32/4 cmp #8 ;32/4
bcs HighForce bcs HighForce
lda #ind_Baby_Missile lda #ind_Baby_Missile
sta ActiveWeapon,x sta ActiveWeapon,x
HighForce HighForce
rts rts
@@ -423,7 +423,7 @@ HighForce
;ldx TankNr ;ldx TankNr
ldy NumberOfPlayers ldy NumberOfPlayers
dey dey
loop01 loop01
cpy TankNr cpy TankNr
beq skipThisPlayer beq skipThisPlayer
@@ -446,8 +446,8 @@ ItIsHuman
bcs EnemyOnTheLeft bcs EnemyOnTheLeft
; enemy on right ; enemy on right
inc tempor2 ; set direction to right inc tempor2 ; set direction to right
EnemyOnTheLeft EnemyOnTheLeft
lowestIsLower lowestIsLower
skipThisPlayer skipThisPlayer
dey dey
@@ -455,7 +455,7 @@ skipThisPlayer
; now we have number of the farthest tank in temp2+1 ; now we have number of the farthest tank in temp2+1
; and direction (0 - left, >0 - right) in tempor2 ; and direction (0 - left, >0 - right) in tempor2
; let's move them to registers ; let's move them to registers
; in temp2 we have energy of target ; in temp2 we have energy of target
ldy temp2+1 ldy temp2+1
lda tempor2 lda tempor2
rts rts
@@ -474,13 +474,13 @@ skipThisPlayer
;ldx TankNr ;ldx TankNr
ldy NumberOfPlayers ldy NumberOfPlayers
dey dey
loop01 loop01
cpy TankNr cpy TankNr
beq skipThisPlayer beq skipThisPlayer
lda eXistenZ,y lda eXistenZ,y
beq skipThisPlayer beq skipThisPlayer
lda LowResDistances,x lda LowResDistances,x
cmp LowResDistances,y cmp LowResDistances,y
bcs EnemyOnTheLeft bcs EnemyOnTheLeft
@@ -503,7 +503,7 @@ EnemyOnTheLeft
bcs lowestIsLower bcs lowestIsLower
sta temp2 sta temp2
sty temp2+1 ; number of the closest tank sty temp2+1 ; number of the closest tank
lowestIsLower lowestIsLower
skipThisPlayer skipThisPlayer
dey dey
@@ -511,7 +511,7 @@ skipThisPlayer
; now we have number of the closest tank in temp2+1 ; now we have number of the closest tank in temp2+1
; and direction (0 - left, >0 - right) in tempor2 ; and direction (0 - left, >0 - right) in tempor2
; let's move them to registers ; let's move them to registers
; in temp2 we have x distance divided by 8 ; in temp2 we have x distance divided by 8
ldy temp2+1 ldy temp2+1
lda tempor2 lda tempor2
rts rts
@@ -529,7 +529,7 @@ skipThisPlayer
mva #$ff SecondTryFlag mva #$ff SecondTryFlag
; set initial Angle and Force values ; set initial Angle and Force values
lda OptionsTable+2 ; selected gravity lda OptionsTable+2 ; selected gravity
asl asl
tay tay
; force correction - lower tank Y position - higher possible force ; force correction - lower tank Y position - higher possible force
sec sec
@@ -556,7 +556,7 @@ RepeatAim
adc temp2 adc temp2
sta NewAngle sta NewAngle
; set virtual weapon :) ; set virtual weapon :)
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 #%11000000 TestFlightFlag mva #%11000000 TestFlightFlag
@@ -597,11 +597,11 @@ GroundHitInFirstLoopR
sta NewAngle sta NewAngle
jmp AimingRight jmp AimingRight
NoHitInFirstLoopR NoHitInFirstLoopR
; Angle 5 deg to left and end loop ; Angle 5 deg to left and end loop
sec sec
lda NewAngle lda NewAngle
sbc #5 sbc #5
sta NewAngle sta NewAngle
HitOnRightSideOfTargetR HitOnRightSideOfTargetR
dec NewAngle dec NewAngle
EndOfFirstLoopR EndOfFirstLoopR
@@ -639,7 +639,7 @@ HitOnLeftSideOfTargetR
; decrease energy (a little) ; decrease energy (a little)
sbw Force #5 sbw Force #5
NoHitInSecondLoopR NoHitInSecondLoopR
; Angle 1 deg to right and end loop ; Angle 1 deg to right and end loop
inc NewAngle inc NewAngle
EndOfSecondLoopR EndOfSecondLoopR
EndOfAim EndOfAim
@@ -657,7 +657,7 @@ AimSecondTry
sta ForceTableH,x sta ForceTableH,x
jsr RandomizeForce.LimitForce jsr RandomizeForce.LimitForce
jmp RepeatAim jmp RepeatAim
AimingLeft AimingLeft
; make test Shoot (Flight) ; make test Shoot (Flight)
jsr SetStartAndFlight jsr SetStartAndFlight
@@ -692,11 +692,11 @@ GroundHitInFirstLoopL
sta NewAngle sta NewAngle
jmp AimingLeft jmp AimingLeft
NoHitInFirstLoopL NoHitInFirstLoopL
; Angle 5 deg to right and end loop ; Angle 5 deg to right and end loop
clc clc
lda NewAngle lda NewAngle
adc #5 adc #5
sta NewAngle sta NewAngle
HitOnLeftSideOfTargetL HitOnLeftSideOfTargetL
inc NewAngle inc NewAngle
EndOfFirstLoopL EndOfFirstLoopL
@@ -734,11 +734,11 @@ HitOnRightSideOfTargetL
; decrease energy (a little) ; decrease energy (a little)
sbw Force #5 sbw Force #5
NoHitInSecondLoopL NoHitInSecondLoopL
; Angle 1 deg to left and end loop ; Angle 1 deg to left and end loop
dec NewAngle dec NewAngle
EndOfSecondLoopL EndOfSecondLoopL
jmp EndOfAim jmp EndOfAim
SetStartAndFlight ; set start point (virtual barrel end :) ) and make test flight SetStartAndFlight ; set start point (virtual barrel end :) ) and make test flight
; xtraj+1 and ytraj+1 set ; xtraj+1 and ytraj+1 set
clc clc
@@ -759,7 +759,7 @@ SetStartAndFlight ; set start point (virtual barrel end :) ) and make test fl
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc PurchaseAI ; .proc PurchaseAI ;
; A - skill of the TankNr ; A - skill of the TankNr
; makes purchase for AI opponents ; makes purchase for AI opponents
; results of this routine are not visible on the screen ; results of this routine are not visible on the screen
@@ -804,7 +804,7 @@ PurchaseAIRoutines
tay tay
lda bittable,y lda bittable,y
ldy temp ldy temp
and PurchaseMeTable2,y and PurchaseMeTable2,y
beq TryToPurchaseOnePiece.SorryNoPurchase beq TryToPurchaseOnePiece.SorryNoPurchase
jmp TryToPurchaseOnePiece.PurchaseIt jmp TryToPurchaseOnePiece.PurchaseIt
.endp .endp
@@ -846,7 +846,7 @@ PurchaseIt
lda temp2+1 lda temp2+1
sbc temp+1 sbc temp+1
sta MoneyH,x sta MoneyH,x
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
sta temp sta temp
lda TanksWeaponsTableH,x lda TanksWeaponsTableH,x
@@ -860,12 +860,12 @@ PurchaseIt
lda #99 lda #99
NotExceeded NotExceeded
sta (temp),y sta (temp),y
SorryNoPurchase SorryNoPurchase
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc ShooterPurchase .proc ShooterPurchase
@@ -877,17 +877,17 @@ SorryNoPurchase
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
; dec tempXroller ; dec tempXroller
; bne @- ; bne @-
; and now offensives ; and now offensives
mva #4 tempXroller; number of offensive purchases to perform mva #4 tempXroller; number of offensive purchases to perform
;ldx TankNr ;ldx TankNr
@ @
randomize ind_Missile ind_Heavy_Roller randomize ind_Missile ind_Heavy_Roller
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
bne @- bne @-
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc PoolsharkPurchase .proc PoolsharkPurchase
@@ -895,21 +895,21 @@ SorryNoPurchase
; mva #2 tempXroller; number of offensive purchases to perform ; mva #2 tempXroller; number of offensive purchases to perform
ldx TankNr ldx TankNr
@ @
randomize ind_Battery ind_Bouncy_Castle randomize ind_Battery ind_Bouncy_Castle
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
; bpl @- ; bpl @-
; and now offensives ; and now offensives
mva #6 tempXroller; number of purchases to perform mva #6 tempXroller; number of purchases to perform
;ldx TankNr ;ldx TankNr
@ @
randomize ind_Missile ind_Dirt_Charge randomize ind_Missile ind_Dirt_Charge
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
bne @- bne @-
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc TosserPurchase .proc TosserPurchase
@@ -922,22 +922,22 @@ SorryNoPurchase
; first try to buy defensives ; first try to buy defensives
; mva #1 tempXroller; number of defensive purchases to perform ; mva #1 tempXroller; number of defensive purchases to perform
@ @
randomize ind_Battery ind_Bouncy_Castle randomize ind_Battery ind_Bouncy_Castle
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
bpl @- bpl @-
; and now offensives ; and now offensives
lda MoneyH,x ; money / 256 lda MoneyH,x ; money / 256
asl ;*2 asl ;*2
sta tempXroller ; perform this many purchase attempts sta tempXroller ; perform this many purchase attempts
@ @
randomize ind_Missile ind_Dirt_Charge randomize ind_Missile ind_Dirt_Charge
jsr TryToPurchaseOnePiece jsr TryToPurchaseOnePiece
dec tempXroller dec tempXroller
bpl @- bpl @-
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc CyborgPurchase .proc CyborgPurchase
@@ -950,22 +950,22 @@ SorryNoPurchase
; first try to buy defensives ; first try to buy defensives
; mva #1 tempXroller; number of defensive purchases to perform ; mva #1 tempXroller; number of defensive purchases to perform
@ @
randomize ind_Battery ind_Bouncy_Castle randomize ind_Battery ind_Bouncy_Castle
jsr TryToPurchaseOnePiece2 jsr TryToPurchaseOnePiece2
dec tempXroller dec tempXroller
bpl @- bpl @-
; and now offensives ; and now offensives
lda MoneyH,x ; money / 256 lda MoneyH,x ; money / 256
:3 asl ;*8 :3 asl ;*8
sta tempXroller ; perform this many purchase attempts sta tempXroller ; perform this many purchase attempts
@ @
randomize first_offensive last_offensive randomize first_offensive last_offensive
jsr TryToPurchaseOnePiece2 jsr TryToPurchaseOnePiece2
dec tempXroller dec tempXroller
bpl @- bpl @-
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
.proc ChooseBestOffensive .proc ChooseBestOffensive
@@ -973,7 +973,7 @@ SorryNoPurchase
; X - TankNr ; X - TankNr
;---------------------------------------------- ;----------------------------------------------
ldy #ind_Dirt_Charge +1 ;the last weapon to choose +1 (not BFG or Laser :) ) ldy #ind_Dirt_Charge +1 ;the last weapon to choose +1 (not BFG or Laser :) )
NotFromAll NotFromAll
; Y - the last offensive weapon to use + 1 ; Y - the last offensive weapon to use + 1
lda TanksWeaponsTableL,x lda TanksWeaponsTableL,x
sta temp sta temp
@@ -982,7 +982,7 @@ NotFromAll
loop loop
dey dey
lda (temp),y lda (temp),y
beq loop beq loop
tya tya
sta ActiveWeapon,x sta ActiveWeapon,x
rts rts
+5 -6
View File
@@ -1,10 +1,10 @@
icl '../lib/atari.hea' icl '../lib/atari.hea'
org $2000 org $2000
joytest joytest
mva #0 dmactls mva #0 dmactls
@ @
lda trig0 lda trig0
beq pressed beq pressed
@@ -15,6 +15,5 @@ pressed
;ora jstick0 ;ora jstick0
sta colbak sta colbak
jmp @- jmp @-
run joytest run joytest
+1 -1
View File
@@ -620,7 +620,7 @@ rmt_p5
.IF TARGET = 800 .IF TARGET = 800
ldx #$10 ; pseudo stereo ldx #$10 ; pseudo stereo
bne SetPokey_OffsetX ; pseudo stereo bne SetPokey_OffsetX ; pseudo stereo
.ELSE .ELIF TARGET = 5200
rts rts
.ENDIF .ENDIF
SetPokey SetPokey
+3 -4
View File
@@ -6,7 +6,7 @@ song_end
buffers buffers
.ds 256 * 9 .ds 256 * 9
POKEY2 = POKEY+$10 ; stereo POKEY2 = POKEY+$10 ; stereo
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -22,7 +22,7 @@ POKEY2 = POKEY+$10 ; stereo
mva #1 bit_data mva #1 bit_data
; Example: here initializes song pointer: ; Example: here initializes song pointer:
;mwa #song_data song_ptr ;mwa #song_data song_ptr
; Init all channels: ; Init all channels:
@@ -67,7 +67,7 @@ delay
sta POKEY2,x ; stereo sta POKEY2,x ; stereo
dex ;stereo dex ;stereo
bpl @- ; stereo bpl @- ; stereo
lda #>buffers lda #>buffers
sta bptr+1 sta bptr+1
@@ -150,4 +150,3 @@ skip
stereo_buff ; stereo stereo_buff ; stereo
.ds 9 ; stereo .ds 9 ; stereo
+6 -6
View File
@@ -4,7 +4,7 @@
/***************************************/ /***************************************/
icl "splash.h" icl "splash.h"
; --- dmsc LZSS player routine on zero page ; --- dmsc LZSS player routine on zero page
org $80 org $80
@@ -57,7 +57,7 @@ fnt
.ds $0300 .ds $0300
pmg SPRITES pmg SPRITES
eif eif
FontSplash FontSplash
ins '../../artwork/weapons_AW6_mod.fnt' ; 'artwork/weapons.fnt' ins '../../artwork/weapons_AW6_mod.fnt' ; 'artwork/weapons.fnt'
@@ -103,14 +103,14 @@ LOOP lda vcount ;synchronization for the first screen (picture) line
mva >ant dlptr+1 mva >ant dlptr+1
icl "output.png.rp.ini" icl "output.png.rp.ini"
;--- 16 lines down ---- !!! ;--- 16 lines down ---- !!!
:16 sta wsync :16 sta wsync
; wait 13 cycles !!! ; wait 13 cycles !!!
:4 nop :4 nop
inc byt2 inc byt2
;--- wait 18 cycles ;--- wait 18 cycles
; jsr _rts ; jsr _rts
; inc byt3 ; inc byt3
@@ -185,7 +185,7 @@ stop mva #$00 pmcntl ;PMG disabled
sta POKEY2,x ; stereo sta POKEY2,x ; stereo
dex dex
bpl @- bpl @-
;no glitching please (issue #67) ;no glitching please (issue #67)
lda #0 lda #0
sta $D400 ;dmactl sta $D400 ;dmactl
+161 -159
View File
@@ -59,11 +59,11 @@ LineGameOver
seppukuText seppukuText
dta d"# SEPPUKU! #" dta d"# SEPPUKU! #"
areYouSureText areYouSureText
.IF target != 5200 .IF TARGET = 800
dta d"# SURE? Y/N #" dta d"# SURE? Y/N #"
.ELSE .ELIF TARGET = 5200
dta d"#END? Y-1/N-0#" dta d"#END? Y-1/N-0#"
.ENDIF .ENDIF
lineClear lineClear
dta d" " dta d" "
@@ -232,109 +232,109 @@ TanksNamesDefault
dta d":1th.Tank" dta d":1th.Tank"
.ENDR .ENDR
;------------------------------------------------- ;-------------------------------------------------
TankShapesTable .BYTE char_tank1 TankShapesTable .BYTE char_tank1
.BYTE char_tank2 .BYTE char_tank2
.BYTE char_tank3 .BYTE char_tank3
.BYTE char_tank4 .BYTE char_tank4
;------------------------------------------------- ;-------------------------------------------------
WeaponPriceH ; weapons prices (tables with prices of weapons) WeaponPriceH ; weapons prices (tables with prices of weapons)
.by >price_Baby_Missile .by >price_Baby_Missile
.by >price_Missile .by >price_Missile
.by >price_Baby_Nuke .by >price_Baby_Nuke
.by >price_Nuke .by >price_Nuke
.by >price_LeapFrog .by >price_LeapFrog
.by >price_Funky_Bomb .by >price_Funky_Bomb
.by >price_MIRV .by >price_MIRV
.by >price_Death_s_Head .by >price_Death_s_Head
.by >price_Napalm .by >price_Napalm
.by >price_Hot_Napalm .by >price_Hot_Napalm
.by >price_Tracer .by >price_Tracer
.by >price_Smoke_Tracer .by >price_Smoke_Tracer
.by >price_Baby_Roller .by >price_Baby_Roller
.by >price_Roller .by >price_Roller
.by >price_Heavy_Roller .by >price_Heavy_Roller
.by >price_Riot_Charge .by >price_Riot_Charge
.by >price_Riot_Blast .by >price_Riot_Blast
.by >price_Riot_Bomb .by >price_Riot_Bomb
.by >price_Heavy_Riot_Bomb .by >price_Heavy_Riot_Bomb
.by >price_Baby_Digger .by >price_Baby_Digger
.by >price_Digger .by >price_Digger
.by >price_Heavy_Digger .by >price_Heavy_Digger
.by >price_Baby_Sandhog .by >price_Baby_Sandhog
.by >price_Sandhog .by >price_Sandhog
.by >price_Heavy_Sandhog .by >price_Heavy_Sandhog
.by >price_Dirt_Clod .by >price_Dirt_Clod
.by >price_Dirt_Ball .by >price_Dirt_Ball
.by >price_Ton_of_Dirt .by >price_Ton_of_Dirt
.by >price_Liquid_Dirt .by >price_Liquid_Dirt
.by >price_Dirt_Charge .by >price_Dirt_Charge
.by >price_Buy_me .by >price_Buy_me
.by >price_Laser .by >price_Laser
.by >price_White_Flag .by >price_White_Flag
.by >price_Battery .by >price_Battery
.by >price_Hovercraft .by >price_Hovercraft
.by >price_Parachute .by >price_Parachute
.by >price_StrongParachute .by >price_StrongParachute
.by >price_Mag_Deflector .by >price_Mag_Deflector
.by >price_Shield .by >price_Shield
.by >price_Heavy_Shield .by >price_Heavy_Shield
.by >price_Force_Shield .by >price_Force_Shield
.by >price_Bouncy_Castle .by >price_Bouncy_Castle
.by >price_Long_Barrel .by >price_Long_Barrel
.by >price_Nuclear_Winter_ .by >price_Nuclear_Winter_
.by >price_Lazy_Boy .by >price_Lazy_Boy
.by >price_Lazy_Darwin .by >price_Lazy_Darwin
.by >price_Auto_Defense .by >price_Auto_Defense
.by >price_Spy_Hard .by >price_Spy_Hard
WeaponPriceL WeaponPriceL
.by <price_Baby_Missile .by <price_Baby_Missile
.by <price_Missile .by <price_Missile
.by <price_Baby_Nuke .by <price_Baby_Nuke
.by <price_Nuke .by <price_Nuke
.by <price_LeapFrog .by <price_LeapFrog
.by <price_Funky_Bomb .by <price_Funky_Bomb
.by <price_MIRV .by <price_MIRV
.by <price_Death_s_Head .by <price_Death_s_Head
.by <price_Napalm .by <price_Napalm
.by <price_Hot_Napalm .by <price_Hot_Napalm
.by <price_Tracer .by <price_Tracer
.by <price_Smoke_Tracer .by <price_Smoke_Tracer
.by <price_Baby_Roller .by <price_Baby_Roller
.by <price_Roller .by <price_Roller
.by <price_Heavy_Roller .by <price_Heavy_Roller
.by <price_Riot_Charge .by <price_Riot_Charge
.by <price_Riot_Blast .by <price_Riot_Blast
.by <price_Riot_Bomb .by <price_Riot_Bomb
.by <price_Heavy_Riot_Bomb .by <price_Heavy_Riot_Bomb
.by <price_Baby_Digger .by <price_Baby_Digger
.by <price_Digger .by <price_Digger
.by <price_Heavy_Digger .by <price_Heavy_Digger
.by <price_Baby_Sandhog .by <price_Baby_Sandhog
.by <price_Sandhog .by <price_Sandhog
.by <price_Heavy_Sandhog .by <price_Heavy_Sandhog
.by <price_Dirt_Clod .by <price_Dirt_Clod
.by <price_Dirt_Ball .by <price_Dirt_Ball
.by <price_Ton_of_Dirt .by <price_Ton_of_Dirt
.by <price_Liquid_Dirt .by <price_Liquid_Dirt
.by <price_Dirt_Charge .by <price_Dirt_Charge
.by <price_Buy_me .by <price_Buy_me
.by <price_Laser .by <price_Laser
.by <price_White_Flag .by <price_White_Flag
.by <price_Battery .by <price_Battery
.by <price_Hovercraft .by <price_Hovercraft
.by <price_Parachute .by <price_Parachute
.by <price_StrongParachute .by <price_StrongParachute
.by <price_Mag_Deflector .by <price_Mag_Deflector
.by <price_Shield .by <price_Shield
.by <price_Heavy_Shield .by <price_Heavy_Shield
.by <price_Force_Shield .by <price_Force_Shield
.by <price_Bouncy_Castle .by <price_Bouncy_Castle
.by <price_Long_Barrel .by <price_Long_Barrel
.by <price_Nuclear_Winter_ .by <price_Nuclear_Winter_
.by <price_Lazy_Boy .by <price_Lazy_Boy
.by <price_Lazy_Darwin .by <price_Lazy_Darwin
.by <price_Auto_Defense .by <price_Auto_Defense
.by <price_Spy_Hard .by <price_Spy_Hard
;------------------------------------------------- ;-------------------------------------------------
; how many units (bulletd) of a given weapon we get for a given price ; how many units (bulletd) of a given weapon we get for a given price
@@ -392,7 +392,7 @@ WeaponUnits
.by 2 ;Auto_Defense ;_46 .by 2 ;Auto_Defense ;_46
.by 4 ;Spy_Hard ;_47 .by 4 ;Spy_Hard ;_47
PurchaseMeTable ;weapons good to be purchased by the robot PurchaseMeTable ;weapons good to be purchased by the robot
;the comment is an index in the tables ;the comment is an index in the tables
; "Baby Missile ","Missile ","Baby Nuke ","Nuke " ; "Baby Missile ","Missile ","Baby Nuke ","Nuke "
; "LeapFrog ","Funky Bomb ","MIRV ","Death's Head " ; "LeapFrog ","Funky Bomb ","MIRV ","Death's Head "
@@ -530,7 +530,7 @@ NamesOfWeapons ;the comment is an index in the tables
dta d"Shield " ; 38 - shield for one shot - no energy dta d"Shield " ; 38 - shield for one shot - no energy
dta d"Heavy Shield " ; 39 - shield with energy dta d"Heavy Shield " ; 39 - shield with energy
dta d"Force Shield " ; 40 - shield with energy and parachute dta d"Force Shield " ; 40 - shield with energy and parachute
dta d"Bouncy Castle " ; 41 - with shield and energy dta d"Bouncy Castle " ; 41 - with shield and energy
dta d"Long Schlong " ; 42 dta d"Long Schlong " ; 42
dta d"Nuclear Winter " ; 43 dta d"Nuclear Winter " ; 43
dta d"Lazy Boy " ; 44 dta d"Lazy Boy " ; 44
@@ -556,22 +556,22 @@ DefensiveEnergy = *-(last_offensive - first_offensive +1) ; to fake the table f
.by 00 ; Auto Defense .by 00 ; Auto Defense
.by 00 ; Spy Hard .by 00 ; Spy Hard
weaponsOfDeath ; weapons used in tank death animations weaponsOfDeath ; weapons used in tank death animations
dta ind_Missile dta ind_Missile
dta ind_Baby_Nuke dta ind_Baby_Nuke
dta ind_Nuke dta ind_Nuke
dta ind_Death_s_Head dta ind_Death_s_Head
dta ind_Hot_Napalm ; why not? dta ind_Hot_Napalm ; why not?
dta ind_Riot_Bomb dta ind_Riot_Bomb
dta ind_Heavy_Riot_Bomb dta ind_Heavy_Riot_Bomb
dta ind_Baby_Digger dta ind_Baby_Digger
dta ind_Digger dta ind_Digger
dta ind_Heavy_Digger dta ind_Heavy_Digger
dta ind_Baby_Sandhog dta ind_Baby_Sandhog
dta ind_Sandhog dta ind_Sandhog
dta ind_Heavy_Sandhog dta ind_Heavy_Sandhog
dta ind_Dirt_Clod dta ind_Dirt_Clod
dta ind_Dirt_Ball dta ind_Dirt_Ball
dta ind_Ton_of_Dirt dta ind_Ton_of_Dirt
weaponsOfDeathEnd weaponsOfDeathEnd
joyToKeyTable joyToKeyTable
.by $ff ;00 .by $ff ;00
@@ -618,66 +618,68 @@ gameOverSpritesTop
.by 130+7,130+7,136+7,142+7,148+7,154+7 .by 130+7,130+7,136+7,142+7,148+7,154+7
;------credits ;------credits
CreditsStart CreditsStart
dta d" "* dta d" "*
dta d"You were playin",d"g"* dta d"You were playin",d"g"*
dta d"Scorc",d"h"* dta d"Scorc",d"h"*
dta d"Warsaw, Miam",d"i"* dta d"Warsaw, Miam",d"i"*
dta d"2000-202",d"3"* dta d"2000-202",d"3"*
dta d" "* dta d" "*
dta d"Programmin",d"g"* dta d"Programmin",d"g"*
dta d"Tomasz 'Pecus' Peck",d"o"* dta d"Tomasz 'Pecus' Peck",d"o"*
dta d"Pawel 'pirx' Kalinowsk",d"i"* dta d"Pawel 'pirx' Kalinowsk",d"i"*
dta d" "* dta d" "*
dta d"SFX, Music and Suppor",d"t"* dta d"SFX, Music and Suppor",d"t"*
dta d"Michal 'Miker' Szpilowsk",d"i"* dta d"Michal 'Miker' Szpilowsk",d"i"*
dta d" "* dta d" "*
.IF target != 5200 .IF TARGET = 800
dta d"Additional Musi",d"c"* dta d"Additional Musi",d"c"*
dta d"Mario 'Emkay' Kri",d"x"* dta d"Mario 'Emkay' Kri",d"x"*
dta d" "* dta d" "*
.ENDIF .ENDIF
dta d"Code Optimizatio",d"n"* dta d"Code Optimizatio",d"n"*
dta d"Piotr '0xF' Fusi",d"k"* dta d"Piotr '0xF' Fusi",d"k"*
dta d" "* dta d" "*
dta d"Ar",d"t"* dta d"Ar",d"t"*
dta d"Adam Wachowsk",d"i"* dta d"Adam Wachowsk",d"i"*
.IF target != 5200 .IF TARGET = 800
dta d"Roman 'xorcerer' Fierfa",d"s"* dta d"Roman 'xorcerer' Fierfa",d"s"*
.ENDIF .ENDIF
dta d" "* dta d" "*
dta d"Ideas, help and Q",d"A"* dta d"Ideas, help and Q",d"A"*
dta d"Bocianu, Probabilitydragon",d","* dta d"Bocianu, Probabilitydragon",d","*
dta d"EnderDude, Dracon",d","* dta d"EnderDude, Dracon",d","*
dta d"Beeblebrox, KrzysRog, lopezpb",d","* dta d"Beeblebrox, KrzysRog, lopezpb",d","*
dta d"brad-colbert, archon800, nowy80",d","* dta d"brad-colbert, archon800, nowy80",d","*
dta d"Shaggy the Atarian, RetroBorsuk, ZPH" dta d"Shaggy the Atarian, RetroBorsuk, ZPH"
.IF target = 5200 .IF TARGET = 800
dta d","* dta d" "*
dta d"x-usr(1536), Aking, JAC!, phaeron",d","* .ELIF TARGET = 5200
dta d"RB520",d"0"* dta d","*
.ELSE dta d"x-usr(1536), Aking, JAC!, phaeron",d","*
dta d" "* dta d"RB520",d"0"*
.ENDIF .ENDIF
dta d" "* dta d" "*
dta d"Additional testin",d"g"* dta d"Additional testin",d"g"*
dta d"Arek and Alex Peck",d"o"* dta d"Arek and Alex Peck",d"o"*
dta d" "* dta d" "*
dta d"Special thank",d"s"* dta d"Special thank",d"s"*
dta d"Krzysztof 'Kaz' Ziembi",d"k"* dta d"Krzysztof 'Kaz' Ziembi",d"k"*
.IF target != 5200 .IF TARGET = 800
dta d" "* dta d" "*
dta d"Stay tuned for the FujiNet version",d"!"* dta d"Stay tuned for the FujiNet version",d"!"*
.ENDIF .ENDIF
dta d" "* dta d" "*
CreditsEnd CreditsEnd
.IF target = 5200 .IF TARGET = 800
CreditsLines=34 + 7; add 7 for scrollout
.ELSE
CreditsLines=40 + 7 ; add 7 for scrollout CreditsLines=40 + 7 ; add 7 for scrollout
.ELIF TARGET = 5200
CreditsLines=34 + 7; add 7 for scrollout
.ENDIF .ENDIF
.IF target = 5200
.IF TARGET = 5200
; Atari 5200 splash ; Atari 5200 splash
NewSplashText=* NewSplashText=*
dta d" 2023 atariage", $4e, "com " ; $4e - non blinking dot dta d" 2023 atariage", $4e, "com " ; $4e - non blinking dot
.ENDIF .ENDIF
.endif
.endif ; .IF *>0
+1 -1
View File
@@ -14,7 +14,7 @@ dliColorsFore
.by $08,$08,$08,$06,$06,$06,$06,$06,$06,$04 .by $08,$08,$08,$06,$06,$06,$06,$06,$06,$04
CashOptionL ;(one zero less than on the screen) CashOptionL ;(one zero less than on the screen)
.by 0,<200,<800,<1200,<2000 .by 0,<200,<800,<1200,<2000
CashOptionH CashOptionH
.by 0,>200,>800,>1200,>2000 .by 0,>200,>800,>1200,>2000
GravityTable .by 10,20,25,30,40 GravityTable .by 10,20,25,30,40
MaxWindTable .by 5,20,40,70,99 MaxWindTable .by 5,20,40,70,99
+26 -26
View File
@@ -34,7 +34,7 @@ char_flame = $14
char_clear_flame = $1c char_clear_flame = $1c
char_digger = $04 char_digger = $04
char_sandhog = $0c char_sandhog = $0c
char_sandhog_offset = char_sandhog - char_digger char_sandhog_offset = char_sandhog - char_digger
char_tank1 = $20 char_tank1 = $20
char_tank2 = $24 char_tank2 = $24
char_tank3 = $2c char_tank3 = $2c
@@ -74,16 +74,16 @@ price_Dirt_Charge = 343 ;_29
price_Buy_me = 170 ;_30 price_Buy_me = 170 ;_30
price_Laser = 277 ;_31 price_Laser = 277 ;_31
price_White_Flag = $0 ;_32 price_White_Flag = $0 ;_32
price_Battery = 300 ;_33 price_Battery = 300 ;_33
price_Hovercraft = 352 ;_34 price_Hovercraft = 352 ;_34
price_Parachute = 234 ;_35 price_Parachute = 234 ;_35
price_StrongParachute = 1000 ;_36 price_StrongParachute = 1000 ;_36
price_Mag_Deflector = 745 ;_37 price_Mag_Deflector = 745 ;_37
price_Shield = 224 ;_38 price_Shield = 224 ;_38
price_Heavy_Shield = 628 ;_39 price_Heavy_Shield = 628 ;_39
price_Force_Shield = 1100 ;_40 price_Force_Shield = 1100 ;_40
price_Bouncy_Castle = 512 ;_41 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 = 730 ;_45 price_Lazy_Darwin = 730 ;_45
@@ -91,7 +91,7 @@ price_Auto_Defense = 250 ;_46
price_Spy_Hard = 83 ;_47 price_Spy_Hard = 83 ;_47
;Weapon indexes (numbers) ;Weapon indexes (numbers)
ind_Baby_Missile = 0 ind_Baby_Missile = 0
first_offensive = ind_Baby_Missile first_offensive = ind_Baby_Missile
ind_Missile = 1 ind_Missile = 1
ind_Baby_Nuke = 2 ind_Baby_Nuke = 2
ind_Nuke = 3 ind_Nuke = 3
@@ -123,26 +123,26 @@ ind_Liquid_Dirt = 28
ind_Dirt_Charge = 29 ind_Dirt_Charge = 29
ind_Buy_me = 30 ind_Buy_me = 30
ind_Laser = 31 ind_Laser = 31
last_offensive = ind_Laser last_offensive = ind_Laser
ind_White_Flag = 32 ind_White_Flag = 32
first_defensive = ind_White_Flag first_defensive = ind_White_Flag
ind_Battery = 33 ind_Battery = 33
ind_Hovercraft = 34 ind_Hovercraft = 34
ind_Parachute = 35 ind_Parachute = 35
ind_StrongParachute = 36 ind_StrongParachute = 36
ind_Mag_Deflector = 37 ind_Mag_Deflector = 37
ind_Shield = 38 ind_Shield = 38
ind_Heavy_Shield = 39 ind_Heavy_Shield = 39
ind_Force_Shield = 40 ind_Force_Shield = 40
ind_Bouncy_Castle = 41 ind_Bouncy_Castle = 41
ind_Long_Barrel = 42 ind_Long_Barrel = 42
ind_Nuclear_Winter_ = 43 ind_Nuclear_Winter_ = 43
ind_Lazy_Boy = 44 ind_Lazy_Boy = 44
ind_Lazy_Darwin = 45 ind_Lazy_Darwin = 45
ind_Auto_Defense = 46 ind_Auto_Defense = 46
ind_Spy_Hard = 47 ind_Spy_Hard = 47
last_defensive = ind_Spy_Hard last_defensive = ind_Spy_Hard
last_real_defensive = ind_Bouncy_Castle last_real_defensive = ind_Bouncy_Castle
number_of_offensives = last_offensive - first_offensive +1 number_of_offensives = last_offensive - first_offensive +1
number_of_defensives = (last_defensive - first_defensive +1) number_of_defensives = (last_defensive - first_defensive +1)
number_of_weapons = number_of_offensives + number_of_defensives number_of_weapons = number_of_offensives + number_of_defensives
+54 -54
View File
@@ -8,7 +8,7 @@ START
jsr Initialize jsr Initialize
;jsr GameOverScreen ; only for test !!! ;jsr GameOverScreen ; only for test !!!
RMTSong song_main_menu RMTSong song_main_menu
jsr Options ;startup screen jsr Options ;startup screen
@@ -24,7 +24,7 @@ START
jsr RandomizeSequence jsr RandomizeSequence
; for the round #1 shooting sequence is random ; for the round #1 shooting sequence is random
MainGameLoop MainGameLoop
jsr SetWallsType jsr SetWallsType
; first set default barrel lengths (fix for Long Schlong activation :) ) ; first set default barrel lengths (fix for Long Schlong activation :) )
@@ -40,20 +40,20 @@ MainGameLoop
jsr GetRandomWind jsr GetRandomWind
jsr RoundInit jsr RoundInit
jsr MainRoundLoop jsr MainRoundLoop
bit escFlag bit escFlag
jvs GoGameOver jvs GoGameOver
bmi START bmi START
jsr CalculateGains jsr CalculateGains
jsr SortSequence jsr SortSequence
mva #0 TankNr ; mva #0 TankNr ;
sta COLBAKS ; set background color to black sta COLBAKS ; set background color to black
sta JoystickNumber ; set joystick port for player sta JoystickNumber ; set joystick port for player
; Hide all (easier than hide last ;) ) tanks ; Hide all (easier than hide last ;) ) tanks
jsr cleartanks ; A=0 jsr cleartanks ; A=0
@@ -69,7 +69,7 @@ MainGameLoop
jsr DemoModeOrKey jsr DemoModeOrKey
jsr MakeDarkScreen jsr MakeDarkScreen
lda GameIsOver lda GameIsOver
beq NoGameOverYet beq NoGameOverYet
GoGameOver GoGameOver
@@ -80,7 +80,7 @@ NoGameOverYet
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
jmp MainGameLoop jmp MainGameLoop
;-------------------------------------------------- ;--------------------------------------------------
.proc CalculateGains .proc CalculateGains
;-------------------------------------------------- ;--------------------------------------------------
@@ -96,7 +96,7 @@ NoGameOverYet
ldx NumberOfPlayers ldx NumberOfPlayers
dex dex
CalculateGainsLoop CalculateGainsLoop
; adding the remaining energy of the tank to gain ; adding the remaining energy of the tank to gain
; winner gets more ! :) ; winner gets more ! :)
lda Energy,x lda Energy,x
@@ -104,7 +104,7 @@ CalculateGainsLoop
sta gainL,x sta gainL,x
bcc @+ bcc @+
inc gainH,x inc gainH,x
@ @
; add gain * 2 ; add gain * 2
asl gainL,x asl gainL,x
rol gainH,x rol gainH,x
@@ -175,7 +175,7 @@ eskipzeroing
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc RoundInit .proc RoundInit
;-------------------------------------------------- ;--------------------------------------------------
; at the beginning of each Round we set energy ; at the beginning of each Round we set energy
; of all players to 99 ; of all players to 99
@@ -191,7 +191,7 @@ eskipzeroing
sta AfterBFGflag ; reset BFG flag sta AfterBFGflag ; reset BFG flag
sta COLOR2 ; status line "off" sta COLOR2 ; status line "off"
sta COLOR1 sta COLOR1
tax tax
@ sta singleRoundVars,x @ sta singleRoundVars,x
inx inx
@@ -219,7 +219,7 @@ SettingEnergies
sta ForceTableL,x sta ForceTableL,x
lda #>350 lda #>350
sta ForceTableH,x sta ForceTableH,x
;lda #(255-45) ;lda #(255-45)
;it does not look good when all tanks have ;it does not look good when all tanks have
;barrels pointing the same direction ;barrels pointing the same direction
@@ -227,7 +227,7 @@ SettingEnergies
;angles ;angles
jsr RandomizeAngle jsr RandomizeAngle
sta AngleTable,x sta AngleTable,x
dex dex
bpl SettingEnergies bpl SettingEnergies
@@ -312,10 +312,10 @@ DoNotFinishTheRound
lda noDeathCounter lda noDeathCounter
cmp seppukuVal cmp seppukuVal
bcc @+ bcc @+
mva #0 noDeathCounter mva #0 noDeathCounter
mva #sfx_seppuku sfx_effect mva #sfx_seppuku sfx_effect
jsr DisplaySeppuku jsr DisplaySeppuku
jmp Seppuku jmp Seppuku
@@ -342,10 +342,10 @@ CheckNextTankAD
jeq NextPlayerShoots jeq NextPlayerShoots
mva #$ff plot4x4color mva #$ff plot4x4color
jsr DisplayTankNameAbove jsr DisplayTankNameAbove
mva #1 color ;to display flying point mva #1 color ;to display flying point
ldx tankNr ldx tankNr
@@ -358,7 +358,7 @@ CheckNextTankAD
beq ManualShooting beq ManualShooting
RoboTanks RoboTanks
; robotanks shoot here ; robotanks shoot here
; TankNr still in X ; TankNr still in X
jsr ArtificialIntelligence jsr ArtificialIntelligence
;pause 30 ;pause 30
@@ -391,7 +391,7 @@ AfterManualShooting
; defensive weapons without flight handling ; defensive weapons without flight handling
ldx TankNr ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #ind_Hovercraft cmp #ind_Hovercraft
beq GoFloat beq GoFloat
cmp #ind_White_Flag ; White Flag cmp #ind_White_Flag ; White Flag
beq ShootWhiteFlag beq ShootWhiteFlag
@@ -431,10 +431,10 @@ ShootNow
bit escFlag bit escFlag
spl:rts ; keys Esc or O spl:rts ; keys Esc or O
lda HitFlag ;0 if missed lda HitFlag ;0 if missed
beq missed beq missed
jsr Explosion jsr Explosion
continueMainRoundLoopAfterSeppuku continueMainRoundLoopAfterSeppuku
@@ -461,7 +461,7 @@ missed
bne @+ bne @+
ldx TankNr ldx TankNr
tya tya
sta ActiveWeapon,x sta ActiveWeapon,x
@ @
;here we clear offensive text (after a shoot) ;here we clear offensive text (after a shoot)
@@ -477,7 +477,7 @@ NextPlayerShoots
SeteXistenZ SeteXistenZ
lda Energy,x lda Energy,x
sta eXistenZ,x sta eXistenZ,x
jsr MaxForceCalculate jsr MaxForceCalculate
dex dex
@@ -504,7 +504,7 @@ PlayersAgain
; Aaaah! - in the main loop we have to set eXistenZ and LASTeXistenZ ; Aaaah! - in the main loop we have to set eXistenZ and LASTeXistenZ
mva #sfx_next_player sfx_effect mva #sfx_next_player sfx_effect
ldx NumberOfPlayers ldx NumberOfPlayers
dex dex
CheckingPlayersDeath CheckingPlayersDeath
@@ -521,7 +521,7 @@ NoPlayerNoDeath
cmp NumberOfPlayers cmp NumberOfPlayers
bne NotLastPlayerInRound bne NotLastPlayerInRound
mva #0 TankSequencePointer mva #0 TankSequencePointer
lda WindChangeInRound lda WindChangeInRound
beq NoWindChangeNow beq NoWindChangeNow
jsr GetRandomWind ; wind change after each turn (not round only) jsr GetRandomWind ; wind change after each turn (not round only)
@@ -529,7 +529,7 @@ NoWindChangeNow
NotLastPlayerInRound NotLastPlayerInRound
jmp MainRoundLoop jmp MainRoundLoop
.endp .endp
;--------------------------------- ;---------------------------------
.proc PlayerXdeath .proc PlayerXdeath
; this tank should not explode anymore: ; this tank should not explode anymore:
@@ -560,9 +560,9 @@ NotLastPlayerInRound
adc ResultsTable,x adc ResultsTable,x
sta ResultsTable,x sta ResultsTable,x
;inc CurrentResult ;inc CurrentResult
; RandomizeDeffensiveText ; RandomizeDeffensiveText
randomize talk.NumberOfOffensiveTexts (talk.NumberOfDeffensiveTexts+talk.NumberOfOffensiveTexts-1) randomize talk.NumberOfOffensiveTexts (talk.NumberOfDeffensiveTexts+talk.NumberOfOffensiveTexts-1)
TextAfterBFG TextAfterBFG
sta TextNumberOff sta TextNumberOff
inc CurrentResult ; ... but increase result of winner (BFG) inc CurrentResult ; ... but increase result of winner (BFG)
@@ -574,7 +574,7 @@ TextAfterBFG
mva TankNr temp2 ; not elegant, and probably unnecessary mva TankNr temp2 ; not elegant, and probably unnecessary
sty TankNr sty TankNr
jsr FlashTank ; blinking and pausing (like PAUSE 72 - 18x(2+2) ) jsr FlashTank ; blinking and pausing (like PAUSE 72 - 18x(2+2) )
mva temp2 TankNr mva temp2 TankNr
;Deffensive text cleanup ;Deffensive text cleanup
;here we clear Deffensive text (after a shoot) ;here we clear Deffensive text (after a shoot)
@@ -752,7 +752,7 @@ NotNegativeShieldEnergy
; Energy of tank X in A ; Energy of tank X in A
;-------------------------------------------------- ;--------------------------------------------------
sta L1 sta L1
;DATA L1,L2 ;DATA L1,L2
;Multiplication 8bit*8bit, ;Multiplication 8bit*8bit,
;result 16bit ;result 16bit
@@ -786,7 +786,7 @@ B0 dey
@ lda #$0 @ lda #$0
cpx #ind_White_Flag ; White Flag cpx #ind_White_Flag ; White Flag
bne no99 bne no99
set99 lda #99 set99 lda #99
no99 no99
.REPT MaxPlayers, #+1 .REPT MaxPlayers, #+1
sta TanksWeapon:1,x sta TanksWeapon:1,x
@@ -823,16 +823,16 @@ deletePtr = temp
iny iny
sty TankShape+2 sty TankShape+2
sty TankShape+5 sty TankShape+5
mwa #1024 RandBoundaryHigh mwa #1024 RandBoundaryHigh
mva #$ff LastWeapon mva #$ff LastWeapon
sta HowMuchToFall sta HowMuchToFall
mva #1 color mva #1 color
jsr SetStandardBarrels jsr SetStandardBarrels
jsr WeaponCleanup jsr WeaponCleanup
mva #>WeaponFont chbas mva #>WeaponFont chbas
;parameter for old plot (unPlot) max 5 points ;parameter for old plot (unPlot) max 5 points
@@ -869,7 +869,7 @@ MakeTanksVisible
mva #1 CurrentRoundNr ;we start from round 1 mva #1 CurrentRoundNr ;we start from round 1
mva #6 NTSCcounter mva #6 NTSCcounter
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
@@ -973,7 +973,7 @@ UsageLoop
lda RANDOM lda RANDOM
and #%00000011 ;(0..1023) and #%00000011 ;(0..1023)
sta temp2+1 sta temp2+1
cpw RandBoundaryLow temp2 cpw RandBoundaryLow temp2
seq:bcs RandomizeForce seq:bcs RandomizeForce
@@ -984,9 +984,9 @@ UsageLoop
sta ForceTableL,x sta ForceTableL,x
lda temp2+1 lda temp2+1
sta ForceTableH,x sta ForceTableH,x
;--------- ;---------
LimitForce LimitForce
; in X must be TankNr ; in X must be TankNr
; cuts force to MaxForceTable ; cuts force to MaxForceTable
lda MaxForceTableH,x lda MaxForceTableH,x
@@ -995,7 +995,7 @@ LimitForce
lda MaxForceTableL,x lda MaxForceTableL,x
cmp ForceTableL,x cmp ForceTableL,x
@ bcs @+ @ bcs @+
lda MaxForceTableL,x lda MaxForceTableL,x
sta ForceTableL,x sta ForceTableL,x
lda MaxForceTableH,x lda MaxForceTableH,x
@@ -1045,7 +1045,7 @@ rotateLeft ; older is bigger
BarrelPositionIsFine BarrelPositionIsFine
jsr DrawTankNr jsr DrawTankNr
rts rts
.endp .endp
;---------------------------------------------- ;----------------------------------------------
@@ -1166,7 +1166,7 @@ SetRandomWalls
.endp .endp
; -------------------------------------- ; --------------------------------------
; Sets the appropriate variables based on the options table ; Sets the appropriate variables based on the options table
; ;
.proc SetVariablesFromOptions .proc SetVariablesFromOptions
;first option ;first option
ldy OptionsTable ldy OptionsTable
@@ -1196,29 +1196,29 @@ SetRandomWalls
ldy OptionsTable+3 ldy OptionsTable+3
lda MaxWindTable,y lda MaxWindTable,y
sta MaxWind sta MaxWind
;fifth option (no of rounds) ;fifth option (no of rounds)
ldy OptionsTable+4 ldy OptionsTable+4
lda RoundsTable,y lda RoundsTable,y
sta RoundsInTheGame sta RoundsInTheGame
;6th option (shell speed) ;6th option (shell speed)
ldy OptionsTable+5 ldy OptionsTable+5
lda flyDelayTable,y lda flyDelayTable,y
sta flyDelay sta flyDelay
;7th option (Airstrike after how many missess) ;7th option (Airstrike after how many missess)
ldy OptionsTable+6 ldy OptionsTable+6
lda seppukuTable,y lda seppukuTable,y
sta seppukuVal sta seppukuVal
;8th option (how aggressive are mountains) ;8th option (how aggressive are mountains)
ldy OptionsTable+7 ldy OptionsTable+7
lda mountainsDeltaTableH,y lda mountainsDeltaTableH,y
sta mountainDeltaH sta mountainDeltaH
lda mountainsDeltaTableL,y lda mountainsDeltaTableL,y
sta mountainDeltaL sta mountainDeltaL
rts rts
.endp .endp
@@ -1228,9 +1228,9 @@ SetRandomWalls
;using 4x4 font ;using 4x4 font
jsr RoundOverSprites jsr RoundOverSprites
mva #$ff plot4x4color mva #$ff plot4x4color
;centering the result screen ;centering the result screen
mva #((ScreenHeight/2)-(8*4)) ResultY mva #((ScreenHeight/2)-(8*4)) ResultY
@@ -1246,7 +1246,7 @@ SetRandomWalls
lda CurrentRoundNr lda CurrentRoundNr
cmp RoundsInTheGame cmp RoundsInTheGame
beq GameOver4x4 beq GameOver4x4
sta decimal sta decimal
mwa #RoundNrDisplay displayposition mwa #RoundNrDisplay displayposition
jsr displaybyte ;decimal (byte), displayposition (word) jsr displaybyte ;decimal (byte), displayposition (word)
@@ -1264,7 +1264,7 @@ GameOver4x4
mva ResultY LineYdraw mva ResultY LineYdraw
jsr TypeLine4x4 jsr TypeLine4x4
mva #1 GameIsOver mva #1 GameIsOver
@ @
adb ResultY #4 ;next line adb ResultY #4 ;next line
@@ -1321,7 +1321,7 @@ ResultOfTheNextPlayer
; overwrite the second digit of the points (max 255) ; overwrite the second digit of the points (max 255)
;it means ":" ;it means ":"
mva #26 ResultLineBuffer+9 mva #26 ResultLineBuffer+9
ldx #0 ldx #0
lda TankNr lda TankNr
asl asl
+59 -59
View File
@@ -4,7 +4,7 @@
;-------------------------------------------------- ;--------------------------------------------------
.proc draw ;;fuxxing good draw :) .proc draw ;;fuxxing good draw :)
; xdraw,ydraw (word) - coordinates of first point ; xdraw,ydraw (word) - coordinates of first point
; xbyte,ybyte (word) - coordinates of last point ; xbyte,ybyte (word) - coordinates of last point
;-------------------------------------------------- ;--------------------------------------------------
@@ -221,7 +221,7 @@ LineGoesLeft
; line goes left - we are reversing X ; line goes left - we are reversing X
sbw xtempDRAW temp xdraw ; XI sbw xtempDRAW temp xdraw ; XI
PutPixelinDraw PutPixelinDraw
; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V) ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V)
bit drawFunction bit drawFunction
bpl @+ bpl @+
@@ -276,7 +276,7 @@ StopHitChecking
jmp ContinueDraw jmp ContinueDraw
@ @
MeasureVisualisation MeasureVisualisation
jsr plot jsr plot
ContinueDraw ContinueDraw
; XI=XI+1 ; XI=XI+1
@@ -292,9 +292,9 @@ EndOfDraw
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc circle ;fxxxing good circle drawing :) .proc circle ;fxxxing good circle drawing :)
; xdraw,ydraw (word) - coordinates of circle center ; xdraw,ydraw (word) - coordinates of circle center
; radius (byte) - radius of circle ; radius (byte) - radius of circle
;-------------------------------------------------- ;--------------------------------------------------
;Turbo Basic source ;Turbo Basic source
; R=30 ; R=30
@@ -483,10 +483,10 @@ endcircleloop
; it is necessary, because randomizing checks ; it is necessary, because randomizing checks
; if the given tank is already placed ; if the given tank is already placed
; after check if its position is not (0,0) ; after check if its position is not (0,0)
; I will be honest with you - I have no idea ; I will be honest with you - I have no idea
; what the above comment was intending to mean :) ; what the above comment was intending to mean :)
sta XtankstableL,x sta XtankstableL,x
sta XtankstableH,x sta XtankstableH,x
sta Ytankstable,x sta Ytankstable,x
@@ -708,7 +708,7 @@ NoMissile
bcs PMForTank6 bcs PMForTank6
; clear sprite and put 3 lines on the tank at the same time ; clear sprite and put 3 lines on the tank at the same time
ldx #3 ; three lines of PM ldx #3 ; three lines of PM
ClearPM ClearPM
cpy temp cpy temp
bne ZeroesToGo bne ZeroesToGo
@ lda (xbyte),y @ lda (xbyte),y
@@ -728,7 +728,7 @@ ZeroesToGo
PMForTank6 PMForTank6
; clear sprite and put 3 lines on the tank at the same time ; clear sprite and put 3 lines on the tank at the same time
ldx #3 ; three lines of PM ldx #3 ; three lines of PM
ClearPM6 ClearPM6
cpy temp cpy temp
bne ZeroesToGo6 bne ZeroesToGo6
@ lda (xbyte),y @ lda (xbyte),y
@@ -756,7 +756,7 @@ noTankNoPM
; in xdraw, ydraw we have coordinates left LOWER corner of Tank char ; in xdraw, ydraw we have coordinates left LOWER corner of Tank char
ldx TankNr ldx TankNr
lda ActiveDefenceWeapon,x lda ActiveDefenceWeapon,x
cmp #ind_Shield ; one shot shield cmp #ind_Shield ; one shot shield
beq DrawTankSh beq DrawTankSh
cmp #ind_Force_Shield ; shield with energy and parachute cmp #ind_Force_Shield ; shield with energy and parachute
beq DrawTankShieldBold beq DrawTankShieldBold
@@ -809,7 +809,7 @@ DoNotDrawTankNr
tankflash_loop tankflash_loop
lda CONSOL ; turbo mode lda CONSOL ; turbo mode
and #%00000001 ; START KEY and #%00000001 ; START KEY
sne:mva #1 fs ; finish it sne:mva #1 fs ; finish it
mva #1 Erase mva #1 Erase
ldx TankNr ldx TankNr
jsr DrawTankNr.SkipHidingPM ; it's necessary becouse DrawTankNr skips tanks with no energy ! jsr DrawTankNr.SkipHidingPM ; it's necessary becouse DrawTankNr skips tanks with no energy !
@@ -833,7 +833,7 @@ tankflash_loop
; if use DrawInPosition entry point then: ; if use DrawInPosition entry point then:
; xdraw, ydraw - coordinates left LOWER corner of Tank char ; xdraw, ydraw - coordinates left LOWER corner of Tank char
; values remain there after a DrawTankNr proc. ; values remain there after a DrawTankNr proc.
; ;
; this proc change xdraw, ydraw and temp! ; this proc change xdraw, ydraw and temp!
;-------------------------------------------------- ;--------------------------------------------------
sbw xdraw #$03 ; 3 pixels to left sbw xdraw #$03 ; 3 pixels to left
@@ -934,7 +934,7 @@ ToHighToParachute
;-------------------------------------------------- ;--------------------------------------------------
.proc DrawTankRocketEngine .proc DrawTankRocketEngine
; X - tank number ; X - tank number
; ;
; this proc change xdraw, ydraw and temp! ; this proc change xdraw, ydraw and temp!
;-------------------------------------------------- ;--------------------------------------------------
clc clc
@@ -942,7 +942,7 @@ ToHighToParachute
adc #2 ; 1 pixel down adc #2 ; 1 pixel down
sta ydraw sta ydraw
mva #0 ydraw+1 mva #0 ydraw+1
clc clc
lda XtanksTableL,x lda XtanksTableL,x
adc #2 ; 2 pixels to right adc #2 ; 2 pixels to right
@@ -951,18 +951,18 @@ ToHighToParachute
adc #0 adc #0
sta xdraw+1 sta xdraw+1
; draw first horizontal line ; draw first horizontal line
mva #5 temp mva #5 temp
@ @
jsr plot jsr plot
inw xdraw inw xdraw
dec temp dec temp
bne @- bne @-
sbw xdraw #2 ; 2 pixels left sbw xdraw #2 ; 2 pixels left
inw ydraw ; 1 pixel down inw ydraw ; 1 pixel down
; draw second horizontal line ; draw second horizontal line
mva #3 temp mva #3 temp
@ @
jsr plot jsr plot
@@ -970,7 +970,7 @@ ToHighToParachute
dec temp dec temp
bne @- bne @-
adw xdraw #2 ; 2 pixels right adw xdraw #2 ; 2 pixels right
inw ydraw ; 1 pixel down inw ydraw ; 1 pixel down
; and last pixel ; and last pixel
@@ -982,7 +982,7 @@ ToHighToParachute
;-------------------------------------------------- ;--------------------------------------------------
.proc DrawTankEngine .proc DrawTankEngine
; X - tank number ; X - tank number
; ;
; this proc change xdraw, ydraw and temp! ; this proc change xdraw, ydraw and temp!
;-------------------------------------------------- ;--------------------------------------------------
; one pixel under tank ; one pixel under tank
@@ -1087,7 +1087,7 @@ ROLPoint2
rol UnderTank1 rol UnderTank1
inw xdraw inw xdraw
dec temp dec temp
bne ByteBelowTank bne ByteBelowTank
NoGroundCheck NoGroundCheck
ldx TankNr ldx TankNr
lda Ytankstable,x lda Ytankstable,x
@@ -1099,7 +1099,7 @@ NoGroundCheck
lda Parachute lda Parachute
and #1 and #1
bne ParachutePresent bne ParachutePresent
; decreasing energy ; decreasing energy
ldy #2 ; how much energy to substract if no parachute ldy #2 ; how much energy to substract if no parachute
jsr DecreaseEnergyX jsr DecreaseEnergyX
ParachutePresent ParachutePresent
@@ -1114,7 +1114,7 @@ ParachutePresent
beq @+ beq @+
jsr DecreaseEnergyX jsr DecreaseEnergyX
@ @
; check energy of parachute ; check energy of parachute
lda ShieldEnergy,x lda ShieldEnergy,x
bne OneTimeParachute bne OneTimeParachute
lda #$00 lda #$00
@@ -1187,7 +1187,7 @@ NotLeftEdge
EndLeftFall EndLeftFall
EndRightFall EndRightFall
NoLeftOrRight NoLeftOrRight
inc EndOfTheFallFlag ; after this is shouldn't fall inc EndOfTheFallFlag ; after this is shouldn't fall
EndOfFCycle EndOfFCycle
; draw tank on new position ; draw tank on new position
jsr DrawTankNr ; ew have TankNr in X (I hope :) ) jsr DrawTankNr ; ew have TankNr in X (I hope :) )
@@ -1247,7 +1247,7 @@ NoParachuteWeapon
beq ThereWasNoParachute beq ThereWasNoParachute
jsr DrawTankParachute jsr DrawTankParachute
ThereWasNoParachute ThereWasNoParachute
; ldx TankNr ; ldx TankNr
jsr PutTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) ) jsr PutTankNr ; redraw tank after erase parachute (exactly for redraw leaky schield :) )
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
rts rts
@@ -1267,7 +1267,7 @@ ThereWasNoParachute
sta pmgraph+$700,y sta pmgraph+$700,y
iny iny
bne @- bne @-
rts rts
.endp .endp
/* /*
@@ -1419,7 +1419,7 @@ ColumnIsReady
bcc FalloutOfLine bcc FalloutOfLine
beq FalloutOfLine beq FalloutOfLine
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
spl:rts ; exit if pressed 'Exit keys' spl:rts ; exit if pressed 'Exit keys'
lda IsEndOfTheFallFlag lda IsEndOfTheFallFlag
@@ -1539,7 +1539,7 @@ EndDrawing
rts rts
.endp .endp
/* /*
;-------------------------------------------------- ;--------------------------------------------------
.proc calculatemountains0 .proc calculatemountains0
; Only for testing - makes ground flat (0 pixels) ; Only for testing - makes ground flat (0 pixels)
@@ -1601,7 +1601,7 @@ NotHigher
sta temp ; opty possible sta temp ; opty possible
; substract address of the next text from previous to get text length ; substract address of the next text from previous to get text length
sbw temp LineAddress4x4 temp2 sbw temp LineAddress4x4 temp2
mva temp2 fx mva temp2 fx
;jsr Display4x4AboveTank ;jsr Display4x4AboveTank
;rts ;rts
@@ -1745,7 +1745,7 @@ DOTOldLowestValue
bne end_found bne end_found
dey dey
bne @- bne @-
end_found end_found
iny iny
sty fx sty fx
@@ -1797,21 +1797,21 @@ EndOfTypeLine4x4
;-------------------------------- ;--------------------------------
.proc AreYouSure .proc AreYouSure
;using 4x4 font ;using 4x4 font
mva #4 ResultY ; where seppuku text starts Y-wise on the screen mva #4 ResultY ; where seppuku text starts Y-wise on the screen
;top frame ;top frame
mva ResultY LineYdraw mva ResultY LineYdraw
jsr TL4x4_top jsr TL4x4_top
adb ResultY #4 ;next line adb ResultY #4 ;next line
;sure? ;sure?
mwa #areYouSureText LineAddress4x4 mwa #areYouSureText LineAddress4x4
jsr _sep_opty jsr _sep_opty
;bottom frame ;bottom frame
mva ResultY LineYdraw mva ResultY LineYdraw
jsr TL4x4_bottom jsr TL4x4_bottom
jsr GetKey jsr GetKey
cmp #@kbcode._Y ; $2b ; "Y" cmp #@kbcode._Y ; $2b ; "Y"
@@ -1821,14 +1821,14 @@ EndOfTypeLine4x4
@ mva #0 escFlag @ mva #0 escFlag
skip01 skip01
jsr WaitForKeyRelease jsr WaitForKeyRelease
;clean ;clean
mva #3 di mva #3 di
mva #4 ResultY mva #4 ResultY
@ @
mva #$ff plot4x4color mva #$ff plot4x4color
mwa #lineClear LineAddress4x4 mwa #lineClear LineAddress4x4
jsr _sep_opty jsr _sep_opty
dec di dec di
bne @- bne @-
@@ -1847,31 +1847,31 @@ quit_areyousure
;-------------------------------- ;--------------------------------
.proc DisplaySeppuku .proc DisplaySeppuku
;using 4x4 font ;using 4x4 font
mva #20 fs ; temp, how many times blink the billboard mva #20 fs ; temp, how many times blink the billboard
seppuku_loop seppuku_loop
lda CONSOL ; turbo mode lda CONSOL ; turbo mode
and #%00000001 ; START KEY and #%00000001 ; START KEY
sne:mva #1 fs ; finish it sne:mva #1 fs ; finish it
mva #4 ResultY ; where seppuku text starts Y-wise on the screen mva #4 ResultY ; where seppuku text starts Y-wise on the screen
;top frame ;top frame
mva ResultY LineYdraw mva ResultY LineYdraw
jsr TL4x4_top jsr TL4x4_top
adb ResultY #4 ;next line adb ResultY #4 ;next line
;seppuku ;seppuku
mwa #seppukuText LineAddress4x4 mwa #seppukuText LineAddress4x4
jsr _sep_opty jsr _sep_opty
;bottom frame ;bottom frame
mva ResultY LineYdraw mva ResultY LineYdraw
jsr TL4x4_bottom ; just go jsr TL4x4_bottom ; just go
;clean seppuku ;clean seppuku
mva #3 di mva #3 di
;mva #4 ResultY ;mva #4 ResultY
lda #4 lda #4
@@ -1879,7 +1879,7 @@ seppuku_loop
loplop ;@ loplop ;@
mwa #lineClear LineAddress4x4 mwa #lineClear LineAddress4x4
jsr _sep_opty jsr _sep_opty
dec di dec di
bne loplop ;@- bne loplop ;@-
@@ -1888,7 +1888,7 @@ loplop ;@
quit_seppuku quit_seppuku
rts rts
.endp .endp
; ------------------------------------- ; -------------------------------------
@@ -1909,7 +1909,7 @@ X lda XtanksTableL,x
;-------------------------------------------------- ;--------------------------------------------------
;vx calculation ;vx calculation
;vx = sin(90-Angle) for Angle <=90 ;vx = sin(90-Angle) for Angle <=90
;vx = -sin(Angle-90) for 90 < Angle <= 180 ;vx = -sin(Angle-90) for 90 < Angle <= 180
; erase previous barrel ; erase previous barrel
@@ -1918,7 +1918,7 @@ X lda XtanksTableL,x
; lda previousBarrelAngle,x ; lda previousBarrelAngle,x
; sta Angle ; sta Angle
; jsr DrawBarrelTech ; jsr DrawBarrelTech
; ;
; mva #1 color ; mva #1 color
ldx TankNr ldx TankNr
jsr SetupXYdraw jsr SetupXYdraw
@@ -1932,11 +1932,11 @@ X lda XtanksTableL,x
.proc DrawBarrelTech .proc DrawBarrelTech
; angle in Angle and A ; angle in Angle and A
mvx #0 goleft mvx #0 goleft
cmp #91 cmp #91
bcc angleUnder90 bcc angleUnder90
;over 90 ;over 90
sec sec
sbc #90 sbc #90
@@ -1953,8 +1953,8 @@ angleUnder90
tax tax
; barrel start offset under 90deg ; barrel start offset under 90deg
adw xdraw #3 xdraw adw xdraw #3 xdraw
@ @
sbw ydraw #3 ydraw sbw ydraw #3 ydraw
lda sintable,x ; cos(X) lda sintable,x ; cos(X)
sta vx sta vx
@@ -1967,7 +1967,7 @@ angleUnder90
lda Angle lda Angle
cmp #91 cmp #91
bcc YangleUnder90 bcc YangleUnder90
lda #180 lda #180
sec sec
sbc Angle sbc Angle
@@ -1984,14 +1984,14 @@ YangleUnder90
sta fy sta fy
; draw by vx vy ; draw by vx vy
; in each step ; in each step
; 1. plot(xdraw, ydraw) ; 1. plot(xdraw, ydraw)
; 2. add vx and vy to 3 byte variables xdraw.fx, ydraw.fy ; 2. add vx and vy to 3 byte variables xdraw.fx, ydraw.fy
; 3 check length, if shorter, go to 1. ; 3 check length, if shorter, go to 1.
; mva #6 yc ; barrel length ; mva #6 yc ; barrel length
barrelLoop barrelLoop
lda goleft lda goleft
bne goright bne goright
clc clc
@@ -2029,15 +2029,15 @@ ybarrel
sta ydraw sta ydraw
bcs @+ bcs @+
dec ydraw+1 dec ydraw+1
@ @
jsr plot ;.MakePlot jsr plot ;.MakePlot
dec yc dec yc
bne barrelLoop bne barrelLoop
mwa xdraw EndOfTheBarrelX mwa xdraw EndOfTheBarrelX
mva ydraw EndOfTheBarrelY mva ydraw EndOfTheBarrelY
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
+97 -111
View File
@@ -7,7 +7,7 @@
;--------------------------------------------------- ;---------------------------------------------------
.IFNDEF TARGET .IFNDEF TARGET
.def TARGET = 800 ; 5200 ; or 64 .def TARGET = 800 ; 5200
.ENDIF .ENDIF
;atari800 -5200 -cart ${outputFilePath} -cart-type 4 ;atari800 -5200 -cart ${outputFilePath} -cart-type 4
;atari800 -run ${outputFilePath} ;atari800 -run ${outputFilePath}
@@ -64,7 +64,7 @@ FirstZpageVariable = $57
.zpvar CreditsVScrol .byte .zpvar CreditsVScrol .byte
;--------------temps used in circle routine ;--------------temps used in circle routine
.zpvar xi .word ;X (word) in draw routine .zpvar xi .word ;X (word) in draw routine
.zpvar fx .byte .zpvar fx .byte
.zpvar yi .word ;Y (word) in draw routine .zpvar yi .word ;Y (word) in draw routine
.zpvar fy .byte .zpvar fy .byte
.zpvar xk .word .zpvar xk .word
@@ -77,7 +77,7 @@ FirstZpageVariable = $57
.zpvar dp .word .zpvar dp .word
;---------------------------- ;----------------------------
.zpvar UnderTank1 .byte .zpvar UnderTank1 .byte
.zpvar UnderTank2 .byte .zpvar UnderTank2 .byte
;---------------------------- ;----------------------------
.zpvar TestFlightFlag .byte ; For AI test flights ($ff - test, $00 - standard shoot flight) .zpvar TestFlightFlag .byte ; For AI test flights ($ff - test, $00 - standard shoot flight)
.zpvar weaponPointer .word .zpvar weaponPointer .word
@@ -131,7 +131,7 @@ FirstZpageVariable = $57
.zpvar escFlag .byte ; 7 bit - Exit game, 6 bit - Exit to GameOver (cleared - exit to Menu), 0 - nothing .zpvar escFlag .byte ; 7 bit - Exit game, 6 bit - Exit to GameOver (cleared - exit to Menu), 0 - nothing
.zpvar LineYdraw .byte .zpvar LineYdraw .byte
.zpvar LineXdraw .word .zpvar LineXdraw .word
.zpvar plot4x4color .byte ; $00 / $ff .zpvar plot4x4color .byte ; $00 / $ff
.zpvar Multiplier .word .zpvar Multiplier .word
.zpvar Multiplier_ .byte ; 3 bytes .zpvar Multiplier_ .byte ; 3 bytes
.zpvar HowToDraw .byte .zpvar HowToDraw .byte
@@ -152,11 +152,15 @@ FirstZpageVariable = $57
;----------------------------------------------- ;-----------------------------------------------
; libraries ; libraries
;----------------------------------------------- ;-----------------------------------------------
.IF TARGET = 5200 .IF TARGET = 800
icl 'Atari/lib/ATARISYS.ASM'
icl 'Atari/lib/MACRO.ASM'
icl 'artwork/splash_v2/splash.asm' ; splash screen and musix
.ELIF TARGET = 5200
OPT h-f+ ; no headers, single block --> cart bin file OPT h-f+ ; no headers, single block --> cart bin file
icl 'Atari/lib/5200SYS.ASM' icl 'Atari/lib/5200SYS.ASM'
icl 'Atari/lib/5200MACRO.ASM' icl 'Atari/lib/5200MACRO.ASM'
.enum @kbcode .enum @kbcode
/* /*
_0 _0
_1 _1
@@ -193,21 +197,17 @@ FirstZpageVariable = $57
_none = $0f _none = $0f
.ende .ende
.ELSE
icl 'Atari/lib/ATARISYS.ASM'
icl 'Atari/lib/MACRO.ASM'
icl 'artwork/splash_v2/splash.asm' ; splash screen and musix
.ENDIF .ENDIF
;----------------------------------------------- ;-----------------------------------------------
; variable declarations in RAM (no code) ; variable declarations in RAM (no code)
;----------------------------------------------- ;-----------------------------------------------
ORG PMGraph + $0300 - (variablesEnd - OneTimeZeroVariables + 1) ORG PMGraph + $0300 - (variablesEnd - OneTimeZeroVariables + 1)
icl 'variables.asm' icl 'variables.asm'
; Game loading address ; Game loading address
ORG $4000 ORG $4000
WeaponFont WeaponFont
ins 'artwork/weapons_AW6_mod.fnt' ; 'artwork/weapons.fnt' ins 'artwork/weapons_AW6_mod.fnt' ; 'artwork/weapons.fnt'
@@ -220,25 +220,25 @@ DisplayCopyStart
icl 'Atari/display_main_menu.asm' icl 'Atari/display_main_menu.asm'
DisplayCopyEnd DisplayCopyEnd
org DisplayCopyRom + (DisplayCopyEnd - DisplayCopyStart) org DisplayCopyRom + (DisplayCopyEnd - DisplayCopyStart)
DisplayCopyPurchaseDlROM = * DisplayCopyPurchaseDlROM = *
org DisplayCopyPurchase, DisplayCopyPurchaseDlROM org DisplayCopyPurchase, DisplayCopyPurchaseDlROM
DisplayCopyPurchaseStart DisplayCopyPurchaseStart
icl 'Atari/display_purchasedl.asm' icl 'Atari/display_purchasedl.asm'
DisplayCopyPurchaseEnd DisplayCopyPurchaseEnd
org DisplayCopyPurchaseDlROM + (DisplayCopyPurchaseEnd - DisplayCopyPurchaseStart) org DisplayCopyPurchaseDlROM + (DisplayCopyPurchaseEnd - DisplayCopyPurchaseStart)
StatusBufferROM = * StatusBufferROM = *
org StatusBufferCopy, StatusBufferROM org StatusBufferCopy, StatusBufferROM
StatusBufferCopyStart StatusBufferCopyStart
icl 'Atari/display_status.asm' icl 'Atari/display_status.asm'
StatusBufferCopyEnd StatusBufferCopyEnd
org StatusBufferROM + (StatusBufferCopyEnd - StatusBufferCopyStart) org StatusBufferROM + (StatusBufferCopyEnd - StatusBufferCopyStart)
icl 'Atari/display_static.asm' icl 'Atari/display_static.asm'
;---------------------------------------------- ;----------------------------------------------
;-------------------------------------------------- ;--------------------------------------------------
; Game Code ; Game Code
;-------------------------------------------------- ;--------------------------------------------------
@@ -246,16 +246,11 @@ FirstSTART
.IF TARGET = 5200 .IF TARGET = 5200
; start in 5200 diagnostic mode ; start in 5200 diagnostic mode
; move original startup procedure to RAM ; move original startup procedure to RAM
Modified5200Splash = $2100 ; apparently there is some free space here Modified5200Splash = $2100 ; apparently there is some free space here
; 6502 initialization
; SEI
; CLD
; LDX #$FF
; TXS
; check kernel version ; check kernel version
Atari5200KernelByte = $fff8 Atari5200KernelByte = $fff8
; $32 - 4 joy ; $32 - 4 joy
; $00 - 2 joy ; $00 - 2 joy
; $ff - Altirra kernel ; $ff - Altirra kernel
@@ -276,11 +271,11 @@ rom2joy
@ @
mwa $fffc temp ; startup proc address mwa $fffc temp ; startup proc address
mwa #Modified5200Splash temp2 mwa #Modified5200Splash temp2
jsr CopyFromROM jsr CopyFromROM
; modify the end of the splash procedure ; modify the end of the splash procedure
lda #$60 ; rts lda #$60 ; rts
sta (temp2),y sta (temp2),y
jsr Modified5200Splash+$0f ; after the diag cart detection jsr Modified5200Splash+$0f ; after the diag cart detection
; modify the text ; modify the text
splash_text = $3c80 ; '.scorch.supersystem.copyright.19xx.atari' splash_text = $3c80 ; '.scorch.supersystem.copyright.19xx.atari'
@@ -290,12 +285,12 @@ rom2joy
@ lda NewSplashText,y @ lda NewSplashText,y
sta splash_copyright,y sta splash_copyright,y
dey dey
bpl @- bpl @-
; splash screen delay. maybe add fire to speed up? ; splash screen delay. maybe add fire to speed up?
@ cpx RTCLOK+1 @ cpx RTCLOK+1
bne @- bne @-
no5200splash no5200splash
.ENDIF .ENDIF
jsr MakeDarkScreen jsr MakeDarkScreen
@@ -305,13 +300,13 @@ no5200splash
@ sta OneTimeZeroVariables,y @ sta OneTimeZeroVariables,y
dey dey
bpl @- bpl @-
; one time zero variables in RAM (zero page) ; one time zero variables in RAM (zero page)
ldy #FirstZpageVariable ldy #FirstZpageVariable
@ sta $0000,y @ sta $0000,y
iny iny
bne @- bne @-
; initialize variables in RAM (non zero page) ; initialize variables in RAM (non zero page)
ldy #initialvaluesCount-1 ldy #initialvaluesCount-1
@ lda initialvaluesStart,y @ lda initialvaluesStart,y
@@ -327,41 +322,32 @@ no5200splash
jsr GenerateLineTable jsr GenerateLineTable
.IF TARGET = 800 .IF TARGET = 800
; pokeys init
; pokeys init lda #3 ; stereo
lda #3 ; stereo sta POKEY+$0f ; stereo
sta POKEY+$0f ; stereo sta POKEY+$1f ; stereo
sta POKEY+$1f ; stereo
lda PAL
lda PAL and #%00001110
and #%00001110 bne NoRMT_PALchange
bne NoRMT_PALchange ;it is PAL here
;it is PAL here ; Change RMT to PAL version
; Change RMT to PAL version ; 5 values in RMT file
; 5 values in RMT file ; not elegant :(
; not elegant :( mva #$06 MODUL-6+$967 ; $07 > $06
mva #$06 MODUL-6+$967 ; $07 > $06 sta MODUL-6+$bc3 ; $07 > $06
;mva #$06 MODUL-6+$bc3 ; $07 > $06 sta MODUL-6+$e69 ; $08 > $06
;mva #$06 MODUL-6+$e69 ; $08 > $06 sta MODUL-6+$ebc ; $08 > $06
;mva #$06 MODUL-6+$ebc ; $08 > $06 mva #$10 MODUL-6+$a69 ; $12 > $10
sta MODUL-6+$bc3 ; $07 > $06 mva #$04 MODUL-6+$bf8 ; $05 > $04
sta MODUL-6+$e69 ; $08 > $06 mva #$08 MODUL-6+$e3d ; $0a > $08
sta MODUL-6+$ebc ; $08 > $06
mva #$10 MODUL-6+$a69 ; $12 > $10 ; and mountains colors table address
mva #$04 MODUL-6+$bf8 ; $05 > $04 mva #<dliColorsFore2PAL GradientAddrL+2
mva #$08 MODUL-6+$e3d ; $0a > $08 mva #>dliColorsFore2PAL GradientAddrH+2
; and mountains colors table address
mva #<dliColorsFore2PAL GradientAddrL+2
mva #>dliColorsFore2PAL GradientAddrH+2
; mva #$c4 dliColorsFore2+16
; mva #$c6 dliColorsFore2+17
; mva #$a4 dliColorsFore2+18
; mva #$a6 dliColorsFore2+19
; sta dliColorsFore2+20
NoRMT_PALchange NoRMT_PALchange
.ELSE .ELIF TARGET = 5200
mva #$7f SkStatSimulator mva #$7f SkStatSimulator
.ENDIF .ENDIF
@@ -380,7 +366,7 @@ NoRMT_PALchange
mwa #kb_continue VKEYCNT ;Keyboard handler mwa #kb_continue VKEYCNT ;Keyboard handler
.ENDIF .ENDIF
VMAIN VBLinterrupt,7 ;jsr SetVBL VMAIN VBLinterrupt,7 ;jsr SetVBL
mva #2 chactl ; necessary for 5200 mva #2 chactl ; necessary for 5200
;-------------------------------------------------- ;--------------------------------------------------
@@ -388,7 +374,7 @@ NoRMT_PALchange
icl 'game.asm' icl 'game.asm'
;-------------------------------------------------- ;--------------------------------------------------
;-------------------------------------------------- ;--------------------------------------------------
.proc GetKey .proc GetKey
; waits for pressing a key and returns pressed value in A ; waits for pressing a key and returns pressed value in A
@@ -396,26 +382,26 @@ NoRMT_PALchange
; result: A=keycode ; result: A=keycode
;-------------------------------------------------- ;--------------------------------------------------
jsr WaitForKeyRelease jsr WaitForKeyRelease
@ getKeyAfterWait
.IF TARGET = 800 .IF TARGET = 800
lda SKSTAT lda SKSTAT
cmp #$ff cmp #$ff
beq checkJoyGetKey ; key not pressed, check Joy beq checkJoyGetKey ; key not pressed, check Joy
cmp #$f7 ; SHIFT cmp #$f7 ; SHIFT
beq checkJoyGetKey beq checkJoyGetKey
.ELSE .ELIF TARGET = 5200
lda SkStatSimulator lda SkStatSimulator
and #%11111110 and #%11111110
bne checkJoyGetKey ; key not pressed, check Joy bne checkJoyGetKey ; key not pressed, check Joy
.ENDIF .ENDIF
lda kbcode lda kbcode
cmp #@kbcode._none cmp #@kbcode._none
beq checkJoyGetKey beq checkJoyGetKey
and #$3f ;CTRL and SHIFT ellimination and #$3f ;CTRL and SHIFT ellimination
cmp #@kbcode._esc ; 28 ; ESC cmp #@kbcode._esc ; 28 ; ESC
bne getkeyend bne getkeyend
mvy #$80 escFlag mvy #$80 escFlag
bne getkeyend bne getkeyend
checkJoyGetKey checkJoyGetKey
;------------JOY------------- ;------------JOY-------------
@@ -425,7 +411,7 @@ checkJoyGetKey
and #$0f and #$0f
cmp #$0f cmp #$0f
beq notpressedJoyGetKey beq notpressedJoyGetKey
tay tay
lda joyToKeyTable,y lda joyToKeyTable,y
bne getkeyend bne getkeyend
@@ -434,26 +420,26 @@ notpressedJoyGetKey
lda STRIG0 lda STRIG0
beq JoyButton beq JoyButton
.IF TARGET = 800 ; Select and Option key only on A800 .IF TARGET = 800 ; Select and Option key only on A800
bne checkSelectKey bne checkSelectKey
checkSelectKey checkSelectKey
lda CONSOL lda CONSOL
and #%00000010 ; Select and #%00000010 ; Select
beq SelectPressed beq SelectPressed
lda CONSOL lda CONSOL
and #%00000100 ; Option and #%00000100 ; Option
.ENDIF .ENDIF
bne @- bne getKeyAfterWait
OptionPressed OptionPressed
lda #@kbcode._atari ; Option key lda #@kbcode._atari ; Option key
bne getkeyend bne getkeyend
SelectPressed SelectPressed
lda #@kbcode._tab ; Select key lda #@kbcode._tab ; Select key
bne getkeyend bne getkeyend
JoyButton JoyButton
lda #@kbcode._ret ;Return key lda #@kbcode._ret ;Return key
getkeyend getkeyend
ldy #0 ldy #0
sty ATRACT ; reset atract mode sty ATRACT ; reset atract mode
mvy #sfx_keyclick sfx_effect mvy #sfx_keyclick sfx_effect
rts rts
.endp .endp
@@ -461,7 +447,7 @@ getkeyend
;-------------------------------------------------- ;--------------------------------------------------
.proc getkeynowait .proc getkeynowait
;-------------------------------------------------- ;--------------------------------------------------
jsr WaitForKeyRelease jsr WaitForKeyRelease
lda kbcode lda kbcode
and #$3f ;CTRL and SHIFT ellimination and #$3f ;CTRL and SHIFT ellimination
rts rts
@@ -471,7 +457,7 @@ getkeyend
.proc WaitForKeyRelease .proc WaitForKeyRelease
;-------------------------------------------------- ;--------------------------------------------------
mva #128-KeyRepeatSpeed pressTimer ; tricky mva #128-KeyRepeatSpeed pressTimer ; tricky
StillWait StillWait
bit pressTimer bit pressTimer
bmi KeyReleased bmi KeyReleased
lda STICK0 lda STICK0
@@ -488,10 +474,10 @@ StillWait
and #%00000110 ; Select and Option only and #%00000110 ; Select and Option only
cmp #%00000110 cmp #%00000110
bne StillWait bne StillWait
.ELSE .ELIF TARGET = 5200
lda SkStatSimulator lda SkStatSimulator
and #%11111110 and #%11111110
beq StillWait beq StillWait
.ENDIF .ENDIF
KeyReleased KeyReleased
rts rts
@@ -745,19 +731,21 @@ EndofBFGDLI
.ERROR 'Code and data too long' .ERROR 'Code and data too long'
.ENDIF .ENDIF
.ECHO "Bytes left: ",$b000-* .ECHO "Bytes left: ",$b000-*
org $b000 ;address of RMT module org $b000 ;address of RMT module
MODUL MODUL
;RMT module is standard Atari binary file already ;RMT module is standard Atari binary file already
ins "artwork/sfx/scorch_str9-NTSC.rmt",+6 ;include music RMT module ins "artwork/sfx/scorch_str9-NTSC.rmt",+6 ;include music RMT module
MODULEND MODULEND
;---------------------------------------------- ;----------------------------------------------
icl 'constants_top.asm' icl 'constants_top.asm'
;---------------------------------------------- ;----------------------------------------------
.ECHO "Bytes on top left: ",$bfe8-* ;ROM_SETTINGS-* .ECHO "Bytes on top left: ",$bfe8-* ;ROM_SETTINGS-*
.IF target = 5200 .IF TARGET = 800
run FirstSTART
.ELIF TARGET = 5200
.IF * > ROM_SETTINGS-1 .IF * > ROM_SETTINGS-1
.ERROR 'Code and RMT song too long to fit in 5200' .ERROR 'Code and RMT song too long to fit in 5200'
.ENDIF .ENDIF
@@ -766,6 +754,4 @@ MODULEND
.byte " scorch supersystem " ;20 characters title .byte " scorch supersystem " ;20 characters title
.byte " ", $ff ;$BFFD == $ff means diagnostic cart, no splash screen .byte " ", $ff ;$BFFD == $ff means diagnostic cart, no splash screen
.word FirstSTART .word FirstSTART
.ELSE
run FirstSTART
.ENDIF .ENDIF
+16 -17
View File
@@ -20,8 +20,8 @@
org $801 org $801
org [a($801)],$801 org [a($801)],$801
basic_start(FirstSTART) basic_start(FirstSTART)
;--------------------------------------------------- ;---------------------------------------------------
.macro build .macro build
dta d"1.28" ; number of this build (4 bytes) dta d"1.28" ; number of this build (4 bytes)
@@ -64,7 +64,7 @@ FirstZpageVariable = $58 ; $57
.zpvar CreditsVScrol .byte .zpvar CreditsVScrol .byte
;--------------temps used in circle routine ;--------------temps used in circle routine
.zpvar xi .word ;X (word) in draw routine .zpvar xi .word ;X (word) in draw routine
.zpvar fx .byte .zpvar fx .byte
.zpvar yi .word ;Y (word) in draw routine .zpvar yi .word ;Y (word) in draw routine
.zpvar fy .byte .zpvar fy .byte
.zpvar xk .word .zpvar xk .word
@@ -77,7 +77,7 @@ FirstZpageVariable = $58 ; $57
.zpvar dp .word .zpvar dp .word
;---------------------------- ;----------------------------
.zpvar UnderTank1 .byte .zpvar UnderTank1 .byte
.zpvar UnderTank2 .byte .zpvar UnderTank2 .byte
;---------------------------- ;----------------------------
.zpvar TestFlightFlag .byte ; For AI test flights ($ff - test, $00 - standard shoot flight) .zpvar TestFlightFlag .byte ; For AI test flights ($ff - test, $00 - standard shoot flight)
.zpvar weaponPointer .word .zpvar weaponPointer .word
@@ -131,7 +131,7 @@ FirstZpageVariable = $58 ; $57
.zpvar escFlag .byte ; 7 bit - Exit game, 6 bit - Exit to GameOver (cleared - exit to Menu), 0 - nothing .zpvar escFlag .byte ; 7 bit - Exit game, 6 bit - Exit to GameOver (cleared - exit to Menu), 0 - nothing
.zpvar LineYdraw .byte .zpvar LineYdraw .byte
.zpvar LineXdraw .word .zpvar LineXdraw .word
.zpvar plot4x4color .byte ; $00 / $ff .zpvar plot4x4color .byte ; $00 / $ff
.zpvar Multiplier .word .zpvar Multiplier .word
.zpvar Multiplier_ .byte ; 3 bytes .zpvar Multiplier_ .byte ; 3 bytes
.zpvar HowToDraw .byte .zpvar HowToDraw .byte
@@ -155,19 +155,19 @@ FirstZpageVariable = $58 ; $57
icl 'C64/lib/C64_ATARISYS.ASM' icl 'C64/lib/C64_ATARISYS.ASM'
icl 'C64/lib/C64SYS.ASM' icl 'C64/lib/C64SYS.ASM'
icl 'C64/lib/MACRO.ASM' icl 'C64/lib/MACRO.ASM'
;----------------------------------------------- ;-----------------------------------------------
; variable declarations in RAM (no code) ; variable declarations in RAM (no code)
;----------------------------------------------- ;-----------------------------------------------
; Game loading address ; Game loading address
ORG $4100 ORG $4100
icl 'variables.asm' icl 'variables.asm'
WeaponFont WeaponFont
ins 'artwork/weapons_AW6_mod.fnt' ; 'artwork/weapons.fnt' ins 'artwork/weapons_AW6_mod.fnt' ; 'artwork/weapons.fnt'
;-------------------------------------------------- ;--------------------------------------------------
; Game Code ; Game Code
;-------------------------------------------------- ;--------------------------------------------------
@@ -199,22 +199,22 @@ FirstSTART
; from here on NMI is disabled ; from here on NMI is disabled
jsr MakeDarkScreen jsr MakeDarkScreen
; one time zero variables in RAM (non zero page) ; one time zero variables in RAM (non zero page)
lda #0 lda #0
ldy #OneTimeZeroVariablesCount-1 ldy #OneTimeZeroVariablesCount-1
@ sta OneTimeZeroVariables,y @ sta OneTimeZeroVariables,y
dey dey
bpl @- bpl @-
; one time zero variables in RAM (zero page) ; one time zero variables in RAM (zero page)
ldy #FirstZpageVariable ldy #FirstZpageVariable
@ sta $0000,y @ sta $0000,y
iny iny
bne @- bne @-
; initialize variables in RAM (non zero page) ; initialize variables in RAM (non zero page)
ldy #initialvaluesCount-1 ldy #initialvaluesCount-1
@ lda initialvaluesStart,y @ lda initialvaluesStart,y
@@ -235,7 +235,7 @@ FirstSTART
icl 'game.asm' icl 'game.asm'
;-------------------------------------------------- ;--------------------------------------------------
;-------------------------------------------------- ;--------------------------------------------------
.proc GetKey .proc GetKey
; waits for pressing a key and returns pressed value in A ; waits for pressing a key and returns pressed value in A
@@ -252,7 +252,7 @@ FirstSTART
;-------------------------------------------------- ;--------------------------------------------------
.proc getkeynowait .proc getkeynowait
;-------------------------------------------------- ;--------------------------------------------------
jsr WaitForKeyRelease jsr WaitForKeyRelease
lda kbcode lda kbcode
and #$3f ;CTRL and SHIFT ellimination and #$3f ;CTRL and SHIFT ellimination
rts rts
@@ -361,7 +361,7 @@ noShellDelay
icl 'C64/textproc.asm' icl 'C64/textproc.asm'
;---------------------------------------------- ;----------------------------------------------
icl 'grafproc.asm' icl 'grafproc.asm'
icl 'C64/gr_basics.asm' icl 'C64/gr_basics.asm'
;---------------------------------------------- ;----------------------------------------------
icl 'weapons.asm' icl 'weapons.asm'
;---------------------------------------------- ;----------------------------------------------
@@ -442,4 +442,3 @@ NMI
INC $D020 ; change border colour, indication for a NMI INC $D020 ; change border colour, indication for a NMI
RTI ; exit interrupt RTI ; exit interrupt
; (not acknowledged!) ; (not acknowledged!)
-11712
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -55,9 +55,9 @@ StatusBufferCopy
variablesStart ; zeroing starts here variablesStart ; zeroing starts here
;===================================================== ;=====================================================
;isInventory .ds 1 ; 0 - purchase, $ff - inventory ;isInventory .ds 1 ; 0 - purchase, $ff - inventory
;-------------- ;--------------
drawFunction .ds 1 ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V) drawFunction .ds 1 ; 0 - plot, %10000000 - LineLength (N), %01000000 - DrawCheck (V)
;-------------- ;--------------
noDeathCounter .ds 1 noDeathCounter .ds 1
;-------------- ;--------------
OptionsY .ds 1 ;vertical position of cursor on Options screen OptionsY .ds 1 ;vertical position of cursor on Options screen
@@ -125,9 +125,9 @@ BarrelLength ;length of the tank barrel - dont forget to set it to 6 at round st
.DS MaxPlayers .DS MaxPlayers
ActiveWeapon ;number of the selected weapon ActiveWeapon ;number of the selected weapon
.DS MaxPlayers .DS MaxPlayers
ActiveDefenceWeapon ;number of the activated defence weapon - 0 ActiveDefenceWeapon ;number of the activated defence weapon - 0
.DS MaxPlayers .DS MaxPlayers
AutoDefenseFlag ; 0 - not activated, >$7f - activated AutoDefenseFlag ; 0 - not activated, >$7f - activated
.DS MaxPlayers .DS MaxPlayers
WeaponDepleted .DS 1 ; if 0 deactivate the weapon and switch to Baby Missile WeaponDepleted .DS 1 ; if 0 deactivate the weapon and switch to Baby Missile
;---------------------------------------------------- ;----------------------------------------------------
@@ -301,7 +301,7 @@ HowManyOnTheListDef
.DS 1 .DS 1
;PositionOnTheList ; pointer position on the list being displayed ;PositionOnTheList ; pointer position on the list being displayed
; .DS 1 ; .DS 1
LastWeapon LastWeapon
; number of the last previously purchased weapon ; number of the last previously purchased weapon
; it is necessary when after purchase some weapon ; it is necessary when after purchase some weapon
; is removed from the list (because too expensive) ; is removed from the list (because too expensive)
@@ -361,9 +361,9 @@ TankTempY
;-------------- single round variables -------------- ;-------------- single round variables --------------
;---------------------------------------------------- ;----------------------------------------------------
singleRoundVars singleRoundVars
;-------------- ;--------------
;escFlag .ds 1 ; 0 - Esc or O not pressed, $80 - Esc pressed, $40 - O pressed ;escFlag .ds 1 ; 0 - Esc or O not pressed, $80 - Esc pressed, $40 - O pressed
;-------------- ;--------------
CurrentResult CurrentResult
.DS 1 .DS 1
;-------------- ;--------------
+104 -105
View File
@@ -22,7 +22,7 @@
pha pha
rts rts
ExplosionRoutines ExplosionRoutines
.word babymissile-1 ;Baby_Missile ;_00 .word babymissile-1 ;Baby_Missile ;_00
.word missile-1 ;Missile ;_01 .word missile-1 ;Missile ;_01
.word babynuke-1 ;Baby_Nuke ;_02 .word babynuke-1 ;Baby_Nuke ;_02
.word nuke-1 ;Nuke ;_03 .word nuke-1 ;Nuke ;_03
@@ -60,7 +60,7 @@ tracer
rts rts
.endp .endp
.proc BFG .proc BFG
mva #sfx_plasma_2_2 sfx_effect mva #sfx_plasma_2_2 sfx_effect
jsr BFGblink jsr BFGblink
; Kill all :) ; Kill all :)
ldx NumberOfPlayers ldx NumberOfPlayers
@@ -79,7 +79,7 @@ CheckNextTankBFG
.proc babymissile .proc babymissile
mva #11 ExplosionRadius mva #11 ExplosionRadius
GoBabyMissileSFX GoBabyMissileSFX
mva #sfx_baby_missile sfx_effect mva #sfx_baby_missile sfx_effect
GoXmissile GoXmissile
jmp xmissile jmp xmissile
.endp .endp
@@ -106,12 +106,12 @@ GoBabyNukeSFX
; ------------------------ ; ------------------------
.proc leapfrog .proc leapfrog
mva #17 ExplosionRadius mva #17 ExplosionRadius
; mva #sfx_baby_missile sfx_effect ; mva #sfx_baby_missile sfx_effect
; jsr xmissile ; jsr xmissile
jsr babymissile.GoBabyMissileSFX jsr babymissile.GoBabyMissileSFX
jsr SecondRepeat jsr SecondRepeat
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
@@ -150,7 +150,7 @@ EndOfLeapping
mva #21 ExplosionRadius mva #21 ExplosionRadius
jsr CalculateExplosionRange0 jsr CalculateExplosionRange0
jsr xmissile.NoRangeCalc jsr xmissile.NoRangeCalc
jsr SoilDown2 jsr SoilDown2
; ;
jsr cleartanks ; maybe not? jsr cleartanks ; maybe not?
@@ -208,10 +208,10 @@ NoWallsInFunky
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
jsr GoXmissileWithSaveXYdraw jsr GoXmissileWithSaveXYdraw
sbw xdraw #34 sbw xdraw #34
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
jsr GoXmissileWithSaveXYdraw jsr GoXmissileWithSaveXYdraw
adw xdraw #68 adw xdraw #68
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
jsr GoXmissileWithSaveXYdraw jsr GoXmissileWithSaveXYdraw
sbw xdraw #34 sbw xdraw #34
; ;
@@ -219,14 +219,14 @@ NoWallsInFunky
;jsr CalculateExplosionRange ;jsr CalculateExplosionRange
cpw ydraw #screenHeight cpw ydraw #screenHeight
bcs NoUpperCircle bcs NoUpperCircle
mva #sfx_nuke sfx_effect mva #sfx_nuke sfx_effect
jsr GoXmissileWithSaveXYdraw jsr GoXmissileWithSaveXYdraw
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
jsr GoXmissileWithSaveXYdraw jsr GoXmissileWithSaveXYdraw
NoLowerCircle NoLowerCircle
mva #sfx_silencer sfx_effect mva #sfx_silencer sfx_effect
@@ -258,7 +258,7 @@ GoXmissileWithSaveXYdraw
; ;
mwa xdraw xcircle ; store hitpoint for future repeats mwa xdraw xcircle ; store hitpoint for future repeats
ldy #30 ; repeat 30 times ldy #30 ; repeat 30 times
sty magic sty magic
RepeatNapalm ; external loop (for fire animation) RepeatNapalm ; external loop (for fire animation)
mwa xcircle xdraw mwa xcircle xdraw
sbw xdraw #(napalmRadius) ; 10 pixels on left side hit point sbw xdraw #(napalmRadius) ; 10 pixels on left side hit point
@@ -280,7 +280,7 @@ RepeatFlame ; internal loop (draw flames)
tya tya
sec sec
sbc ydraw sbc ydraw
sta ydraw sta ydraw
sbw xdraw #4 ; half character correction sbw xdraw #4 ; half character correction
; draw flame symbol ; draw flame symbol
lda magic ; if last repeat - clear flames lda magic ; if last repeat - clear flames
@@ -288,7 +288,7 @@ RepeatFlame ; internal loop (draw flames)
lda random lda random
and #%00000110 and #%00000110
clc clc
adc #char_flame adc #char_flame
bne PutFlameChar bne PutFlameChar
LastNapalmRepeat LastNapalmRepeat
lda #char_clear_flame ; clear flame symbol lda #char_clear_flame ; clear flame symbol
@@ -312,7 +312,7 @@ CharOffTheScreen
jne RepeatFlame jne RepeatFlame
dec magic dec magic
jpl RepeatNapalm jpl RepeatNapalm
; after napalm ; after napalm
;now we must check tanks in range ;now we must check tanks in range
ldx NumberOfPlayers ldx NumberOfPlayers
dex dex
@@ -536,7 +536,7 @@ DiggerCharacter
lda random lda random
and #$06 and #$06
clc clc
adc #char_digger adc #char_digger
adc sandhogflag adc sandhogflag
sta CharCode sta CharCode
cpw xdraw #(screenwidth-6) cpw xdraw #(screenwidth-6)
@@ -619,7 +619,7 @@ RepeatFill
ldy #0 ldy #0
lda (tempXROLLER),y lda (tempXROLLER),y
sta HeightRol ; relative point sta HeightRol ; relative point
RollinContinuesLiquid RollinContinuesLiquid
; new point is set ; new point is set
adw xdraw #mountaintable tempXROLLER adw xdraw #mountaintable tempXROLLER
@@ -684,19 +684,19 @@ ToHighFill
ldx TankNr ldx TankNr
lda AngleTable,x lda AngleTable,x
tay tay
mwa EndOfTheBarrelX xbyte mwa EndOfTheBarrelX xbyte
mva EndOfTheBarrelY ybyte mva EndOfTheBarrelY ybyte
mva #0 ybyte+1 mva #0 ybyte+1
sta LaserFlag ; turn on gravity and wind after shot :) sta LaserFlag ; turn on gravity and wind after shot :)
mwa xdraw LaserCoordinate mwa xdraw LaserCoordinate
mwa ydraw LaserCoordinate+2 mwa ydraw LaserCoordinate+2
mwa xbyte LaserCoordinate+4 mwa xbyte LaserCoordinate+4
mwa ybyte LaserCoordinate+6 mwa ybyte LaserCoordinate+6
mva #sfx_lightning sfx_effect mva #sfx_lightning sfx_effect
mva #%10000000 drawFunction mva #%10000000 drawFunction
;the above switches Draw to measuring length ;the above switches Draw to measuring length
jsr draw jsr draw
@@ -723,7 +723,7 @@ ToHighFill
dec yc dec yc
bne @- bne @-
mva #1 color mva #1 color
mwa LaserCoordinate xdraw mwa LaserCoordinate xdraw
mwa LaserCoordinate+2 ydraw mwa LaserCoordinate+2 ydraw
@@ -764,7 +764,7 @@ ExplosionLoop2
bcc ExplosionLoop2 bcc ExplosionLoop2
mva #1 color mva #1 color
;check tanks' distance from the centre of the explosion ;check tanks' distance from the centre of the explosion
mva #%10000000 drawFunction mva #%10000000 drawFunction
@@ -830,10 +830,10 @@ UseShieldWithEnergy
cpy #0 ; is necessary to reduce tenk energy ? cpy #0 ; is necessary to reduce tenk energy ?
beq ShieldCoveredTank beq ShieldCoveredTank
jsr DecreaseEnergyX jsr DecreaseEnergyX
ShieldCoveredTank ShieldCoveredTank
lda ShieldEnergy,x lda ShieldEnergy,x
jne EndOfDistanceCheckLoop jne EndOfDistanceCheckLoop
ShieldEnergy0 ; deactivate if no energy. it's like use one hit shield :) ShieldEnergy0 ; deactivate if no energy. it's like use one hit shield :)
UseShield UseShield
lda TankNr lda TankNr
pha ; store TankNr pha ; store TankNr
@@ -1007,7 +1007,7 @@ DirectionChecked
; -------------------------------------------------- ; --------------------------------------------------
; makes dirt on xdraw,ydraw position and of ExplosionRadius height ; makes dirt on xdraw,ydraw position and of ExplosionRadius height
mva #sfx_dirt_chrg_s sfx_effect mva #sfx_dirt_chrg_s sfx_effect
mva #1 color mva #1 color
NoColor ; jump here with color=0 to clean dirt NoColor ; jump here with color=0 to clean dirt
mwa xdraw xcircle mwa xdraw xcircle
@@ -1098,10 +1098,10 @@ ContinueToCheckMaxForce2
; $f3 - shift+key ; $f3 - shift+key
notpressed notpressed
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
spl:rts ; exit if pressed 'Exit keys' spl:rts ; exit if pressed 'Exit keys'
ldx TankNr ; for optimize ldx TankNr ; for optimize
; Select and Option ; Select and Option
lda CONSOL lda CONSOL
tay tay
@@ -1127,7 +1127,7 @@ callActivation
jsr DefensivesActivate jsr DefensivesActivate
jmp afterInventory jmp afterInventory
@ @
cmp #@kbcode._I ; $0d ; I cmp #@kbcode._I ; $0d ; I
bne @+ bne @+
callInventory callInventory
@@ -1137,9 +1137,9 @@ callInventory
mva #$ff isInventory mva #$ff isInventory
jsr Purchase jsr Purchase
afterInventory afterInventory
jsr MakeDarkScreen jsr MakeDarkScreen
jsr DisplayStatus jsr DisplayStatus
jsr SetMainScreen jsr SetMainScreen
jsr DrawTanks jsr DrawTanks
;jsr WaitOneFrame ; not necessary ;jsr WaitOneFrame ; not necessary
bit LazyFlag bit LazyFlag
@@ -1152,7 +1152,7 @@ NoLazy
NoSpyHard NoSpyHard
RmtSong song_ingame RmtSong song_ingame
mva #0 escFlag mva #0 escFlag
jmp ReleaseAndLoop jmp ReleaseAndLoop
@ @
cmp #$80|@kbcode._up cmp #$80|@kbcode._up
jeq CTRLPressedUp jeq CTRLPressedUp
@@ -1163,13 +1163,13 @@ NoSpyHard
jumpFromStick jumpFromStick
.IF TARGET = 800 .IF TARGET = 800
cmp #$80|17 ; Ctrl+Help cmp #$80|17 ; Ctrl+Help
bne NoVdebugSwitch bne NoVdebugSwitch
lda Vdebug lda Vdebug
eor #$ff eor #$ff
sta Vdebug sta Vdebug
jmp ReleaseAndLoop jmp ReleaseAndLoop
NoVdebugSwitch NoVdebugSwitch
.ENDIF .ENDIF
and #$3f ;CTRL and SHIFT ellimination and #$3f ;CTRL and SHIFT ellimination
cmp #@kbcode._up ; $e cmp #@kbcode._up ; $e
@@ -1189,10 +1189,10 @@ NoVdebugSwitch
cmp #@kbcode._S ; $3e ; S cmp #@kbcode._S ; $3e ; S
jeq pressedS jeq pressedS
.IF TARGET = 800 .IF TARGET = 800
cmp #61 ; G cmp #61 ; G
bne EndKeys bne EndKeys
jsr SelectNextGradient.NotWind jsr SelectNextGradient.NotWind
jmp ReleaseAndLoop jmp ReleaseAndLoop
.ENDIF .ENDIF
EndKeys EndKeys
jmp notpressed jmp notpressed
@@ -1205,7 +1205,7 @@ checkJoy
cmp #$0f cmp #$0f
beq notpressedJoy beq notpressedJoy
tay tay
mva #0 ATRACT ; reset atract mode mva #0 ATRACT ; reset atract mode
lda joyToKeyTable,y lda joyToKeyTable,y
jmp jumpFromStick jmp jumpFromStick
notpressedJoy notpressedJoy
@@ -1221,14 +1221,14 @@ pressedUp
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
bcs CTRLPressedUp bcs CTRLPressedUp
;force increaseeee! ;force increaseeee!
;ldx TankNr ; optimized ;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
@@ -1305,7 +1305,7 @@ pressedRight
mva #1 Erase mva #1 Erase
jsr DrawTankNr.BarrelChange jsr DrawTankNr.BarrelChange
dec:lda AngleTable,x dec:lda AngleTable,x
cmp #255 ; -1 cmp #255 ; -1
jne BeforeFire jne BeforeFire
lda #180 lda #180
sta AngleTable,x sta AngleTable,x
@@ -1325,7 +1325,7 @@ CTRLPressedRight
lda #180 lda #180
sta AngleTable,x sta AngleTable,x
jmp BeforeFire jmp BeforeFire
pressedLeft pressedLeft
;ldx TankNr ; optimized ;ldx TankNr ; optimized
@@ -1369,7 +1369,7 @@ pressedTAB
lda #first_offensive ; #0 lda #first_offensive ; #0
sta ActiveWeapon,x sta ActiveWeapon,x
beq @+ ; allways = 0 beq @+ ; allways = 0
?notlasttofirst ?notlasttofirst
inc ActiveWeapon,x inc ActiveWeapon,x
@ @
lda ActiveWeapon,x lda ActiveWeapon,x
@@ -1413,7 +1413,7 @@ pressedSpace
;================================= ;=================================
;we shoot here!!! ;we shoot here!!!
lda #0 lda #0
sta ATRACT ; reset atract mode sta ATRACT ; reset atract mode
sta pressTimer ; reset sta pressTimer ; reset
jsr WaitForKeyRelease.StillWait jsr WaitForKeyRelease.StillWait
lda pressTimer lda pressTimer
@@ -1447,7 +1447,7 @@ RandomizeOffensiveText
ldy TankNr ldy TankNr
mva #$ff plot4x4color mva #$ff plot4x4color
jsr DisplayOffensiveTextNr jsr DisplayOffensiveTextNr
AfterOffensiveText AfterOffensiveText
mva #0 LaserFlag ; $ff - Laser mva #0 LaserFlag ; $ff - Laser
ldx TankNr ldx TankNr
@@ -1477,7 +1477,7 @@ AfterStrongShoot
; to start where the tank's barrel ends ; to start where the tank's barrel ends
; (without it bullet would go from the left lower corner of the tank) ; (without it bullet would go from the left lower corner of the tank)
;ldx TankNr ;ldx TankNr
mwa EndOfTheBarrelX xtraj+1 mwa EndOfTheBarrelX xtraj+1
mva EndOfTheBarrely ytraj+1 mva EndOfTheBarrely ytraj+1
lda #0 lda #0
@@ -1535,12 +1535,12 @@ noSmokeTracer
sty SmokeTracerFlag sty SmokeTracerFlag
RepeatIfSmokeTracer RepeatIfSmokeTracer
RepeatFlight RepeatFlight
mwa ytraj+1 Ytrajold+1 mwa ytraj+1 Ytrajold+1
mwa xtraj+1 Xtrajold+1 mwa xtraj+1 Xtrajold+1
mva #%01000000 drawFunction mva #%01000000 drawFunction
lda #0 lda #0
sta vx sta vx
sta vx+1 sta vx+1
sta vx+2 sta vx+2
@@ -1552,7 +1552,7 @@ RepeatFlight
;vx calculation ;vx calculation
;vx = sin(90-Angle) for Angle <=90 ;vx = sin(90-Angle) for Angle <=90
;vx = -sin(Angle-90) for 90 < Angle <= 180 ;vx = -sin(Angle-90) for 90 < Angle <= 180
aslw Force ;Force = Force * 2 aslw Force ;Force = Force * 2
;cos(Angle) (but we use sin table only so some shenanigans happen) ;cos(Angle) (but we use sin table only so some shenanigans happen)
@@ -1565,10 +1565,10 @@ RepeatFlight
;180 horizontally left ;180 horizontally left
; (we have to set goleft used in rolling weapons) ; (we have to set goleft used in rolling weapons)
cpx #91 cpx #91
bcc angleUnder90 bcc angleUnder90
;over 90 ;over 90
mva #1 goleft mva #1 goleft
sec sec
@@ -1583,7 +1583,7 @@ angleUnder90
lda #90 lda #90
sbc Angle sbc Angle
tax tax
@ @
lda sintable,x ; cos(X) lda sintable,x ; cos(X)
sta Multiplee ; *Force sta Multiplee ; *Force
mwa Force Multiplier mwa Force Multiplier
@@ -1610,9 +1610,9 @@ DoNotAdd
rol Multiplier+2 rol Multiplier+2
dex dex
bne MultiplyLoop bne MultiplyLoop
mva #0 vx+3 mva #0 vx+3
; here in vx there is a number ; here in vx there is a number
; xxxx.xx00 = sin(Angle)*Force ; xxxx.xx00 = sin(Angle)*Force
; negate it if going left ; negate it if going left
lda goleft lda goleft
@@ -1627,7 +1627,7 @@ DoNotAdd
;vy = sin(Angle) for Angle <=90 ;vy = sin(Angle) for Angle <=90
;vy = sin(180-Angle) for 90 < Angle <= 180 ;vy = sin(180-Angle) for 90 < Angle <= 180
lda #0 lda #0
sta vy sta vy
sta vy+1 sta vy+1
sta vy+2 sta vy+2
@@ -1635,7 +1635,7 @@ DoNotAdd
ldx Angle ldx Angle
cpx #91 cpx #91
bcc YangleUnder90 bcc YangleUnder90
lda #180 lda #180
sec sec
sbc Angle sbc Angle
@@ -1669,7 +1669,7 @@ DoNotAddY
rol Multiplier+2 rol Multiplier+2
dex dex
bne MultiplyLoopY bne MultiplyLoopY
; here in vy there is a number ; here in vy there is a number
; yyyy.yy=cos(Angle)*Force ; yyyy.yy=cos(Angle)*Force
mva #0 vy+3 ;vy=cos(Angle)*Force mva #0 vy+3 ;vy=cos(Angle)*Force
@@ -1757,12 +1757,12 @@ LaserNoWalls
nolaserwait nolaserwait
lda color lda color
beq nonowait ; smoke tracer erases slowly beq nonowait ; smoke tracer erases slowly
lda tracerflag lda tracerflag
bne nowait ; funky bomb explotes fast ( tracerflag in real is funkyflag :) ) bne nowait ; funky bomb explotes fast ( tracerflag in real is funkyflag :) )
nonowait nonowait
jsr shellDelay jsr shellDelay
; ;
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
spl:rts ; exit if pressed 'Exit keys' spl:rts ; exit if pressed 'Exit keys'
ldx TankNr ldx TankNr
; ;
@@ -1797,7 +1797,7 @@ SkipCollisionCheck
mwa xtraj+1 xdraw mwa xtraj+1 xdraw
mwa ytraj+1 ydraw mwa ytraj+1 ydraw
bit TestFlightFlag bit TestFlightFlag
bvc NoTestFlight bvc NoTestFlight
bit Vdebug bit Vdebug
@@ -1807,7 +1807,7 @@ SkipCollisionCheck
NoTestFlight NoTestFlight
lda tracerflag lda tracerflag
bne NoUnPlot bne NoUnPlot
YesUnPlot YesUnPlot
jsr UnPlot jsr UnPlot
@@ -1837,7 +1837,7 @@ EndOfFlight
jmp SecondFlight jmp SecondFlight
EndOfFlight2 EndOfFlight2
mva #0 tracerflag ; don't know why mva #0 tracerflag ; don't know why
bit TestFlightFlag bit TestFlightFlag
jmi NoHitAtEndOfFight ; RTS only !!! - no defendsives check jmi NoHitAtEndOfFight ; RTS only !!! - no defendsives check
; and now check for defensive-aggressive weapon ; and now check for defensive-aggressive weapon
@@ -1861,7 +1861,7 @@ EndOfFlight2
lda ActiveWeapon,y lda ActiveWeapon,y
cmp #ind_Tracer ; defence not fire by tracers cmp #ind_Tracer ; defence not fire by tracers
beq JNoDefence beq JNoDefence
cmp #ind_Smoke_Tracer cmp #ind_Smoke_Tracer
beq JNoDefence beq JNoDefence
cmp #ind_Laser ; Bouncy and Mag not fire by Laser cmp #ind_Laser ; Bouncy and Mag not fire by Laser
beq JNoDefence beq JNoDefence
@@ -1914,12 +1914,12 @@ NoTankHitAtEndOfFight
NoHitAtEndOfFight NoHitAtEndOfFight
NoDefence NoDefence
lsrw Force ; Force = Force / 2 - because earlier we multiplied by 2 lsrw Force ; Force = Force / 2 - because earlier we multiplied by 2
rts ; END !!! rts ; END !!!
BouncyCastle BouncyCastle
; now in Y we have number of of the attacking player (TankNr) ! ; now in Y we have number of of the attacking player (TankNr) !
lda ActiveWeapon,y lda ActiveWeapon,y
; if Bouncy Castle bounced Funky Bomb - whole screen in range of soil down ; if Bouncy Castle bounced Funky Bomb - whole screen in range of soil down
cmp #ind_Funky_Bomb cmp #ind_Funky_Bomb
bne @+ bne @+
jsr SetFullScreenSoilRange jsr SetFullScreenSoilRange
@ @
@@ -1965,7 +1965,7 @@ BouncyCastle
; to start where the tank's barrel ends ; to start where the tank's barrel ends
; (without it bullet would go from the left lower corner of the tank) ; (without it bullet would go from the left lower corner of the tank)
;ldx TankNr ;ldx TankNr
mwa EndOfTheBarrelX xtraj+1 mwa EndOfTheBarrelX xtraj+1
mva EndOfTheBarrely ytraj+1 mva EndOfTheBarrely ytraj+1
lda #0 lda #0
@@ -1975,7 +1975,7 @@ BouncyCastle
sta ytraj sta ytraj
sta color sta color
ldy #100 ; ??? ldy #100 ; ???
mva #1 tracerflag ; I do not know (I mean I think I know ;) ) mva #1 tracerflag ; I do not know (I mean I think I know ;) )
; 10 years later - I do not know!!! ; 10 years later - I do not know!!!
@@ -2068,7 +2068,7 @@ mrLoopi
bne @+ bne @+
ldx #0 ldx #0
@ stx MirvMissileCounter @ stx 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)
@@ -2101,14 +2101,14 @@ mrLoopi
jsr ShellDelay jsr ShellDelay
; ;
phx phx
jsr CheckExitKeys ; Check for O, Esc or Start+Option keys jsr CheckExitKeys ; Check for O, Esc or Start+Option keys
bpl ExitnotPressed bpl ExitnotPressed
plx plx
rts ; exit if pressed 'Exit keys' rts ; exit if pressed 'Exit keys'
ExitnotPressed ExitnotPressed
plx plx
; ;
MIRVdoNotChangeY MIRVdoNotChangeY
lda MirvDown,x ; if bullet is already down we go with the next one lda MirvDown,x ; if bullet is already down we go with the next one
@@ -2140,14 +2140,14 @@ MIRVdoNotChangeY
; if (Y>=0 and Y<=screenhight) and X<=screenwidth (bullet on the screen) - check collision ; if (Y>=0 and Y<=screenhight) and X<=screenwidth (bullet on the screen) - check collision
; if Y>screenhight and X>screenwidth (bullet under the screen on the left or right side) - stop flying without hit ; if Y>screenhight and X>screenwidth (bullet under the screen on the left or right side) - stop flying without hit
; if Y>screenhight and X<=screenwidth (bullet under the screen) - check collision (allways hit) ; if Y>screenhight and X<=screenwidth (bullet under the screen) - check collision (allways hit)
; check bullet position and set flags: ; check bullet position and set flags:
; XposFlag - bullet positon X (0 - on screen , %1000000 - off-screen) ; XposFlag - bullet positon X (0 - on screen , %1000000 - off-screen)
; YposFlag - bullet positon Y (0 - on screen , %1000000 - over the screen , %0100000 - under the screen) ; YposFlag - bullet positon Y (0 - on screen , %1000000 - over the screen , %0100000 - under the screen)
lda #$00 lda #$00
sta XposFlag sta XposFlag
sta YposFlag sta YposFlag
lda ytraj+2 ; Y high byte lda ytraj+2 ; Y high byte
bpl @+ bpl @+
mva #%10000000 YposFlag ; bullet over the screen (Y) mva #%10000000 YposFlag ; bullet over the screen (Y)
bmi MIRVsetXflag bmi MIRVsetXflag
@@ -2341,13 +2341,13 @@ MakeBump
sec sec
lda #180 lda #180
sbc LeapFrogAngle sbc LeapFrogAngle
sta LeapFrogAngle ; swap angle (LeapFrogAngle) sta LeapFrogAngle ; swap angle (LeapFrogAngle)
inc FunkyWallFlag inc FunkyWallFlag
rts rts
WrapAndNone WrapAndNone
bvc NoWall bvc NoWall
cpw xtraj+1 #screenwidth cpw xtraj+1 #screenwidth
bcc OnScreen bcc OnScreen
; (wrapping wall) ; (wrapping wall)
inc FunkyWallFlag inc FunkyWallFlag
bit xtraj+2 bit xtraj+2
@@ -2431,7 +2431,7 @@ SelectNextTank
beq RepeatSpy beq RepeatSpy
SpyHardEnd SpyHardEnd
mvx TargetTankNr TankNr ; restore mvx TargetTankNr TankNr ; restore
jsr DisplaySpyInfo jsr DisplaySpyInfo
rts rts
.endp .endp
.proc DisplaySpyInfo .proc DisplaySpyInfo
@@ -2490,7 +2490,7 @@ EndLazy
bcc IsToHigh bcc IsToHigh
sbc #12 ; tank with shield high correction sbc #12 ; tank with shield high correction
bne StoreMaxAlt bne StoreMaxAlt
IsToHigh IsToHigh
lda #18 lda #18
StoreMaxAlt StoreMaxAlt
sta FloatingAlt sta FloatingAlt
@@ -2502,10 +2502,10 @@ StoreMaxAlt
jsr TypeLine4x4.variableLength jsr TypeLine4x4.variableLength
ldx TankNr ldx TankNr
; TankNr in X reg. ; TankNr in X reg.
; now animate Up ; now animate Up
mva #0 modify ; it's a counter mva #0 modify ; it's a counter
TankGoUp TankGoUp
lda ytankstable,x lda ytankstable,x
cmp FloatingAlt ; Floating altitude cmp FloatingAlt ; Floating altitude
@@ -2576,7 +2576,7 @@ KeyboardAndJoyCheck
lda ShieldEnergy,x lda ShieldEnergy,x
cmp #20 cmp #20
bne LotOfFuel bne LotOfFuel
; display text 4x4 - low fuel ; display text 4x4 - low fuel
jsr SetLowFuelText jsr SetLowFuelText
jsr TypeLine4x4.variableLength jsr TypeLine4x4.variableLength
@@ -2590,7 +2590,7 @@ notpressed
; let's animate "engine" ; let's animate "engine"
jsr DrawTankEngine jsr DrawTankEngine
; enimation ends ; enimation ends
lda SKSTAT lda SKSTAT
cmp #$ff cmp #$ff
jeq checkJoy jeq checkJoy
@@ -2616,7 +2616,7 @@ checkJoy
and #$0f and #$0f
cmp #$0f cmp #$0f
beq notpressedJoy beq notpressedJoy
tay tay
lda joyToKeyTable,y lda joyToKeyTable,y
jmp jumpFromStick jmp jumpFromStick
notpressedJoy notpressedJoy
@@ -2635,11 +2635,11 @@ pressedRight
jsr ClearTankNr jsr ClearTankNr
mva #0 Erase mva #0 Erase
lda XtankstableH,x lda XtankstableH,x
cmp #>(screenwidth-TankWidth-4) ; tank width correction +4 cmp #>(screenwidth-TankWidth-4) ; tank width correction +4
bne @+ bne @+
lda XtankstableL,x lda XtankstableL,x
cmp #<(screenwidth-TankWidth-4) ; tank width correction +4 pixels cmp #<(screenwidth-TankWidth-4) ; tank width correction +4 pixels
@ bcs RightScreenEdge @ bcs RightScreenEdge
inc XtankstableL,x inc XtankstableL,x
sne:inc XtankstableH,x sne:inc XtankstableH,x
jmp NoREdge jmp NoREdge
@@ -2729,10 +2729,10 @@ CheckCollisionWithTankLoop
bne @+ bne @+
cpy xdraw cpy xdraw
@ @
bcs LeftFromTheTank bcs LeftFromTheTank
tya ;add 20 (tank size*2 +2 and +2) tya ;add 20 (tank size*2 +2 and +2)
clc clc
adc #20 adc #20
tay tay
lda xtankstableH,x lda xtankstableH,x
adc #0 adc #0
@@ -2828,7 +2828,7 @@ NotHighest
jsr SoilDown2 jsr SoilDown2
ldx TankNr ldx TankNr
rts rts
CalculateSoildown CalculateSoildown
ldx TankNr ldx TankNr
clc clc
@@ -2888,11 +2888,11 @@ CheckCollisionWithTankLoop
cmp #ind_Mag_Deflector ; first shielded weapon cmp #ind_Mag_Deflector ; first shielded weapon
bcc CheckCollisionWithNotShieldedTank bcc CheckCollisionWithNotShieldedTank
cmp #ind_Bouncy_Castle +1 ; last shielded weapon cmp #ind_Bouncy_Castle +1 ; last shielded weapon
bcc CheckCollisionWithShieldedTank ; tank with shield is bigger :) bcc CheckCollisionWithShieldedTank ; tank with shield is bigger :)
;lda ShieldEnergy,x ; there is wrong method to check shield :) ;lda ShieldEnergy,x ; there is wrong method to check shield :)
;bne CheckCollisionWithShieldedTank ; tank with shield is bigger :) ;bne CheckCollisionWithShieldedTank ; tank with shield is bigger :)
CheckCollisionWithNotShieldedTank CheckCollisionWithNotShieldedTank
lda xtankstableH,x lda xtankstableH,x
cmp xdraw+1 cmp xdraw+1
@@ -2944,10 +2944,10 @@ CheckCollisionWithShieldedTank
bne @+ bne @+
cpy xdraw cpy xdraw
@ @
bcs LeftFromTheTank bcs LeftFromTheTank
tya ;add 16 double byte tya ;add 16 double byte
clc clc
adc #TankWidth+4+4 adc #TankWidth+4+4
tay tay
lda xtankstableH,x lda xtankstableH,x
adc #0 adc #0
@@ -3017,7 +3017,7 @@ CheckRangeRight
RangesChecked RangesChecked
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc SetFullScreenSoilRange .proc SetFullScreenSoilRange
@@ -3031,7 +3031,7 @@ RangesChecked
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc ClearScreenSoilRange .proc ClearScreenSoilRange
; cleanup of the soil fall down ranges (left and right) ; cleanup of the soil fall down ranges (left and right)
;-------------------------------------------------- ;--------------------------------------------------
mwa #screenwidth RangeLeft mwa #screenwidth RangeLeft
lda #0 lda #0
@@ -3072,7 +3072,7 @@ noBullets
.proc HowManyBullets .proc HowManyBullets
; in: A <-- Weapon number, TankNr ; in: A <-- Weapon number, TankNr
; out: A <-- How many bullets in the weapon, Y: weapon number ; out: A <-- How many bullets in the weapon, Y: weapon number
; how many bullets weapon of tank(TankNr) has, Result in A ; how many bullets weapon of tank(TankNr) has, Result in A
;-------------------------------------------------- ;--------------------------------------------------
tay tay
ldx TankNr ldx TankNr
@@ -3080,11 +3080,10 @@ noBullets
sta weaponPointer sta weaponPointer
lda TanksWeaponsTableH,x lda TanksWeaponsTableH,x
sta weaponPointer+1 sta weaponPointer+1
lda (weaponPointer),y ; and we have number of bullets in A lda (weaponPointer),y ; and we have number of bullets in A
rts rts
.endp .endp
.ENDIF .ENDIF