;UPRAVA HER MSX-SORD
;(C) ROS 28-JUN-89
;KONKRETNE - OIL'S WELL (TM)
;
;ADJOIL;1	01-DEC-89 17:17
;
	.RADIX 16T
;
KOLIK	EQU	4880
VEKTOR	EQU	903D+1
RUTINA	EQU	457F
;
;--------------------------------
	ORG	8FF8
ZACATE	DI
	JP	JESORD
;--------------------------------
	ORG	9000
ODKUD	DS	KOLIK
;--------------------------------
EXCLOP	DI
	LD	HL,ODKUD
	LD	DE,4000
	LD	BC,KOLIK
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
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	POP	AF
	EI
	JP	RUTINA
;---------------
SHIFTY	CALL	EXCLOP
	LD	HL,0000
	ORG	$-2
	DI
	JP	0000
	ORG	$-2
	LD	(ZACATE),HL
	LD	HL,JESORD
	LD	(ZACATE+2),HL
	RST	0
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	LD	A,(ZIVOT)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ZIVOT),A
	JR	VEN
SMRTEL	LD	A,0
	ORG	$-1
	DEC	A
	JR	ULOZIT
;--------------------------------
TEXT	DB 0C,0A,0A,0A,0A,0A,0A,0D,09,'Pro SORD m.5',0D,0A,0D,0A,'      upravil LZR Soft',0D,0A
	DB 0D,0A,'         01-DEC-89',0D,0
;--------------------------------
JESORD	LD	A,(0006)
	CP	10
	JR	NZ,MSX
	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	(VEKTOR),HL
	LD	A,03
	LD	(906A),A
	CALL	EXCLOP
	LD	HL,(4002)
	EI
	IN	A,(11)
	JP	(HL)
;--------------------------------
MSX	LD	HL,(9002)
	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,ODKUD
	LD	BC,KOLIK
	LDIR
	RET
ZIVOT:	;ZATIM JSEM HO NENASEL
KONEC:
DELKA	EQU	KONEC-ZACATE
	END	ZACATE
