IF gs
INIGS
SC #32 ;stop module
;WC
ld b,25 ;от балды
halt
djnz $-1
RET
ENDIF
EDORN
XOR A
LD (volA),A
ld (volC),A
LD BC,mEDORN
CALL WINDUM
LD HL,tEDORN
ld DE,#800
CALL PRMENU
;LD HL,tORNKEY,DE,#12
;CALL PRMENU
LD HL,tORNo_s
ld DE,#711
CALL PRMENU
CALL OUT4
CALL HLORN
LD (ornadr),HL
LD DE,EDORbf
LD BC,64
LDIR
CALL PRORNos
LD A,(ORN)
ld HL,TORNSZ
ADD A,A
add A,L
LD L,A
ld A,(HL)
ld B,A
ld (EoLOOP),A
INC L
LD A,(HL)
SUB B
LD (EoLPlen),A
PUSH HL
CALL PRORN
XOR A
LD (EoLIN),A
ld (EoMflag),A
CALL GornMRK
EDORN0
CALL RESHALT
CALL EORNCUR
CALL EoCHMRK
CALL EoPRMRK
CALL EDORNKY
LD A,(ORN)
ld (piaORN),A
EoSMP=$+1
LD A,0
ld (piaSMP),A
ADD A,A
LD L,A
ld H,TSMPSZ/256
LD A,(HL)
ld (piSLOOP),A
INC L
LD A,(HL)
ld (piSEND),A
LD A,(EoLPlen)
ld B,A
LD A,(EoLOOP)
ld (piOLOOP),A
ADD A,B
LD (piOEND),A
CALL OUT4
LD HL,EDORbf
ornadr=$+1
LD DE,0
ld BC,64
LDIR
CALL PIANO
CALL TSTFIRE
jr NC,EDORN0
CALL DOWNMER
POP HL
ORNQU
LD A,(EoLOOP)
ld B,A
LD A,(EoLPlen)
ORNQ ADD A,B
LD (HL),A
DEC L
LD (HL),B
CALL CLOSWIN
LD A,(OCT)
JP PROCT
HEXDIG
ADD A,'0'
CP ':'
RET C
ADD A,'A'-':' ;TODO daa? + 3 other places
RET
PRMEMOS
memol=$+1
LD DE,0x060c;#60E
CALL PRMEMO
LD HL,Tmemo
memo=$+1
LD B,0
DJNZ $+4
LD D,6
DJNZ $+4
LD D,11
DJNZ $+4
LD D,#E+2
DJNZ $+4
LD D,#18+8
DJNZ $+4
LD D,#22+14
LD (memol),DE
JP PRMENU
EPsseP
LD A,(CURX)
LD E,1
LD BC,#200
CP 4
RET C
INC E
LD BC,#102
CP 6
RET C
LD BC,#503
INC E
CP 11+4
RET C
LD C,8
INC E
CP 16+8
RET C
LD C,13
INC E
RET
EPsse
CALL EPsseP
LD A,E
ld (memo),A
PUSH BC
CALL PRMEMOS
LD A,(EPAT)
ld B,A
ld C,0
CALL GETnADR
LD DE,BUF
LD BC,#480
LDIR
CALL OUT6
LD HL,BUF
POP BC
LD A,B
ld B,0
ADD HL,BC
LD C,A
LD DE,MEMOBUF
LD A,64
EPsse0 PUSH BC
PUSH HL
LDIR
POP HL
LD C,18
ADD HL,BC
POP BC
DEC A
jr NZ,EPsse0
RET
EPssr
CALL EPsseP
LD A,(memo)
CP E
jr Z,EPssrE
CP 3
RET C
LD A,E
CP 3
RET C
EPssrE
PUSH BC
LD A,(EPAT)
LD B,A
ld C,0
CALL GETnADR
LD (EPssrDE),HL
LD DE,BUF
LD BC,#480
LDIR
LD A,(curpg32khigh) ;ok ;(pg) ;pat
ex af,af'
CALL OUT6
LD HL,BUF
POP BC
LD A,B
ld B,0
ADD HL,BC
LD C,A
LD DE,MEMOBUF
ex de,hl
LD A,64
EPssr0 PUSH BC
PUSH DE
LDIR
POP DE
ex de,hl
LD C,18
ADD HL,BC
ex de,hl
POP BC
DEC A
jr NZ,EPssr0
ex af,af'
SETPG32KHIGH;CALL OUTME
LD HL,BUF
EPssrDE=$+1
LD DE,0
LD BC,#480
LDIR
JP PRPATU
EXCHANG
CALL FROMSZ
PUSH AF
LD A,(pat1)
LD B,A
CALL GETnADR
PUSH HL
POP IX
CALL CHN1PP
ADD HL,BC
LD A,(chn2)
LD C,3
DEC A
jr Z,EXCHX2
LD C,8
DEC A
jr Z,$+4
LD C,13
EXCHX2 ADD IX,BC
POP AF
EXCH0 ex af,af'
PUSH HL
LD DE,BUF
LD BC,5
LDIR
POP DE
PUSH DE
push IX
POP HL
LD C,5
LDIR
LD HL,BUF
PUSH IX
POP DE
LD C,5
LDIR
POP HL
LD C,18
ADD HL,BC
ADD IX,BC
ex af,af'
DEC A
jr NZ,EXCH0
JP PRPATO
CATBAR
LD HL,#48B5
XOR A
LD (CATBf),A
LD B,A
ld C,A
LD E,#81
LD A,(catH)
OR A
jr NZ,CATBNZ
INC A
LD D,A
JR CATBARP
CATBNZ ADD A,A
DEC A
LD D,A
LD A,(cattop)
OR A
CALL NZ,CATBARP
LD E,#BD
LD A,(catH)
CP 9
jr C,CATBARP
LD A,8
CALL CATBARP
LD A,(catH)
cattop=$+1
SUB 0
SUB 8
LD E,#81
RET Z
CATBARP ex af,af'
CATBf=$+1
CATBAR0 LD A,0
XOR -1
LD (CATBf),A
jr Z,$+6
LD (HL),E
CALL DHL
SCF
LD A,C
ADC A,D
LD C,A
jr NC,CATBAR0
ex af,af'
DEC A
jr NZ,CATBARP
RET
USEBAR
LD A,(catH)
CP 9
RET C
ex af,af'
CALL FIRE
RET Z
LD A,(ARX)
SUB #A8
CP 8
RET NC
LD A,(ARXY)
SUB #68
CP #40
RET NC
LD L,A
XOR A
LD (USEBf),A
LD E,A
ld C,A
ld H,A
LD A,(catH)
ADD A,A
DEC A
LD D,A
USEBAR0 LD A,E
CP L
jr NC,USEBok
USEBf=$+1
USEBAR1 LD A,0
XOR -1
LD (USEBf),A
jr Z,$+3
INC E
SCF
LD A,C
ADC A,D
LD C,A
jr NC,USEBAR1
INC H
JR USEBAR0
USEBok LD B,0
ex af,af'
LD C,A
OR A
RET Z
SUB 9
jr C,USEBARQ
LD B,H
ld A,H
ADD A,7
CP C
jr C,$+6
LD A,C
SUB 8
LD B,A
USEBARQ LD A,B
ld (cattop),A
JP PRCAT
AUDATER
LD C,#7F
LD DE,AUTO2
LD A,(DE)
CP C
jr Z,AUDnS
AND #80
LD B,A
LD A,(HL)
AND C
OR B
LD (HL),A
INC HL
inc HL
inc HL
LD A,(DE)
AND #7F
RRCA
RRCA
RRCA
RRCA
LD B,A
LD A,(HL)
AND #F
OR B
LD (HL),A
JR $+5
AUDnS INC HL
inc HL
inc HL
INC DE
LD A,(DE)
CP C
jr Z,AUDnT
LD B,A
LD A,(HL)
AND #F0
OR B
LD (HL),A
AUDnT INC DE
inc HL
LD A,(DE)
CP C
jr Z,AUDnO
RRCA
RRCA
RRCA
RRCA
LD B,A
LD A,(HL)
AND #F
OR B
LD (HL),A
AUDnO INC DE
LD A,(DE)
CP C
RET Z
LD B,A
LD A,(HL)
AND #F0
OR B
LD (HL),A
RET
AENVER
CP E
jr Z,AEnres
LD HL,ead
RES 7,(HL)
INC L
RES 7,(HL)
AEnres
AENVFRQ=$+1
LD HL,0
AENVnot=$+1
LD DE,0
INC HL
inc HL
inc HL
LD A,(HL)
AND 9
SUB 8
RET NZ
OR E
RET Z
div=$+1
LD B,0
LD A,23
DJNZ $+4
LD A,28 ;3:4
DJNZ $+4
LD A,35 ;1:2
DJNZ $+4
LD A,47 ;1:4
DJNZ $+4
LD A,4 ;3:1
DJNZ $+4
LD A,7 ;5:2
DJNZ $+4
LD A,11 ;2:1
DJNZ $+4
LD A,16 ;3:2
ADD A,E
LD B,0
INC B
SUB 12
jr NC,$-3
LD E,A
;00,01->+0
;10,11->+1
LD HL,FrTab+24-512
ADD HL,DE
add HL,DE
LD A,(HL)
INC L
LD E,(HL)
SRL E
RRA
DJNZ $-3
ADC A,D
LD D,A
AENVadr=$+2
LD (0),DE
RET
EPdelln
CALL XPPSCF
RET NC
LD HL,(CURY)
ld H,L
INC L
LD A,201
ld (COPQJP),A
CALL EPdellnP
LD A,195
ld (COPQJP),A
CALL PRPATU
JR TSTNROL
TSTnSSL
LD A,(ead)
RLA
jr C,AEskip
LD A,(HL)
AND #80
OR D
LD (HL),A
AEskip
LD A,D
TSTSSLQ
LD (AENVnot),A
INC E
jr Z,TSTNQ
auto=$+1
LD A,-1
OR A
CALL Z,AUDATER
LD A,(ead)
RLA
SBC A,A
CPL
aenv=$+1
LD E,-1
AND E
CALL Z,AENVER
TSTNQ CALL PRCU7
;LD A,(EPAT),B,A
;LD A,(CURY),E,#13
;CALL STROKA
CALL PRPATUU
LD A,(iycurkey);(23560)
CP kL
jr Z,$+4
CP kssL
CALL NZ,PLNOTE
TSTNROL LD A,(roll)
OR A
LD L,A ;how many lines down
JP NZ,ROLLPATFON
LD HL,CURX
LD A,(HL)
CP 3
RET Z
CP 5
RET NC
;LD A,2;(curite)
;CP (HL)
;RET C
INC (HL)
RET
TSTNnot
LD (AENVadr),HL
XOR A
LD B,A
ADD HL,BC
LD (AENVFRQ),HL
LD E,-1
OR D
jr Z,TSTnNOT
CP 97
jr NC,TSTnNOT
INC E
CP 25
LD A,(HL)
RES 7,A
jr Z,TSTSSLQ
CALL NotOct
TSTnNOT
;LD A,D
SUB 99
jr Z,TSTk
INC A
JP NZ,TSTnSSL
LD (HL),A
INC HL
LD (HL),A
INC HL
LD (HL),A
TSTk INC HL
LD (HL),A
INC HL
LD (HL),A
;LD (IY-50),kssL
ld a,kssL
ld (iycurkey),a
JP TSTSSLQ
EPdellnP
LD A,64
SUB H
LD DE,(EPAT)
ld D,A
ld A,E
DEC BC
LD B,C
RET Z
JP COPYU
EPins
CALL XPPSCF
RET NC
LD HL,(CURY)
ld H,L
INC H
CALL EPdellnP
LD A,(chnall)
OR A
jr Z,insNALL
LD BC,(CURY)
CALL GETnADR
ex de,hl
LD HL,BUF+#480 ;тут нули
LD BC,18
LDIR
insNALL
YIELD
;LD (IY-50),kssL
ld a,kssL
ld (iycurkey),a
TSTNOTE
LD BC,(CURY)
CALL GETnADR
CALL NOTEKEY
BIT 7,D
CALL Z,XPPSCF
DEC BC
jp Z,TSTNnot
LD A,D
CP 98
jr Z,$-5
CALL RECHEX
INC D
jr NZ,TSTnDIG
LD C,D
ld B,D
ld D,A
LD A,(CURX)
OR A
CALL TSTnPPz
CALL TSTnP
LD C,6
CALL TSTnPPdecadeca
LD C,4
CALL TSTnPPdeca
LD C,11
CALL TSTnPPdecadeca
LD C,9
CALL TSTnPPdeca
LD C,16
CALL TSTnPPdecadeca
LD C,14
CALL TSTnPPdeca
TSTnDIG
LD A,D
CP 9 ;key '9' - overlaying copy on/off
jr Z,EVENODD
CALL RECopq
INC D
RET NZ
LD D,A
OR A
CALL XPP
RET NZ
INC C
inc C
LD B,0
ADD HL,BC
LD A,(HL)
LD (HL),D
RLD
SCF
JR TSTs0
EVENODD
;switch overlaying copy
LD HL,COPSCF
LD A,(HL)
XOR 128
LD (HL),A
LD HL,0x483a;#485A ;screen addr
LD C,2
CALL INVSYMS
POP AF
RET
;2(EDSONG,EPEXT)
MELINV
;switch edit melody
LD HL,#40EA ;screen addr
LD C,6
INVSYMS
PUSH HL
LD B,8
invsym0 LD A,(HL)
CPL
LD (HL),A
INC H
DJNZ invsym0
POP HL
INC L
DEC C
JR NZ,INVSYMS
RET
TSTL
POP AF
ADD HL,BC
LD A,(HL)
LD (HL),D
RLD
OR A
CALL XPP
jr Z,oraTSTs0
CP -7
jr NZ,tstnq
LD A,(CURX)
OR A
jr Z,tstnq
LD A,D
OR A
jr Z,tstnq
PUSH AF
LD A,(ORN)
LD (ORN2),A
XOR A
CALL ONCORN2
POP AF
LD (ORN),A
XOR A
CALL ONCORN
tstnq JP TSTNQ
oraTSTs0
OR A
TSTs0 DEC HL
dec HL
dec HL
RL (HL)
RRC (HL)
LD A,(HL)
RRA
RRA
RRA
AND 16
OR D
jr Z,tstnq
PUSH AF
LD A,(smp)
LD (SMP2),A
XOR A
CALL ONCSMP2
POP AF
LD (smp),A
XOR A
CALL ONCSMP
JP tstnq
TSTnPPdecadeca
DEC A
TSTnPPdeca
dec A
TSTnPPz
jr Z,TSTL
DEC A
jr Z,TSTR
TSTnP INC BC
DEC A
jr Z,TSTL
DEC A
RET NZ
TSTR POP AF
ADD HL,BC
LD A,(HL)
AND #F0
OR D
LD (HL),A
JP TSTNQ
RECopq
LD DE,0x0000+'O'
LD A,(iycurkey);(23560)
cp 'a'
jr c,RECopq_noletter
cp 'z'+1
jr nc,RECopq_noletter
sub 0x20
RECopq_noletter
CP ';'
jr Z,RECopY
CP E
RET Z
INC E
CP #22
jr Z,RECopY
CP E
RET Z
CP 'G'
RET C
CP 'W'
RET NC
LD E,A
XOR 'Q'
CALL Z,cs_8026 ;csQ instead of Q
RET C
RECopY LD A,E
SUB 'G'
DEC D
RET
RECHEX
LD D,0
LD A,(iycurkey);(23560)
cp 'a'
jr c,RECHEX_noletter
cp 'z'+1
jr nc,RECHEX_noletter
sub 0x20
RECHEX_noletter
CP '0'
RET C
CP 'G'
RET NC
CP ':'
jr NC,$+6
SUB '0'
DEC D
RET
CP 'A'
RET C
SUB #37
DEC D
RET
D0TO_
LD A,(HL)
CP '0'
jr C,d0TO0
CP ':'
jr NC,$+5
SUB '0'
RET
CP 'A'
jr C,d0TO0
CP 'G'
jr NC,$+5
SUB #37
RET
d0TO0 LD (HL),'-'
LD A,#7F
RET
ENVFL
;switch transparent envelope
LD HL,ead
ld A,(HL)
XOR 128
LD (HL),A
INC L
LD (HL),A
RET
TSTOCT
LD A,(iycurkey);(23560)
CP kE
jr Z,ENVFL
SUB '1'
CP 9
RET NC
;CALL NEWOCT
;JP SHOLK
;NEWOCT
AND 7
INC A
LD (OCT),A
;1
PROCT LD DE,0x2f00;#D08
JP PRBCD
POSEDIT
LD BC,mPOS
CALL WINDUM
LD HL,tPOS
LD DE,0
CALL PRMENU
XOR A
LD (EpMflag),A
LD (EpY),A
LD A,(POS)
CALL EDPOSR
POSED0
CALL RESHALT
LD A,#28
CALL EpPRCUR
CALL EDPOSKY
LD A,5
CALL EpPRCUR
CALL EpCHMRK
CALL EpPRMRK
CALL TSTFIRE
jr NC,POSED0
LD A,(EsTOP)
ld B,A
LD A,(EpY)
ADD A,B
LD (POS),A
LD L,A
ld H,TPOSS/256
LD A,(HL)
ld (EPAT),A
LD L,A
INC H
LD A,(HL)
ld (PATLEN),A
CALL CLOSWIN
CALL POSFON
JP PRPAT
EpPRMRK
LD HL,#58C3
LD BC,(LOOP)
LD DE,32
LD A,(EsTOP)
ex af,af'
LD A,16
EpPRMR0 ex af,af'
CP C
jr NC,EpPRMR1+1
EpPRMRQ LD (HL),#28
INC A
ex af,af'
ADD HL,DE
DEC A
jr NZ,EpPRMR0
RET
EpPRMR1 ex af,af'
CP B
jr NC,EpPRMRQ
LD (HL),#55
INC A
ex af,af'
ADD HL,DE
DEC A
jr NZ,EpPRMR1
RET
EpCHMRK
LD A,(EpMflag)
OR A
CALL NZ,EpCHEND
LD A,(NOPKA)
OR A
RET Z
XOR A
EpMflag=$+1
CP 0
jr NZ,EpCHMRQ
CALL EpARPOS
RET C
LD (LOOP),A
CPL
EpCHMRQ LD (EpMflag),A
RET
EpCHEND CALL EpARPOS
RET C
LD HL,LOOP
CP (HL)
jr NC,$+3
LD A,(HL)
INC A
inc HL
LD (HL),A
RET
;1
EsCHMRK
LD A,(EsMflag)
OR A
CALL NZ,esCHEND
LD A,(NOPKA)
OR A
RET Z
XOR A
EsMflag=$+1
CP 0
jr NZ,esCHMRQ
CALL EsARPOS
RET C
LD (EsLOOP),A
CPL
esCHMRQ LD (EsMflag),A
RET
esCHEND
CALL EsARPOS
RET C
LD HL,EsLOOP
SUB (HL)
RET C
INC A
LD (EsLEN),A
RET
;1
EoCHMRK
LD A,(EoMflag)
OR A
CALL NZ,eoCHEND
LD A,(NOPKA)
OR A
RET Z
XOR A
EoMflag=$+1
CP 0
jr NZ,eoCHMRQ
CALL EoARLOP
RET C
LD (EoLOOP),A
CPL
eoCHMRQ LD (EoMflag),A
RET
eoCHEND CALL EoARLOP
RET C
LD HL,EoLOOP
SUB (HL)
RET C
INC A
LD (EoLPlen),A
RET
EpARPOS
LD BC,#610
LD L,3
JR psARPOS
EsARPOS
LD BC,+((SMPY+1)<<8)+SMPH
LD L,1+SMPX
psARPOS LD A,(ARXY)
RRA
RRA
RRA
AND 31
SUB B
CP C
CCF
RET C
LD C,A
LD A,(ARX)
RRA
RRA
RRA
AND 31
CP L
jr NZ,SCFRET
LD A,(EsTOP)
ADD A,C
RET
EoARLOP
LD A,1
EoARPOS
LD E,A
LD HL,(ARXY)
LD A,L
RRA
RRA
RRA
AND 31
SUB 3
RET C
CP 16
CCF
RET C
LD D,A
LD A,H
RRA
RRA
RRA
AND 31
LD BC,#400
EoARp0 CP E
jr Z,EoARpQ
SUB 4
INC C
DJNZ EoARp0
SCFRET SCF
RET
EoARpQ LD A,C
ADD A,A
add A,A
add A,A
add A,A
add A,D
RET
decCOR
LD A,(DE)
CP L
RET C
DEC A
LD (DE),A
RET
incCOR
LD A,(DE)
CP L
RET C
RET Z
INC A
RET Z
LD (DE),A
RET
EDPOSB
CALL EpGadr
LD (LOOP),A
RET
EDPOSE
CALL EpGadr
LD (LENG),A
RET
EpPRCUR
ex af,af'
LD A,(EpY)
ADD A,A
add A,A
add A,A
add A,A
LD L,A
ld H,0
ADD HL,HL
LD DE,#58C6
ADD HL,DE
ex af,af'
LD (HL),A
INC L
LD (HL),A
INC L
LD (HL),A
RET
EpGadr
LD A,H
ADD A,L
LD L,A
LD H,TPOSS/256
RET
EDPOSDQ
LD (EpY),A
JP SHOLK
EDPOSKY
CALL BIT5
RET Z
LD HL,(EsTOP)
EpY=$+1
LD H,0
CALL RECHEX
INC D
jr Z,EDpDIG
LD A,(iycurkey);(23560)
CP kKpos;'K'
jr Z,EDPOSB
CP kLpos;'L'
jr Z,EDPOSE
cp key_left;SUB 8
jr NZ,EDPOSNL
LD A,L
SUB 15
jr NC,$+3
XOR A
JR EDPOSTO
EDPOSNL cp key_right ;DEC A
jr NZ,EDPOSNR
LD A,L
ADD A,15
EDPOSR CP -16
jr C,$+4
LD A,-16
JR EDPOSTO
EDPOSNR cp key_down ;DEC A
jr NZ,EDPOSND
LD A,H
INC A
AND 15
jr NZ,EDPOSDQ
LD A,L
INC A
CP -15
RET Z
JR EDPOSTO
EDPOSND cp key_up ;DEC A
jr NZ,EDPOSNU
LD A,H
DEC A
JP P,EDPOSDQ
LD A,L
SUB 1
RET C
EDPOSTO LD (EsTOP),A
JR PRPOS
EDPOSNU CP kDelLn;-11
jr NZ,EDpNdelln
CALL EpGadr
LD D,H
ld E,L
INC L
RET Z
PUSH HL
LD A,(HL)
ld (DE),A
INC E
inc L
jr NZ,$-4
POP HL
LD DE,LOOP
CALL decCOR
LD DE,LENG
CALL decCOR
JR PRPOS
EDpDIG
LD D,A
CALL EpGadr
LD A,(HL)
LD B,4
ADD A,A
jr C,EpDIGo
DJNZ $-3
ADD A,D
CP PATS
jr C,$+3
EpDIGo LD A,D
LD (HL),A
PRPOS
LD HL,(EsTOP)
ld H,TPOSS/256
LD A,16
ld DE,#41C3
PRPOS0 PUSH AF
push DE
LD A,L
PUSH HL
CALL PRF8
POP HL
INC E
inc E
inc E
LD A,(HL)
INC L
PUSH HL
CALL PRF8
POP HL
pop DE
LD A,D
ADD A,6
LD D,A
CALL DDE
INC D
POP AF
DEC A
jr NZ,PRPOS0
JP SHOLK
EDpNdelln
cp key_ins ;CP 201-11
RET NZ
CALL EpGadr
XOR -1
RET Z
PUSH HL
LD C,A
ld B,0
LD DE,bf240
PUSH HL
push DE
LDIR
LD C,A
POP HL
pop DE
INC E
LDIR
POP HL
LD DE,LOOP
CALL incCOR
LD DE,LENG
CALL incCOR
JR PRPOS
EoGadr
EoLIN=$+1
LD A,0
ornADR=$+1
LD HL,EDORbf
ADD A,L
LD L,A
LD A,(HL)
RET
EDOR_p
POP AF
pop HL
CALL ORNQU
CALL DECORN ;+print
JP EDORN
EDOR_n
POP AF
pop HL
CALL ORNQU
CALL INCORN ;+print
JP EDORN
EDORNKY
CALL BIT5
RET Z
LD B,1
CP key_pgup;4
jr Z,EDOR_p
CP key_pgdown;5
jr Z,EDOR_n
CP ssI;172;i
jr Z,EDORSMP
CP kE;'E'
jr Z,EDORNUM
LD B,-1
CP ssU;197;u
jr Z,EDORSMP
CP kW;'W'
jr Z,EDORNUM
LD B,12
CP kT;'T'
jr Z,EDORNUM
LD B,-12
CP kR;'R'
jr Z,EDORNUM
CP '0'
jr Z,EDOR0
CP kIns
jr Z,EDoINS
CP kDelLn
JP Z,EDoDELLN
CP kKpos;'K'
JP Z,EDoBEG
CP kLpos;'L'
JP Z,EDoEND
CP '+'
jr Z,EDoPLU
SUB '0';1
CP 9;8
RET NC
LD (OCT),A
EDORSq CALL PRORNos
JP SHOLK
EDoPLU CALL EoGadr
JR EDORNEG
EDORSMP
LD HL,EoSMP
ld A,(HL)
ADD A,B
AND 31
LD (HL),A
JR EDORSq
EDORNUM
CALL EoGadr
ADD A,B
LD B,0
JP P,$+6
INC B
NEG
AND 127
CP 96
jr C,$+4
LD A,96
DJNZ $+4
EDORNEG
NEG
LD (HL),A
CALL ORNline
JP SHOLK
EDOR0
CALL EoGadr
XOR A
JR EDORNEG
EDoINS
CALL EoGadr
LD A,63
SUB L
RET Z
LD L,62
ld E,63
ld D,H
ld B,0
ld C,A
LDDR
INC L
LD DE,EoLOOP
CALL incCOR
jr Z,$+4
jr NC,EDoz
ex de,hl
INC HL
DEC A
ADD A,(HL)
CP E
jr C,EDoz
CP 63
jr NC,$+3
EDoINSQ INC (HL)
JR EDoz
EDoDELLN
CALL EoGadr
LD D,H
ld E,L
INC L
LD A,64
SUB L
RET Z
LD B,0
ld C,A
ld A,L
LDIR
LD L,A
LD DE,EoLOOP
CALL decCOR
jr NC,EDoz
ex de,hl
INC HL
ADD A,(HL)
CP E
jr C,EDoz
DEC (HL)
jr Z,EDoINSQ
EDoz
CALL PRORN
JP SHOLK
EDoBEG
LD A,(EoLIN)
LD HL,EoLOOP
EDoBEGQ LD C,(HL)
LD (HL),A
INC HL
SUB C
NEG
ADD A,(HL)
LD (HL),A
RET
EDoEND
LD HL,EoLOOP
LD A,(EoLIN)
SUB (HL)
INC HL
LD (HL),A
RET
EDsBEG
LD A,(EsLIN)
LD HL,EsLOOP
JR EDoBEGQ
EDsEND
LD HL,EsLOOP
LD A,(EsLIN)
SUB (HL)
INC HL
LD (HL),A
RET
PRORN
LD HL,EDORbf
LD E,1
ld C,16
PRORN0 PUSH HL
LD D,1
ld B,4
PRORN1 PUSH BC
LD A,L
CALL toOO
INC D
inc D
PUSH HL
LD A,(HL)
ld L,A
OR A
LD B,'+'
CALL M,ldbminusNEGHL
LD A,B
CALL PRADD
INC D
LD A,L
CALL toOO
INC D
inc D
inc D
POP HL
LD BC,16
ADD HL,BC
POP BC
DJNZ PRORN1
INC E
POP HL
INC L
DEC C
jr NZ,PRORN0
RET
EORNCUR
CALL BIT5
RET Z
cp key_left ;SUB 8
LD B,-16
jr Z,EORNC
cp key_right ;DEC A
LD B,16
jr Z,EORNC
cp key_down ;DEC A
LD B,1
jr Z,EORNC
cp key_up ;DEC A
LD B,-1
RET NZ
EORNC LD A,(EoLIN)
ADD A,B
AND 63
EORNCQ ex af,af'
LD E,7
CALL GornMRK+2
ex af,af'
LD (EoLIN),A
LD HL,SHOLK
PUSH HL
GornMRK LD E,56
ld A,(EoLIN)
LD BC,16
LD H,B
INC B
SUB C
jr NC,$-2
ADD A,C
add A,3
ADD A,A
add A,A
add A,A
LD L,A
ADD HL,HL
add HL,HL
LD A,H
SUB -88
LD H,A
ld A,B
ADD A,A
add A,A
SUB 2
OR L
LD L,A
ld (HL),E
INC L
LD (HL),E
RET
ORNline
LD A,(EoLIN)
ld BC,16
INC B
SUB C
jr NC,$-2
ADC A,C
LD E,A
ld A,B
ADD A,A
add A,A
add A,A
SUB 4
LD D,A
LD HL,(ornADR)
LD A,(EoLIN)
ADD A,L
LD L,A
ld A,(HL)
ld L,A
OR A
LD B,'+'
CALL M,ldbminusNEGHL
LD A,B
CALL PRADD
INC D
LD A,L
JP toOO
EoPRMRK
LD A,(NOPKA)
OR A
LD A,3
CCF
CALL NZ,EoARPOS
CALL NC,EORNCQ
EoLOOP=$+1
EoLPlen=$+2
LD BC,0
ld DE,32
XOR A
LD HL,#5861
PRoLP0 CP C
jr Z,PRoLPQ
LD (HL),5
CALL PRoLPP
jr NZ,PRoLP0
RET
PRoLPQ LD (HL),#5D
CALL PRoLPP
RET Z
DJNZ PRoLPQ
JR PRoLP0
PRoLPP INC A
PUSH AF
AND 15
jr NZ,PRoLPE
LD A,L
AND 31
LD H,88
ADD A,#44
LD L,A
PRoLPE ADD HL,DE
POP AF
AND 63
RET
EsPRMRK
LD HL,SMPATR+1;#58E5
EsLOOP=$+1
EsLEN=$+2
LD BC,#100
ld A,C
ADD A,B
LD B,A
ld DE,32
LD A,(EsTOP)
ex af,af'
LD A,SMPH
EsPRMR0 ex af,af'
CP C
jr NC,EsPRMR1_
EsPRMRQ LD (HL),5
INC A
ex af,af'
ADD HL,DE
DEC A
jr NZ,EsPRMR0
RET
EsPRMR1exa
ex af,af'
EsPRMR1_
CP B
jr NC,EsPRMRQ
LD (HL),#5D
INC A
ex af,af'
ADD HL,DE
DEC A
jr NZ,EsPRMR1exa
RET
EDSMORN
LD HL,EsORN
ld A,(HL)
ADD A,C
AND #F
LD (HL),A
JR EDSMOq
EDSM_p
POP AF
pop HL
CALL SMPQU
CALL DECSMP
JP EDSMP
EDSM_n
POP AF
pop HL
CALL SMPQU
CALL INCSMP
JP EDSMP
EDSMPKY
CALL FIRE
JP NZ,EDSMPFI
XOR A
LD (EDSMFIh),A
CALL BIT5
RET Z
CP key_pgup ;4
jr Z,EDSM_p
CP key_pgdown ;5
jr Z,EDSM_n
LD BC,32
CP kR;'R'
jr Z,EDSMNUM
LD C,1
CP ssI;172;i
jr Z,EDSMORN
CP kW;'W'
jr Z,EDSMNUM
DEC BC
dec BC
CP ssU;197;u
jr Z,EDSMORN
CP kE;'E'
jr Z,EDSMNUM
LD C,-32
CP kT;'T'
jr Z,EDSMNUM
LD c,0;bc,-256
CP 'T'
jr Z,EDSMNUM
LD b,1;bc,256
CP 'R'
jr Z,EDSMNUM
CP '0'
jr Z,EDSM0
CP '+'
jr Z,EDsPLU
SUB '0';1
CP 9;8
RET NC
LD (OCT),A
EDSMOq CALL PROCORN
JP SHOLK
EsX=$+1
EDsPLU LD A,0
INC A
RET Z
CALL EsGadr
PUSH HL
POP IX
LD L,(IX)
ld H,(IX+1)
CALL NEGHL
JR EDSMNQ
EDSM0
CALL EsGadr
LD A,(EsX)
INC A
jr NZ,EDsNOI0
INC L
inc L
LD A,(HL)
AND #E0
LD (HL),A
JR EDsNOIQ
EDsNOI0 XOR A
LD (HL),A
INC L
LD (HL),A
JR EDSMKQ
EDSMNUM
LD A,(EsX)
INC A
jr Z,EDSMNOI
CALL EsGadr
PUSH HL
POP IX
LD L,(IX)
ld H,(IX+1)
ADD HL,BC
LD A,H
OR A
LD B,#F
JP P,EDSMNOK
CALL NEGHL
LD A,H
AND B
LD H,A
CALL NEGHL
JR $+4
EDSMNOK AND B
LD H,A
EDSMNQ LD (IX),L
ld (IX+1),H
EDSMKQ CALL EsPRNUM
JP SHOLK
EDSMNOI
CALL EsGadr
INC L
inc L
LD A,(HL)
SUB C
XOR (HL)
AND 31
XOR (HL)
LD (HL),A
EDsNOIQ CALL EsPRNOI
JP SHOLK
EsGadr
LD H,EDORbf/256
ld A,(EsTOP)
ld D,A
EsLIN=$+1
LD A,0
PUSH AF
SUB D
LD E,A
POP AF
ADD A,A
add A,A
LD L,A
RET
;3
PRSMLIN
PUSH AF
push AF
LD D,1
CALL toOO
LD D,8
POP AF
ADD A,A
add A,A
LD HX,EDORbf/256
ld LX,A
LD A,(IX+1)
OR A
LD L,(IX)
ld H,(IX+1)
LD B,'+'
CALL M,ldbminusNEGHL
LD A,'+'+'-'
SUB B
CALL PRADD
INC D
CALL toOOOO
INC D
inc D
LD A,(IX+2)
PUSH AF
AND 31
CALL toOO
INC D
inc D
POP AF
CALL PRTNE
LD A,(IX+3)
CALL PRVTN
POP AF
JP PRSMVOL
EsPRNUM
CALL EsGadr
LD D,8
ld A,(HL)
INC L
LD H,(HL)
ld L,A
ld A,H
RLA
LD B,'-'
jr NC,$+7
LD B,'+'
CALL NEGHL
LD A,B
CALL PRADD
INC D
JP toOOOO
EsPRNOI
CALL EsGadr
ADD A,2
LD L,A
ld D,#E
ld A,(HL)
AND 31
JP toOO
TNEVTN
LD H,EDORbf/256
TNEVTNl=$+1
LD L,0
TNEVTNy=$+1
LD DE,#1100
LD A,(HL)
INC HL
LD B,(HL)
PUSH BC
CALL PRTNE
POP AF
JR PRVTN
PRTNE
LD L,A
ld H,'-'
AND #80
LD A,'T'
jr Z,$+3
LD A,H
CALL PRADD
INC D
LD A,L
AND 64
LD A,'N'
jr Z,$+3
LD A,H
CALL PRADD
INC D
LD A,L
AND 32
LD A,'E'
jr Z,$+3
LD A,H
JP PRADD
PRVTN
LD D,4
ld C,A
RLA
LD A,'0'
jr NC,PRVTN0
BIT 6,C
LD A,'-'
jr Z,$+4
LD A,'+'
PRVTN0 CALL PRADD
LD A,32
CALL PRVTNPP
LD A,16
PRVTNPP AND C
LD A,'0'
jr Z,$+4
LD A,'+'
INC D
JP PRADD
EsFITN
LD B,32
CP +(SMPX<<3)+#1C
jr C,$+7
EsFIfN LD B,16
CP 64
RET NC
INC HL
LD A,(HL)
XOR B
JR EsFIVTQ
EsFIx
SBC A,A
ex af,af'
CALL GsMRK7
LD A,(EsFIlin)
ld (EsLIN),A
ex af,af'
LD (EsX),A
CALL GsMRK56
JP SHOLK
EsNfix
CALL EDSMFIp
XOR A
JR EsFIfN
EsTfix
CALL EDSMFIp
XOR A
JR EsFITN
EsAfix
CALL EDSMFIp
JR EsFIV
EsTi
CALL EDSMFIp
XOR A
JR Es_T
EsNi
CALL EDSMFIp
XOR A
JR Es_N
EsEi
CALL EDSMFIp
JR Es_E
EsFIVTN
CP (SMPX<<3)+#38
CCF
jr C,EsFIx ;смещ.шума
CP (SMPX<<3)+#28
jr NC,EsFIx ;цикл
CP (SMPX<<3)+#14
RET C ;слева от VTN
CP (SMPX<<3)+#18
jr NC,EsFITN
EsFIV INC HL
LD A,(HL)
ld C,A
LD B,#80
AND B
jr NZ,$+6
LD A,C
OR B
JR EsFIVTQ
LD A,C
XOR 64
LD C,A
AND 64
LD A,C
jr NZ,$+4
AND 63
EsFIVTQ LD (HL),A
JR EsFIQ
EDSMPFI
LD HL,(ARXY)
ld A,L
SUB (SMPY+1)<<3;#38
CP SMPH<<3
RET NC
RES 0,H
res 1,H
RRA
RRA
RRA
AND #1F
LD B,A
CP 0
LD ($-1),A
LD A,H
jr NZ,EDSMFIn
EDSMFIh=$+1
CP 0
EDSMFIn LD ($-1),A
RET Z
CALL EDSMFIP
CP (SMPX<<3)+#48
jr C,EsFIVTN
CP (SMPX<<3)+#54
jr NC,EsFIVOL
Es_T LD B,#80
CP (SMPX<<3)+#4C
jr C,EsFINUM
Es_N LD B,64
CP (SMPX<<3)+#50
jr C,$+4
Es_E LD B,32
EsFINUM LD A,(HL)
XOR B
LD (HL),A
EsFIQ CALL TNEVTN
JP SHOLK
EDSMFIp
LD A,(EsLIN)
ld HL,EsTOP
SUB (HL)
LD B,A
EDSMFIP LD A,(EsTOP)
ADD A,B
LD (EsFIlin),A
ADD A,A
add A,A
add A,2
LD L,A
ld (TNEVTNl),A
LD A,B
EDSpQ LD (TNEVTNy),A
LD A,H
ld H,EDORbf/256
RET
EsVOLi
CALL EDSMFIp
INC HL
LD A,(HL)
INC A
JR EsVOLQ
EsVOLd
CALL EDSMFIp
INC HL
LD A,(HL)
DEC A
JR EsVOLQ
EsFIVOL
SUB (SMPX<<3)+#54
CP #40
RET NC
RRA
RRA
INC HL
EsVOLQ AND #F
LD E,A
ld A,(HL)
AND #F0
OR E
LD (HL),A
LD A,(TNEVTNy)
ld E,A
EsFIlin=$+1
LD A,0
CALL PRSMVOL
JP SHOLK
EDsSCUP
LD DE,+((SMPATRĬ)<<3)+(SMPATR&0xff)+#4001+SMPX
LD HL,+(((SMPATR+32)Ĭ)<<3)+((SMPATR+32)&0xff)+#4001+SMPX
LD A,+(SMPH<<3)-8
EDsSCU0
CALL EDsLDI
CALL DHL
call DDE
ex af,af'
jr NZ,EDsSCU0
RET
EDsSCDN
LD DE,+((SMPBOTĬ)<<3)+(SMPBOT&0xff)+#4001+SMPX
LD HL,+(((SMPBOT-32)Ĭ)<<3)+((SMPBOT-32)&0xff)+#4001+SMPX
LD A,+(SMPH<<3)-8
EDsSCD0
CALL EDsLDI
CALL UHL
call UDE
ex af,af'
jr NZ,EDsSCD0
RET
EDsLDI
DEC A
ex af,af'
LD BC,19
PUSH HL
push DE
LDIR
POP DE
pop HL
RET
EDsUP
cp key_up ;DEC A
RET NZ
CALL GsMRK7
LD A,(EsLIN)
DEC A
JP M,EDsCQ
LD B,A
ld A,(EsTOP)
ld C,A
DEC A
CP B
jr NZ,EDsUQ
PUSH BC
CALL EDsSCDN
POP BC
LD A,C
DEC A
LD (EsTOP),A
PUSH BC
LD E,0
CALL PRSMLIN
POP BC
EDsUQ LD A,B
ld (EsLIN),A
JR EDsCQ
EDsLR
CALL GsMRK7
LD HL,EsX
ld A,(HL)
CPL
LD (HL),A
EDsCQ CALL GsMRK56
JP SHOLK
EDSMCUR
CALL BIT5
RET Z
CP kA;'A'
JP Z,EsAfix
CP '9'
JP Z,EsTfix
CP kF;'F'
JP Z,EsNfix
CP ')'
JP Z,EsVOLi
CP '('
JP Z,EsVOLd
CP kIns
jr Z,EDsINS
CP kDelLn
JP Z,EDsDELLN
CP kKpos;'K'
JP Z,EDsBEG
CP kLpos;'L'
JP Z,EDsEND
CP kY;'Y'
JP Z,EsTi
CP kU;'U'
JP Z,EsNi
CP kI;'I'
JP Z,EsEi
; SUB 4
; JZ EDsTRU
; DEC A
; JP Z,EDsINV
cp key_left ;SUB 3+5
jr Z,EDsLR
cp key_right ;DEC A
jr Z,EDsLR
cp key_down ;DEC A
JP NZ,EDsUP
CALL GsMRK7
LD A,(EsLIN)
INC A
AND 63
jr Z,EDsCQ
LD BC,(EsTOP)
ld B,A
SUB C
CP SMPH
jr NZ,EDsDQ
PUSH BC
CALL EDsSCUP
POP BC
LD A,C
INC A
LD (EsTOP),A
PUSH BC
LD E,SMPH-1
ADD A,E
CALL PRSMLIN
POP BC
EDsDQ LD A,B
ld (EsLIN),A
JP EDsCQ
IF 0
EDsTRU
CALL GsMRK7
LD HL,EsLIN
ld A,(HL)
SUB SMPH
LD (HL),A
LD DE,EsTOP
ld A,(DE)
SUB SMPH
jr NC,$+4
XOR A
LD (HL),A
JR EDsInE
ENDIF
EDsINS
CALL EsGadr
LD A,-4
SUB L
RET Z
LD L,-5
ld D,H
ld E,-1
ld B,0
ld C,A
LDDR
INC L
SRL L
srl L
LD DE,EsLOOP
CALL incCOR
jr Z,$+4
jr NC,EDsINVQ
ex de,hl
INC HL
DEC A
ADD A,(HL)
CP E
jr C,EDsINVQ
CP 63
jr NC,$+3
INC (HL)
JR EDsINVQ
EDsDELLN
CALL EsGadr
LD D,H
ld A,L
ADD A,4
LD E,A
ex de,hl
XOR A
LD B,A
SUB L
RET Z
LD C,A
LD A,L
LDIR
LD L,A
SRL L
srl L
LD DE,EsLOOP
CALL decCOR
jr NC,EDsINVQ
ex de,hl
INC HL
ADD A,(HL)
CP E
jr C,$+3
DEC (HL)
IF 0
JR EDsINVQ
EDsINV
CALL GsMRK7
LD HL,EsLIN
ld A,(HL)
ADD A,SMPH
LD (HL),A
ld DE,EsTOP
ld A,(DE)
ADD A,SMPH
CP 65-SMPH
jr C,EDsInE
LD (HL),63
LD A,64-SMPH
EDsInE LD (DE),A
ENDIF
EDsINVQ CALL SHOLK
CALL PRSMP
GsMRK56
LD E,56
JR GsmpMRK
GsMRK7
LD E,7
GsmpMRK
LD A,(EsLIN)
EsTOP=$+1
SUB 0
ADD A,A
add A,A
add A,A
LD L,A
ld H,0
ld BC,SMPATR;#58E4
ADD HL,HL
add HL,HL
add HL,BC
LD A,(EsX)
OR A
LD A,5
jr Z,$+4
LD A,7
ADD A,L
LD L,A
LD (HL),E
INC L
LD (HL),E
RET
PRORNos
LD A,(OCT)
ADD A,'0'
LD DE,#E11
CALL PRADD
LD A,(EoSMP)
CALL HEXDIG
LD D,#18
JP PRADD
PROCORN
LD A,(OCT)
ADD A,'0'
LD DE,#1000+SMPH
CALL PRADD
LD A,(EsORN)
CALL HEXDIG
LD D,#1C
JP PRADD
PRSMP
LD E,0
LD A,(EsTOP)
ADD A,SMPH
LD (PRSMPe),A
SUB SMPH
PRSMP0 PUSH AF
push DE
CALL PRSMLIN
POP DE
pop AF
INC E,A
PRSMPe=$+1
CP 0
jr NZ,PRSMP0
RET
PRSMVOL
PUSH DE
push AF
CALL PRADDPP
LD D,11+SMPX
CALL DE2SCR
INC H
ex de,hl
LD H,EDORbf/256
POP AF
ADD A,A
add A,A
add A,3
LD L,A
ld A,(HL)
AND #F
LD (PRSMVa),A
ex de,hl
PUSH AF
push HL
LD A,#22
ld B,7
CALL BLOBER
INC L
DJNZ $-4
LD A,#20
CALL BLOBER
POP HL
pop AF
LD E,A
RRA
PUSH AF
AND 7
jr Z,PRVOL7
LD B,A
ld A,#77
PRVOL0 LD D,H
DUP 5
LD (HL),A
INC H
EDUP
LD (HL),A
ld H,D
INC L
DJNZ PRVOL0
PRVOL7 LD A,E
CP #F
LD E,#72
jr NZ,$+4
LD E,#70
POP AF
LD A,E
CALL C,BLOBER7
PRSMVa=$+1
LD A,0
POP DE
LD D,#25
JP D2HEX