;UPRAVA HRY MSX NINJYA KAGE
;ADJNINJYA ; 19-AUG-91 ; 11:54

;(C) ROS, 20-OCT-90

	.RADIX 16T

	ORG	0C000

;--------------------------------
ADR1	EQU	9FD5 ;INIT INT
ADR2	EQU	9852 ;SUBR INT
ADR3	EQU	83A9 ;LIVE-
ADR4	EQU	8004 ;START
;--------------------------------
START	DI
	LD	SP,0F380
	LD	A,9 ;MAX LIVES
	LD	(9A49),A
	LD	A,(0006)
	CP	10
	JR	NZ,RUN
SORDM5	LD	HL,0F3E9
	LD	A,0F
	LD	(HL),A
	INC	HL
	LD	A,4
	LD	(HL),A
	INC	HL
	LD	(HL),A
	CALL	00CC
	CALL	006F
	LD	HL,TEXT
TISK	LD	A,(HL)
	OR	A
	JR	Z,PAUSE
	CALL	00A2
	INC	HL
	JR	TISK
PAUSE	LD	B,0E
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	HL,TEST
	LD	(ADR1),HL
	LD	A,0C3
	LD	(9033),A
	LD	HL,ZAPIS
	LD	(9034),HL
	IN	A,(11)
RUN	EI
	JP	ADR4
;--------------------------------
ZAPIS	PUSH	AF
	LD	A,B
	CP	80
	JR	C,NIC
	POP	AF
	LD	(BC),A
	PUSH	AF
NIC	POP	AF
	JP	8FFC
;--------------------------------
TEST	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JP	Z,0000
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	POP	AF
	JP	ADR2
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	PUSH	HL
	LD	HL,ADR3
	LD	A,3D
	XOR	(HL)
	LD	(HL),A
	POP	HL
	JR	VEN
;--------------------------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,09,'Pro SORD m.5',0D,0A,0A,'      upravil LZR Soft',0D,0A,0A,09,20
	DB '19-AUG-91',0
;--------------------------------
ZKONEC
	END
