	CALL	#E1D2
	DI
	LD	(RelocatedCode.SPsave),SP
	LD	HL,.START
	LD	DE,#D800
	LD	BC,.END-.START
	PUSH	DE
	LDIR

	LD	HL,#E1D1
	LD	DE,#FFFF
	LD	BC,#0850
	RET

RelocatedCode:
.START:
	LDDR
	LD	HL,#F7B0
	LD	DE,#D900
	LD	B,#00
	LD	A,(HL)
	BIT	7,A
	JR	NZ,#D94A
	AND	#0F
	LD	B,A
	RLD
	ADD	A,#03
	LD	C,A
	INC	HL
	LD	A,E
	SUB	(HL)
	INC	HL
	LD	SP,HL
	LD	H,(HL)
	LD	L,A
	LD	A,D
	SBC	A,B
	LD	B,H
	LD	H,A
	LD	A,B
	LD	B,#00
	LDIR
	LD	H,B
	LD	L,C
	ADD	HL,SP
	JR	#D929
	AND	#7F
	JR	Z,#D967
	INC	HL
	BIT	6,A
	JR	NZ,#D958
	LD	C,A
	LDIR
	JR	#D928
	AND	#3F
	ADD	A,#03
	LD	B,A
	LD	A,(HL)
	INC	HL
	LD	C,(HL)
	LD	(DE),A
	INC	DE
	DJNZ	#D960
	LD	A,C
	JR	#D929
	LD	SP,#D85B
	LD	B,#03
	POP	HL
	DEC	SP
	POP	AF
	LD	(HL),A
	DJNZ	#D96C
.SPsave+1: LD	SP,#0000
	DI
	RET
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
.END EQU $
; Картинка на стартовом экране слева сверху
	INCBIN 'SP_LOGO.BIN'