;UPRAVA HRY ATHLETIC LAND MSX
;(C) ROS, 1990
;ADJLAND;1 ; 02-SEP-90 ; 14:25
;
	.RADIX 16T

	ORG	0CC40

;--------------------------------
ADR1	EQU	426B ; LIVE-
;--------------------------------
START	DI
	LD	A,(0006)
	CP	10
	JR	Z,SORDM5
	IN	A,(0A8)
	AND	0F3
	PUSH	AF
	RRA
	RRA
	AND	0C
	POP	BC
	ADD	A,B
	OUT	(0A8),A
	LD	HL,9000
	LD	DE,4000
	LD	BC,3C40
	LDIR
	LD	HL,(4002)
	JP	(HL)
SORDM5	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,1000
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	A,10
	LD	(9020),A
	LD	(9074),A
	LD	(9551),A
	LD	(9565),A
	LD	(9BC1),A
	INC	A
	LD	(9025),A
	LD	(9028),A
	LD	(9040),A
	LD	(90A5),A
	LD	A,03
	LD	(953F),A
	LD	A,0CD
	LD	(90BA),A
	LD	(0C94F),A
	LD	(0C956),A
	LD	A,0C3
	LD	(0C8F9),A
	XOR	A
	LD	HL,90BD
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,0C8F7
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,0C94D
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,0C954
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,M5JOY
	LD	(90BB),HL
	LD	HL,SOUND2
	LD	(0C950),HL
	LD	(0C8FA),HL
	LD	HL,SOUND3
	LD	(0C957),HL
	LD	HL,90F4
	LD	(HL),0DB
	INC	HL
	LD	(HL),31
	INC	HL
	LD	(HL),2F
	INC	HL
	LD	(HL),17
	LD	HL,SOUND1
	LD	DE,94FC
	LD	BC,SOUND2-SOUND1
	LDIR
	LD	HL,TEST
	LD	(9090),HL
	CALL	EXCLOP
	LD	HL,(4002)
	EI
	IN	A,(11)
	JP	(HL)
;--------------------------------
EXCLOP	DI
	LD	HL,9000
	LD	DE,4000
	LD	BC,3C40
EX1	LD	A,(DE)
	LDI
	DEC	HL
	LD	(HL),A
	INC	HL
	JP	PE,EX1
	RET
;--------------------------------
TEST	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JR	Z,SHIFTY
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	POP	AF
	JP	4038
;---------------
SHIFTY	CALL	EXCLOP
	RST	0
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	LD	A,(ADR1)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ADR1),A
	JR	VEN
SMRTEL	LD	A,35
	JR	ULOZIT
;--------------------------------
M5JOY	PUSH	BC
	LD	A,(0E002)
	BIT	7,A
	JP	019F
SOUND1	LD	E,0B8
	CALL	1102
	NOP
	CALL	460E
	LD	A,08
	LD	E,00
	LD	B,03
INISGC	CALL	1102
	INC	A
	DJNZ	INISGC
	NOP
SOUND2	PUSH	DE
	LD	E,H
	JR	SOUND4
SOUND3	PUSH	DE
	LD	E,L
SOUND4	CALL	1102
	POP	DE
	RET
;--------------------------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,0D,09
	DB         'Pro SORD m.5'
	DB 0D,0A,0D,0A,09
	DB         'v potu tvare'
	DB 0D,0A,0D,0A
	DB '       pracne upravil'
	DB 0D,0A,0D,0A
	DB '     LZR Soft 2.8. 1990'
	DB 0D,0,0,0,0,0
	DW 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
;--------------------------------
ZKONEC
	END	8FF8
