;UPRAVA HRY MSX PITFAL II
;ADJPITFAL ; 20-AUG-91 ; 17:20

;(C) ROS, 20-OCT-90

	.RADIX 16T

	ORG	0C000

;--------------------------------
ADR1	EQU	8025 ;INIT INT
ADR2	EQU	815F ;SUBR INT
ADR3	EQU	0000 ;LIVE-
ADR4	EQU	8027 ;START
;--------------------------------
;VDP (10)
U101	EQU	9E5E
U102	EQU	9E72
U103	EQU	0BE29
U104	EQU	0BE3A
U105	EQU	0BE58
U106	EQU	0BF3D
U107	EQU	0BF4A
;--------------------------------
START	DI
	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	BC,0E00
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	A,10
	LD	(U101),A
	LD	(U102),A
	LD	(U103),A
	LD	(U104),A
	LD	(U105),A
	LD	(U106),A
	LD	(U107),A
	LD	HL,03F0
	LD	A,(HL)
	LD	(HL),0C3
	LD	(SCHOVA),A
	LD	HL,TEST
	LD	(ADR1),HL
	LD	HL,0033
	LD	(8425),HL
	LD	HL,0034
	LD	(9BA4),HL
	IN	A,(11)
RUN	EI
	JP	ADR4
;--------------------------------
TEST	PUSH	AF
	IN	A,(30)
	CPL
	AND	0C
	JR	Z,SHIFTY
;	IN	A,(50)
;	RLCA
;	JR	C,RESET
VEN	POP	AF
	JP	ADR2
;---------------
SHIFTY	LD	A,(SCHOVA)
	LD	(03F0),A
	JP	0000
;---------------
;RESET	IN	A,(50)
;	RLCA
;	JR	C,RESET
;	LD	A,(ADR3)
;	XOR	3D
;	LD	(ADR3),A
;	JR	VEN
;---------------
SCHOVA	DB 0
;--------------------------------
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-AUG-91',0
;--------------------------------
ZKONEC
	END
