RANDOM
ldarnd
;ld a,r
push de
push hl
;Patrik Rak
rndseed1=$+1
ld hl,0xA280 ; xz -> yw
rndseed2=$+1
ld de,0xC0DE ; yw -> zt
ld (rndseed1),de ; x = y, z = w
;ifdef CLIENT
;ld hl,(joy1state)
;ld de,(logicindex)
;endif
ld a,e ; w = w ^ ( w << 3 )
add a,a
add a,a
add a,a
xor e
ld e,a
ld a,h ; t = x ^ (x << 1)
add a,a
xor h
ld d,a
rra ; t = t ^ (t >> 1) ^ w
xor d
xor e
ld h,l ; y = z
ld l,a ; w = t
ld (rndseed2),hl
pop hl
pop de
;xor a
ret
CLSBULL LD (IX+UNIT_YESORNOT),3
LD (IX+UNIT_TIMEFORSHOTONWAR),0
LD HL,SPRBOOM0;56
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
RET
COMPA2P LD IX,UNITS
LD (COMA),A
LD BC,4*UNITSZ;96
ADD IX,BC
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
LD A,2
CALL NZ,COMPAR2
RET
COMPA1P ; LD IX,UNITS ;??? why commented?
LD (COMA),A ;direction
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
CALL NZ,COMPAR2
RET
COMPAL2 LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD BC,8
SBC HL,BC
JR COMPAX
COMPAR2
LD A,(COMA)
CP 4
JR Z,COMPAL2
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD A,(IX+UNIT_STOPBIT)
LD BC,8
ADD HL,BC
COMPAX LD (COM1X),HL
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD (COM1Y),HL
LD (COMIX),IX
LD IX,UNITS
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
CALL NZ,COMPAR3
LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),0
LD IX,UNITS+(4*UNITSZ);96
;LD DE,4*UNITSZ;96
;ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
CALL NZ,COMPAR3
LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),0 ;зачем второй раз???
LD IX,UNITS+(6*UNITSZ);192-48 ;-----WAR COMPAIRE
;LD DE,6*UNITSZ;192-48 ;-----WAR COMPAIRE
;ADD IX,DE
LD B,8
LC2 LD (ZZBC),BC
LD DE,2*UNITSZ;48 ;-----WAR COMPAIRE
ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
JR Z,XCD
CP 8
CALL Z,COMGIFT
LD A,(IX+UNIT_YESORNOT)
CP 4
CALL C,COMPAR3
XCD LD BC,(ZZBC)
DJNZ LC2
LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),0 ;зачем второй раз???
RET
ZZBC DEFW 0
COMPAR3
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD DE,(COM1X)
LD A,(COMA)
CP 4 ;left
JR Z,C44
CP 2 ;right
JR Z,C22
RET
COMGIFT
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD DE,(COM1X)
LD A,(COMA)
CP 4 ;left
JR Z,C44GIF
CP 2 ;right
RET nz
LD BC,8 ;??? заезд на приз слева (0 - прикосновение слева берёт приз)
ADD HL,BC
jp C22
C44GIF
LD BC,8 ;??? заезд на приз справа
SBC HL,BC
C44 ;(de-hl)==(0..15) => BOMPAR4, иначе ret
ex de,hl
C22 ;(hl-de)==(0..15) => COMPAR4, иначе ret
xor a
sbc hl,de
cp h
ret nz
ld a,l
cp 16
ret nc
COMPAR4
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD BC,8
SBC HL,BC
LD DE,(COM1Y)
;(de-hl)==(0..23) => ENDCOMP, иначе ret
ex de,hl
xor a
sbc hl,de
cp h
ret nz
ld a,l
cp 24
ret nc
ENDCOMP
LD A,(IX+UNIT_TYPEOFTANK)
CP 21
CALL NC,CLEAR
LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),1
POP HL
POP HL
RET
CLEAR
LD B,(IX+UNIT_TYPEOFTANK)
LD (IX+UNIT_TYPEOFTANK),0
PUSH IX
LD IX,(COMIX)
LD A,(IX+UNIT_TYPEOFTANK)
POP IX
CP 1
JP Z,CLEARW
CP 2
JP Z,CLEARW
CP 3
JP Z,CLEARW
CP 4
JP Z,CLEARW
CP 5
JP Z,CLEARW
CP 11
JP Z,CLEARW
CP 12
JP Z,CLEARW
CP 13
JP Z,CLEARW
LD (IX+UNIT_YESORNOT),7
LD (IX+UNIT_TIMEFORSHOTONWAR),64
LD HL,SPRENE4;256+128+54 ;???
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
PUSH IX
LD IX,(COMIX)
LD A,(IX+UNIT_BITPARENTSBULL)
CP 1
CALL Z,PDD
CP 2
CALL Z,PDD2
POP IX
PUSH IX,BC,DE,HL
LD A,2
CALL AFXPLAY
POP HL,DE,BC,IX
;take bonus
LD A,12 ;beton
LD (STEN),A
LD A,B
CP 23
JP Z,INSTAL
CP 22
JP Z,SLOWTIM
CP 25
JP Z,BADBAD ;bomb
CP 26
JP Z,ADDLIFE
CP 27
JR Z,WATER
CP 24
JR Z,STARS
LD A,(IX+UNIT_BITPARENTSBULL)
CP 2
JP Z,PRIZ2
PUSH IX
LD IX,(COMIX)
PUSH IX
POP HL
POP IX
LD IX,BRONITS
RETW LD (IX+UNIT_DIRECTION),L
LD (IX+UNIT_ANIMATION),H
LD (IX+UNIT_COUNTER),250
LD (IX+UNIT_YESORNOT),6
LD IX,(COMIX)
LD (IX+UNIT_SHELLTIME),250
RET
WATER
LD IX,(COMIX)
LD (IX+UNIT_WATERWAY),1
RET
PDD LD DE,50
LD HL,(POINTP1)
ADD HL,DE
LD (POINTP1),HL
RET
PDD2 LD DE,50
LD HL,(POINTP2)
ADD HL,DE
LD (POINTP2),HL
RET
;upgrade my tank
STARS
LD IX,(COMIX)
LD A,(IX+UNIT_STAR) ;my tank level 0,1,2,3
CP 3
RET Z
LD DE,SPRMYTANKLEVEL1-SPRMYTANKLEVEL0;16
;LD A,(IX+UNIT_STAR)
CP 2
CALL Z,STARS3
LD A,(IX+UNIT_STAR)
CP 1
CALL Z,STARS2
;LD A,(IX+UNIT_STAR)
;INC A
;LD (IX+UNIT_STAR),A
inc (IX+UNIT_STAR)
LD L,(IX+UNIT_NUMBERSPRITES)
LD H,(IX+UNIT_NUMBERSPRITES+1)
ADD HL,DE
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
;LD DE,UNITSZ;24
;ADD IX,DE
;LD A,(IX+UNIT_STAR)
;INC A
;LD (IX+UNIT_STAR),A
inc (IX+(UNITSZ+UNIT_STAR)) ;???
RET
STARS2
;LD L,(IX+UNIT_NUMBERSPRITES)
;LD H,(IX+UNIT_NUMBERSPRITES+1)
;LD DE,256-16 ;реально 256, т.к. 16 прибавится потом
;ADD HL,DE ;???
;LD (IX+UNIT_NUMBERSPRITES),L
;LD (IX+UNIT_NUMBERSPRITES+1),H
ld de,SPRMYTANKLEVEL2-SPRMYTANKLEVEL1;256
;LD DE,2*UNITSZ;48
;ADD IX,DE
;LD A,(IX+UNIT_STAR)
;INC A
;LD (IX+UNIT_STAR),A
;LD IX,(COMIX)
inc (IX+(2*UNITSZ+UNIT_STAR)) ;???
RET
STARS3
;LD L,(IX+UNIT_NUMBERSPRITES)
;LD H,(IX+UNIT_NUMBERSPRITES+1)
;LD DE,128;-16 ;реально 128, т.к. 16 прибавится потом
;ADD HL,DE ;???
;LD (IX+UNIT_NUMBERSPRITES),L
;LD (IX+UNIT_NUMBERSPRITES+1),H
ld de,SPRMYTANKLEVEL3-SPRMYTANKLEVEL2;256
;LD DE,2*UNITSZ;48
;ADD IX,DE
;LD A,(IX+UNIT_STAR)
;INC A
;LD (IX+UNIT_STAR),A
;LD IX,(COMIX)
inc (IX+(2*UNITSZ+UNIT_STAR)) ;???
RET
STARSW PUSH IX
LD IX,UNITS
LD DE,8*UNITSZ;192
ADD IX,DE
LD (IX+UNIT_STAR),1
LD DE,UNITSZ
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
;LD DE,24
ADD IX,DE
LD (IX+UNIT_STAR),1
POP IX
RET
ADDLIFE
LD IX,(COMIX)
LD A,(IX+UNIT_BITPARENTSBULL)
CP 1
JR Z,ADDLIF1
CP 2
JR Z,ADDLIF2
RET
ADDLIF1
LD A,(UP1)
CP 138 ;129 '0', 130 '1'
RET Z
INC A
LD (UP1),A
LD HL,TEXT6
LD (TEXTW),HL
LD D,#C0
LD E,#10
LD BC,256+24
LD HL,128
CALL TEXT
RET
ADDLIF2
LD A,(UP2)
CP 138
RET Z
INC A
LD (UP2),A
LD HL,TEXT7
LD (TEXTW),HL
LD D,#C0
LD E,#10
LD BC,256+24
LD HL,128+24
CALL TEXT
RET
CLEARW6
LD A,(WARTAN)
INC A
LD (WARTAN),A
CALL PRTAN
LD HL,WAR
LD DE,5
NHFX LD A,(HL)
CP 0
JR Z,CLW6
ADD HL,DE
DJNZ NHFX
RET
CLW6 LD A,1
LD (HL),A
CALL TEXTLEF
RET
BADBAD
;take bomb
LD IX,UNITS
LD DE,8*UNITSZ;192
ADD IX,DE
LD B,7
LKKF LD A,(IX+UNIT_YESORNOT)
or a;CP 0
JR Z,ZXXX
LD (IX+UNIT_YESORNOT),4
LD (IX+UNIT_TIMEFORSHOTONWAR),0
ZXXX LD DE,2*UNITSZ;48
ADD IX,DE
DJNZ LKKF
RET
CLEARW5
;enemy takes bomb
LD IX,UNITS
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
JR Z,ZXX2X
LD (IX+UNIT_YESORNOT),4
LD (IX+UNIT_TIMEFORSHOTONWAR),0
LD A,(UP1)
CP 129 ;129 '0', 130 '1'
JR Z,ZXX2X
DEC A
LD (UP1),A
cp 129 ;'0'
jr z,CLEARW5_allkilled1
LD A,100
LD (NEWTAN1),A
CLEARW5_allkilled1
LD HL,TEXT6 ;"1p",line down,танк,число
LD (TEXTW),HL
LD D,#C0 ;const
LD E,#10 ;const
LD BC,256+24
LD HL,128
CALL TEXT
ZXX2X LD DE,4*UNITSZ;96
ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
RET Z
LD (IX+UNIT_YESORNOT),4
LD (IX+UNIT_TIMEFORSHOTONWAR),0
LD A,(UP2)
CP 129 ;129 '0', 130 '1'
RET Z
DEC A
LD (UP2),A
cp 129 ;'0'
jr z,CLEARW5_allkilled2
LD A,100
LD (NEWTAN2),A
CLEARW5_allkilled2
LD HL,TEXT7 ;"2p",line down,танк,число
LD (TEXTW),HL
LD D,#C0 ;const
LD E,#10 ;const
LD BC,256+24
LD HL,128+24
CALL TEXT
RET
PRIZ2
LD IX,(COMIX)
PUSH IX
POP HL
POP IX
LD IX,BRONITS
LD DE,24
ADD IX,DE
JP RETW
CLEARW
LD (IX),0
PUSH IX,BC,DE,HL
LD A,3
CALL AFXPLAY
POP HL,DE,BC,IX
;jp CLEARW5 ;enemy takes bomb
LD A,B
CP 21
JR Z,CLEARW1
CP 22
JR Z,CLEARW3
CP 23
JR Z,CLEARW2
CP 25
JP Z,CLEARW5 ;enemy takes bomb
CP 26
JP Z,CLEARW6
CP 27
JP Z,WATER
CP 24
JP Z,STARSW
RET
SLOWTIM LD A,90
LD (TIMES),A
PUSH IX
LD IX,UNITS+(8*UNITSZ);192
;LD DE,8*UNITSZ;192
;ADD IX,DE
LD DE,2*UNITSZ;48
LD B,7
SLTI LD (IX+UNIT_ANIMATION),0
ADD IX,DE
DJNZ SLTI
POP IX
RET
CLEARW3 LD A,50
LD (TIMEW),A
;PUSH IX
;LD IX,UNITS
;LD (IX+UNIT_ANIMATION),0
;LD DE,4*UNITSZ;96
;ADD IX,DE
;LD (IX+UNIT_ANIMATION),0
;POP IX
xor a
ld (UNITS+UNIT_ANIMATION),a
ld (UNITS+(4*UNITSZ)+UNIT_ANIMATION),a
RET
TIMES DEFB 0
TIMEW DEFB 0
CLEARW2 XOR A
LD (STEN),A
CALL INSTAL
RET
CLEARW1
;PUSH IX
;LD IX,(COMIX)
ld hl,(COMIX) ;addr!!!
;PUSH IX
;POP HL
;POP IX
LD (IX),0
LD IX,BRONITS+(2*UNITSZ);48
;LD DE,2*UNITSZ;48
;ADD IX,DE
LD (IX+UNIT_DIRECTION),L ;???
LD (IX+UNIT_ANIMATION),H ;???
LD (IX+UNIT_COUNTER),150
LD (IX+UNIT_YESORNOT),6
LD IX,(COMIX)
LD (IX+UNIT_SHELLTIME),150
RET
SHEELDW LD IX,BRONITS
LD DE,2*UNITSZ;48
ADD IX,DE
LD (IX+UNIT_DIRECTION),L
LD (IX+UNIT_ANIMATION),H
LD (IX+UNIT_COUNTER),A
LD (IX+UNIT_YESORNOT),6
RET
YOMPA2P
;a=direction (1 up, 3 down)
LD IX,UNITS
LD (COMA),A
LD BC,4*UNITSZ;96
ADD IX,BC
LD A,(IX+UNIT_YESORNOT)
or a ;CP 0
CALL NZ,YOMPAR2
RET
YOMPA1P
;a=direction (1 up, 3 down)
; LD IX,UNITS ;??? why commented?
LD (COMA),A
LD A,(IX+UNIT_YESORNOT)
or a ;CP 0
CALL NZ,YOMPAR2
RET
YOMPAL2 LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD BC,8 ;up
SBC HL,BC
JR YOMPAX
YOMPAR2
LD A,(COMA)
CP 1 ;up
JR Z,YOMPAL2
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD A,(IX+UNIT_STOPBIT)
LD BC,8 ;down
ADD HL,BC
YOMPAX
LD (COM1Y),HL
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD (COM1X),HL
LD (COMIX),IX
LD IX,UNITS
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
CALL NZ,YOMPAR3
LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),0
LD IX,UNITS
LD DE,4*UNITSZ;96
ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
CALL NZ,YOMPAR3
LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),0
LD IX,UNITS+(8*UNITSZ);192;-----WAR COMPAIRE
;LD DE,8*UNITSZ;192;-----WAR COMPAIRE
;ADD IX,DE
FFF8 LD A,(IX+UNIT_YESORNOT)
inc a;CP 255
JP Z,FFF7 ;end of list of objects
dec a;CP 0
JR Z,KJJ ;skip
CP 8
CALL Z,YOMGIFT ;bonus???
CP 4
CALL C,YOMPAR3 ;another tank???
KJJ LD DE,2*UNITSZ;48
ADD IX,DE
JR FFF8
FFF7 LD IX,(COMIX)
LD (IX+UNIT_STOPBIT),0
RET
YOMPAR3
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD DE,(COM1Y)
LD A,(COMA)
CP 1 ;up
JR Z,C44Y
CP 3 ;down
JR Z,C22Y
RET
YOMGIFT
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD DE,(COM1Y)
LD A,(COMA)
CP 1 ;up
JR Z,C44YGI
CP 3 ;down
RET nz
LD bc,8
ADD HL,bc
JR C22Y
C44YGI
LD bc,16
SBC HL,bc
C44Y
;(de-hl)==(0..15) => YOMPAR4, иначе ret
ex de,hl
C22Y
;было (de-hl)==(-8..+7) => YOMPAR4, иначе ret (исключение e<8)
;переделано на: (hl-de)==(0..15) => YOMPAR4, иначе ret
xor a
sbc hl,de
cp h
ret nz
ld a,l
cp 16
ret nc
;YOMPAR4
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
ld bc,-8
add hl,bc ;иначе можно проехать по леву танка и заед справа на приз берёт его
LD DE,(COM1X)
;(de-hl)==(0..23) => ENDCOMP, иначе ret
ex de,hl
xor a
sbc hl,de
cp h
ret nz
ld a,l
cp 24
ret nc
jp ENDCOMP
INTELLE LD A,(TIMES)
or a;CP 0
RET NZ
LD IX,UNITS+(8*UNITSZ);192
;LD DE,8*UNITSZ;192
;ADD IX,DE
Z2 LD A,(IX+UNIT_YESORNOT)
CP 255 ;end of list of objects
RET Z
CP 1
CALL Z,UNGO
Z1 LD DE,2*UNITSZ;48
ADD IX,DE
JP Z2
RND2
LD (IX+UNIT_STOPBIT),0
LD (IX+UNIT_NEEDRND),1
LD (IX+UNIT_COUNTER),7
RET
SPEEDWAR
LD A,128
LD (IX+UNIT_TIMEFORSHOTONWAR),A
RET
FIREWAR
LD A,(IX+UNIT_TIMEFORSHOTONWAR)
or a;CP 0
RET NZ
LD A,(IX+UNIT_TYPEOFTANK)
CP 21
RET NC
call ldarnd;LD A,R
LD C,50
ADD A,C
LD (IX+UNIT_TIMEFORSHOTONWAR),A
LD A,(IX+UNIT_TYPEOFTANK)
CP 4
CALL Z,SPEEDWAR
LD A,(IX+UNIT_TYPEOFTANK)
CP 5
CALL Z,SPEEDWAR
WIRE LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD C,(IX+UNIT_Y)
LD B,(IX+UNIT_Y+1)
LD A,(IX+UNIT_DIRECTION)
LD (DDD),A
LD DE,UNITSZ;24
ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
or a;CP 0
RET NZ
LD (IX+UNIT_BITFRIENDLYFIRE),1
LD A,(DDD)
LD (IX+UNIT_STOPBIT),0
CP 1
JP Z,PBUL1
CP 3
JP Z,PBUL2
CP 2
JP Z,PBUL3
CP 4
JP Z,PBUL4
RET
DDD DEFB 0
UNGO LD A,(IX+UNIT_TYPEOFTANK)
CP 2
JR Z,UNGO2
CP 12
JR Z,UNGO2
LD A,(TIME)
or a;CP 0
RET NZ
UNGO2 LD A,(IX+UNIT_TYPEOFTANK)
CP 21
RET NC
PUSH IX
CALL FIREWAR
POP IX
LD (IX+UNIT_ANIMATION),0
LD A,(RAZWOR)
CP 1
CALL Z,RNDR
LD A,(IX+UNIT_NEEDRND)
CP 1
CALL Z,RND
LD A,(IX+UNIT_DIRECTION2)
CP 3
CALL Z,KEYDFC
LD A,(IX+UNIT_DIRECTION2)
CP 1
CALL Z,KEYUFC
LD A,(IX+UNIT_DIRECTION2)
CP 2
CALL Z,KEYRFC
LD A,(IX+UNIT_DIRECTION2)
CP 4
CALL Z,KEYLFC
RET
RNDR LD A,(IX+UNIT_COUNTER)
or a;CP 0
RET NZ
;XOR A
LD (RAZWOR),A;0
RND
LD (IX+UNIT_NEEDRND),0
CALL INT55
call ldarnd;LD A,R
CP 32
JP C,I1
CP 64
JP C,I2
CP 96
JP C,I3
CP 128
JP C,I4
RET
I1 LD (IX+UNIT_DIRECTION2),1
RET
I2 LD (IX+UNIT_DIRECTION2),2
RET
I3 LD (IX+UNIT_DIRECTION2),3
RET
I4 LD (IX+UNIT_DIRECTION2),4
RET
INT55
LD A,(WARTAN)
CP 6
RET NC
CALL RANDOM
CP 100
RET NC
POP BC
JP I3
KEYDFC LD A,3
CALL YOMPA1P
LD A,(IX+UNIT_COUNTER)
or a;CP 0
JP NZ,KEYD3
LD A,(IX+UNIT_STOPBIT)
CP 1
JP Z,RND
JP KEYDF2
KEYUFC LD A,1
CALL YOMPA1P
LD A,(IX+UNIT_COUNTER)
or a;CP 0
JP NZ,KEYF3
LD A,(IX+UNIT_STOPBIT)
CP 1
JP Z,RND
JP KEYUF2
KEYRFC
LD A,2
CALL COMPA1P
LD A,(IX+UNIT_COUNTER)
or a;CP 0
JP NZ,KEYYR3
LD A,(IX+UNIT_STOPBIT)
CP 1
JP Z,RND
JP KEYRF2
KEYLFC
LD A,4
CALL COMPA1P
LD A,(IX+UNIT_COUNTER)
or a;CP 0
JP NZ,KEYLL3
LD A,(IX+UNIT_STOPBIT)
CP 1
JP Z,RND
JP KEYLF2
;BIX DEFW 0
BULLSRA
LD (BOMA),A ;2=right, 4=left
LD A,(IX+UNIT_YESORNOT)
CP 1
CALL Z,BOMPAR2
LD A,(IX+UNIT_YESORNOT)
CP 2
CALL Z,BOMPAR2
RET
BOMPAL2 LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD BC,8
SBC HL,BC
JP BOMPAX
BOMPAR2
LD A,(BOMA)
CP 4 ;left
JR Z,BOMPAL2
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD BC,8
ADD HL,BC
JP BOMPAX
BOMPAX LD (BOM1X),HL
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD A,(IX+UNIT_BITPARENTSBULL)
LD (SEA),A
LD (BOM1Y),HL
LD (BOMIX),IX
LD IX,UNITS
FFF2 LD A,(IX)
CP 255
JR Z,FFF
LD A,(IX)
or a;CP 0
JR Z,XCV
CP 4
CALL C,BOMPAR3
XCV LD DE,UNITSZ;24;-----WAR COMPAIRE
ADD IX,DE
JR FFF2
FFF LD IX,(BOMIX)
LD (IX+UNIT_STOPBIT),0
RET
;ZBC DEFW 0
BOMPAR3
LD A,(SEA)
LD B,A
LD A,(IX+UNIT_BITPARENTSBULL)
CP B
RET Z
LD A,(SEA)
CP 3
CALL NC,NU11
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD DE,(BOM1X)
LD A,(BOMA)
CP 2 ;right
jr Z,C22B ;(hl-de)==(0..15) => BOMPAR4, иначе ret
CP 4 ;left
;JR Z,C44B ;(de-hl)==(0..15) => BOMPAR4, иначе ret
RET nz
C44B ;(de-hl)==(0..15) => BOMPAR4, иначе ret
ex de,hl
C22B ;(hl-de)==(0..15) => BOMPAR4, иначе ret
xor a
sbc hl,de
cp h
ret nz
ld a,l
cp 16
ret nc
;BOMPAR4
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD BC,8
SBC HL,BC
ex de,hl
LD hl,(BOM1Y)
xor a
sbc hl,de
cp h
ret nz
ld a,l
cp 24
ret nc
BNDCOMP
LD A,(IX+UNIT_YESORNOT)
CP 1
CALL Z,BNF
LD IX,(BOMIX)
LD (IX+UNIT_STOPBIT),1
POP HL ;???
POP HL ;???
RET
BNF
PUSH IX
LD IX,(BOMIX)
LD A,(IX+UNIT_BITFRIENDLYFIRE)
CP 0
JP Z,DEATH0
CP 1
JP Z,DEATH1
POP IX
RET
DEATH0 POP IX
LD A,(IX+UNIT_BITPARENTSBULL)
CP 3
JP NC,DEATH666
LD A,(IX+UNIT_SHELLTIME)
CP 0
RET NZ
LD (IX+UNIT_BITFRIENDLYFIRE),100; W KOGO
RET
DEATH666 LD A,(IX+UNIT_SHELLTIME)
CP 0
RET NZ
LD A,(IX+UNIT_ENERGY)
CP 0
JP Z,DEATH
DEC A
LD (IX+UNIT_ENERGY),A
PUSH IX
XOR A
CALL AFXPLAY
POP IX
LD A,(IX+UNIT_TYPEOFTANK)
CP 4
JR Z,DEATH777
CP 5
JR Z,DEATH888
RET
DEATH777 LD A,(IX+UNIT_ENERGY)
CP 3
RET NZ
LD HL,256+128+128+128 ;broken flag???
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
RET
CC1 LD (IX+UNIT_DIRECTION2),1
LD (IX+UNIT_DIRECTION),1
JP DDDEA
C2 LD (IX+UNIT_DIRECTION2),3
LD (IX+UNIT_DIRECTION),3
JP DDDEA
C3 LD (IX+UNIT_DIRECTION2),4
LD (IX+UNIT_DIRECTION),4
JP DDDEA
C4 LD (IX+UNIT_DIRECTION2),2
LD (IX+UNIT_DIRECTION),2
JP DDDEA
DEATH888 LD (IX+UNIT_SHELLTIME),16
LD A,1
LD (RAZWOR),A
LD A,(IX+UNIT_COUNTER)
CP 0
JP NZ,DDDEA
;go back???
LD A,(IX+UNIT_DIRECTION2)
CP 3
JR Z,CC1
CP 1
JR Z,C2
CP 2
JR Z,C3
CP 4
JR Z,C4
DDDEA PUSH IX
PUSH IX
POP HL
LD A,16
CALL SHEELDW
POP IX
LD A,(IX+UNIT_ENERGY)
CP 5
JR Z,DEAT8
CP 2
JR Z,DEAT9
RET
DEAT8 LD HL,256+128+128+256 ;???
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
RET
DEAT9
LD HL,256+128+128+128 ;???
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
RET
DEATH1 POP IX
LD A,(IX+UNIT_BITPARENTSBULL)
CP 1
JP Z,DEATH6
CP 2
JP Z,DEATH7
RET
DEATH6
LD A,(IX+UNIT_SHELLTIME)
CP 0
JR NZ,DEATH3
LD A,(UP1)
CP 130 ;129 '0', 130 '1'
JP Z,DEAT77 ;(UP1)=129, jp DEATH (без NEWTAN1)
DEC A
LD (UP1),A
LD A,100
LD (NEWTAN1),A
JP DEATH
DEATH7
LD A,(IX+UNIT_SHELLTIME)
CP 0
JR NZ,DEATH3
LD A,(UP2)
CP 130 ;129 '0', 130 '1'
JP Z,DEAT88 ;(UP2)=129, jp DEATH (без NEWTAN2)
DEC A
LD (UP2),A
LD A,100
LD (NEWTAN2),A
;JP DEATH
DEATH
LD HL,TEXT7
LD (TEXTW),HL
LD D,#C0
LD E,#10
LD BC,256+24
LD HL,128+24
CALL TEXT
LD HL,TEXT6
LD (TEXTW),HL
LD D,#C0
LD E,#10
LD BC,256+24
LD HL,128
CALL TEXT
LD A,(IX+UNIT_SHELLTIME)
CP 0
JR NZ,DEATH3
LD A,(IX+UNIT_BITFRIENDLYFIRE)
CP 253
CALL Z,CINTRO2
LD (IX+UNIT_YESORNOT),4
LD (IX+UNIT_TIMEFORSHOTONWAR),0
LD (IX+UNIT_STOPBIT),1
CALL POINT
LD A,(IX+UNIT_BITFRIENDLYFIRE)
CP 253
CALL Z,CINTRO
DEATH3 LD IX,(BOMIX)
LD (IX+UNIT_YESORNOT),0
LD (IX+UNIT_STOPBIT),0
POP HL
POP HL
POP HL
RET
CINTRO2 LD A,(IX+UNIT_TYPEOFTANK)
CP 0
JP Z,WSEBAH
DEC A
LD (IX+UNIT_TYPEOFTANK),A
PUSH IX
XOR A
CALL AFXPLAY
POP IX
LD A,8
LD (ATAKA),A
LD IX,(BOMIX)
LD (IX+UNIT_YESORNOT),3 ;BONG1
LD (IX+UNIT_STOPBIT),1
POP HL
POP HL
POP HL
POP HL
RET
CINTRO LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD BC,8
ADD HL,BC
LD (IX+UNIT_X),L
LD (IX+UNIT_X+1),H
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD BC,8
ADD HL,BC
LD (IX+UNIT_Y),L
LD (IX+UNIT_Y+1),H
PUSH IX
LD IX,UNITS
LD A,(WR1)
LD (IX+UNIT_WATERWAY),A
LD A,(WR2)
ld (ix+(4*UNITSZ+UNIT_WATERWAY)),a ;(IX+117),A
POP IX
RET
BULLSR2; LD IX,UNITS ;??? why commented?
LD (BOMA),A ;3=down, 1=up
LD A,(IX)
CP 1
CALL Z,YBMPAR2
LD A,(IX)
CP 2
CALL Z,YBMPAR2
RET
YBMPAL2 LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD BC,8
SBC HL,BC
JP YBMPAX
YBMPAR2
LD A,(BOMA)
CP 1 ;up
JR Z,YBMPAL2
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD BC,8
ADD HL,BC
JP YBMPAX
YBMPAX LD (BOM1Y),HL
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD (BOM1X),HL
LD A,(IX+UNIT_BITPARENTSBULL)
LD (SEA),A
LD (BOMIX),IX
LD IX,UNITS
FFF4 LD A,(IX)
CP 255
JR Z,FFF3
CP 0
JR Z,XCV2
CP 4
CALL C,YBMPAR3
XCV2 LD DE,UNITSZ;24
ADD IX,DE
JR FFF4
FFF3 LD IX,(BOMIX)
LD (IX+UNIT_STOPBIT),0
RET
NU11
LD A,(IX+UNIT_BITPARENTSBULL)
CP 3
RET C
POP HL
RET
YBMPAR3 LD A,(SEA)
LD B,A
LD A,(IX+UNIT_BITPARENTSBULL)
CP B
RET Z
LD A,(SEA)
CP 3
CALL NC,NU11
LD L,(IX+UNIT_Y)
LD H,(IX+UNIT_Y+1)
LD B,16
LD DE,(BOM1Y)
LD A,(BOMA)
CP 1 ;up
JR Z,C44YB
CP 3 ;down
JR Z,C22YB
RET
PROW
LD A,E
CP 32
JP C,YBMPAR4
RET
JKJDYB LD A,E
CP L
JP Z,YBMPAR4
INC HL
DJNZ JKJDYB
RET
C44YB LD A,(IX+UNIT_BITFRIENDLYFIRE)
CP 253
JP Z,PROW
LD A,E
CP 16
JR C,JKJDYB
LD BC,16
ADD HL,BC
LD A,E
CP L
RET NC
LD BC,16
SBC HL,BC
LD A,E
CP L
JP NC,YBMPAR4
RET
JKJD2YB
LD A,E
CP L
JR Z,YBMPAR4
INC DE
DJNZ JKJD2YB
RET
C22YB LD A,E
CP 8
JR C,JKJD2YB
LD A,E
CP L
RET NC
PUSH HL
PUSH DE
POP HL
LD BC,8
ADD HL,BC
PUSH HL
POP DE
POP HL
LD A,E
CP L
JP NC,YBMPAR4
RET
Y22SPB LD A,L
CP 239
JP Z,CNN2B
RET
CNN2B POP AF
JP BNDCOMP
C11YB
JKJD1YB LD A,D
CP 1
CALL Z,Y22SPB
LD A,H
CP D
RET NZ
LD A,E
CP L
JP Z,BNDCOMP
INC HL
DJNZ JKJD1YB
RET
C33YB
JKJD3YB LD A,D
CP 1
CALL Z,Y22SPB
LD A,H
CP D
RET NZ
LD A,E
CP L
JP Z,BNDCOMP
DEC DE
DJNZ JKJD3YB
RET
BKAA
LD DE,(BOM1X)
LD A,D
CP 1
JP Z,ENDCB
RET
ENDCB POP AF
JP BNDCOMP
YBMPAR4
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD DE,(BOM1X)
LD A,E
CP 248
JP Z,BLKABB
LD A,H
CP 1
JR Z,BLKA
LD A,L
CP 248
CALL Z,BKAA
LD A,L
CP 0
JR Z,BLKA8
BLKABB LD BC,8
SBC HL,BC
BLKA LD B,24
LD A,(IX+UNIT_BITFRIENDLYFIRE)
CP 253
CALL Z,SMENA
BLKAZ LD DE,(BOM1X)
LD A,(BOMA)
CP 1 ;up
JR Z,C11YB
CP 3 ;down
JR Z,C33YB
RET
BLKA8 LD B,16
JP BLKAZ
SMENA
LD B,32
RET
STARTM LD A,(MAP)
INC A
LD (MAP),A
JP FIGHTT
NEXTMIS
PUSH IX
LD IX,UNITS
LD DE,192
ADD IX,DE
LD B,7
NEX3 LD A,(IX)
CP 1
JR Z,NEX1
LD DE,48
ADD IX,DE
DJNZ NEX3
NEX2 POP IX
LD A,(WARTAN)
CP 0
RET NZ
XOR A
LD (TIMES),A
LD (TIMEW),A
LD A,1
LD (NEWLEVEL),A
LD A,(MAP)
CP 255
CALL Z,NJNAA
RET
NEX1 POP IX
RET
ADD20 LD A,(IX+UNIT_YESORNOT)
CP 1 ;SHOT1
RET NZ
LD A,(IX+UNIT_BITFRIENDLYFIRE)
CP 253
RET Z
LD A,(TANKP) ;tank phase?
CP 4
RET C
LD L,(IX+UNIT_NUMBERSPRITES)
LD H,(IX+UNIT_NUMBERSPRITES+1)
LD DE,8
ADD HL,DE ;мерцать белый-красный(red)??? (изначально hl=(IX+UNIT_NUMBERSPRITES))
RET
ADD21 LD A,(IX+UNIT_TYPEOFTANK)
CP 21
RET C
LD A,(TANKPP)
CP 16
RET C
XOR A
LD (YESORNO),A
RET
NEWBON
LD HL,BONUS
LD A,(MAP)
CP 0
JR Z,GGGG
CP 255
JR Z,GGGG
LD B,A
GGG INC HL
INC HL
INC HL
DJNZ GGG
GGGG LD A,(HL)
CP 0
JR Z,GG44
LD B,A
LD A,(WARTAN)
CP B
JR Z,NEWB2
GG44 INC HL
LD A,(HL)
CP 0
JR Z,GG45
LD B,A
LD A,(WARTAN)
CP B
JR Z,NEWB2
GG45 INC HL
LD A,(HL)
CP 0
RET Z
LD B,A
LD A,(WARTAN)
CP B
JR Z,NEWB2
RET
NEWB2 LD (HL),0
LD A,(IX+UNIT_TYPEOFTANK)
ADD A,10
LD (IX+UNIT_TYPEOFTANK),A
RET
RT1
LD HL,SPRBONUS0;256+128+16
LD A,21
LD (A21),A
JP CCC
RT2
LD HL,SPRBONUS1;256+128+18
LD A,22
LD (A21),A
JP CCC
RT3
LD HL,SPRBONUS2;256+128+20
LD A,23
LD (A21),A
JP CCC
RT4
LD HL,SPRBONUS3;256+128+22
LD A,24
LD (A21),A
JP CCC
RT5
LD HL,SPRBONUS4;256+128+24
LD A,25
LD (A21),A
JP CCC
RT6
LD HL,SPRBONUS5;256+128+26
LD A,26
LD (A21),A
JP CCC
RT7
LD HL,SPRBONUS6;256+128+28
LD A,27
LD (A21),A
JP CCC
RT8
LD HL,SPRBONUS7;256+128+30
LD A,28
LD (A21),A
JP CCC
RT9
LD HL,SPRBONUS8;256+128+32
LD A,29
LD (A21),A
JP CCC
PRIZ LD A,(IX+UNIT_TYPEOFTANK)
CP 11
JR Z,PRIZ666
CP 12
JR Z,PRIZ666
CP 13
JR Z,PRIZ666
RET
PRIZ666 LD (IX+UNIT_YESORNOT),0
LD IX,SLU
LD (IX+UNIT_YESORNOT),8 ;???
CALL RANDOM
CP 36
JP C,RT1
CP 72
JP C,RT2
CP 108
JP C,RT3
CP 144
JP C,RT4
CP 180
JP C,RT5
CP 216
JP C,RT6
CP 255
JP C,RT7
JP RT1
CCC
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
C224A CALL RANDOM
CP 224 ;??? это X!
JR NC,C224A
;SRL A
;SRL A
;SRL A
;SLA A
;SLA A
;SLA A
and 0xf8
LD L,A
LD H,0
LD B,0
LD C,16
ADD HL,BC
LD (IX+UNIT_X),L
LD (IX+UNIT_X+1),H
C224 CALL RANDOM
CP MAXY-16;208
JR NC,C224
;SRL A
;SRL A
;SRL A
;SLA A
;SLA A
;SLA A
and 0xf8
LD L,A
LD H,0
LD B,0
LD C,16
ADD HL,BC
LD (IX+UNIT_Y),L
LD (IX+UNIT_Y+1),H
LD A,(A21)
LD (IX+UNIT_TYPEOFTANK),A
RET
if 1==0
RANDOM
call ldarnd;LD A,R
RLCA ; RANDOMIZE
RLCA
RLCA
RLCA
LD B,A
call ldarnd;LD A,R
ADD A,B
RET
endif
P500 LD A,(IX+UNIT_TIMEFORSHOTONWAR)
DEC A
LD (IX+UNIT_TIMEFORSHOTONWAR),A
CP 0
RET NZ
LD (IX+UNIT_YESORNOT),0
LD (YESORNO),A
RET
BW XOR A
RET
EXITBOS LD A,2
LD (BOS),A
LD (IX+UNIT_BITFRIENDLYFIRE),0
LD A,1
LD (NEWLEVEL),A
CALL BADBAD
RET
BOSS
LD A,(MAP)
CP 31
RET NZ
LD A,(BOS)
CP 2
RET Z
LD A,(BOSTART)
CP 0
JR Z,BOOO
DEC A
LD (BOSTART),A
BOOO LD A,(TANKB)
INC A
CP 64
CALL Z,BW
LD (TANKB),A
LD A,1
LD (BOS),A
LD IX,UNITS
LD DE,14*UNITSZ;336
ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
CP 1 ;SHOT1
JR NZ,EXITBOS
LD HL,SPRMEGASHIP;256+36
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
LD HL,(BOSX)
LD (IX+UNIT_X),L
LD (IX+UNIT_X+1),H
LD HL,(BOSY)
LD D,0
LD A,(BOSTART)
LD E,A
SBC HL,DE
LD A,(TANKB)
CP 32
CALL NC,BOSANI
LD (IX+UNIT_Y),L
LD (IX+UNIT_Y+1),H
LD (IX+UNIT_DIRECTION),0
LD (IX+UNIT_ANIMATION),0
LD (IX+UNIT_BITFRIENDLYFIRE),253
LD A,(BOSTART)
CP 0
RET NZ
LD A,(BOSSCIK)
INC A
LD (BOSSCIK),A
CP 100
JR NC,FZZ
RET
FZZ LD A,(MOVE)
CP 1
JP Z,BOSL
CP 2
JP Z,BOSR
LD A,(ATAKA)
CP 0
JR NZ,ATAKA2
LD A,(IX+UNIT_STOPBIT)
DEC A
CP 0
JP NZ,MNOL2
LD (IX+UNIT_STOPBIT),A
ATAKA3
CALL RANDOM
CP 128
JR C,BOSN
LD A,1
LD (MOVE),A
RET
ATAKA2
DEC A
LD (ATAKA),A
JP ATAKA3
BOSANI
DEC HL
RET
BOSN
LD A,2
LD (MOVE),A
RET
MNOL
XOR A
LD (MOVE),A
MNOL2
call ldarnd;LD A,R
LD (IX+UNIT_STOPBIT),A
LD (IX+UNIT_STAR),0
LD (IX+UNIT_DIRECTION),5
LD L,(IX+UNIT_X)
LD H,(IX+UNIT_X+1)
LD E,(IX+UNIT_Y)
LD D,(IX+UNIT_Y+1)
LD DE,UNITSZ;24
ADD IX,DE
LD A,(IX+UNIT_YESORNOT)
CP 0
RET NZ
LD (IX+UNIT_YESORNOT),2 ;BULL1
LD A,L
ADD A,8
LD (IX+UNIT_X),A
LD (IX+UNIT_X+1),H
PUSH HL
LD HL,SPRDROP;256+34
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
POP HL
LD (IX+UNIT_Y),E
LD (IX+UNIT_Y+1),D
LD (IX+UNIT_BITFRIENDLYFIRE),1
LD (IX+UNIT_DIRECTION),3
LD (IX+UNIT_STAR),1
LD (IX+UNIT_ENERGY),1
LD A,(ATAKA)
CP 0
RET Z
LD BC,UNITSZ;24
ADD IX,BC
LD A,(IX+UNIT_YESORNOT)
CP 0
RET NZ
LD (IX+UNIT_YESORNOT),2
LD A,L
ADD A,8
LD (IX+UNIT_X),A
LD (IX+UNIT_X+1),H
PUSH HL
LD HL,SPRDROP;256+34
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
POP HL
LD (IX+UNIT_Y),E
LD (IX+UNIT_Y+1),D
LD (IX+UNIT_BITFRIENDLYFIRE),1
LD (IX+UNIT_DIRECTION),3
LD (IX+UNIT_STAR),1
LD (IX+UNIT_ENERGY),2
LD BC,UNITSZ;24
ADD IX,BC
LD A,(IX+UNIT_YESORNOT)
CP 0
RET NZ
LD (IX+UNIT_YESORNOT),2
LD A,L
ADD A,8
LD (IX+UNIT_X),A
LD (IX+UNIT_X+1),H
LD HL,SPRDROP;256+34
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
LD (IX+UNIT_Y),E
LD (IX+UNIT_Y+1),D
LD (IX+UNIT_BITFRIENDLYFIRE),1
LD (IX+UNIT_DIRECTION),3
LD (IX+UNIT_STAR),1
LD (IX+UNIT_ENERGY),3
RET
BOSL LD HL,(BOSX)
LD A,L
CP 0
JP Z,MNOL
DEC HL
LD (BOSX),HL
LD A,(IX+UNIT_STAR)
CP 32
JP Z,MNOL
INC A
LD (IX+UNIT_STAR),A
RET
BOSR LD HL,(BOSX)
LD A,L
CP 232
JP Z,MNOL
INC HL
LD (BOSX),HL
LD A,(IX+UNIT_STAR)
CP 32
JP Z,MNOL
INC A
LD (IX+UNIT_STAR),A
RET
NEWTANK
LD (IX),1
LD HL,MASSIV
LD DE,20
LD A,(MAP)
CP 0
JR Z,NEWT1
CP 255
JR Z,NEWT1
LD B,A
MASS ADD HL,DE
DJNZ MASS
LD A,(BOS)
CP 1
JR Z,NEWT2
NEWT1 LD A,(WARTAN)
CP 0
JR Z,NEWT2
LD B,A
MASS2 INC HL
DJNZ MASS2
NEWT2 LD A,(HL)
CP 1
CALL Z,ENEMY1
CP 2
CALL Z,ENEMY2
CP 3
CALL Z,ENEMY3
CP 4
CALL Z,ENEMY4
CP 5
CALL Z,ENEMY5
LD (IX+UNIT_NUMBERSPRITES),L
LD (IX+UNIT_NUMBERSPRITES+1),H
LD (IX+UNIT_DIRECTION2),3
LD (IX+UNIT_DIRECTION),0
LD (IX+UNIT_ANIMATION),0
LD (IX+UNIT_COUNTER),0
call ldarnd;LD A,R
LD (IX+UNIT_TIMEFORSHOTONWAR),A
LD (IX+UNIT_STOPBIT),0
LD (IX+UNIT_BITFRIENDLYFIRE),0
LD (IX+UNIT_SHELLTIME),0
LD (IX+UNIT_ICE),0
LD (IX+UNIT_SAND),0
LD (IX+UNIT_WATERWAY),0
RET
ENEMY1 LD HL,SPRENEMY1;256+128
LD (IX+UNIT_TYPEOFTANK),1; TYPE OF TANK
LD (IX+UNIT_ENERGY),0
LD (IX+UNIT_STAR),0
RET
ENEMY2 LD HL,SPRENEMY2;256+128+128
LD (IX+UNIT_TYPEOFTANK),2; TYPE OF TANK
LD (IX+UNIT_ENERGY),0
LD (IX+UNIT_STAR),0
RET
ENEMY3 LD HL,SPRENEMY3;256+128+128+128
LD (IX+UNIT_TYPEOFTANK),3; TYPE OF TANK
LD (IX+UNIT_ENERGY),3
LD (IX+UNIT_STAR),0
RET
ENEMY4 LD HL,SPRENEMY4;256+128+256+128
LD (IX+UNIT_TYPEOFTANK),4; TYPE OF TANK
LD (IX+UNIT_ENERGY),6
LD (IX+UNIT_STAR),0
RET
ENEMY5 LD HL,SPRENEMY5;256+128+256+256
LD (IX+UNIT_TYPEOFTANK),5; TYPE OF TANK
LD (IX+UNIT_ENERGY),10
LD (IX+UNIT_STAR),1
PUSH IX
LD DE,UNITSZ;24
ADD IX,DE
LD (IX+UNIT_STAR),1
POP IX
RET
MASSIV
DEFB 1,1,1,1,1,1,1,1,1,1
DEFB 1,1,1,1,1,1,1,1,1,1
DEFB 2,2,2,1,1,1,1,1,1,1
DEFB 1,1,1,1,1,1,1,1,1,1
DEFB 2,1,1,1,2,1,1,1,2,1
DEFB 1,1,1,1,2,1,1,1,2,1
DEFB 3,3,3,1,1,1,1,1,1,1
DEFB 1,1,2,1,1,1,1,2,1,1
DEFB 2,2,3,1,2,1,1,1,3,1
DEFB 1,1,1,3,1,1,3,1,1,1
DEFB 3,3,3,2,3,2,1,1,1,1
DEFB 3,2,2,2,1,1,1,2,2,2
DEFB 3,2,3,3,3,1,3,1,1,2
DEFB 3,3,3,3,3,3,3,3,3,3
DEFB 1,3,2,2,2,2,2,2,1,1
DEFB 1,2,3,3,2,1,1,2,3,3
DEFB 2,3,2,1,3,2,2,2,1,1
DEFB 2,2,2,3,1,2,3,1,2,3
DEFB 1,2,2,1,1,1,1,1,1,1
DEFB 1,1,1,1,1,1,1,1,2,3
DEFB 2,2,2,1,1,1,1,1,1,1
DEFB 1,1,1,1,1,1,2,1,3,3
DEFB 1,1,1,1,3,3,3,3,3,3
DEFB 1,1,1,1,1,1,1,1,1,1
DEFB 2,2,2,3,1,1,1,1,2,2
DEFB 2,2,2,2,2,2,2,2,2,3
DEFB 1,2,2,1,1,1,1,1,1,1
DEFB 1,1,1,1,2,1,1,1,2,3
DEFB 3,2,2,1,3,1,1,2,1,1
DEFB 1,3,3,3,1,2,2,1,2,2
DEFB 5,5,5,5,5,5,1,1,1,1
DEFB 1,1,1,1,5,5,5,5,5,5
DEFB 3,2,2,3,3,1,1,1,1,1
DEFB 1,1,1,1,1,1,1,1,1,1
DEFB 2,2,2,2,2,2,2,2,2,2
DEFB 2,2,2,2,2,2,2,2,2,2
DEFB 4,4,4,2,3,3,1,1,2,2
DEFB 2,2,2,2,1,3,2,1,1,1
DEFB 1,1,2,2,3,3,1,1,2,2;---20
DEFB 2,2,2,2,1,3,2,1,1,1
DEFB 1,1,4,2,3,3,1,1,2,2; 21
DEFB 1,1,2,3,2,1,1,1,3,3
DEFB 1,1,1,2,2,2,1,1,2,2;22
DEFB 1,1,1,1,1,1,2,1,1,1
DEFB 4,4,4,3,3,3,3,3,3,3;23
DEFB 3,3,3,3,3,3,3,3,3,3
DEFB 1,1,1,2,3,3,1,1,2,2
DEFB 2,1,2,2,1,1,2,1,1,1
DEFB 1,2,2,2,1,1,1,1,2,2;25
DEFB 1,1,1,2,1,1,2,1,1,1
DEFB 3,3,3,2,3,3,3,2,2,2;26
DEFB 2,2,2,2,1,3,2,1,1,1
DEFB 4,2,4,3,3,3,4,4,4,2;27
DEFB 2,3,3,3,4,3,3,3,3,4
DEFB 2,2,2,2,3,3,1,1,2,2;28
DEFB 2,2,2,2,1,3,2,1,1,1
DEFB 2,2,2,2,3,3,1,1,2,2;29
DEFB 2,2,2,2,1,3,2,1,2,1
DEFB 1,1,1,2,1,1,1,1,2,2;30
DEFB 2,1,1,2,1,1,2,1,1,1
DEFB 4,4,3,2,4,4,3,2,4,2;31
DEFB 4,4,3,3,2,3,4,3,4,3
DEFB 1,4,3,2,4,4,3,1,4,2;32
DEFB 1,1,1,1,1,1,1,1,1,1
BONUS DEFB 15,8,3
DEFB 17,3,0
DEFB 10,7,0
DEFB 12,11,1
DEFB 7,5,0
DEFB 10,8,0
DEFB 15,10,4
DEFB 12,7,5
DEFB 3,0,0
DEFB 18,9,0
DEFB 13,3,0
DEFB 0,0,0
DEFB 15,7,0
DEFB 7,6,5
DEFB 6,0,1
DEFB 10,0,0
DEFB 19,13,5
DEFB 17,3,0
DEFB 13,7,5
DEFB 9,0,0
DEFB 18,7,2
DEFB 16,5,1
DEFB 19,10,0
DEFB 8,0,0
DEFB 16,11,4
DEFB 10,7,0
DEFB 0,0,0
DEFB 17,10,0
DEFB 18,12,5
DEFB 16,9,4
DEFB 19,3,0
DEFB 15,0,0
SM1 DEFB #10
SM2 DEFB #13
MMM DEFB 0
MMM2 DEFB 0
WERH DEFW #C001-4096
WERH2 DEFW 65536-512
TIME DEFB 0
;блок перенесён в units
HISTORE DEFW 0 ;Hi-Score table
DEFS 256
NEWLEVEL DEFB 0