;-----------------
CUBE_PG1	INCBIN "bin/part2/cube_pg1.bin.pl5d"
CUBE_PG1_END
CUBE_PG1_PG EQU #14
;-----------------
TUNNEL_EXE	INCBIN "bin/part2/mapping_tonnel.bin.pl5d"
TUNNEL_EXE_END
TUNNEL_EXE_PG EQU #14
;-----------------
LOADSTEP_DO
	LD	HL,LOADSTEP_TBL
LOADSTEP_HL EQU $-2
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	INC	HL
	PUSH	DE
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	INC	HL
	LD	C,(HL)
	INC	HL
	LD	(LOADSTEP_HL),HL
	LD	HL,32
	LD	B,0
	AND	A
	SBC	HL,BC
	EX	DE,HL
	RET
LOAD_ATTR
	LD	A,3
LOAD_ATTR2
	LD	B,C
LOAD_ATTR1
	LD	(HL),#47
	INC	L
	DJNZ	LOAD_ATTR1
	ADD	HL,DE
	DEC	A
	JP	NZ,LOAD_ATTR2
	;---
	LD	LX,6
	JR	LOADMUS_PLAY
LOADSTEP_TBL
	;------------ zeebr
	DW	LOAD_ATTR
	DW	#5960
	DB	8
	;------------ tmk
	DW	LOAD_ATTR
	DW	#59E0
	DB	5
	;------------ bfox
	DW	LOAD_ATTR
	DW	#5A40
	DB	6
	;------------ nq
	DW	LOAD_ATTR
	DW	#5AA0
	DB	6
	;-- load end
	DW	LOAD_END
LOAD_END
	LD	HL,EFFTABLE2
	;LD	(EFFTABLE_IY),HL
	LD	DE,EFFTABLE
	LD	BC,EFFTABLE2_SZ
	LDIR

	LD	HL,#7000	
	LD	DE,#BF00
	LD	BC,#0100
	LDIR
	
	DISPLAY "BREAK: ", /A, $	
	JP	MAIN_DEMO2
	
LOADMUS_PLAY
	LD	HL,LOADMUS + #11
LOADMUS_HL EQU $-2
LOADPL2	LD	A,(HL)
	INC	HL
	CP	#FF
	JP	Z,LOADPL1
	;--
	LD	BC,#FFFD
	OUT	(C),A
	LD	A,(HL)
	INC	HL
	LD	BC,#BFFD
	OUT	(C),A
	JP	LOADPL2
LOADPL1	;EI
	;HALT
	LD	C,20
PLW2	LD	B,0
PLW1	DJNZ	PLW1
	DEC	C
	JR	NZ,PLW2
	
	
	
	DEC	LX
	JP	NZ,LOADPL2
	LD	(LOADMUS_HL),HL
	RET
LOADMUS	INCBIN	"bin/loadmus.psg"
	DB	#FF
;-------------------
EFFTABLE2
	INCLUDE "timeline_part_2.asm"
EFFTABLE2_SZ EQU $ - EFFTABLE2

	DISPLAY "LOADSTEP SIZE: ", /A, $-LOADSTEP_DO
	DISPLAY "PAGE_14_END: ", /A, $
	DISPLAY "PAGE_14_FREE: ", /A, #FFFF-$

;-----------------
TWISTER_PG0	INCBIN "bin/part1/twister_pg0.bin.pl5d"
TWISTER_PG0_END
TWISTER_PG0_PG EQU #14
;-----------------
TWISTER_MAP2	INCBIN "bin/part1/twister_map2.bin.pl5d"
TWISTER_MAP2_END
TWISTER_MAP2_PG EQU #14
;-----------------
