;UPRAVA HRY FAIRY MSX
;(C) ROS, 1990
;ADJFAI;1 ; 27-JUL-90 ; 20:37
;
	.RADIX 16T
	ORG	0BFFC
;--------------------------------
ADRLIV	EQU	81E6  ; LIVE
ADRINT	EQU	0EF00 ; VOLNO
ADRAT1	EQU	8AD6  ; ATTACK 1
ADRAT2	EQU	0A44B ; ATTACK 2
START	EQU	801E  ; BEGIN
;--------------------------------
ZMENA	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	DE,ADRINT
	LD	BC,KTEST-TEST
	LDIR
	LD	HL,ADRINT
	LD	(ADRAT1),HL
	LD	(ADRAT2),HL
	JP	START
;--------------------------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,0D,09,'Pro SORD m.5',0D,0A,0D,0A,'      upravil LZR Soft',0D,0
;--------------------------------
TEST	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JP	Z,0000
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	POP	AF
	JP	00D8
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	LD	A,(ADRLIV)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ADRLIV),A
	JR	VEN
SMRTEL	LD	A,3D
	JR	ULOZIT
KTEST
;--------------------------------
	END
