;UPRAVA HER MSX-SORD
;(C) ROS 28-JUN-89
;KONKRETNE - COMPUTER BILIAR
;
;ADJBILI;3	01-DEC-89 23:57
;
	.RADIX 16T
;
KOLIK	EQU	2000
VEKTOR	EQU	906C+1
RUTINA	EQU	403C
;
;--------------------------------
	ORG	8FF8
ZACATE	;DI
	;JP	JESORD
;--------------------------------
	ORG	9000
ODKUD	DS	KOLIK
;--------------------------------
EXCLOP	DI
	LD	HL,ODKUD
	LD	DE,4000
	LD	BC,KOLIK
EX1	LD	A,(DE)
	LDI
	DEC	HL
	LD	(HL),A
	INC	HL
	JP	PE,EX1
	RET
;--------------------------------
TEST	DI
	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JR	Z,SHIFTY
VEN	POP	AF
	EI
	JP	RUTINA
;---------------
SHIFTY	CALL	EXCLOP
	RST	0
;---------------
JOY	IN	A,(37)
	RRCA
	RRCA
	RRCA
	RRCA
	LD	B,A
	AND	04
	LD	C,A
	LD	A,B
	RRCA
	LD	B,A
	AND	01
	OR	C
	LD	C,A
	LD	A,B
	RRCA
	LD	B,A
	AND	02
	OR	C
	LD	C,A
	LD	A,B
	RRCA
	RRCA
	RRCA
	AND	08
	OR	C
	LD	C,A
	IN	A,(31)
	AND	10
	OR	C
	RET
;--------------------------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,0D,09,'Pro SORD m.5',0D,0A,0D,0A,'      upravil LZR Soft',0D,0A
	DB 0D,0A,'         01-DEC-89',0D,0
;--------------------------------
JESORD	LD	A,(0006)
	CP	10
	JP	NZ,MSX
	CALL	00CC
	CALL	006F
	LD	HL,TEXT
TISK	LD	A,(HL)
	PUSH	AF
	CALL	00A2
	POP	AF
	OR	A
	JR	Z,PAUSE
	INC	HL
	JR	TISK
PAUSE	LD	BC,0B00
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	HL,TEST
	LD	(VEKTOR),HL
	LD	HL,0031
	LD	(93BF),HL
	LD	HL,0000
	LD	(93C1),HL
	LD	(90DA),HL
	LD	(90DC),HL
	LD	(90DE),HL
	LD	HL,0034
	LD	(90F0),HL
	LD	(90FC),HL
	LD	HL,JOY
	LD	(90D8),HL
	LD	A,0CD
	ORG	$-1
	CALL	0
	ORG	$-2
	LD	(90D7),A
	LD	A,03
	LD	(9506),A
	XOR	A
	LD	(93C3),A
	LD	A,10
	LD	(9021),A
	LD	(9061),A
	LD	(94B4),A
	LD	(94B9),A
	LD	(94C1),A
	LD	(94C5),A
	LD	(9517),A
	LD	(9529),A
	LD	(9A72),A
	LD	(0A483),A
	LD	(0A488),A
	LD	(0AA31),A
	LD	(0AA37),A
	LD	(0AA44),A
	LD	(0AA4A),A
	LD	(0AB7C),A
	LD	(0AB85),A
	LD	(0AB8B),A
	LD	(0AB9A),A
	LD	(0ABA3),A
	LD	(0ABA9),A
	LD	(0ABAD),A
	LD	(0ABF7),A
	LD	(0ABFE),A
	INC	A
	LD	(9026),A
	LD	(9029),A
	LD	(903E),A
	LD	(90BF),A
	CALL	EXCLOP
	LD	HL,(4002)
	EI
	IN	A,(11)
	JP	(HL)
;--------------------------------
MSX	LD	HL,(9002)
	PUSH	HL
	LD	A,H
	AND	0C0
	LD	DE,0000
	LD	HL,0F00F
	JR	Z,MSX2
	LD	DE,4000
	LD	HL,0F30C
MSX2	LD	A,(0FFFF)
	CPL
	AND	H
	LD	C,A
	RRCA
	RRCA
	RRCA
	RRCA
	AND	L
	OR	C
	LD	(0FFFF),A
	IN	A,(0A8)
	AND	H
	LD	B,A
	RRCA
	RRCA
	RRCA
	RRCA
	AND	L
	OR	B
	OUT	(0A8),A
	LD	HL,ODKUD
	LD	BC,KOLIK
	LDIR
	RET
KONEC:
DELKA	EQU	KONEC-ZACATE
	END	JESORD
