?login_element?
?pathlinks? – Rev 1494
Blame |
Last modification |
View Log
| Download
ARWBUF EQU #5BDC
ORG #6000
CALL INIMOUS
LD HL,#4000
LD DE,#4001
LD BC,#17FF
LD (HL),C
LDIR
CALL TROIKA
JR Z,$-3
RET
PRARW LD BC,0
LD A,B
CALL 8881
LD (REW+1),HL
EX DE,HL
LD B,A
INC B
LD A,-1
ADD A,A
DJNZ $-1
LD (PRARWR-1),A
LD HL,SPRARW
LD IX,ARWBUF
LD B,12
PRARW0 PUSH BC
LD C,(HL)
INC HL
LD B,(HL)
INC HL
LD A,(HL)
INC HL
PUSH HL
LD H,(HL)
LD L,A
PUSH DE
LD A,(DE)
LD (IX),A
LD E,A
SCF
SBC A,A
LD D,0
PRARWR
RL C ;sli
RL B
RLA
ADD HL,HL
RL D
JR C,PRARWR
AND E
XOR D
POP DE
LD (DE),A
INC E
LD A,E
AND 31
LD A,(DE)
LD (IX+12),A
JR Z,PRARWN
AND B
XOR H
LD (DE),A
INC E
LD A,E
AND 31
JR Z,PRARWN-1
LD A,(DE)
LD (IX+24),A
AND C
XOR L
LD (DE),A
DEC E
PRARWN DEC E
CALL DDE
POP HL
POP BC
LD A,D
CP 88
RET NC
INC LX
INC HL
DJNZ PRARW0
RET
REW LD DE,0
LD IX,ARWBUF
LD B,12
REW0 LD A,(IX)
LD (DE),A
INC E
LD A,(IX+12)
LD (DE),A
INC E
LD A,E
AND 30
JR Z,REWN
LD A,(IX+24)
LD (DE),A
REWN DEC E
DEC E
CALL DDE
LD A,D
CP 88
RET NC
INC LX
DJNZ REW0
RET
INKEY LD A,239
IN A,(-2)
RRCA
RLA
RLA
OR #C2
LD C,A
LD A,#DF
IN A,(-2)
RRA
JR C,$+4
RES 4,C
RRA
JR C,$+4
RES 5,C
LD A,-5
IN A,(-2)
RRA
JR C,$+4
RES 2,C
LD A,-3
IN A,(-2)
RRA
JR C,$+4
RES 3,C
LD A,-2
IN A,(-2)
RRA
JR C,$+4
RES 0,C
LD A,#7F
IN A,(-2)
CPL
AND 31
JR Z,$+4
RES 1,C
LD A,-6
MOUSEF IN A,(#DF)
RRA
JR C,$+4
RES 1,C
RRA
JR C,$+4
RES 0,C
INKEYF RET
RR C
EX AF,AF'
RR C
EX AF,AF'
RL C
EX AF,AF'
RL C
RET
MANAGE CALL INKEY
LD HL,(PRARW+1)
ARVEL LD DE,0
LD A,C
KEY EQU $+1
CP 0
LD (KEY),A
RRA
RRA
CPL
JR NZ,MANTORM
AND 31
JR NZ,MANNOT
MANTORM SRA D
INC D
JR Z,$+3
DEC D
SRA E
INC E
JR Z,$+3
DEC E
MANNOT RRA
JR NC,$+3
DEC D
RRA
JR NC,$+3
INC D
RRA
JR NC,$+3
INC E
RRA
JR NC,$+3
DEC E
LD A,D
CP 1
JR Z,MANYOK
CP -1
JR Z,MANYOK
INC A
JP P,$+4
INC A
SRA A
SRA A
JR Z,VEROK+1
MANYOK ADD A,H
CP 192
JR C,VEROK
XOR A
BIT 7,D
LD D,A
JR NZ,VEROK
LD A,191
VEROK LD H,A
LD A,E
CP 1
JR Z,MANXOK
CP -1
JR Z,MANXOK
INC A
JP P,$+4
INC A
SRA A
SRA A
JR Z,HOROK+1
MANXOK ADD A,L
BIT 7,E
JR Z,HORNOL
JR C,HOROK
XOR A
LD E,A
HORNOL JR NC,HOROK
XOR A
LD E,A
DEC A
HOROK LD L,A
LD (ARVEL+1),DE
LD (PRARW+1),HL
MANAGEF LD A,-5
IN A,(#DF)
OLDX LD E,0
LD (OLDX+1),A
SUB E
JP P,MPX
ADD A,L
JR C,MXQ
XOR A
LD L,A
MPX ADD A,L
JR NC,$+3
SBC A,A
MXQ LD L,A
LD A,-1
IN A,(#DF)
OLDY LD D,0
LD (OLDY+1),A
SUB D
NEG
JP P,MPY
ADD A,H
JR C,MYQ
XOR A
LD H,A
MPY ADD A,H
LD H,191
CP H
JR NC,$+3
MYQ LD H,A
LD (PRARW+1),HL
RET
INIMOUS
EI
HALT
LD HL,#AA00
PUSH HL
POP DE
INC E
LD B,E,C,L
LD (HL),#A9
LD A,H
LDIR
DEC (HL)
LD HL,#C9AF
LD (#A9A8),HL
LD (#A8A9),HL
LD I,A
IM 2
EI
HALT
IM 1
EI
LD A,#80
OUT (127),A
;IN A,(-1)
;CP -1
JR NZ,INIMOFS
LD A,-1
IN A,(#DF)
LD (OLDY+1),A
LD B,A
LD A,-5
IN A,(#DF)
LD (OLDX+1),A
CP B
RET NZ
LD A,-6
IN A,(#DF)
CP B
RET NZ
INIMOFS LD A,62
LD (MOUSEF),A
LD A,201
LD (MANAGEF),A
RET
TROIKA CALL PRARW
CALL MANAGE
HALT
CALL REW
TROIKAQ LD A,(KEY)
CPL
AND 3
RET
DDE INC D
LD A,D
AND 7
RET NZ
LD A,E
ADD A,32
LD E,A
RET C
LD A,D
ADD A,-8
LD D,A
RET
SPRARW DW #1FFF,0
DW #07FF,#6000
DW #01FF,#7800
DW #807F,#3E00
DW #803F,#3F80
DW #C07F,#1F00
DW #C07F,#1F00
DW #E03F,#0F80
DW #E01F,#09C0
DW #F60F,#00E0
DW #FF0F,#0060
DW #FF9F,#0000