;UPRAVA HRY COMPUTER BILLIARD MSX
;(C) ROS, 1990
;ADJBILL;5 ; 04-AUG-90 ; 13:27
;
	.RADIX 16T

	ORG	9000

;--------------------------------
ADR2	EQU	403C ; SUBR INT
ADR3	EQU	906D ; SET INT
LENGHT	EQU	2000 ; OF PROGRAM
;--------------------------------
ZACATE	DS	LENGHT
;--------------------------------
MSX	LD	HL,(ZACATE+2)
	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,ZACATE
	LD	BC,LENGHT
	LDIR
	RET
;--------------------------------
EXCLOP	DI
	LD	HL,ZACATE
	LD	DE,4000
	LD	BC,LENGHT
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	ADR2
;---------------
SHIFTY	CALL	EXCLOP
	RST	0
;---------------
SOUND1	PUSH	DE
	LD	E,0B8
SOUND	CALL	1102
	POP	DE
	RET
SOUND2	PUSH	DE
	LD	E,H
	JR	SOUND
SOUND3	PUSH	DE
	LD	E,L
	JR	SOUND
JOYS	PUSH	BC
	BIT	7,A
	JP	019F
;--------------------------------
START	DI
	LD	A,(0006)
	CP	10
	JP	NZ,MSX
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,03
	LD	(9506),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
	LD	A,0CD
	LD	(94D3),A
	LD	(0ACE8),A
	LD	(0AD3E),A
	LD	(0AD45),A
	LD	(90D7),A
	LD	HL,SOUND1
	LD	(94D4),HL
	LD	HL,SOUND2
	LD	(0ACE9),HL
	LD	(0AD3F),HL
	LD	HL,SOUND3
	LD	(0AD46),HL
	LD	HL,JOYS
	LD	(90D8),HL
	XOR	A
	LD	H,A
	LD	L,A
	LD	(94D6),A
	LD	(94D7),HL
	LD	(0ACEB),HL
	LD	(0AD41),HL
	LD	(0AD48),HL
	LD	(90DA),A
	LD	(90DB),HL
	LD	HL,90E8
	LD	(HL),0DB
	INC	HL
	LD	(HL),34
	INC	HL
	LD	A,7
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	XOR	A
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,90F6
	LD	(HL),0DB
	INC	HL
	LD	(HL),34
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,93B8
	LD	(HL),0DB
	INC	HL
	LD	(HL),31
	INC	HL
	LD	(HL),7
	INC	HL
	LD	(HL),2F
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	INC	HL
	LD	(HL),A
	LD	HL,TEST
	LD	(ADR3),HL
	CALL	EXCLOP
	LD	HL,(4002)
	EI
	IN	A,(11)
	JP	(HL)
;--------------------------------
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 4.8. 1990'
	DB 0D,0
;--------------------------------
ZKONEC
	END	8FF8
