;*L+
;*D-
;(C) 1996 Медноногов Алексей
;Подводный бой с НЛО
db "Alex "
ANGSNUM EQU 33
SHDSCR EQU #9000
VISSCR EQU #C000
; ORG #B000 ;не трогать
RTINF4 DEFB 0,0,0,0,0,0
SHINF4 DEFB 0,0,0
BEGIN
CMPMOD BIT 7,A
JR NZ,CM1
CP B
RET
CM1 CPL
CP B
CPL
RET
OURENT EQU T_INTR ;DEFB 0 ; entry point for our ship (0..2)
HISENT EQU T_UFO ;DEFB 1 ; entry point for his ship (0..2)
RETURN DEFB 0 ; our return parameter
;0-Ucrash,1-Usit,2-paritet,3-Xwound,4-Xcrash
CMPSGN XOR 128
LD C,A
LD A,B
XOR 128
LD B,A
LD A,C
CP B
RET
;PLOT2 LD L,D
; LD H,TAB1/256
; LD B,(HL)
; INC H
; LD C,(HL)
; INC H
; LD L,E
; LD A,(HL)
; OR C
; LD C,A
; INC H
; LD E,(HL)
; LD H,B
; LD L,C
; LD BC,VISSCR-SHDSCR
; ADD HL,BC
; CALL MEM7
; LD A,(HL)
; XOR E
; LD (HL),A
; JP PT128
LINE2 PUSH HL; NEW line from p1(l,h) to p2(e,d)
PUSH DE
PUSH BC
LD B,#15
LD C,#1D
LD A,E
SUB L
JR NC,M1LI_
NEG
EX DE,HL
M1LI_ LD L,A
LD A,D
SUB H
JR NC,M2LI_
NEG
DEC B
M2LI_ LD H,A
CP L
JR C,M3LI_
LD A,B
LD B,C
LD C,A
LD A,H
LD H,L
LD L,A
M3LI_ LD A,B
LD (dePENC),A
LD A,C
LD (inDEPC),A
PUSH DE
LD C,L
LD E,L
LD L,H
CALL DIVB
LD A,E
LD (simLIN+1),A
LD L,C
LD A,L
LD (ldLIN+1),A
LD A,D
LD (decLIN+1),A
OR A
LD B,E
RR B
INC B
OR A
RR C
POP DE
INC L
JR L4LI_
simLIN LD B,#FF
L4LI_ PUSH DE
;------
EXX
POP DE
LD L,D
LD H,TAB1/256
LD B,(HL)
INC H
LD C,(HL)
INC H
LD L,E
LD A,(HL)
OR C
LD C,A
INC H
LD L,(HL)
LD A,(BC)
OR L
LD (BC),A
EXX
;-----
inDEPC DEC D
DEC L
JR Z,retLIN
LD A,C
decLIN SUB #02
LD C,A
JR C,ldLIN
DJNZ L4LI_
dePENC DEC E
JR simLIN
ldLIN ADD A,#FF
LD C,A
JR L4LI_
retLIN POP BC
POP DE
POP HL
RET
FORMTBL ; forms rescaled cosines table
; forms line-drawing aid table
LD IX,COSTBL
LD HL,ANGLES
LD B,ANGSNUM
FTCC1 PUSH BC
PUSH HL
LD A,(HL)
LD E,0
LD B,128
FTCC2 PUSH BC
PUSH AF
PUSH DE
LD L,A
CALL MULB
LD (IX),D
INC IX
POP DE
POP AF
POP BC
INC E
DJNZ FTCC2
POP HL
POP BC
INC HL
DJNZ FTCC1
LD HL,TAB1
LD C,4
LD A,#90
FTCC21 LD E,8
FTCC22 PUSH AF
LD B,8
FTCC23 LD (HL),A
INC A
INC HL
DJNZ FTCC23
POP AF
DEC E
JR NZ,FTCC22
ADD A,8
DEC C
JR NZ,FTCC21
LD C,4
FTCC3 LD E,8
XOR A
FTCC4 LD B,8
FTCC5 LD (HL),A
INC HL
DJNZ FTCC5
ADD A,32
DEC E
JR NZ,FTCC4
DEC C
JR NZ,FTCC3
LD C,32
XOR A
FTCC6 LD B,8
FTCC7 LD (HL),A
INC HL
DJNZ FTCC7
INC A
DEC C
JR NZ,FTCC6
LD A,128
LD B,0
FTCC9 LD (HL),A
INC HL
RRCA
DJNZ FTCC9
RET
GETCOS AND 127
LD B,A
LD DE,PTTABL
ADD HL,DE
LD A,(HL)
BIT 7,A
PUSH AF
JR Z,GC1
NEG
GC1 LD E,A
LD D,0
LD HL,COSTBL
ADD HL,DE
LD E,0
LD A,B
AND 96
CP 32
JR Z,GC2PART
CP 64
JR Z,GC3PART
CP 96
JR Z,GC4PART
GC1PART LD D,B
SRL D
RR E
ADD HL,DE
LD B,(HL)
JR GCEND
GC2PART LD A,64
SUB B
LD D,A
SRL D
RR E
ADD HL,DE
LD A,(HL)
NEG
LD B,A
JR GCEND
GC3PART LD A,B
SUB 64
LD D,A
SRL D
RR E
ADD HL,DE
LD A,(HL)
NEG
LD B,A
JR GCEND
GC4PART LD A,128
SUB B
LD D,A
SRL D
RR E
ADD HL,DE
LD B,(HL)
GCEND POP AF
LD A,B
RET Z
NEG
RET
GETSIN SUB 32
JP GETCOS
ROTX LD A,C
ADD A,C
ADD A,C
LD L,A
LD H,0
INC HL
PUSH HL
LD A,D
LD C,A
CALL GETCOS
EXX
LD C,A
POP HL
PUSH HL
DEC HL
LD DE,PTTABL
ADD HL,DE
LD H,(HL)
EXX
LD A,C
POP HL
PUSH HL
INC HL
CALL GETSIN
EXX
SUB C
NEG
LD L,A
EXX
POP HL
PUSH HL
LD A,C
CALL GETSIN
EXX
LD C,A
EXX
POP HL
INC HL
LD A,C
CALL GETCOS
EXX
ADD A,C
LD B,A
RET
ROTY LD A,C
ADD A,C
ADD A,C
LD L,A
LD H,0
PUSH HL
LD A,D
LD C,A
CALL GETCOS
EXX
LD C,A
POP HL
INC HL
PUSH HL
LD DE,PTTABL
ADD HL,DE
LD L,(HL)
EXX
LD A,C
POP HL
PUSH HL
INC HL
CALL GETSIN
EXX
ADD A,C
LD H,A
EXX
POP HL
PUSH HL
DEC HL
LD A,C
CALL GETSIN
EXX
LD C,A
EXX
POP HL
INC HL
LD A,C
CALL GETCOS
EXX
SUB C
LD B,A
RET
ROTZ LD A,C
ADD A,C
ADD A,C
LD L,A
LD H,0
PUSH HL
LD A,D
LD C,A
CALL GETCOS
EXX
LD C,A
POP HL
INC HL
PUSH HL
INC HL
LD DE,PTTABL
ADD HL,DE
LD B,(HL)
EXX
LD A,C
POP HL
PUSH HL
CALL GETSIN
EXX
SUB C
NEG
LD H,A
EXX
POP HL
PUSH HL
DEC HL
LD A,C
CALL GETSIN
EXX
LD C,A
EXX
POP HL
LD A,C
CALL GETCOS
EXX
ADD A,C
LD L,A
RET
ROT LD B,3
LD IX,RTINFO
LD A,C
ADD A,C
ADD A,C
LD E,A
LD D,0
LD HL,PTTABL
ADD HL,DE
ROTCYC1 PUSH BC
PUSH IX
PUSH HL
LD A,(IX)
OR A
JR Z,RTEND2
LD D,(IX+3)
DEC A
JR NZ,ROT1
CALL ROTX
JR RTEND1
ROT1 DEC A
JR NZ,ROT2
CALL ROTY
JR RTEND1
ROT2 DEC A
JR NZ,RTEND2
CALL ROTZ
RTEND1 POP DE
PUSH DE
EX DE,HL
LD (HL),D
INC HL
LD (HL),E
INC HL
LD (HL),B
RTEND2 POP HL
POP IX
POP BC
INC IX
DJNZ ROTCYC1
LD DE,PTTABL-PTBUFF
PUSH HL
OR A
SBC HL,DE
POP DE
EX DE,HL ; before ldir
PUSH DE
LD D,(HL)
INC HL
LD E,(HL)
INC HL
LD B,(HL)
RTCFG1 LD HL,SHINFO
LD A,D
ADD A,(HL)
INC HL
LD D,A
LD A,E
ADD A,(HL)
INC HL
LD E,A
LD A,B
ADD A,(HL)
LD B,A
EX DE,HL
RTCFG2 CALL RESCALE
POP DE
EX DE,HL
LD (HL),D
INC HL
LD (HL),E
INC HL
LD (HL),B
EX DE,HL
RTEND RET
NEWROT LD DE,RTEND
LD (RTCFG2+1),DE
CALL ROT
LD DE,RESCALE
LD (RTCFG2+1),DE
RET
RESCALE LD A,H
EXX
LD C,A
NEG
LD HL,SCALES
LD D,0
LD E,A
ADD HL,DE
LD A,(HL)
EXX
LD E,A
PUSH AF
BIT 7,L
PUSH AF
JR Z,Rs1
LD A,L
NEG
LD L,A
Rs1 CALL MULB
POP AF
LD A,D
JR Z,Rs2
NEG
Rs2 EX AF,AF'
POP AF
LD L,A
LD E,B
BIT 7,B
PUSH AF
JR Z,Rs3
LD A,B
NEG
LD E,A
Rs3 CALL MULB
POP AF
LD A,D
JR Z,Rs4
NEG
Rs4 LD B,A
EX AF,AF'
LD L,A
EXX
LD A,C
EXX
LD H,A
RET
SUMUL BIT 7,L
PUSH AF
JR Z,SM01
LD A,L
NEG
LD L,A
SM01 CALL MULB
POP AF
RET Z
LD A,D
CPL
LD D,A
LD A,E
CPL
LD E,A
INC DE
RET
SIGNMUL XOR A
BIT 7,L
JR Z,SM1
XOR 1
EX AF,AF'
LD A,L
NEG
LD L,A
EX AF,AF'
SM1 BIT 7,E
JR Z,SM2
XOR 1
EX AF,AF'
LD A,E
NEG
LD E,A
EX AF,AF'
SM2 PUSH AF
CALL MULB
POP AF
OR A
RET Z
LD A,D
CPL
LD D,A
LD A,E
CPL
LD E,A
INC DE
RET
SIGNSRL PUSH HL
BIT 7,A
PUSH AF
JR Z,SS01
NEG
SS01 SRL A
LD H,A
POP AF
LD A,H
POP HL
RET Z
NEG
RET
SGNSRL2 BIT 7,D
PUSH AF
JR Z,SS1
LD A,D
CPL
LD D,A
LD A,E
CPL
LD E,A
INC DE
SS1 SRL D
RR E
SRL D
RR E
SRL D
RR E
POP AF
RET Z
LD A,D
CPL
LD D,A
LD A,E
CPL
LD E,A
INC DE
RET
NORMVEC DEFS 3
PREVNRM DEFS 2
DRWOBJ ;draws object
display "DRWOBJ=",DRWOBJ
XOR A
LD (PREVNRM),A
LD DE,PTSNUM
LD BC,28
LDIR
LD HL,(PPTS)
LD DE,PTTABL
LD BC,64*3
LDIR
LD A,(INIFLAG)
OR A
JR NZ,DONXT1
LD HL,DONXT1
PUSH HL
LD HL,(INIPTR)
JP (HL) ;первый раз = в SMT3INI
DONXT1 LD HL,DONXT2
PUSH HL
LD HL,(SMTPTR)
JP (HL)
DONXT2 LD A,(CSRFLAG)
OR A
CALL NZ,DRWCSR
LD HL,(ROTPTR)
LD DE,RTINFO
LD BC,6
LDIR
LD HL,(SHIPTR)
LD DE,SHINFO
LD BC,3
LDIR
LD HL,PTDRAW
LD DE,PTDRAW+1
LD BC,64-1
LD (HL),0
LDIR
LD HL,LNDRAW
LD DE,LNDRAW+1
LD BC,64-1
LD (HL),0
LDIR
LD IX,(PPGP)
LD A,(PGSNUM)
LD B,A
DOCYC1 PUSH BC
PUSH IX
LD E,(IX)
LD D,(IX+1)
DEFB #DD
LD H,D
DEFB #DD
LD L,E
LD E,(IX+1)
LD A,(PREVNRM)
CP E
LD A,E
LD (PREVNRM),A
JR NZ,DO001
LD A,(PREVNRM+1)
OR A
JP DOVISIB
DO001 LD A,(IX+3)
OR A
JR NZ,DO00
LD A,(IX+2)
OR A
JP Z,DOVIS0
DO00 LD H,(IX+3)
LD L,(IX+2)
INC HL
INC HL
LD (HL),1
LD E,(IX+4)
DEC E
LD D,0
LD HL,(PLNS)
ADD HL,DE
ADD HL,DE
LD E,(HL)
LD D,0
LD HL,(PPTS)
ADD HL,DE
ADD HL,DE
ADD HL,DE
LD DE,63*3+PTTABL
LDI
LDI
LDI
LD C,(IX+1)
LD DE,NULINFO
LD (RTCFG1+1),DE
PUSH IX
CALL NEWROT
LD (NORMVEC),HL
LD A,B
LD (NORMVEC+2),A
LD DE,SHINFO
LD (RTCFG1+1),DE
LD C,63
CALL NEWROT
LD A,H
CALL SIGNSRL
LD H,A
LD A,107
SUB H
EXX
LD E,A
LD A,(NORMVEC+1)
LD L,A
CALL SUMUL
LD A,D
CPL
LD D,A
LD A,E
CPL
LD E,A
INC DE
CALL SGNSRL2
PUSH DE
EXX
LD A,L
CALL SIGNSRL
EXX
LD L,A
LD A,(NORMVEC)
LD E,A
CALL SIGNMUL
CALL SGNSRL2
PUSH DE
EXX
LD A,B
CALL SIGNSRL
LD L,A
LD A,(NORMVEC+2)
LD E,A
CALL SIGNMUL
CALL SGNSRL2
POP HL
ADD HL,DE
POP DE
ADD HL,DE
POP IX
LD A,H
AND 128
JR Z,DOVIS0
LD H,(IX+3)
LD L,(IX+2)
INC HL
INC HL
LD (HL),0
DOVIS0 LD (PREVNRM+1),A
DOVISIB JP Z,DOEND1
LD B,(IX)
INC IX
INC IX
INC IX
INC IX
DOCYC2 PUSH BC
PUSH IX
LD E,(IX)
DEC E
LD D,0
LD HL,LNDRAW
ADD HL,DE
LD A,(HL)
OR A
JP NZ,DOEND2
LD (HL),1
LD HL,(PLNS)
ADD HL,DE
ADD HL,DE
LD E,(HL)
LD D,0
PUSH HL
POP IY
LD HL,PTDRAW
ADD HL,DE
LD A,(HL)
OR A
JR NZ,DO1
LD (HL),1
LD C,E
CALL ROT
JR DO2
DO1 LD HL,PTBUFF
ADD HL,DE
ADD HL,DE
ADD HL,DE
LD D,(HL)
INC HL
LD E,(HL)
INC HL
LD B,(HL)
EX DE,HL
DO2 LD A,128
ADD A,L
LD L,A
LD A,B
NEG
LD B,A
LD A,64
ADD A,B
LD H,A
PUSH HL ; L - screen x (our y+dy)
; H - screen y (our -z+dz)
LD E,(IY+1)
LD D,0
LD HL,PTDRAW
ADD HL,DE
LD A,(HL)
OR A
JR NZ,DO3
LD (HL),1
LD C,E
CALL ROT
JR DO4
DO3 LD HL,PTBUFF
ADD HL,DE
ADD HL,DE
ADD HL,DE
LD D,(HL)
INC HL
LD E,(HL)
INC HL
LD B,(HL)
EX DE,HL
DO4 LD A,128
ADD A,L
LD L,A
LD A,B
NEG
LD B,A
LD A,64
ADD A,B
LD H,A
POP DE
CALL LINE2
DOEND2 POP IX
POP BC
INC IX
DEC B
LD A,B
OR A
JP NZ,DOCYC2
DOEND1 POP IX
INC IX
INC IX
POP BC
DEC B
JP NZ,DOCYC1
END RET
CLS LD (CLS1+1),SP
LD SP,SHDSCR+4096
LD HL,0
LD B,64
CLSCYC1 PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
DJNZ CLSCYC1
CLS1 LD SP,0
RET
VIEWSR CALL MEM7
LD HL,SHDSCR+34 ;пересылка 2/3 экрана
LD DE,VISSCR+34
XOR A
EX AF,AF'
LD A,126
VSCYC1 LDI
LDI
LDI
LDI;
LDI
LDI
LDI
LDI;
LDI
LDI
LDI
LDI;
LDI
LDI
LDI
LDI;
LDI
LDI
LDI
LDI;
LDI
LDI
LDI
LDI;
LDI
LDI
LDI
LDI;
;LDI
;LDI
;LDI
;LDI;
LD BC,4
ADD HL,BC
EX DE,HL
ADD HL,BC
EX DE,HL
DEC A
VSCFG1 JP NZ,VSCYC1
NOP
NOP
NOP
JP PT128
SUBSTCD CALL SOUND
JP NZ,VSCYC1
SOUND EX AF,AF'
XOR 16
OUT (#FE),A
EX AF,AF'
RET
VIEWS2 LD HL,VSCFG1
LD DE,CODEBUF
LD BC,6
LDIR
LD HL,SUBSTCD
LD DE,VSCFG1
LD C,6
LDIR
CALL VIEWSR
LD DE,VSCFG1
LD HL,CODEBUF
LD BC,6
LDIR
XOR A
LD (ISSOUND),A
RET
FRAMINI LD (FR1CFG1+1),SP ;очистка + рамка
LD HL,SHDSCR
LD DE,SHDSCR+1
LD BC,6144
LD (HL),0
LDIR
LD BC,767
LD (HL),#45
LDIR
LD B,127
LD HL,SHDSCR+32
LD DE,29
FR1CC1 LD (HL),128
INC HL
LD (HL),1
ADD HL,DE
LD (HL),128
INC HL
LD (HL),1
INC HL
DJNZ FR1CC1
LD HL,SHDSCR+4096
LD B,63
LD DE,31
FR1CC2 LD (HL),128
ADD HL,DE
LD (HL),1
INC HL
DJNZ FR1CC2
LD SP,SHDSCR+32
LD A,2
LD HL,#FFFF
FR1CC3 PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
DEC A
JR NZ,FR1CC3
LD SP,SHDSCR+6144
LD A,2
FR1CC4 PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
DEC A
JR NZ,FR1CC4
LD SP,SHDSCR+4096
LD A,2
FR1CC5 PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
DEC A
JR NZ,FR1CC5
FR1CFG1 LD SP,0
LD A,(HISPWR)
LD B,A
LD DE,#9230
LD HL,#9E30
FR1CC6 PUSH BC
PUSH HL
PUSH DE
CALL LINE2
POP DE
POP HL
POP BC
INC L
INC E
DJNZ FR1CC6
LD A,(OURPWR)
LD B,A
LD DE,#A230
LD HL,#AE30
FR1CC7 PUSH BC
PUSH HL
PUSH DE
CALL LINE2
POP DE
POP HL
POP BC
INC L
INC E
DJNZ FR1CC7
CALL STD
LD BC,#606
LD HL,#1101
LD A,7
CALL ATRBAR
LD L,C
LD BC,#1903
LD A,#43
CALL ATRBAR
LD H,#14
LD A,#46
CALL ATRBAR
Ms 3
LD HL,#1201
LD BC,#404
LD DE,xBBUTTN
CALL PUTSIM
CALL STS
CHNs XOR_
;------цвета и спрайты
CALL OFFS
CALL COPYAT
JP PT128
FRAME LD (FR2CFG1+1),SP ;рамка в бою
LD B,127
LD HL,SHDSCR+32
LD DE,29
FR2CC1 LD (HL),128
INC HL
LD (HL),1
ADD HL,DE
LD (HL),128
INC HL
LD (HL),1
INC HL
DJNZ FR2CC1
LD SP,SHDSCR+32
LD A,2
LD HL,#FFFF
FR2CC3 PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
DEC A
JR NZ,FR2CC3
LD SP,SHDSCR+4096
LD A,2
FR2CC5 PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
PUSH HL
DEC A
JR NZ,FR2CC5
FR2CFG1 LD SP,0
RET
SNOWINI LD HL,SNOWTAB
LD DE,SNOWTAB+1
LD BC,31
LD (HL),0
LD (SNOWPTR),HL
LDIR
LD HL,BEGIN
LD (RNDPTR),HL
RET
SNOW LD HL,(RNDPTR)
INC HL
LD (RNDPTR),HL
LD A,H
CP END/256
JR C,SN1
LD HL,BEGIN
LD (RNDPTR),HL
SN1 LD A,(HL)
INC HL
XOR (HL)
AND 63
LD HL,(SNOWPTR)
LD (HL),A
LD C,L
INC L
RES 5,L
LD (SNOWPTR),HL
LD L,C
SLA L
LD DE,RNDTAB-SNOWTAB
ADD HL,DE
EX DE,HL
LD C,A
LD B,0
SLA C
LD HL,RNDPTS
ADD HL,BC
LDI
LDI
LD HL,(RNDPTR)
INC HL
LD (RNDPTR),HL
LD A,H
CP END/256
JR C,SN2
LD HL,BEGIN
LD (RNDPTR),HL
SN2 LD A,(HL)
AND 63
LD HL,(SNOWPTR)
LD (HL),A
LD C,L
INC L
RES 5,L
LD (SNOWPTR),HL
LD L,C
SLA L
LD DE,RNDTAB-SNOWTAB
ADD HL,DE
EX DE,HL
LD C,A
LD B,0
SLA C
LD HL,RNDPTS
ADD HL,BC
LDI
LDI
LD B,32
LD HL,(SNOWPTR)
SNCYC1 PUSH BC
PUSH HL
LD A,(HL)
OR A
JR Z,SNEND1
LD E,L
LD D,0
SLA E
LD HL,RNDTAB
ADD HL,DE
LD IX,MASK
LD A,(HL)
ADD A,(IX+1)
SUB (IX)
LD E,A
LD (HL),A
INC HL
LD A,(HL)
ADD A,(IX+2)
SUB (IX+3)
LD D,A
LD (HL),A
LD A,B
SLA A
SLA A
SLA A
SLA A
SUB 128
LD H,A
LD L,E
LD B,D
CALL RESCALE
LD A,L
ADD A,128
LD E,A
LD A,B
NEG
ADD A,64
LD D,A
PLOT_ LD L,D
LD H,TAB1/256
LD B,(HL)
INC H
LD C,(HL)
INC H
LD L,E
LD A,(HL)
OR C
LD C,A
INC H
LD L,(HL)
LD A,(BC)
OR L
LD (BC),A
SNEND1 POP HL
POP BC
INC L
RES 5,L
DJNZ SNCYC1
RET
CSRINI LD HL,0
LD (MASK),HL
LD (MASK+2),HL
RET
DRWCSR CALL CONTR
LD HL,MASK
LD A,(CONTRB)
LD B,A
LD A,(HL)
DEC A
XOR 255
CPL
JR Z,DC0
LD (HL),A
DC0 BIT 0,B
JR Z,DC1
LD A,(HL)
INC A
INC A
BIT 3,A
JR NZ,DC1
LD (HL),A
DC1 INC HL
LD A,(HL)
DEC A
XOR 255
CPL
JR Z,DC11
LD (HL),A
DC11 BIT 1,B
JR Z,DC2
LD A,(HL)
INC A
INC A
BIT 3,A
JR NZ,DC2
LD (HL),A
DC2 INC HL
LD A,(HL)
DEC A
XOR 255
CPL
JR Z,DC22
LD (HL),A
DC22 BIT 2,B
JR Z,DC3
LD A,(HL)
INC A
INC A
BIT 3,A
JR NZ,DC3
LD (HL),A
DC3 INC HL
LD A,(HL)
DEC A
XOR 255
CPL
JR Z,DC33
LD (HL),A
DC33 BIT 3,B
JR Z,DC4
LD A,(HL)
INC A
INC A
BIT 3,A
JR NZ,DC4
LD (HL),A
DC4 LD IX,MASK
LD HL,(SHIPTR)
INC HL
LD A,(RANGE+1)
LD B,A
LD A,(HL)
SUB (IX)
ADD A,(IX+1)
CALL CMPMOD
JR C,DC5
XOR A
LD (MASK),A
LD (MASK+1),A
DC5 INC HL
LD A,(RANGE+2)
LD B,A
LD A,(HL)
ADD A,(IX+2)
SUB (IX+3)
CALL CMPMOD
JR C,DC6
XOR A
LD (MASK+2),A
LD (MASK+3),A
DC6 LD E,128
LD L,E
LD H,52
LD D,60
CALL LINE2
LD E,128
LD L,E
LD H,68
LD D,76
CALL LINE2
LD HL,SHDSCR+2048+14
LD (HL),15
INC HL
LD (HL),15*16
INC HL
LD (HL),15
INC HL
LD (HL),15*16
RET
MAININI XOR A
LD (INIFLAG),A
LD (CSRFLAG),A
LD (FIRE_c),A
LD (HISCNT),A
LD (OURCNT),A
LD (REACT),A
LD (ISSOUND),A
LD A,(OURENT)
LD B,A
ADD A,B
ADD A,B
PUSH AF
LD A,(HISENT)
LD E,A
LD D,0
SLA E
LD HL,CMPLXTY
ADD HL,DE
LD DE,MNGPTR
LDI
LDI
POP BC
ADD A,B
LD E,A
LD D,0
SLA E
SLA E
LD HL,PARAMTB
ADD HL,DE
LD DE,HISPWR
LD BC,4
LDIR
LD A,(OURPWR)
LD (OINIPWR),A
XOR A
OUT (#FE),A
;---------------
; CALL MEM7
; LD HL,VISSCR ;очистка экрана и атрибутов
; LD DE,VISSCR+1
; LD BC,6144
; LD (HL),L
; LDIR
; LD (HL),7
; LD BC,767
; LDIR
; CALL PT128
RET
BASEINI
BICFG1 LD A,176
PUSH HL
LD HL,(SHIPTR)
LD (HL),A
XOR A
INC HL
LD (HL),A
INC HL
LD (HL),A
LD A,32
LD IX,(MNGPTR)
LD (IX+24),A
LD A,1
LD (INIFLAG),A
LD (IX+22),A
XOR A
LD IX,(ROTPTR)
LD (IX+3),A
LD IX,(MNGPTR)
LD (IX+25),A
LD HL,SM1END
LD (IX+13),L
LD (IX+14),H
CALL CLS
BICFG2 LD B,20
BICYC1 PUSH BC
LD HL,(ROTPTR)
INC HL
INC HL
INC HL
LD A,4
ADD A,(HL)
LD (HL),A
LD HL,(MNGPTR)
CALL DRWOBJ
CALL SNOW
CALL FRAME
CALL VIEWSR
CALL CLS
LD HL,(SHIPTR)
LD A,8
ADD A,(HL)
LD (HL),A
POP BC
DJNZ BICYC1
POP HL
LD IX,(MNGPTR)
LD (IX+13),L
LD (IX+14),H
LD A,1
LD (CSRFLAG),A
LD HL,(PPTS)
LD DE,PTTABL
LD BC,64*3
LDIR
RET
SMT1INI LD HL,SMART1
CALL BASEINI
RET
SMT2INI LD A,1
LD (INIFLAG),A
LD (OBINF2+22),A
LD (FIRE_c),A
LD HL,0
LD (SHINF2+1),HL
LD (SHINFO+1),HL
LD A,127
LD (SHINF2),A
LD (SHINFO),A
XOR A
LD (RTINF2+3),A
LD (RTINFO+3),A
RET
SMT3INI LD HL,SMART3
CALL BASEINI
RET
SMT4INI LD A,1
LD (INIFLAG),A
LD (OBINF4+22),A
LD IX,(MNGPTR)
LD E,(IX+11)
LD D,(IX+12)
EX DE,HL
LD A,(HL)
SUB 32 ; "shifting" reality !
LD (SHINF4),A
LD (SHINFO),A
INC HL
LD A,(HL)
LD (SHINF4+1),A
LD (SHINFO+1),A
CALL SIGNSRL
CALL SIGNSRL
LD (HBULSFT),A
INC HL
LD A,(HL)
LD (SHINF4+2),A
LD (SHINFO+2),A
CALL SIGNSRL
CALL SIGNSRL
LD (HBULSFT+1),A
RET
SMT5INI LD HL,BICFG2+1
PUSH HL
LD A,(HL)
PUSH AF
LD A,14
LD (HL),A
LD A,2
LD (RTINF5+1),A
LD A,64
LD (RTINF5+4),A
LD HL,SM1END
CALL BASEINI
POP AF
POP HL
LD (HL),A
XOR A
LD (CSRFLAG),A
LD HL,RTINF5+3
LD A,(HL)
ADD A,4
LD (HL),A
LD A,63
S5ICYC1 PUSH AF
LD (RTINF5+4),A
LD HL,SHINF5
BIT 1,A
JR NZ,S5I1
INC (HL)
S5I1 AND 1
ADD A,(HL)
LD (HL),A
LD HL,OBINF5
CALL DRWOBJ
CALL SNOW
CALL FRAME
CALL VIEWSR
CALL CLS
LD HL,RTINF5+3
LD A,(HL)
ADD A,4
LD (HL),A
POP AF
DEC A
JR NZ,S5ICYC1
LD (RTINF5+1),A
LD HL,SMART5
LD (OBINF5+13),HL
LD A,1
LD (CSRFLAG),A
LD HL,(PPTS)
LD DE,PTTABL
LD BC,64*3
LDIR
RET
BASESHI LD IX,MASK
LD HL,(SHIPTR)
INC HL
LD A,(HL)
SUB (IX)
ADD A,(IX+1)
LD (HL),A
LD (SHINFO+1),A
INC HL
LD A,(HL)
ADD A,(IX+2)
SUB (IX+3)
LD (HL),A
LD (SHINFO+2),A
RET
ALTSHI LD IX,(MNGPTR)
LD IY,(SHIPTR)
LD A,(DIRVECN)
LD L,A
ADD A,L
ADD A,L
LD L,A
LD H,0
INC HL
PUSH HL
LD A,(FY0)
LD B,A
LD A,(DFY)
ADD A,B
LD (IX+24),A
CALL GETSIN
LD HL,SHINFO+1
ADD A,(HL)
LD HL,RANGE+1
LD B,(HL)
CALL CMPMOD
JR NC,AS1
LD (SHINFO+1),A
LD (IY+1),A
AS1 LD A,(FZ0)
LD HL,DFZ
ADD A,(HL)
LD (IX+25),A
POP HL
INC HL
CALL GETSIN
LD HL,SHINFO+2
ADD A,(HL)
LD HL,RANGE+2
LD B,(HL)
CALL CMPMOD
JR NC,AS2
LD (SHINFO+2),A
LD (IY+2),A
AS2 RET
SMART1 LD A,(RTINF1+3)
ADD A,4
LD (RTINF1+3),A
CALL BASESHI
CALL ALTSHI
LD A,1
LD (CSRFLAG),A
SM1END RET
SMART2 LD A,(SHINF2)
SUB 20
LD (SHINF2),A
LD (SHINFO),A
XOR A
LD (CSRFLAG),A
LD A,(RTINF2+3)
SUB 4
LD (RTINF2+3),A
CALL BASESHI
LD IX,(MNGPTR)
LD E,(IX+11)
LD D,(IX+12)
EX DE,HL
LD A,(SHINF2)
XOR 128
LD B,A
LD A,(HL)
SUB 80 ; "shifting" reality !
XOR 128
SUB B
JR NC,SMT21
NEG
SMT21 LD C,A
LD A,(SHINF2+1)
XOR 128
LD B,A
INC HL
LD A,(HL)
XOR 128
SUB B
JR NC,SMT22
NEG
SMT22 LD E,A
LD A,(SHINF2+2)
XOR 128
LD B,A
INC HL
LD A,(HL)
XOR 128
SUB B
JR NC,SMT23
NEG
SMT23 ADD A,C
JR C,SMT24
ADD A,E
JR C,SMT24
CP 36
JR NC,SMT24
LD HL,HISCNT
LD A,(CONSTH)
ADD A,(HL)
LD (HL),A
LD A,1
LD (ISSOUND),A
CALL DONE2
SMT24 LD A,(SHINFO)
LD B,150
CALL CMPSGN
CALL C,DONE2
RET
SMART3 LD A,(RTINF3+3)
ADD A,4
LD (RTINF3+3),A
CALL BASESHI
CALL ALTSHI
LD A,1
LD (CSRFLAG),A
RET
SMART4 XOR A
LD (CSRFLAG),A
LD A,(SHINF4)
ADD A,16
LD (SHINF4),A
LD (SHINFO),A
LD A,1
LD (REACT),A
CALL BASESHI
LD A,(SHINF4+1)
LD HL,HBULSFT
SUB (HL)
LD (SHINF4+1),A
LD (SHINFO+1),A
LD A,(SHINF4+2)
INC HL
SUB (HL)
LD (SHINF4+2),A
LD (SHINFO+2),A
LD A,(SHINF4)
XOR 128
ADD A,16
CALL C,DONE4
RET
SMART5 LD A,(RTINF5+3)
ADD A,4
LD (RTINF5+3),A
CALL BASESHI
CALL ALTSHI
LD A,1
LD (CSRFLAG),A
RET
DONE1 XOR A
LD (OBINF1+22),A
RET
DONE2 XOR A
LD (OBINF2+22),A
LD (FIRE_c),A
LD A,4
LD (REACT),A
RET
DONE3 XOR A
LD (OBINF3+22),A
RET
DONE4 XOR A
LD (OBINF4+22),A
LD (REACT),A
LD HL,OURCNT
LD A,(CONSTO)
ADD A,(HL)
LD (HL),A
RET
DONE5 XOR A
LD (OBINF5+22),A
RET
MANAGER CALL CLS
LD HL,(MNGPTR)
CALL DRWOBJ
CALL SNOW
LD A,(CONTRB)
AND 16
XOR 16
LD HL,HISCNT
OR (HL)
LD HL,FIRE_c
OR (HL)
JR NZ,MG1
LD HL,OBINF2
CALL DRWOBJ
JR MG2
MG1 LD A,(FIRE_c)
LD HL,OBINF2
OR A
CALL NZ,DRWOBJ
MG2 LD HL,REACT
LD A,(HL)
DEC A
LD (HL),A
LD HL,OBINF4
CALL Z,DRWOBJ
LD A,(ISSOUND)
OR A
PUSH AF
CALL Z,VIEWSR
POP AF
CALL NZ,VIEWS2
LD A,(OURCNT)
DEC A
XOR 255
CPL
JR Z,MG23
LD (OURCNT),A
LD HL,OURPWR
LD A,(HL)
DEC A
DEC A
LD (HL),A
JR NZ,MG21
LD A,4
LD (RETURN),A
JP MGEND
MG21 ADD A,48
LD E,A
LD D,128+32+2
CALL MEM7
LD B,13
MGCYC1 PUSH BC
PUSH DE
CALL PLOT
POP DE
POP BC
INC D
DJNZ MGCYC1
CALL PT128
JR MG24
MG23 LD A,(OURPWR)
CP 17
JR NC,MG24
LD A,(HISPWR)
CP 17
LD A,3
JR NC,MG231
LD A,1
MG231 LD (RETURN),A
JR MGEND
MG24 LD A,(HISCNT)
DEC A
XOR 255
CPL
JR Z,MG3
LD (HISCNT),A
LD HL,HISPWR
LD A,(HL)
DEC A
DEC A
LD (HL),A
JR NZ,MG25
XOR A
LD (RETURN),A
JR MGEND
MG25 ADD A,48
LD E,A
LD D,128+16+2
CALL MEM7
LD B,13
MGCYC2 PUSH BC
PUSH DE
CALL PLOT ;вывод полоски энергии
POP DE
POP BC
INC D
DJNZ MGCYC2
CALL PT128
JR MG4
MG3 LD A,(HISPWR)
CP 17
JR NC,MG4
LD A,1
MG3_ LD (RETURN),A
JR MGEND
MG4 LD BC,#FBFE
IN A,(C)
BIT 2,A;E-exit
JR Z,MG4_
AND %11000;RT-retry
JP NZ,MANAGER
CPL
JR MG3_
MG4_
if CHEATS
ld a,1
ld (HISPWR),a
jp MANAGER
endif
LD A,2
LD (RETURN),A
LD A,(OURPWR)
SLA A
JR C,MGEND
LD HL,OINIPWR
CP (HL)
JR NC,MGEND
LD A,3
LD (RETURN),A
MGEND LD HL,(MNGPTR)
LD DE,20
ADD HL,DE
LD E,(HL)
INC HL
LD D,(HL)
EX DE,HL
JP (HL) ; calling DONEn
ALEX LD HL,TAB1 ;My entry
LD DE,TAB1+1
LD (HL),L
LD BC,DATAEND-TAB1
LDIR
MAIN# ; entry point
CALL FORMTBL
CALL MAININI
CALL FRAMINI
CALL SNOWINI
CALL CSRINI
CALL MANAGER
LD A,(RETURN)
CP 5
RET
ANGLES
;*B ..\DATA\Xangles.DAN
incbin "data/xangles.dan"
SCALES
;*B ..\DATA\Xscales.DAN
incbin "data/xscales.dan"
RNDPTS EQU SCALES+256
PARAMTB DEFB 100,11,150,7 ;En_UFO,Dec_UFO,En_INT,Dec_INT
DEFB 112,9,150,9 ;130->112
DEFB 200,16,150,25
DEFB 100,14,180,7
DEFB 140,17,180,8
DEFB 200,19,186,13
DEFB 100,25,200,9
DEFB 140,34,200,7
DEFB 200,48,200,7
CMPLXTY DEFW OBINF3,OBINF1,OBINF5
; level of alien ship complexity
;*F MNTINC--------------------------------------
OBINF1 DEFB 53,48,20 ; ptsnum, lnsnum, pgsnum
DEFW PTTAB1,LNTAB1,PGPTB1 ; rectangle alien ship
DEFW RTINF1,SHINF1,SMART1,SMT1INI
DEFB 80,87,45
DEFW DONE1
DEFB 0
DEFB 52,32,0,1,5
OBINF2 DEFB 3,3,1
DEFW PTTAB2,LNTAB2,PGPTB2 ; our bullet
DEFW RTINF2,SHINF2,SMART2,SMT2INI
DEFB 127,87,50
DEFW DONE2
DEFB 0
OBINF3 DEFB 23,20,11
DEFW PTTAB3,LNTAB3,PGPTB3 ; star alien ship
DEFW RTINF3,SHINF3,SMART3,SMT3INI
DEFB 80,87,50
DEFW DONE3
DEFB 0
DEFB 22,0,32,5,1
OBINF4 DEFB 32,16,1
DEFW PTTAB4,LNTAB4,PGPTB4 ; his bullet
DEFW RTINF4,SHINF4,SMART4,SMT4INI
DEFB 127,87,50
DEFW DONE4
DEFB 0
OBINF5 DEFB 37,34,17
DEFW PTTAB5,LNTAB5,PGPTB5 ; super alien ship
DEFW RTINF5,SHINF5,SMART5,SMT5INI
DEFB 80,87,50
DEFW DONE5
DEFB 0
DEFB 36,32,0,1,5
NULINFO DEFB 0,0,0
PTTAB1 ; constant basic table
DEFB 236,0,10 ; points - pt #0
DEFB 0,20,10
DEFB 216,20,0
DEFB 226,20,10
DEFB 236,30,10
DEFB 236,40,0 ; #5
DEFB 0,236,10
DEFB 20,0,10
DEFB 236,216,0
DEFB 236,226,10
DEFB 226,236,10 ; #10
DEFB 216,236,0
DEFB 40,236,0
DEFB 30,236,10
DEFB 20,226,10
DEFB 20,216,0 ; #15
DEFB 20,40,0
DEFB 20,30,10
DEFB 30,20,10
DEFB 40,20,0
DEFB 30,236,246 ; #20
DEFB 20,226,246
DEFB 20,30,246
DEFB 30,20,246
DEFB 226,20,246
DEFB 236,30,246 ; #25
DEFB 236,226,246
DEFB 226,236,246
DEFB 20,0,246
DEFB 0,236,246
DEFB 0,20,246 ; #30
DEFB 236,0,246
DEFB 0,0,63 ; normal vectors - polygon #1
DEFB 0,0,63
DEFB 193,0,63
DEFB 193,193,63
DEFB 0,193,63 ; #5
DEFB 63,193,63
DEFB 63,0,63
DEFB 63,63,63
DEFB 0,63,63
DEFB 193,63,63 ; #10
DEFB 0,0,193
DEFB 0,0,193
DEFB 193,0,193
DEFB 193,193,193
DEFB 0,193,193 ; #15
DEFB 63,193,193
DEFB 63,0,193
DEFB 63,63,193
DEFB 0,63,193
DEFB 193,63,193 ; #20
DEFB 7,6,6 ; direction vector
LNTAB1 ; lines table
DEFB 0,6,6,7,7,1,1,0,3,10,10,9,9,14,14,13,13,18,18,17
DEFB 17,4,4,3,2,11,11,8,8,15,15,12,12,19,19,16,16,5,5,2
DEFB 31,29,29,28,28,30,30,31,24,27,27,26,26,21
DEFB 21,20,20,23,23,22,22,25,25,24
DEFB 3,2,10,11,9,8,14,15,13,12,18,19,17,16,4,5
DEFB 24,2,27,11,26,8,21,15,20,12,23,19,22,16
DEFB 25,5
PGPTB1 ; polygons table
DEFW POL11,POL12,POL13,POL14,POL15,POL16,POL17
DEFW POL18,POL19,POL110,POL111,POL112,POL113,POL114
DEFW POL115,POL116,POL117,POL118,POL119,POL120
POL11 DEFB 4,32
DEFW POL111
DEFB 1,2,3,4
POL12 DEFB 8,32
DEFW POL112
DEFB 5,6,7,8,9,10,11,12
POL13 DEFB 4,34
DEFW POL117
DEFB 13,34,5,33
POL14 DEFB 4,35
DEFW POL118
DEFB 14,35,6,34
POL15 DEFB 4,36
DEFW POL119
DEFB 15,36,7,35
POL16 DEFB 4,37
DEFW POL120
DEFB 16,37,8,36
POL17 DEFB 4,38
DEFW POL113
DEFB 17,38,9,37
POL18 DEFB 4,39
DEFW POL114
DEFB 18,39,10,38
POL19 DEFB 4,40
DEFW POL115
DEFB 19,40,11,39
POL110 DEFB 4,41
DEFW POL116
DEFB 20,33,12,40
POL111 DEFB 4,42,0,0,21,22,23,24
POL112 DEFB 8,42,0,0,25,26,27,28,29,30,31,32
POL113 DEFB 4,44,0,0,13,42,25,41
POL114 DEFB 4,45,0,0,14,43,26,42
POL115 DEFB 4,46,0,0,15,44,27,43
POL116 DEFB 4,47,0,0,16,45,28,44
POL117 DEFB 4,48,0,0,17,46,29,45
POL118 DEFB 4,49,0,0,18,47,30,46
POL119 DEFB 4,50,0,0,19,48,31,47
POL120 DEFB 4,51,0,0,20,41,32,48
RTINF1 DEFB 1,0,0,0,0,0
SHINF1 DEFB 80,20,50
PTTAB2 DEFB 0,0,20
DEFB 0,17,246
DEFB 0,239,246
DEFB 63,0,0
LNTAB2 DEFB 0,1,1,2,2,0
PGPTB2 DEFW POL21
POL21 DEFB 3,3,1,0,1,2,3
RTINF2 DEFB 1,0,0,0,0,0
SHINF2 DEFB 0,0,0
PTTAB3 DEFB 0,0,15 ; #0
DEFB 244,218,0
DEFB 216,0,0
DEFB 244,38,0
DEFB 32,24,0
DEFB 32,232,0 ; #5
DEFB 236,0,241
DEFB 250,19,241
DEFB 16,12,241
DEFB 16,244,241
DEFB 250,237,241 ; #10
DEFB 232,239,63
DEFB 232,17,63
DEFB 9,28,63
DEFB 29,0,63
DEFB 9,228,63 ; #15
DEFB 209,222,193
DEFB 209,34,193
DEFB 18,55,193
DEFB 58,0,193
DEFB 18,201,193 ; #20
DEFB 0,0,193
DEFB 10,10,6 ; direction vector
LNTAB3 DEFB 1,2,2,3,3,4,4,5,5,1,10,6,6,7,7,8,8,9,9,10
DEFB 0,2,0,4,0,5,0,1
DEFB 2,6,3,7,4,8,5,9,1,10,0,3
PGPTB3 DEFW POL31,POL32,POL33,POL34,POL35,POL36
DEFW POL37,POL38,POL39,POL310,POL311
POL31 DEFB 3,11,1,0,1,11,14
POL32 DEFB 3,12,1,0,2,11,20
POL33 DEFB 3,13,1,0,3,20,12
POL34 DEFB 3,14,1,0,4,12,13
POL35 DEFB 3,15,1,0,5,13,14
POL36 DEFB 4,16,1,0,1,6,19,15
POL37 DEFB 4,17,1,0,2,7,15,16
POL38 DEFB 4,18,1,0,3,8,16,17
POL39 DEFB 4,19,1,0,4,9,17,18
POL310 DEFB 4,20,1,0,5,10,18,19
POL311 DEFB 5,21,1,0,6,7,8,9,10
RTINF3 DEFB 3,0,0,0,0,0
SHINF3 DEFB 80,0,50
PTTAB5 DEFB 0,236,0 ; #0
DEFB 0,0,251
DEFB 0,20,0
DEFB 0,0,5
DEFB 0,216,5
DEFB 0,216,251 ; #5
DEFB 0,0,241
DEFB 0,40,251
DEFB 0,40,5
DEFB 0,0,15
DEFB 206,236,251 ; #10
DEFB 206,236,5
DEFB 206,0,10
DEFB 206,20,5
DEFB 206,20,251
DEFB 206,0,246 ; #15
DEFB 186,246,251
DEFB 186,246,5
DEFB 186,10,5
DEFB 186,10,251 ; #19
DEFB 63,0,0 ; #20
DEFB 250,240,63
DEFB 250,240,193
DEFB 250,16,63
DEFB 250,16,193
DEFB 248,240,63 ; #25
DEFB 248,240,193
DEFB 240,0,63
DEFB 240,0,193
DEFB 248,16,63
DEFB 248,16,193 ; #30
DEFB 231,193,0
DEFB 224,193,0
DEFB 193,0,0
DEFB 224,63,0
DEFB 231,63,0 ; #35
DEFB 7,8,8 ; direction vector
LNTAB5 DEFB 0,1,1,2,2,3,3,0
DEFB 4,5,5,6,6,7,7,8,8,9,9,4
DEFB 9,12,6,15,4,11,5,10,8,13,7,14
DEFB 11,12,10,15,12,13,15,14
DEFB 13,18,14,19,12,18,15,19
DEFB 12,17,15,16,11,17,10,16,17,18,16,19
DEFB 10,11,17,16,18,19,13,14
PGPTB5 DEFW POL51,POL52,POL53,POL54,POL55
DEFW POL56,POL57,POL58,POL59,POL510
DEFW POL511,POL512,POL513,POL514,POL515
DEFW POL516,POL517
POL51 DEFB 4,20
DEFW POL515
DEFB 1,2,3,4
POL52 DEFB 6,20
DEFW POL515
DEFB 5,6,7,8,9,10
POL53 DEFB 4,21,1,0,13,10,11,17
POL54 DEFB 4,22,1,0,14,6,12,18
POL55 DEFB 4,23,1,0,11,9,15,19
POL56 DEFB 4,24,1,0,12,7,16,20
POL57 DEFB 3,25,1,0,17,25,27
POL58 DEFB 3,26,1,0,18,26,28
POL59 DEFB 3,27,1,0,25,29,23
POL510 DEFB 3,28,1,0,26,30,24
POL511 DEFB 3,29,1,0,19,23,21
POL512 DEFB 3,30,1,0,20,24,22
POL513 DEFB 4,31,1,0,13,14,5,31
POL514 DEFB 4,32,1,0,27,28,31,32
POL515 DEFB 4,33,0,0,29,30,32,33
POL516 DEFB 4,34,1,0,21,22,33,34
POL517 DEFB 4,35,1,0,15,16,34,8
RTINF5 DEFB 1,0,0,0,0,0
SHINF5 DEFB 80,20,50
;--------------------------include end---
CC EQU 3
PTTAB4 DEFB 0,40,CC ;
DEFB 0,40,256-CC
DEFB 0,40-CC,0
DEFB 0,40+CC,0
DEFB 0,28,28+CC ;
DEFB 0,28,28-CC
DEFB 0,28-CC,28
DEFB 0,28+CC,28
DEFB 0,0,40+CC ;
DEFB 0,0,40-CC
DEFB 0,256-CC,40
DEFB 0,CC,40
DEFB 0,228,28+CC ;
DEFB 0,228,28-CC
DEFB 0,228-CC,28
DEFB 0,228+CC,28
DEFB 0,216,CC ;
DEFB 0,216,256-CC
DEFB 0,216-CC,0
DEFB 0,216+CC,0
DEFB 0,228,228+CC ;
DEFB 0,228,228-CC
DEFB 0,228-CC,228
DEFB 0,228+CC,228
DEFB 0,0,216+CC ;
DEFB 0,0,216-CC
DEFB 0,256-CC,216
DEFB 0,CC,216
DEFB 0,28,228+CC ;
DEFB 0,28,228-CC
DEFB 0,28-CC,228
DEFB 0,28+CC,228
DEFB 63,0,0
LNTAB4 DEFB 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DEFB 16,17,18,19,20,21,22,23,24,25,26,27
DEFB 28,29,30,31
PGPTB4 DEFW POL41
POL41 DEFB 16,32,1,0,1,2,3,4,5,6,7,8,9,10
DEFB 11,12,13,14,15,16
;генерируемые данные
TAB1 EQU #C900 ;DEFS 256 ;ORG кратен 256
TAB2 EQU TAB1+256 ;DEFS 256 ;
TAB3 EQU TAB2+256 ;DEFS 256 ;
TAB4 EQU TAB3+256 ;DEFS 256 ;
;
SNOWTAB EQU TAB4+256 ;DEFS 32 ;
SNOWPTR EQU SNOWTAB+32 ;DEFS 2 ;
RNDPTR EQU SNOWPTR+2 ;DEFS 2 ;
RNDTAB EQU RNDPTR+2 ;DEFS 64 ;конец блока
PTSNUM EQU RNDTAB+64 ;DEFB 0
LNSNUM EQU PTSNUM+1 ;DEFB 0
PGSNUM EQU LNSNUM+1 ;DEFB 0
PPTS EQU PGSNUM+1 ;DEFW 0 ; ptr on constant pts table
PLNS EQU PPTS+2 ;DEFW 0 ; ptr on lines table
PPGP EQU PLNS+2 ;DEFW 0 ; ptr on ptr on polygons
ROTPTR EQU PPGP+2 ;DEFW 0
SHIPTR EQU ROTPTR+2 ;DEFW 0
SMTPTR EQU SHIPTR+2 ;DEFW 0
INIPTR EQU SMTPTR+2 ;DEFW 0
RANGE EQU INIPTR+2 ;DEFS 3 ; xyz-range
DONEPTR EQU RANGE+3 ;DEFW 0
INIFLAG EQU DONEPTR+2 ;DEFS 1
DIRVECN EQU INIFLAG+1 ;DEFS 1
FY0 EQU DIRVECN+1 ;DEFS 1
FZ0 EQU FY0+1 ;DEFS 1
DFY EQU FZ0+1 ;DEFS 1
DFZ EQU DFY+1 ;DEFS 1
LNDRAW EQU DFZ+1 ;DEFS 64
PGDRAW EQU LNDRAW+64 ;DEFS 32
PTDRAW EQU PGDRAW+32 ;DEFS 64
PTBUFF EQU PTDRAW+64 ;DEFS 64*3
COSTBL EQU 64*3+PTBUFF ;DEFS 128*ANGSNUM
PTTABL EQU 128*ANGSNUM+COSTBL ;DEFS 64*3 ; permanent basic pts table
RTINFO EQU 64*3+PTTABL ;DEFS 6
SHINFO EQU RTINFO+6 ;DEFS 3
MASK EQU SHINFO+3 ;DEFS 4
CSRFLAG EQU MASK+4 ;DEFS 1
MNGPTR EQU CSRFLAG+1 ;DEFW 0
FIRE_c EQU MNGPTR+2 ;DEFB 0 ; flag indicating our fire conditions
HISPWR EQU FIRE_c+1 ;DEFB 200
CONSTH EQU HISPWR+1 ;DEFB 32 ; decrement of his power
OURPWR EQU CONSTH+1 ;DEFB 200
CONSTO EQU OURPWR+1 ;DEFB 32 ; decrement of our power
OINIPWR EQU CONSTO+1 ;DEFW 200 ; our initial power
HISCNT EQU OINIPWR+2 ;DEFB 0
OURCNT EQU HISCNT+1 ;DEFB 0
REACT EQU OURCNT+1 ;DEFB 0
HBULSFT EQU REACT+1 ;DEFS 2 ; yz of his bullets shift
ANGCNT EQU HBULSFT+2 ;DEFB 0 ; angle counter used for alien shift
CODEBUF EQU ANGCNT+1 ;DEFS 16 ; used for code substitutions
ISSOUND EQU CODEBUF+16 ;DEFB 0 ; should sound appear
DATAEND EQU ISSOUND+100
;выше заменить на EQU