Code cleanup
This commit is contained in:
+25
-10
@@ -638,6 +638,7 @@ SettingEnergies
|
|||||||
.proc MainRoundLoop
|
.proc MainRoundLoop
|
||||||
; here we must check if by a chance there is only one
|
; here we must check if by a chance there is only one
|
||||||
; tank with energy greater than 0 left
|
; tank with energy greater than 0 left
|
||||||
|
;--------------------------------------------------
|
||||||
|
|
||||||
ldy #0 ; in Y - number of tanks with energy greater than zero
|
ldy #0 ; in Y - number of tanks with energy greater than zero
|
||||||
sty ATRACT ; reset atract mode
|
sty ATRACT ; reset atract mode
|
||||||
@@ -903,9 +904,10 @@ NotLastPlayerInRound
|
|||||||
|
|
||||||
;---------------------------------
|
;---------------------------------
|
||||||
.proc PlayerXdeath
|
.proc PlayerXdeath
|
||||||
|
|
||||||
; this tank should not explode anymore:
|
; this tank should not explode anymore:
|
||||||
; there is 0 in A, and Tank Number in X, so...
|
; there is 0 in A, and Tank Number in X, so...
|
||||||
|
;---------------------------------
|
||||||
|
|
||||||
sta LASTeXistenZ,x
|
sta LASTeXistenZ,x
|
||||||
; save x somewhere
|
; save x somewhere
|
||||||
stx TankTempY
|
stx TankTempY
|
||||||
@@ -1034,7 +1036,6 @@ ldahashzero
|
|||||||
NotNegativeEnergy
|
NotNegativeEnergy
|
||||||
sta Energy,x
|
sta Energy,x
|
||||||
;now increase the gain of the shooting tank
|
;now increase the gain of the shooting tank
|
||||||
; phx
|
|
||||||
ldy TankNr
|
ldy TankNr
|
||||||
clc
|
clc
|
||||||
lda gainL,y
|
lda gainL,y
|
||||||
@@ -1043,7 +1044,6 @@ NotNegativeEnergy
|
|||||||
lda gainH,y
|
lda gainH,y
|
||||||
adc #$00
|
adc #$00
|
||||||
sta gainH,y
|
sta gainH,y
|
||||||
; plx
|
|
||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
|
|
||||||
@@ -1076,6 +1076,7 @@ NotNegativeShieldEnergy
|
|||||||
|
|
||||||
;---------------------------------
|
;---------------------------------
|
||||||
.proc Seppuku
|
.proc Seppuku
|
||||||
|
;---------------------------------
|
||||||
lda #0
|
lda #0
|
||||||
sta ydraw+1
|
sta ydraw+1
|
||||||
; get position of the tank
|
; get position of the tank
|
||||||
@@ -1149,7 +1150,7 @@ B0 dey
|
|||||||
.endp
|
.endp
|
||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc WeaponCleanup;
|
.proc WeaponCleanup
|
||||||
; cleaning of the weapon possesion tables
|
; cleaning of the weapon possesion tables
|
||||||
; 99 of Baby Missles and White Flags, all other weapons=0)
|
; 99 of Baby Missles and White Flags, all other weapons=0)
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
@@ -1247,6 +1248,9 @@ MakeTanksVisible
|
|||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc SetStandardBarrels
|
.proc SetStandardBarrels
|
||||||
|
; set standart barrel length and deactivate Auto Defense
|
||||||
|
; for all tanks
|
||||||
|
;--------------------------------------------------
|
||||||
ldx #maxPlayers-1
|
ldx #maxPlayers-1
|
||||||
@ lda #StandardBarrel ; standard barrel length
|
@ lda #StandardBarrel ; standard barrel length
|
||||||
sta BarrelLength,x
|
sta BarrelLength,x
|
||||||
@@ -1376,6 +1380,7 @@ LimitForce
|
|||||||
.endp
|
.endp
|
||||||
;----------------------------------------------
|
;----------------------------------------------
|
||||||
.proc Table2Force
|
.proc Table2Force
|
||||||
|
;----------------------------------------------
|
||||||
lda ForceTableL,x
|
lda ForceTableL,x
|
||||||
sta Force
|
sta Force
|
||||||
lda ForceTableH,x
|
lda ForceTableH,x
|
||||||
@@ -1384,6 +1389,7 @@ LimitForce
|
|||||||
.endp
|
.endp
|
||||||
;----------------------------------------------
|
;----------------------------------------------
|
||||||
.proc MoveBarrelToNewPosition
|
.proc MoveBarrelToNewPosition
|
||||||
|
;----------------------------------------------
|
||||||
mva #1 Erase
|
mva #1 Erase
|
||||||
jsr DrawTankNr.BarrelChange
|
jsr DrawTankNr.BarrelChange
|
||||||
mva #0 Erase
|
mva #0 Erase
|
||||||
@@ -1518,8 +1524,10 @@ SetRandomWalls
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc GetKey ; waits for pressing a key and returns pressed value in A
|
.proc GetKey
|
||||||
|
; waits for pressing a key and returns pressed value in A
|
||||||
; when [ESC] is pressed, escFlag is set
|
; when [ESC] is pressed, escFlag is set
|
||||||
|
; result: A=keycode
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
jsr WaitForKeyRelease
|
jsr WaitForKeyRelease
|
||||||
@
|
@
|
||||||
@@ -1623,7 +1631,8 @@ KeyReleased
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc IsKeyPressed ; A=0 - yes , A>0 - no
|
.proc IsKeyPressed
|
||||||
|
; result: A=0 - yes , A>0 - no
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
lda SKSTAT
|
lda SKSTAT
|
||||||
and #%00000100
|
and #%00000100
|
||||||
@@ -1634,6 +1643,8 @@ KeyReleased
|
|||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc DemoModeOrKey
|
.proc DemoModeOrKey
|
||||||
|
; Waits for the key pressed if at least one human is playing.
|
||||||
|
; Otherwise, waits 3 seconds (demo mode).
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
;check demo mode
|
;check demo mode
|
||||||
ldx numberOfPlayers
|
ldx numberOfPlayers
|
||||||
@@ -1648,17 +1659,19 @@ checkForHuman ; if all in skillTable other than 0 then switch to DEMO MODE
|
|||||||
ldy #75
|
ldy #75
|
||||||
jsr PauseYFrames
|
jsr PauseYFrames
|
||||||
rts
|
rts
|
||||||
|
|
||||||
peopleAreHere
|
peopleAreHere
|
||||||
jmp getkey ; jsr:rts
|
jmp getkey ; jsr:rts
|
||||||
.endp
|
.endp
|
||||||
|
|
||||||
|
;--------------------------------------------------
|
||||||
MakeDarkScreen
|
MakeDarkScreen
|
||||||
jsr PMoutofScreen
|
;--------------------------------------------------
|
||||||
|
jsr PMoutofScreen ; hide P/M
|
||||||
mva #0 dmactls ; dark screen
|
mva #0 dmactls ; dark screen
|
||||||
; sta dmactl ; probably not necessary (3 bytes!!! :) )
|
|
||||||
; and wait one frame :)
|
; and wait one frame :)
|
||||||
|
;--------------------------------------------------
|
||||||
.proc WaitOneFrame
|
.proc WaitOneFrame
|
||||||
|
;--------------------------------------------------
|
||||||
lda CONSOL
|
lda CONSOL
|
||||||
and #%00000101 ; Start + Option
|
and #%00000101 ; Start + Option
|
||||||
sne:mva #$40 escFlag
|
sne:mva #$40 escFlag
|
||||||
@@ -1667,9 +1680,11 @@ MakeDarkScreen
|
|||||||
rts
|
rts
|
||||||
.endp
|
.endp
|
||||||
|
|
||||||
|
;--------------------------------------------------
|
||||||
.proc PauseYFrames
|
.proc PauseYFrames
|
||||||
; Y - number of frames to wait (divided by 2)
|
; Y - number of frames to wait (divided by 2)
|
||||||
; pauses for maximally 510 frames (255 * 2)
|
; pauses for maximally 510 frames (255 * 2)
|
||||||
|
;--------------------------------------------------
|
||||||
@ jsr WaitOneFrame
|
@ jsr WaitOneFrame
|
||||||
jsr WaitOneFrame
|
jsr WaitOneFrame
|
||||||
dey
|
dey
|
||||||
@@ -1679,8 +1694,8 @@ MakeDarkScreen
|
|||||||
|
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc RmtSongSelect
|
.proc RmtSongSelect
|
||||||
;--------------------------------------------------
|
|
||||||
; starting song line 0-255 to A reg
|
; starting song line 0-255 to A reg
|
||||||
|
;--------------------------------------------------
|
||||||
cmp #song_ingame
|
cmp #song_ingame
|
||||||
bne noingame ; noMusic blocks only ingame song
|
bne noingame ; noMusic blocks only ingame song
|
||||||
bit noMusic
|
bit noMusic
|
||||||
|
|||||||
Reference in New Issue
Block a user