;UPRAVA HER MSX-SORD
;(C) ROS 28-JUN-89
;KONKRETNE - CHESS MSX
;
;ADJCHES;5	14-AUG-89 19:15
;
	.RADIX 16T
;
	ORG	0C000
;
;--------------------------------
EXCLOP	DI
	LD	HL,8000
	LD	DE,4000
	LD	BC,3F80
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
	EI
	POP	AF
	JP	00D5
;--------------------------------
SHIFTY	CALL	EXCLOP
	RST	0
;---------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,0D,09,'Pro SORD m.5',0D,0A,0D,0A,'      upravil LZR Soft',0D,0
START	DI
	LD	HL,4241
	LD	(8000),HL
	LD	HL,4334
	LD	(8002),HL
	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	(0B695),HL
	LD	(0B6AD),HL
	LD	A,10
	LD	(0B91B),A
	LD	(0B92C),A
	LD	(0B8B1),A
	LD	(0B9FF),A
	LD	A,11
	LD	(0B90F),A
	LD	(0B91F),A
	LD	(0B98E),A
	LD	(0B992),A
	LD	(0B995),A
	LD	(0B999),A
	LD	(0B9BE),A
	LD	(0B9C2),A
	CALL	EXCLOP
	LD	HL,(4002)
	EI
	IN	A,(11)
	JP	(HL)
;--------------------------------
MSX	LD	HL,(8002)
	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,8000
	LD	BC,4000
	LDIR
	RET
KONEC:
DELKA	EQU	KONEC-START
	END	START
