;UPRAVA HRY PINE APPLIN MSX
;(C) ROS, 1990
;ADJAPPL;1 ; 20-OCT-90 ; 15:33
;
	.RADIX 16T

;--------------------------------
ADR1	EQU	8061 ;TEST
ADR2	EQU	00D8 ;SUBR TEST
ADR3	EQU	8F2C ;LIVE-
ADR4	EQU	8080 ;START
;--------------------------------

	ORG	801D

;--------------------------------
START	LD	A,(0006)
ZMENA	CP	10
	CALL	Z,SORDM5
	JR	ADR4
;--------------------------------
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
	LD	A,(ADR3)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ADR3),A
	JR	VEN
SMRTEL	LD	A,3D
	JR	ULOZIT
ZZZ	;MAX 804E
;--------------------------------

	ORG	0C000

;--------------------------------
SORDM5	DI
	XOR	A
	LD	(ZMENA+1),A
	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	BC,0E00
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	HL,TEST
	LD	(ADR1),HL
	EI
	IN	A,(11)
	RET
;--------------------------------
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 '20-OCT-90',0
;--------------------------------
ZKONEC
	END	8FF8
