;UPRAVA HRY MAKE THE HAMBURGER
;(C) ROS 16-JUL-89
;ADJHAM;4  19:20
;
	.RADIX 16T
	ORG	0C941
;--------------------------------
ADR1	EQU	430B
;--------------------------------
;STRT	CALL	13B6
;	CALL	VEN
;	CALL	1082
;	JR	STRT
;--------------------------------
EXCLO1	DI
	LD	HL,0B900
	LD	DE,0A800
	LD	BC,1000
EX1	LD	A,(DE)
	LDI
	DEC	HL
	LD	(HL),A
	INC	HL
	JP	PE,EX1
	RET
;--------------------------------
EXCLO2	DI
	LD	HL,9000
	LD	DE,4000
	LD	BC,2900
EX2	LD	A,(DE)
	LDI
	DEC	HL
	LD	(HL),A
	INC	HL
	JP	PE,EX2
	RET
;--------------------------------
ATTACK	CALL	TEST
	XOR	A
	CALL	00D8
	OR	A
	RET	NZ
	LD	A,1
	CALL	00D8
	OR	A
	RET	NZ
	LD	A,2
	JP	00D8
;--------------------------------
JOYS	CALL	TEST
	IN	A,(37)
	AND	0F0
	OR	A
	JR	Z,LEVY
	RLCA
	RLCA
	RLCA
	RLCA
	JR	OBA
LEVY	IN	A,(37)
	AND	0F
	OR	A
	JR	Z,KEYS
OBA	BIT	3,A
	JR	NZ,DOLU
	BIT	2,A
	JR	NZ,VLEVO
	BIT	1,A
	JR	NZ,NAHORU
VPRAVO	LD	A,10
	RET
DOLU	LD	A,20
	RET
NAHORU	LD	A,40
	RET
VLEVO	LD	A,80
	RET
KEYS	IN	A,(34)
	AND	0F0
	OR	A
	RET	Z
	BIT	4,A
	JR	NZ,VLEVO
	BIT	5,A
	JR	NZ,NAHORU
	BIT	6,A
	JR	NZ,DOLU
	JR	VPRAVO
;--------------------------------
TEST	DI
	IN	A,(30)
	CPL
	AND	0C
	JR	Z,SHIFTY
	IN	A,(50)
	RLCA
	JR	C,RESET
VEN	EI
	RET
;---------------
SHIFTY	CALL	EXCLO1
	CALL	EXCLO2
	RST	0
;---------------
RESET	IN	A,(50)
	RLCA
	JR	C,RESET
	LD	A,(ADR1)
	OR	A
	JR	Z,SMRTEL
	XOR	A
ULOZIT	LD	(ADR1),A
	JR	VEN
SMRTEL	LD	A,3D
	JR	ULOZIT
;--------------------------------
START	DI
	CALL	00CC
	CALL	006F
	XOR	A
	LD	(0F3DB),A
	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,1000
PAUS1	XOR	A
PAUS2	DEC	A
	JR	NZ,PAUS2
	DEC	BC
	OR	B
	JR	NZ,PAUS1
	LD	A,(0006)
	CP	10
	JP	NZ,0C900
	LD	A,0C3
	LD	HL,JOYS
	LD	(0AF4E),A
	LD	(0AF4F),HL
	LD	HL,ATTACK
	LD	(0AEE7),HL
	LD	(097F8),HL
	LD	(09908),HL
	CALL	EXCLO2
	CALL	EXCLO1
	LD	HL,(4002)
	EI
	JP	(HL)
;--------------------------------
TEXT	DB 0C,0D,0A,0A,0A,0A,0A
	DM				"     MAKE THE HAMBURGER"
	DB 0D,0A,0A
	DM				"    UPRAVIL (C) LZR SOFT"
	DB 0D,0A,0A
	DM				"         16-JUL-89"
	DB 0D,0A,0
KONEC:
DELKA	EQU	KONEC-START
	END	START
