				NOLIST
                ; Saved 2.259 bytes using appack instead MegaLZ
                ; Include constants for editing the timmings for NOT Nerds :P
				READ "timming_constants.asm"

; Mettre >0 pour générer les fichiers de l'intro (executable + datas)
; Ils seront sauvés dans le repertoire bin/
cnf_write_to_files		EQU 1

; Adresse où l'intro JumP en quittant
cnf_jump_hyperspace		EQU 0

; Configuration de départ du CRTC
; (décomenter si besoin pour changer la valeur par défaut, en particulier de R7
; sinon l'écran va décrocher... et c'est moche)
;cnf_crtc_default_R1		EQU 40
;cnf_crtc_default_R2		EQU 46
;cnf_crtc_default_R4		EQU 38
;cnf_crtc_default_R5		EQU 0
;cnf_crtc_default_R6		EQU 25
;cnf_crtc_default_R7		EQU 30
;cnf_crtc_default_R9		EQU 7

; Configuration de sortie du CRTC
cnf_crtc_exit_R2		EQU 46
cnf_crtc_exit_R7		EQU 35

; Les autres registres seront configurés avec les valeurs suivantes
; R0 = 63
; R1 = 0(full-BORDER)
; R3 = &88
; R4 = 38
; R5 = 0
; R6 = 25
; R8 = 0
; R9 = 7


; Adresse de depack des data de la sequence 3
; (valeur calculée et indiquée dans le makefile)
cnf_sequence3_depack_address	EQU &9140

;*******************************************************************************

				ORG &400
				LIST
;; Arkos Tracker song data
				NOLIST
				
				LIMIT &7FFF
				
				WRITE DIRECT -1,-1,&c0
				IF cnf_write_to_files
					WRITE "bin/exec.c0.bin"
				ENDIF
				
data_music			INCBIN "data/music.bin"

				LIST
;; Intro executable & raw data
				NOLIST

INK0				EQU &54
INK1				EQU &44
INK2				EQU &55
INK3				EQU &5C
INK4				EQU &58
INK5				EQU &5D
INK6				EQU &4C
INK7				EQU &45
INK8				EQU &4D
INK9				EQU &56
INK10				EQU &46
INK11				EQU &57
INK12				EQU &5E
INK13				EQU &40
INK14				EQU &5F
INK15				EQU &4E
INK16				EQU &47
INK17				EQU &4F
INK18				EQU &52
INK19				EQU &42
INK20				EQU &53
INK21				EQU &5A
INK22				EQU &59
INK23				EQU &5B
INK24				EQU &4A
INK25				EQU &43
INK26				EQU &4B

;				READ "lib/depack.megalz.asm"
				READ "lib/aplib_cpc.asm"
				READ "lib/crtc.asm"
				READ "lib/keyframer.asm"
				READ "lib/keyboard.asm"
				READ "lib/at.player.asm"
;the stack will overwrite the initialization routine of the AT player
				dw 0
intro_stack

;*** TOOLS *********************************************************************
				
kf_pal
				ld de,_var_palette
				ldi
				ldi
				ret
				
tool_setCrtcReg:
				ld b,&bc
				out (c),h
				inc b
				out (c),l
				ret
				
tool_setCrtcR1213:
				ld bc,&bc0c
				out (c),c
				inc b
				out (c),h
				dec b
				inc c
				out (c),c
				inc b
				out (c),l
				ret
				
tool_xySprite:
				ld a,d
				call tool_screenaddress_y
				
				; HL = source
				; DE = screen addresse
				; IXh= height
				; B  = 0
				; C  = width (byte)
tool_putSprite:
				ld a,c
				push de
				ldir
				pop de
				ld c,a
				call tool_screenaddress_nextline_de
				dec ixh
				jr nz,tool_putSprite
				ret
				
tool_screenaddress_nextline_de:
				ld a,d
				add a,8
				ld d,a
				and %00111000
				ret nz
				ld a,64
				add a,e
				ld e,a
				ld a,d
				adc -&40
				ld d,a
				ret
				
				; &8000
				; (32x9)x64
				; Input
				;  A = Y (line)
				;  E = X (byte) * 4
				; Output
				;  DE = Screen Address
				;  AF modified
tool_screenaddress_y:
				rrca
				rrca
				rrca
				srl a
				rr e
				rra
				rr e
var_tool_screenaddress_base	EQU $+1
				or &80
				ld d,a
				; --LL LCCC CCxx xxxx
				ret
				
tool_palette16:
				ld bc,&7f0f
_tool_setpal_loop		out (c),c
				inc b
				outi
				dec c
				jr nz,_tool_setpal_loop
				ld a,(hl)
				inc hl
				out (c),c
				out (c),a
				ld c,&10
				out (c),c
				out (c),a
				or a
				ld b,0
				ld c,(hl)
				inc hl
				sbc hl,bc
				ret
				
				
;; Wait until VSync is active
crtc_wait_vsync			ld b,&F5
				in a,(c)
				rra
				ret c
				jr crtc_wait_vsync+2
				
				
;; 300Hz Interrupt Service Routine
isr300Hz:
				push af
				ld a,&F5
				in a,(&DB)
				rra
				jr nc,_isr300Hz_no_vbi
				  ; Vertical Blanking Interrupt (~50Hz)
				  ; Save CPU registers
				  push ix
				  push iy
				  push hl
				  push de
				  push bc
				  exx
				  ex af,af'
				  push af
				  push hl
				  push de
				  push bc
				  
				  ; Mode 0 Palette
_var_palette			  EQU $+1
				  ld hl,0
_var_palette_call		  EQU $+1
				  call _ret; tool_palette16
				  ld (_var_palette),hl
				  
				  ; Get Joystick status
				  ld a,&49
				  call kbd_read_row
				  ; Fire button
				  bit 4,a
				  jr z,_kb_exit_callback
				  ; ignore repeated code
_var_kb_antirepeat		  EQU $+1
				  cp &FF
				  jr z,_kb_ignore
				  ld (_var_kb_antirepeat),a
				  ; no lines active?
				  cp &FF
				  jr z,_kb_ignore
				  ; konami code sequence
_var_kb_konami			  EQU $+1
				  ld hl,data_konami_code
				  ld de,data_konami_code - 1
				  cp (hl)
				  jr z,$+3
				    ex de,hl
				  inc hl
				  bit 7,(hl)
				  jr nz,_kb_konami_continue
;					ld a,&C5
;					ld (_var_titlescreen_databank),a
;					ld hl,data_eggzausted_pal_in
;					ld (_var_titlescreen_palette),hl
;					ld hl,data_crt_eggzausted
;					ld (_var_titlescreen_crt),hl
					ex de,hl
_kb_konami_continue
				  ld (_var_kb_konami),hl 
_kb_ignore
                  ; CTRL pressed?
                  ld a,&42
				  call kbd_read_row
				  bit 7,a
                  jr z,_kb_exit_callback
                  ; SPACE pressed?
                  ld a,&45
                  call kbd_read_row
                  bit 7,a
                  jr z,_kb_exit_callback
                  ; Z pressed?
                  ld a,&48
                  call kbd_read_row
                  bit 7,a
                  jr z,_kb_exit_callback

				  ; Cowardly ESCape?
				  call kbd_key_esc
_var_exit_callback		  EQU $+1
_kb_exit_callback		  call z,_ret
				  
				  ; Play music
				  call PLY_Play
				  
				  ; Restore CPU registers
				  pop bc
				  pop de
				  pop hl
				  pop af
				  ex af,af'
				  exx
				  pop bc
				  pop de
				  pop hl
				  pop iy
				  pop ix
				  
_isr300Hz_no_vbi		pop af
				ei
_ret				ret
				
tool_blackout:
				ld bc,&7F10
				ld a,&54
_init_palette			out (c),c
				out (c),a
				dec c
				jp p,_init_palette
				ret
				
;*** Intro exit ****************************************************************
intro_exit:
				di
				; Wait for VSync
				call crtc_wait_vsync
				; Mute sound
				call PLY_Stop
				; Blackout
				call tool_blackout
				; Disconnect banks
				ld c,&c0
				out (c),c
				; Reset CRTC
				ld hl,data_crt_exit
				call crtc_setup
				
				;ld bc,&7F10
				;out (c),c
				;ld c,&4C
				;out (c),c
				;jr $
				
				; Exit
				jp cnf_jump_hyperspace
				
data_crt_exit
				db 1,0
				db 2,cnf_crtc_exit_R2
				db 6,25
				db 7+128,cnf_crtc_exit_R7
				
;*** R-9 Take Off (Zoom) *******************************************************
				
sequence4_start
;				ld bc,&BC06
;				out (c),c
;				ld bc,&BD00+15
;				out (c),c
 				ld hl,data_crt_sequence4
				call crtc_setup
				
				ld hl,data_sequence4_pal_black
				ld (_var_palette),hl
				
				ld bc,&7FC4
				out (c),c
				
				ld hl,data_mlz_sequence4_screen01
				ld de,&8000 ;&c000
				call depack_apk

                ; Decrunch Ship Zoom2
                ld hl,data_mlz_sequence4_screen2
                ld de,data_mlz_sequence4_screen01
                call depack_apk

				
				ld hl,data_sequence4_pal_in
				ld (_var_palette),hl
				
sequence4_mainloop		call crtc_wait_vsync
				
				; keyframing
				ld ix,data_kf_sequence4
				call keyframer
				
				jr sequence4_mainloop
				
kf_sequence4_zoom1
                push hl

                ld hl,&0C00+&30
				call tool_setCrtcReg

;				ld hl,data_mlz_sequence4_screen2
;				ld de,&8000
;				call depack_apk
                ; Copy sprite to first buffer
                ; HL = source
                ; DE = screen addresse
                ; IXh= height
                ; B  = 0
                ; C  = width (byte)
                ld hl,data_mlz_sequence4_screen01
                ld de,&9210 ;&8000 + &800 * 2 + 8 * 64 + 16
                ld ixh,90
                ld bc,32
                call tool_putSprite

                pop hl
				ret
				
kf_sequence4_zoom2
                push hl
;				ex de,hl
                ld hl,&0C00+&20
				call tool_setCrtcReg
				
;                ld hl,data_mlz_titlescreenb
;                ld de,&c000
;                call depack_apk

;				ex de,hl
                pop hl
				ret

				; Konami code
				;      xRLDU
data_konami_code		db %11111110	; ?
				db %11111110	; ?
				db %11111101	; ?
				db %11111101	; ?
				db %11111011	; ?
				db %11110111	; ?
				db %11111011	; ?
				db %11110111	; ?
				db 0
				
;*** Title fullscreen **********************************************************
titlescreen_start

_var_titlescreen_databank	EQU $+1
				ld bc,&7FC4
				out (c),c
				
				ld hl,data_mlz_titlescreen
				ld de,&8000
				call depack_apk
				
_var_titlescreen_crt		EQU $+1
				ld hl,data_crt_titlescreen
				call crtc_setup
				
_var_titlescreen_palette	EQU $+1
				ld hl,data_titlescreen_pal_in
				ld (_var_palette),hl
				
titlescreen_mainloop		call crtc_wait_vsync
				
				djnz $
				
				jr titlescreen_mainloop
				
; keyframer data
				
data_kf_sequence4		dw len_sequence4_zoom1
				dw _data_kf_sequence4
_data_kf_sequence4
				dw kf_sequence4_zoom1
				dw kf_cmd_wait, len_sequence4_zoom2
				dw kf_sequence4_zoom2
				dw kf_cmd_wait, len_sequence4_pal_flash
				
				dw kf_pal, data_sequence4_pal_flash
				dw kf_cmd_wait, len_sequence4_exit
				
				dw kf_cmd_exit, titlescreen_start
				
				
				
; Palettes data
				
data_sequence4_pal_black
				db INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,17
data_sequence4_pal_in
;				db INK1 ,INK1,INK1,INK1 ,INK1 ,INK1 ,INK1 ,INK1 ,INK1,INK1,INK1,INK1 ,INK1,INK1,INK1 ,INK0, 0
;				db INK2 ,INK3,INK3,INK2 ,INK5 ,INK2 ,INK2 ,INK5 ,INK1,INK2,INK2,INK4 ,INK4,INK4,INK2 ,INK0, 0
;				db INK10,INK3,INK6,INK13,INK10,INK11,INK11,INK14,INK1,INK2,INK5,INK7 ,INK4,INK7,INK13,INK0, 0
                db INK1, INK1, INK1, INK1,INK1, INK1, INK1,INK1, INK1,INK1, INK1, INK1,INK1,INK1, INK1,INK0,0
                db INK2, INK2, INK2, INK3,INK2, INK2, INK2,INK2, INK2,INK2, INK2, INK4,INK3,INK5, INK1,INK0,0
                db INK13,INK13,INK10,INK6,INK13,INK11,INK5,INK11,INK2,INK10,INK10,INK4,INK3,INK10,INK1,INK0,0
                db INK26,INK25,INK15,INK6,INK23,INK20,INK5,INK11,INK2,INK13,INK12,INK4,INK3,INK10,INK1,INK0,17

data_sequence4_pal_flash
				db INK14,INK3 ,INK6 ,INK23,INK10,INK20,INK11,INK14,INK1 ,INK2 ,INK5 ,INK17,INK4 ,INK7 ,INK26,INK1, 0
				db INK20,INK6 ,INK15,INK26,INK13,INK23,INK13,INK20,INK5 ,INK11,INK14,INK24,INK5 ,INK17,INK26,INK2, 0
				db INK23,INK15,INK24,INK26,INK20,INK26,INK20,INK23,INK14,INK14,INK20,INK26,INK14,INK20,INK26,INK11, 0
				db INK26,INK24,INK26,INK26,INK26,INK26,INK23,INK26,INK20,INK20,INK26,INK26,INK20,INK26,INK26,INK20, 0
				db INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26,INK26, 17
				
data_titlescreen_pal_in
				db INK20,INK24,INK24,INK23,INK20,INK23,INK23,INK23,INK20,INK20,INK20,INK25,INK23,INK25,INK26,INK23,0
				db INK14,INK15,INK16,INK23,INK14,INK23,INK20,INK20,INK14,INK14,INK14,INK20,INK20,INK20,INK26,INK20,0
				db INK13,INK6 ,INK15,INK23,INK10,INK20,INK14,INK14,INK11,INK11,INK11,INK17,INK17,INK17,INK26,INK13,0
				db INK13,INK3 ,INK6 ,INK23,INK10,INK20,INK11,INK14,INK2 ,INK5 ,INK5 ,INK17,INK8 ,INK8 ,INK26,INK2 ,0
				db INK13,INK3 ,INK6 ,INK23,INK10,INK20,INK11,INK14,INK1 ,INK2 ,INK5 ,INK17,INK4 ,INK7 ,INK26,INK0 ,17
data_titlescreen_pal_out
				
				db INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,17
				
;data_eggzausted_pal_in
;				db INK3 ,INK16,INK15,INK24,INK12,INK18,INK13,INK0 ,INK10,INK20,INK14,INK1 ,INK4 ,INK26,INK6 ,INK9 ,17
				
data_crt_titlescreen
				db 1,46
				db 2,49
				db 6,33
				db 7,34
				db 12,&2c
				db 13+128,&00
;data_crt_eggzausted
;				db 1,48
;				db 2,50
;				db 6,35
;				db 7,35
;				db 12,&2c
;				db 13+128,&00
				
;;*******************************************************************************
sequence1_1_start
				ld hl,intro_exit
				ld (_var_exit_callback),hl
				
				ld hl,data_crt_intro
				call crtc_setup
				
				ld hl,data_mlz_sequence1_screen
				ld de,&8000
				call depack_apk
				ld hl,data_mlz_sequence1_sprite
				ld de,data_mlz_sequence1_screen
				call depack_apk
				
				ld hl,data_sequence1_1_pal1
				ld (_var_palette),hl
				ld hl,tool_palette16
				ld (_var_palette_call),hl
				
sequence1_1_mainloop		call crtc_wait_vsync
				
				ld ix,data_kf_sequence1_1
				call keyframer
				
				ld de,&D592+&800
				ld ixh,76
				
kf_data_kf_sequence1_1_pos	EQU $+1
				ld a,63
kf_data_kf_sequence1_1_mov	nop;dec a
				or a
				jr z,sequence1_1_mainloop

				ld (kf_data_kf_sequence1_1_pos),a
				srl a				
				ld b,a
sequence1_1_init_sprite		call tool_screenaddress_nextline_de
				dec ixh
				djnz sequence1_1_init_sprite
				
				ld hl,data_mlz_sequence1_screen
				ld bc,28
				call tool_putSprite
				
				jr sequence1_1_mainloop
				
kf_sequence1_1_raiseShip
				ld a,&3D
				ld (kf_data_kf_sequence1_1_mov),a
				ret
kf_sequence1_1_stopShip
				xor a
				ld (kf_data_kf_sequence1_1_mov),a
				ret
				

;*******************************************************************************
sequence1_2_start
				ld hl,sequence1_2_exit
				ld (_var_exit_callback),hl
				
				ld hl,data_sequence1_2_pal1
				ld (_var_palette),hl
				
sequence1_2_mainloop		call crtc_wait_vsync
				
_var_sequence1_2_specscreen	EQU $+1
				ld hl,&2000
				call tool_setCrtcR1213
				
				djnz $
				
				halt
				
				ld hl,&0400+15
				call tool_setCrtcReg
				
				ld hl,16*32 + &3000
				call tool_setCrtcR1213
				
				halt
				halt
				halt
				
				ld hl,data_sequence1_1_pal5
				call tool_palette16
				
				ld hl,&0400+22
				call tool_setCrtcReg
				
				ld hl,&0700 + 34-16
				call tool_setCrtcReg
				
				ld ix,data_kf_sequence1_2
				call keyframer

				jr sequence1_2_mainloop
				
kl_sequence_1_2_specscreen	ld de,_var_sequence1_2_specscreen
				ldi
				ldi
				ret
				
sequence1_2_exit
				ei
				
				halt
				halt
				
				ld hl,&0400+38
				call tool_setCrtcReg
				
				ld hl,&0700 + 34
				call tool_setCrtcReg
				
				jp intro_exit
				
								
;*******************************************************************************
sequence1_3_start
			
				ld hl,data_sequence1_1_pal5
				ld (_var_palette),hl
				
				ld hl,&3000
				call tool_setCrtcR1213
				
				call crtc_wait_vsync
				
				halt
				halt
				
				ld hl,&0400+38
				call tool_setCrtcReg
				
				ld hl,&0700 + 34
				call tool_setCrtcReg
				
				ld hl,intro_exit
				ld (_var_exit_callback),hl
				
				ld hl,data_mlz_sequence2_screen
				ld de,&8000
				call depack_apk
				call sequence2_putSprites
				
				ld hl,data_sequence1_1_pal5
				ld (_var_palette),hl
				
sequence1_3_mainloop		call crtc_wait_vsync
								
				ld ix,data_kf_sequence1_3
				call keyframer
				
				djnz $
				djnz $
				
				jr sequence1_3_mainloop
				
kl_sequence_1_3_poke
				ld e,(hl)
				inc hl
				ld d,(hl)
				inc hl
				ldi
				ret
								
;*******************************************************************************
sequence2_start

				ld hl,data_sequence2_pal1
				ld (_var_palette),hl
				
sequence2_mainloop		call crtc_wait_vsync
				
_var_sequence2_sah		EQU $+2
				ld hl,&2000
				call tool_setCrtcR1213
				
				; page flipping
				ld a,h
_var_sequence2_pageflipping	EQU $+1
				xor &00
				ld (_var_sequence2_sah),a
				add a,a
				add a,a
				ld (var_tool_screenaddress_base),a
				
				; keyframing
				ld ix,data_kf_sequence2
				call keyframer

				; display sprites
				call sequence2_putSprites
				
				; animate sprites
				ld a,(_var_sequence2_cable_y)
_var_sequence2_craneMove	EQU $+1
				call sequence2_craneStop
				ld (_var_sequence2_cable_y),a
				add a,2
				ld (_var_sequence2_spine_y),a
				add a,58
				ld (_var_sequence2_arms_y),a
				
				ld a,10
_sequence2_cyclewaste		djnz $
				dec a
				jr nz,_sequence2_cyclewaste
				
				jr sequence2_mainloop
				
sequence2_craneDown:
				inc a
				cp 91-4
				ret c
				ld a,91-4
sequence2_craneStop		ret
sequence2_craneUp:
				dec a
				ret p
				xor a
				ret
				
sequence2_putSprites:
				
				; spine
				let ypos = 2*256
_var_sequence2_spine_y		EQU $+2
				ld de,29*4 + ypos
				ld hl,data_sequence2_spr_spine
				ld ixh,58
				ld bc,6
				call tool_xySprite
				
				; arms
				let ypos = 60*256
_var_sequence2_arms_y		EQU $+2
				ld de,20*4 + ypos
_var_sequence2_arms_sprite	EQU $+1
				ld hl,data_sequence2_spr_arms1
_var_sequence2_arms_h		EQU $+2
				ld ixh,65
				ld bc,24
_var_sequence2_sprite_disable	call tool_xySprite

				; cable
_var_sequence2_cable_y		EQU $+2
				ld de,29*4
				ld hl,data_sequence2_spr_cable
				ld ixh,2
				ld bc,6
				bit 0,d
				jr nz,$+3
				  add hl,bc
				call tool_xySprite
				
				; ship
				let ypos = 179*256      ; SyX
				ld de,24*4 + ypos
				ld hl,data_sequence2_spr_ship
				ld ixh,37
				ld bc,16
				jp tool_xySprite
				
kf_sequence2_copyscreen
				push hl
				ld hl,&8000
				ld de,&c000
				ld bc,&4000
				ldir
				pop hl
				ret
				
kf_sequence2_craneDown
				ld a,&10
				ld (_var_sequence2_pageflipping),a
				
				ld de,sequence2_craneDown
				ld (_var_sequence2_craneMove),de
				ret
kf_sequence2_craneClose
				ld a,&c3
				ld (_var_sequence2_sprite_disable),a
				ld de,data_sequence2_spr_arms2
				ld (_var_sequence2_arms_sprite),de
				ld a,69 ;+1                              ; Fix for the extra blank scanline
				ld (_var_sequence2_arms_h),a
				ret
kf_sequence2_craneLock
				ld de,data_sequence2_spr_arms3
				ld (_var_sequence2_arms_sprite),de
				ld a,69
				ld (_var_sequence2_arms_h),a            ; Set the Sprite height
				ret
kf_sequence2_craneUp
				ld de,sequence2_craneUp
				ld (_var_sequence2_craneMove),de
				ret
				
sequence3_start

data_mlz_sequence3_depack	EQU cnf_sequence3_depack_address
data_mlz_sequence3_sprite1	EQU 34*88*0 + data_mlz_sequence3_depack
data_mlz_sequence3_sprite2	EQU 34*88*1 + data_mlz_sequence3_depack
data_mlz_sequence3_sprite3	EQU 34*88*2 + data_mlz_sequence3_depack
data_mlz_sequence3_sprite4	EQU 34*88*3 + data_mlz_sequence3_depack

				ld hl,data_crt_sequence3
				call crtc_setup
				
				ld hl,data_mlz_sequence3
				ld de,data_mlz_sequence3_depack
				call depack_apk
				
				ld a,&c0
				ld (var_tool_screenaddress_base),a
				
				ld hl,data_sequence3_pal_in
				ld (_var_palette),hl
				
sequence3_mainloop		call crtc_wait_vsync
				
				djnz $
				
				halt
				halt
				djnz $
				
				; keyframing
				ld ix,data_kf_sequence3
				call keyframer
				
				jr sequence3_mainloop
				
kf_sequence3_step1		ld de,data_mlz_sequence3_sprite1
				jr _kf_sequence3_putSprite
				
kf_sequence3_step2		ld de,data_mlz_sequence3_sprite2
				jr _kf_sequence3_putSprite
				
kf_sequence3_step3		ld de,data_mlz_sequence3_sprite3
				jr _kf_sequence3_putSprite
				
kf_sequence3_step4		ld de,data_mlz_sequence3_sprite4
				
_kf_sequence3_putSprite		push hl
				ex de,hl
				ld de,&E18E
				ld ixh,88
				ld bc,34
				call tool_putSprite
				pop hl
				ret
				
;*** CRTC SETUPS ***************************************************************
					
data_crt_intro
				db 1,32
				db 2,42
				db 6,32
				db 7,34
				db 12,&30
				db 13+128,&00
				
data_crt_sequence3
				db 6,25
				db 7,32
				db 12+128,&30				
				
;*** KEYFRAMER DATA ************************************************************
				
data_kf_sequence1_1		dw len_sequence1_1_pal2
				dw _data_kf_sequence1_1
_data_kf_sequence1_1
				dw kf_pal, data_sequence1_1_pal2
				dw kf_cmd_wait, len_sequence1_1_pal3
				
				dw kf_pal, data_sequence1_1_pal3
				dw kf_cmd_wait, len_sequence1_1_pal4
				
				dw kf_pal, data_sequence1_1_pal4
				dw kf_cmd_wait, len_sequence1_1_pal5
				
				dw kf_pal, data_sequence1_1_pal5
				dw kf_cmd_wait, len_sequence1_1_raiseShip_1
				
				dw kf_sequence1_1_raiseShip
				dw kf_cmd_wait, len_sequence1_1_stopShip_1
				dw kf_sequence1_1_stopShip
				dw kf_cmd_wait, len_sequence1_1_raiseShip_2
				dw kf_sequence1_1_raiseShip
				dw kf_cmd_wait, len_sequence1_1_stopShip_2
				dw kf_sequence1_1_stopShip
				dw kf_cmd_wait, len_sequence1_1_raiseShip_3
				dw kf_sequence1_1_raiseShip
				dw kf_cmd_wait, len_sequence1_1_stopShip_3
				dw kf_sequence1_1_stopShip
				dw kf_cmd_wait, len_sequence1_1_raiseShip_4
				dw kf_sequence1_1_raiseShip
				dw kf_cmd_wait, len_sequence1_1_stopShip_4
				dw kf_sequence1_1_stopShip
				dw kf_cmd_wait, len_sequence1_1_raiseShip_5
				dw kf_sequence1_1_raiseShip
				dw kf_cmd_wait, len_sequence1_1_exit
				
				dw kf_cmd_exit, sequence1_2_start
				
				
data_kf_sequence1_2		dw len_sequence1_2_pal2
				dw _data_kf_sequence1_2
_data_kf_sequence1_2
				dw kl_sequence_1_2_specscreen, &2200
				dw kf_pal,data_sequence1_2_pal2
				dw kf_cmd_wait, len_sequence1_2_pal4a
				dw kf_pal,data_sequence1_2_pal4
				dw kf_cmd_wait, len_sequence1_2_pal3a
				dw kf_pal,data_sequence1_2_pal3
				dw kf_cmd_wait, len_sequence1_2_pal4b
				dw kf_pal,data_sequence1_2_pal4
				dw kf_cmd_wait, len_sequence1_2_pal3b
				dw kf_pal,data_sequence1_2_pal3
				dw kf_cmd_wait, len_sequence1_2_pal4c
				
				dw kf_pal,data_sequence1_2_pal4
				dw kf_cmd_wait, len_sequence1_2_pal3c
				dw kf_pal,data_sequence1_2_pal3
				dw kf_cmd_wait, len_sequence1_2_pal4d
				
				dw kf_pal,data_sequence1_2_pal4
				dw kf_cmd_wait, len_sequence1_2_pal3d
				dw kf_pal,data_sequence1_2_pal3
				dw kf_cmd_wait, len_sequence1_2_pal4e
				dw kf_pal,data_sequence1_2_pal4
				dw kf_cmd_wait, len_sequence1_2_pal5
				
				dw kf_pal,data_sequence1_2_pal5
				
				dw kf_cmd_wait, len_sequence1_2_exit
				
				dw kf_cmd_exit, sequence1_3_start
				
data_kf_sequence1_3		dw len_sequence1_3_begin
				dw _data_kf_sequence1_3
								
darkGreenLeft			EQU &2a
darkGreenRight			EQU &15
brightGreenLeft			EQU &82
brightGreenRight		EQU &41

darkRedLeft			EQU &22
darkRedRight			EQU &11
brightRedLeft			EQU &0a
brightRedRight			EQU &05
				
led1				EQU &c000+&1880+14 	;28,19, g
led2				EQU &c000+&1880+15 	;30,19, r
				
led3				EQU &c000+&1880+56 	;112,19, g
led4				EQU &c000+&1880+57 	;114,19, r
				
led5				EQU &c000+&2140+11	;22,44, g
led6				EQU &c000+&3140+11	;22,46, r
				
led7				EQU &c000+&1180+7	;15,50, g
				
led8				EQU &c000+&01c0+4	;8,56,g
led9				EQU &c000+&11c0+4	;8,58,r
				
led10				EQU &c000+&2200+4	;9,68,g
led11				EQU &c000+&2200+5	;11;68,r
led12				EQU &c000+&2a00+4	;9,69,g
led13				EQU &c000+&2a00+5	;11,69,r
				
led14				EQU &c000+&3ac0+49	;98,95,g
led15				EQU &c000+&0b00+49	;98,97,r
				
led16				EQU &c000+&1b40+13	;27,107,g
				
led17				EQU &c000+&0c40+55	;110,137,g
led18				EQU &c000+&1c40+55	;110,139,r
				
led19				EQU &c000+&3540+5	;10,174,g
led20				EQU &c000+&3540+6	;12,174,r
				
led21				EQU &c000+&3d80+13	;27,183,g
				
led22				EQU &c000+&36c0+12	;24,222,g
				
led23				EQU &c000+&1780+12	;24,242,g
led24				EQU &c000+&2780+12	;24,244,r
				
_data_kf_sequence1_3
				
				dw kf_cmd_wait, len_sequence_1_3_led7a
				
				dw kl_sequence_1_3_poke, led7 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led7b
				dw kl_sequence_1_3_poke, led7 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led7c
				dw kl_sequence_1_3_poke, led7 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led7d
				dw kl_sequence_1_3_poke, led7 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led7e
				dw kl_sequence_1_3_poke, led7 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led1415a
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led1415b
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led1415c
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led1415d
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led1415e
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led1415f
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led1415g
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led1415h
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led1415i
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led1415j
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led1415k
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led1415l
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led71415
				dw kl_sequence_1_3_poke, led7 : db BrightGreenRight
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led141510111213a
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kl_sequence_1_3_poke, led10 : db darkGreenRight
				dw kl_sequence_1_3_poke, led11 : db darkRedRight
				dw kl_sequence_1_3_poke, led12 : db darkGreenRight
				dw kl_sequence_1_3_poke, led13 : db darkRedRight
				dw kf_cmd_wait, len_sequence_1_3_led141510111213b
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kl_sequence_1_3_poke, led10 : db 0
				dw kl_sequence_1_3_poke, led11 : db 0
				dw kl_sequence_1_3_poke, led12 : db 0
				dw kl_sequence_1_3_poke, led13 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led141510111213c
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kl_sequence_1_3_poke, led10 : db darkGreenRight
				dw kl_sequence_1_3_poke, led11 : db darkRedRight
				dw kl_sequence_1_3_poke, led12 : db darkGreenRight
				dw kl_sequence_1_3_poke, led13 : db darkRedRight
				dw kf_cmd_wait, len_sequence_1_3_led141510111213d
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kl_sequence_1_3_poke, led10 : db 0
				dw kl_sequence_1_3_poke, led11 : db 0
				dw kl_sequence_1_3_poke, led12 : db 0
				dw kl_sequence_1_3_poke, led13 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led141510111213e
				dw kl_sequence_1_3_poke, led14 : db 0
				dw kl_sequence_1_3_poke, led15 : db 0
				dw kl_sequence_1_3_poke, led10 : db darkGreenRight
				dw kl_sequence_1_3_poke, led11 : db darkRedRight
				dw kl_sequence_1_3_poke, led12 : db darkGreenRight
				dw kl_sequence_1_3_poke, led13 : db darkRedRight
				dw kf_cmd_wait, len_sequence_1_3_led141510111213f
				dw kl_sequence_1_3_poke, led14 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led15 : db darkRedLeft
				dw kl_sequence_1_3_poke, led10 : db 0
				dw kl_sequence_1_3_poke, led11 : db 0
				dw kl_sequence_1_3_poke, led12 : db 0
				dw kl_sequence_1_3_poke, led13 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led141510111213g
				dw kl_sequence_1_3_poke, led14 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led15 : db brightRedLeft
				dw kl_sequence_1_3_poke, led10 : db darkGreenRight
				dw kl_sequence_1_3_poke, led11 : db darkRedRight
				dw kl_sequence_1_3_poke, led12 : db darkGreenRight
				dw kl_sequence_1_3_poke, led13 : db darkRedRight
				dw kf_cmd_wait, len_sequence_1_3_led10111213
				dw kl_sequence_1_3_poke, led10 : db brightGreenRight
				dw kl_sequence_1_3_poke, led11 : db brightRedRight
				dw kl_sequence_1_3_poke, led12 : db brightGreenRight
				dw kl_sequence_1_3_poke, led13 : db brightRedRight
				
				dw kf_cmd_wait, len_sequence_1_3_led345617182122a
				
				dw kl_sequence_1_3_poke, led3 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led4 : db darkRedLeft
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led18 : db darkRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kl_sequence_1_3_poke, led22 : db darkGreenLeft
				dw kf_cmd_wait, len_sequence_1_3_led345617182122b
				dw kl_sequence_1_3_poke, led3 : db 0
				dw kl_sequence_1_3_poke, led4 : db 0
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led17 : db 0
				dw kl_sequence_1_3_poke, led18 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kl_sequence_1_3_poke, led22 : db brightGreenLeft
				dw kf_cmd_wait, len_sequence_1_3_led3456171821a
				dw kl_sequence_1_3_poke, led3 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led4 : db darkRedLeft
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led18 : db darkRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led3456171821b
				dw kl_sequence_1_3_poke, led3 : db 0
				dw kl_sequence_1_3_poke, led4 : db 0
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led17 : db 0
				dw kl_sequence_1_3_poke, led18 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led3456171821c
				dw kl_sequence_1_3_poke, led3 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led4 : db darkRedLeft
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led18 : db darkRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led3456171821d
				dw kl_sequence_1_3_poke, led3 : db 0
				dw kl_sequence_1_3_poke, led4 : db 0
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led17 : db 0
				dw kl_sequence_1_3_poke, led18 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led3456171821e
				dw kl_sequence_1_3_poke, led3 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led4 : db darkRedLeft
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led18 : db darkRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led3456171821f
				dw kl_sequence_1_3_poke, led3 : db 0
				dw kl_sequence_1_3_poke, led4 : db 0
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led17 : db 0
				dw kl_sequence_1_3_poke, led18 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led3456171821g
				dw kl_sequence_1_3_poke, led3 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led4 : db brightRedLeft
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led18 : db darkRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led56171821a
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led17 : db 0
				dw kl_sequence_1_3_poke, led18 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led56171821b
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led18 : db darkRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led56171821c
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led17 : db 0
				dw kl_sequence_1_3_poke, led18 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led56171821d
				dw kl_sequence_1_3_poke, led5 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led6 : db darkRedLeft
				dw kl_sequence_1_3_poke, led17 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led18 : db brightRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kf_cmd_wait, len_sequence_1_3_led125621
				dw kl_sequence_1_3_poke, led5 : db 0
				dw kl_sequence_1_3_poke, led6 : db 0
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kl_sequence_1_3_poke, led1 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led2 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led568921
				dw kl_sequence_1_3_poke, led5 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led6 : db brightRedLeft
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kl_sequence_1_3_poke, led8 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led9 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led8921a
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kl_sequence_1_3_poke, led8 : db 0
				dw kl_sequence_1_3_poke, led9 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led8921b
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kl_sequence_1_3_poke, led8 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led9 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led128921
				dw kl_sequence_1_3_poke, led1 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led2 : db brightRedLeft
				dw kl_sequence_1_3_poke, led21 : db 0
				dw kl_sequence_1_3_poke, led8 : db 0
				dw kl_sequence_1_3_poke, led9 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led89192021
				dw kl_sequence_1_3_poke, led21 : db darkGreenRight
				dw kl_sequence_1_3_poke, led8 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led9 : db darkRedLeft
				dw kl_sequence_1_3_poke, led19 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led20 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led891920212324
				dw kl_sequence_1_3_poke, led21 : db brightGreenRight
				dw kl_sequence_1_3_poke, led8 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led9 : db brightRedLeft
				dw kl_sequence_1_3_poke, led19 : db 0
				dw kl_sequence_1_3_poke, led20 : db 0
				dw kl_sequence_1_3_poke, led23 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led24 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led19202324a
				dw kl_sequence_1_3_poke, led19 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led20 : db darkRedLeft
				dw kl_sequence_1_3_poke, led23 : db 0
				dw kl_sequence_1_3_poke, led24 : db 0
				dw kf_cmd_wait, len_sequence_1_3_led19202324b
				dw kl_sequence_1_3_poke, led19 : db 0
				dw kl_sequence_1_3_poke, led20 : db 0
				dw kl_sequence_1_3_poke, led23 : db darkGreenLeft
				dw kl_sequence_1_3_poke, led24 : db darkRedLeft
				dw kf_cmd_wait, len_sequence_1_3_led19202324c
				dw kl_sequence_1_3_poke, led19 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led20 : db brightRedLeft
				dw kl_sequence_1_3_poke, led23 : db brightGreenLeft
				dw kl_sequence_1_3_poke, led24 : db brightRedLeft
				
				dw kf_cmd_wait, len_sequence1_3_fadeout
				
				dw kf_pal, data_seq1_3_fadeout
				dw kf_cmd_wait, len_sequence1_3_exit
				
				dw kf_cmd_exit, sequence2_start
				
				
data_kf_sequence2		dw len_sequence2_copyscreen
				dw _data_kf_sequence2
_data_kf_sequence2
				dw kf_sequence2_copyscreen
				
				dw kf_cmd_wait, len_sequence2_craneDown
				
				dw kf_sequence2_craneDown
				dw kf_cmd_wait, len_sequence2_craneClose
				
				dw kf_sequence2_craneClose
				dw kf_cmd_wait, len_sequence2_craneLock
				dw kf_sequence2_craneLock
				dw kf_cmd_wait, len_sequence2_craneUp
				
				dw kf_sequence2_craneUp
				dw kf_cmd_wait, len_sequence2_pal2
				
				dw kf_pal, data_sequence2_pal2
				dw kf_cmd_wait, len_sequence2_exit
				
				dw kf_cmd_exit, sequence3_start
				
				
data_kf_sequence3		dw len_sequence3_step1a
				dw _data_kf_sequence3
_data_kf_sequence3
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2a
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3a
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4a
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1b
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1c
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2b
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3b
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4b
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1d
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1e
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2c
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3c
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4c
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1f
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1g
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2d
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3d
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4d
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1h
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1i
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2e
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3e
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4e
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1j
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1k
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2f
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3f
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4f
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1l
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1m
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2g
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3g
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4g
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1n
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1o
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2h
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3h
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4h
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1p
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1q
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2i
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3i
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4i
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1r
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1s
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2j
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3j
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4j
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1t
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_step1u
				
				dw kf_sequence3_step1
				dw kf_cmd_wait, len_sequence3_step2k
				dw kf_sequence3_step2
				dw kf_cmd_wait, len_sequence3_step3k
				dw kf_sequence3_step3
				dw kf_cmd_wait, len_sequence3_step4k
				dw kf_sequence3_step4
				dw kf_cmd_wait, len_sequence3_step1v
				dw kf_sequence3_step1
				
				dw kf_cmd_wait, len_sequence3_pal_out
				
				dw kf_pal, data_sequence3_pal_out
				dw kf_cmd_wait, len_sequence3_exit
				
				dw kf_cmd_exit, sequence4_start
				
				
				; Do not change the sprites order or it will
				; lower the compression ratio!				
data_sequence2_spr_cable	INCBIN "data/sequence.2.spine.6x61.spr"
data_sequence2_spr_spine	EQU 6*3 + data_sequence2_spr_cable
data_sequence2_spr_arms1	INCBIN "data/sequence.2.arms1.24x65.spr"
data_sequence2_spr_ship		INCBIN "data/sequence.2.ship.16x37.spr"
data_sequence2_spr_arms2	INCBIN "data/sequence.2.arms2.24x69.spr"
;                            db 0,0,&c0,&84,&0c,0,0,0,0,0,0,0,0  ; Bytes for the extra scan 
;                            db 0,0,0,0,0,0,0,0,&0c,&48,&c0  
data_sequence2_spr_arms3	INCBIN "data/sequence.2.arms3.24x69.spr"
				db 0
				
				
data_sequence1_1_pal1		db &8c,INK0,INK1, INK0,INK0,INK0,INK1, INK0, INK9, INK1, INK0,INK1, INK0,INK0, INK0,INK0, 17
data_sequence1_1_pal2		db &8c,INK1,INK5, INK0,INK0,INK0,INK3, INK0, INK12,INK4, INK0,INK5, INK0,INK0, INK0,INK0, 17
data_sequence1_1_pal3		db &8c,INK3,INK13,INK0,INK1,INK0,INK4, INK1, INK13,INK9, INK1,INK13,INK0,INK1, INK0,INK0, 17
data_sequence1_1_pal4		db &8c,INK4,INK20,INK1,INK3,INK3,INK9, INK4, INK18,INK12,INK2,INK14,INK0,INK2, INK1,INK0, 17
data_sequence1_1_pal5		db &8c,INK9,INK26,INK3,INK4,INK6,INK18,INK10,INK22,INK13,INK5,INK20,INK1,INK11,INK2,INK0, 17
				
data_sequence1_2_pal1		db INK0,INK0,INK0, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK1,INK0,INK0,INK0, 0
				db INK0,INK0,INK1, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK2,INK0,INK0,INK0, 0
				db INK0,INK1,INK2, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK5,INK0,INK0,INK0, 0
				db INK0,INK2,INK5, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK11,INK0,INK0,INK0, 0
				db INK1,INK5,INK11, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK13,INK0,INK0,INK0, 0
				db INK2,INK11,INK14, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK20,INK0,INK0,INK0, 0
				db INK5,INK14,INK20, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0, 0
				db INK5,INK14,INK20, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0, 0
				db INK1,INK5,INK14, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK20,INK0,INK0,INK0, 0
				db INK0,INK1,INK2, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK13,INK0,INK0,INK0, 0
				db INK0,INK0,INK1, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK13,INK0,INK0,INK0, 17*2
				
data_sequence1_2_pal2		db INK0,INK1,INK2, INK0,INK0,INK0,INK0,INK0,INK1, INK1,INK0,INK1,INK13,INK0,INK0,INK0, 0
				db INK0,INK1,INK2, INK1,INK0,INK0,INK0,INK1,INK5, INK5,INK1,INK2,INK13,INK0,INK0,INK0, 0
				db INK0,INK1,INK2, INK2,INK3,INK0,INK1,INK2,INK11,INK11,INK4,INK13,INK13,INK0,INK0,INK0, 0
				db INK0,INK1,INK2, INK4,INK4,INK0,INK3,INK5,INK14,INK14,INK5,INK20,INK13,INK1,INK0,INK0, 0
data_sequence1_2_pal3		db INK0,INK1,INK2, INK5,INK6,INK3,INK4,INK11,INK23,INK20,INK10,INK26,INK13,INK2,INK1,INK0, 17
				
data_sequence1_2_pal4		db INK1,INK2,INK2, INK2,INK3,INK0,INK1,INK5,INK14,INK14,INK5,INK20,INK10,INK1,INK0,INK0, 0
				db INK0,INK1,INK2, INK5,INK6,INK3,INK4,INK11,INK23,INK20,INK10,INK26,INK13,INK2,INK1,INK0, 0
				db INK0,INK0,INK1, INK5,INK6,INK3,INK4,INK11,INK23,INK20,INK10,INK26,INK13,INK2,INK1,INK0, 2*17
				
				
data_sequence1_2_pal5		db INK0,INK1,INK2, INK5,INK6,INK3,INK4,INK11,INK23,INK20,INK10,INK26,INK13,INK2,INK1,INK0, 0
				db INK0,INK0,INK1, INK4,INK4,INK0,INK3,INK5,INK14,INK14,INK5,INK20,INK11,INK1,INK0,INK0, 0
				db INK0,INK0,INK0, INK2,INK3,INK0,INK0,INK2,INK11,INK11,INK4,INK11,INK5,INK0,INK0,INK0, 0
				db INK0,INK0,INK0, INK1,INK0,INK0,INK0,INK1,INK5,INK5,INK1,INK5,INK4,INK0,INK0,INK0, 0
				db INK0,INK0,INK0, INK0,INK0,INK0,INK0,INK0,INK2,INK2,INK0,INK2,INK1,INK0,INK0,INK0, 0
				db INK0,INK0,INK0, INK0,INK0,INK0,INK0,INK0,INK1,INK1,INK0,INK1,INK0,INK0,INK0,INK0, 0
				db INK0,INK0,INK0, INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0,INK0, 17
				
data_seq1_3_fadeout		db &8c,INK9,INK26,INK3,INK4,INK6,INK18,INK10,INK22,INK13,INK5,INK20,INK1,INK11,INK2,INK0, 0
				db &8c,INK9,INK20,INK3,INK1,INK6,INK18,INK5,INK14,INK11,INK2,INK14,INK1,INK5,INK1,INK0, 0
				db &8c,INK9,INK14,INK3,INK1,INK3,INK18,INK1,INK5,INK5,INK1,INK5,INK1,INK1,INK1,INK0, 0
				db &8c,INK9,INK14,INK1,INK1,INK1,INK18,INK1,INK5,INK5,INK1,INK5,INK1,INK1,INK1,INK0, 17
				
data_sequence2_pal1
				db INK3,INK9,INK1,INK1,INK2,INK1,INK18,INK1,INK2,INK2,INK2,INK5,INK2,INK1,INK1,INK0,0
				db INK4,INK9,INK3,INK3,INK2,INK3,INK18,INK3,INK6,INK4,INK5,INK5,INK2,INK1,INK1,INK0,0
				db INK9,INK9,INK3,INK3,INK2,INK3,INK18,INK4,INK6,INK6,INK11,INK5,INK2,INK1,INK1,INK0,0
				db INK12,INK9,INK3,INK3,INK5,INK4,INK18,INK4,INK6,INK6,INK11,INK11,INK2,INK1,INK1,INK0,0
				db INK12,INK9,INK3,INK3,INK5,INK4,INK18,INK4,INK6,INK15,INK14,INK11,INK2,INK1,INK1,INK0,0
				db INK12,INK9,INK3,INK3,INK14,INK6,INK18,INK5,INK15,INK15,INK20,INK14,INK5,INK1,INK1,INK0,0
				db INK12,INK9,INK4,INK3,INK23,INK6,INK18,INK10,INK15,INK24,INK26,INK20,INK11,INK2,INK1,INK0, 17
data_sequence2_pal2
				db INK12,INK9,INK3,INK3,INK14,INK6,INK18,INK5,INK15,INK15,INK20,INK14,INK5,INK1,INK1,INK0,0
				db INK12,INK9,INK3,INK1,INK5 ,INK4,INK12,INK2,INK6 ,INK6 ,INK14,INK11,INK2,INK1,INK1,INK0,0
				db INK12,INK4,INK1,INK0,INK5 ,INK3,INK9 ,INK4,INK6 ,INK6 ,INK11,INK11,INK2,INK1,INK0,INK0,0
				db INK9 ,INK3,INK0,INK0,INK2 ,INK1,INK4 ,INK1,INK3 ,INK3 ,INK5 ,INK5,INK1 ,INK0,INK0,INK0,0
				db INK4 ,INK0,INK0,INK0,INK1 ,INK0,INK1 ,INK1,INK1 ,INK1 ,INK2 ,INK2,INK1 ,INK0,INK0,INK0,0
				db INK3 ,INK0,INK0,INK0,INK0 ,INK0,INK0 ,INK0,INK0 ,INK0 ,INK1 ,INK1,INK0 ,INK0,INK0,INK0,0
				db INK0 ,INK0,INK0,INK0,INK0 ,INK0,INK0 ,INK0,INK0 ,INK0 ,INK0 ,INK0,INK0 ,INK0,INK0,INK0,17
				
data_sequence3_pal_in
				db INK0,INK0,INK0,INK0,INK1 ,INK1,INK1,INK1 ,INK1 ,INK1 ,INK1 ,INK1 ,INK1,INK1,INK1 ,INK0, 0
				db INK0,INK0,INK0,INK0,INK2 ,INK3,INK3,INK3 ,INK2 ,INK2 ,INK2 ,INK2 ,INK1,INK1,INK5 ,INK0, 0
				db INK0,INK0,INK0,INK0,INK5 ,INK3,INK3,INK6 ,INK5 ,INK5 ,INK5 ,INK5 ,INK1,INK2,INK14,INK0, 0
				db INK0,INK0,INK0,INK0,INK10,INK3,INK6,INK15,INK14,INK10,INK14,INK11,INK1,INK2,INK23,INK0, 0
				db INK0,INK0,INK0,INK0,INK13,INK3,INK6,INK15,INK23,INK10,INK20,INK11,INK1,INK2,INK26,INK0, 17+17
data_sequence3_pal_out
				db INK0,INK0,INK0,INK0,INK10,INK3,INK6,INK15,INK14,INK10,INK13,INK11,INK1,INK2,INK20,INK0, 0
				db INK0,INK0,INK0,INK0,INK5 ,INK3,INK3,INK6 ,INK5 ,INK5 ,INK5 ,INK5 ,INK1,INK2,INK14,INK0, 0
				db INK0,INK0,INK0,INK0,INK2 ,INK3,INK3,INK3 ,INK2 ,INK2 ,INK2 ,INK2 ,INK1,INK1,INK5 ,INK0, 0
				db INK0,INK0,INK0,INK0,INK1 ,INK1,INK1,INK1 ,INK1 ,INK1 ,INK1 ,INK1 ,INK1,INK1,INK1 ,INK0, 0
				db INK0,INK0,INK0,INK0,INK0 ,INK0,INK0,INK0 ,INK0 ,INK0 ,INK0 ,INK0 ,INK0,INK0,INK0 ,INK0, 17


;;*** Easter Egg pre-intro *****************************************************

				LIST				
;; Easter Egg Pre-intro
				NOLIST
				
				RUN _exec, _snapshot
_exec
				di
				; Initialize hardware
				ld sp,intro_stack
				im 1
				ld a,&C3
				ld (&38),a
				ld hl,isr300Hz
				ld (&39),hl
_snapshot
				; Init music
				ld de,data_music
				call PLY_Init
				
				; Init CRTC
				call crtc_wait_vsync
				
				; Black out
				call tool_blackout
				
				; Depack pre-intro graphics
				ld hl,data_mlz_preintro
				ld de,&C000
				call depack_apk
				
;;*** Display interlaced mode 2 picture ****************************************
screen_jack_init
				; Setup CRTC configuration
				ld hl,data_crt_jack
				call crtc_setup
				; 50Hz display loop
screen_jack_loop		call crtc_wait_vsync
			;*** Start of Timing critical code ***
				; Synchronize code
				di
				ld b,3
				djnz $
				; Select CRTC.R2
				ld bc,&BC02
				out (c),c
				inc b
				; Screen offset variables
				ld hl,&3000
				ld de,17*18
				; HSync Flip-flop (R2 = 3 or 255)
_var_jack_r2			EQU $+1
				ld a,3
				xor 252
				ld (_var_jack_r2),a
				; Additionnal HSync every two frames to trick the GA
				out (c),a
				; Adjust screen offset (flipping)
				inc a
				jr z,$+3
				  add hl,de
				ld de,&0C0D
				dec b
				out (c),d
				inc b
				out (c),h
				dec b
				out (c),e
				inc b
				out (c),l
				; Set the HSync back to it's normal position
				ld a,35
				dec b
				out (c),c
				inc b
				out (c),a
				ld bc,&7F9E
				out (c),c
				ei
			; *** End of Timing critical code ***
				
				; Set the colors
				ld c,1
				out (c),c
_var_jack_inks			EQU $+1
				ld de,&5454
				out (c),d
				
				halt
				halt
				halt
				halt
				ld b,16*6
				djnz $
				ld b,&7f
				out (c),e
				; Execute keyframer
				ld ix,data_kf_jack
				call keyframer
				; Infinite loop
				jr screen_jack_loop
				
data_crt_jack
				db 0,63
				db 1,18
				db 2,35
				;db 3,&88 is fix for TV ?
				db 3,#8E
				db 4,38
				db 5,0
				db 6,17
				db 7,26
				db 8,0
				db 9+128,7
				
				; Keyframer object
data_kf_jack			dw len_jack_setInks_a
				dw _data_kf_jack
_data_kf_jack			; Keyframer data
				dw kf_jack_setInks,&4454,	kf_cmd_wait, len_jack_setInks_b
				dw kf_jack_setInks,&5844,	kf_cmd_wait, len_jack_setInks_c
				dw kf_jack_setInks,&5658,	kf_cmd_wait, len_jack_setInks_d
				dw kf_jack_setInks,&4056,	kf_cmd_wait, len_jack_setInks_e
				dw kf_jack_setInks,&5340,	kf_cmd_wait, len_jack_setInks_f
				dw kf_jack_setInks,&4b40
				
				dw kf_cmd_wait, len_jack_setInks_g
				
				dw kf_jack_setInks,&5340,	kf_cmd_wait, len_jack_setInks_h
				dw kf_jack_setInks,&4056,	kf_cmd_wait, len_jack_setInks_i
				dw kf_jack_setInks,&5658,	kf_cmd_wait, len_jack_setInks_j
				dw kf_jack_setInks,&5844,	kf_cmd_wait, len_jack_setInks_k
				dw kf_jack_setInks,&4454,	kf_cmd_wait, len_jack_setInks_l
				dw kf_jack_setInks,&5454,	kf_cmd_wait, len_jack_setInks_m
				
				dw kf_cmd_wait, len_jack_exit
				
				dw kf_cmd_exit, easteregg_logo_start
				
				; Stereo-jack custom keyframer command
kf_jack_setInks			ld de,_var_jack_inks
				ldi
				ldi
				ret
				
;;*** Display the Easter Egg logo **********************************************
easteregg_logo_start
				; Setup CRTC configuration
				di
				ld hl,data_crt_easteregg
				call crtc_setup
				ei
				; 50Hz display loop
screen_easteregg_loop		call crtc_wait_vsync
				
				ld b,16*8
				djnz $
				
				; Slogan height (initial transition)
				ld a,39 -5-2 -1
				call crtc_set_height
				
				ld bc,&BC06
				out (c),c
				inc b
				out (c),c
				
				; Setup color
_var_easteregg_palette		EQU $+1
				ld hl,_data_kf_easteregg+2
				ld a,(hl)
				inc hl
				ld bc,&7F8D
				out (c),c
				ld c,&10
				out (c),c
				out (c),a	; border
				ld c,&01
				dw &71ED
				out (c),a	; ink0
				
				out (c),c
				inc b
				outi		; ink1
				inc c
				out (c),c
				inc b
				outi		; ink2
				inc c
				out (c),c
				inc b
				outi		; ink3
				
				; "Easter" offset
_var_easteregg_offset1		EQU $+1
				ld hl,0
				call tool_setCrtcR1213
				
				halt
				halt
				halt
				
				; "Easter" screen height
				ld a,5-1
				call crtc_set_height
				; preload "Egg" offset
_var_easteregg_offset2		EQU $+1
				ld hl,0
				call tool_setCrtcR1213
				
				ld b,16*5
				djnz $
				djnz $
				
				; "Egg" screen height
				ld a,2-1
				call crtc_set_height
				; preload Slogan offset
_var_easteregg_offset3		EQU $+1
				ld hl,0
				call tool_setCrtcR1213
				
				ld b,16*4
				djnz $
				
				; Slogan screen height
				ld a,39 -5-2 -1
				call crtc_set_height
				; Slogan visible height
				ld bc,&BC06
				out (c),c
				ld bc,&BD01
				out (c),c
				
				ld ix,data_kf_easteregg
				call keyframer
				
				jr screen_easteregg_loop
				
crtc_set_height
				ld bc,&BC04
				out (c),c
				inc b
				out (c),a
				ret
				
data_crt_easteregg
				db 1,20
				db 2,37
				db 7+128,23-7
				
data_kf_easteregg		dw len_easteregg_inks_offset_a
				dw _data_kf_easteregg
_data_kf_easteregg
				dw kf_easteregg_inks:db &44,&54,&54,&54
				dw kf_easteregg_offset,&328A,&32EE,&328A
				dw kf_cmd_wait, len_easteregg_inks_offset_b
				
				dw kf_easteregg_inks:db &58,&54,&54,&54
				dw kf_easteregg_offset,&3289,&32EF,&328A
				dw kf_cmd_wait, len_easteregg_inks_offset_c
				
				dw kf_easteregg_inks:db &56,&54,&54,&54
				dw kf_easteregg_offset,&3288,&32F0,&328A
				dw kf_cmd_wait, len_easteregg_inks_offset_d
				
				dw kf_easteregg_inks:db &40,&4B,&4B,&54
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_inks_a
				
				
				dw kf_easteregg_inks:db &40,&4B,&5B,&54
				dw kf_cmd_wait, len_easteregg_inks_b
				
				dw kf_easteregg_inks:db &40,&4B,&53,&54
				dw kf_cmd_wait, len_easteregg_inks_c
				
				dw kf_easteregg_inks:db &40,&4B,&5F,&54
				dw kf_cmd_wait, len_easteregg_inks_d
				
				dw kf_easteregg_inks:db &40,&4B,&57,&54
				dw kf_cmd_wait, len_easteregg_offset_a
				
				
				dw kf_easteregg_offset,&3316,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_b
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_c
				dw kf_easteregg_offset,&3316,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_d
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_e
				dw kf_easteregg_offset,&3316,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_f
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_g
				dw kf_easteregg_offset,&3316,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_h
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_i
				dw kf_easteregg_offset,&3316,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_j
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_k
				dw kf_easteregg_offset,&3316,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_l
				dw kf_easteregg_offset,&3287,&32F1,&328A
				dw kf_cmd_wait, len_easteregg_offset_m
				dw kf_easteregg_offset,&3316,&32F1,&337A
				dw kf_cmd_wait, len_easteregg_offset_n
				dw kf_easteregg_offset,&3316,&32F1,&337A + 20
				dw kf_cmd_wait, len_easteregg_offset_o
				dw kf_easteregg_offset,&3316,&32F1,&337A + 40
				dw kf_cmd_wait, len_easteregg_offset_p
				dw kf_easteregg_offset,&3316,&32F1,&337A + 60
				dw kf_cmd_wait, len_easteregg_offset_q
				dw kf_easteregg_offset,&3316,&32F1,&337A + 80
				dw kf_cmd_wait, len_easteregg_offset_r
				dw kf_easteregg_offset,&3316,&32F1,&337A + 100
				
				dw kf_cmd_wait, len_easteregg_inks_e
				
				dw kf_easteregg_inks:db &40,&4B,&5F,&54
				dw kf_cmd_wait, len_easteregg_inks_f
				dw kf_easteregg_inks:db &40,&4B,&53,&54
				dw kf_cmd_wait, len_easteregg_inks_g
				dw kf_easteregg_inks:db &40,&4B,&5B,&54
				dw kf_cmd_wait, len_easteregg_inks_h
				dw kf_easteregg_inks:db &40,&4B,&4B,&54
				dw kf_cmd_wait, len_easteregg_inks_i
				dw kf_easteregg_inks:db &56,&54,&54,&54
				dw kf_cmd_wait, len_easteregg_inks_j
				dw kf_easteregg_inks:db &58,&54,&54,&54
				dw kf_cmd_wait, len_easteregg_inks_k
				dw kf_easteregg_inks:db &44,&54,&54,&54
				dw kf_cmd_wait, len_easteregg_inks_l
				dw kf_easteregg_inks:db &54,&54,&54,&54
				
				
				dw kf_cmd_wait, len_easteregg_exit
				dw kf_cmd_exit, sequence1_1_start
				
kf_easteregg_offset
				ld de,_var_easteregg_offset1
				ldi
				ldi
				ld de,_var_easteregg_offset2
				ldi
				ldi
				ld de,_var_easteregg_offset3
				ldi
				ldi
				ret
				
kf_easteregg_inks
				ld (_var_easteregg_palette),hl
				inc hl
				inc hl
				inc hl
				inc hl
				ret		
				
				LIST
;; MLZ Data begins
				NOLIST
				IF cnf_write_to_files
					WRITE "bin/data.c0.bin"
				ENDIF
data_mlz_sequence1_screen	INCBIN "data/sequence.1.screen.apk"
data_mlz_sequence1_sprite	INCBIN "data/sequence.1.spr28x76.apk"
data_mlz_sequence2_screen	INCBIN "data/sequence.2.screen.apk"
data_mlz_sequence3		INCBIN "data/sequence.3.data.apk"
free_ram
data_crt_sequence4
               db 6,32
               db 7,34
               db 12+128,&20
				LIST
;; MLZ Pre-intro Data begins
				NOLIST
				LIMIT &BFFF
data_mlz_preintro		INCBIN "data/preintro.apk"

				LIST
;; MLZ Data ends
				NOLIST
				
				ORG &4000
				WRITE DIRECT -1,-1,&c4
				IF cnf_write_to_files
					WRITE "bin/data.c4.bin"
				ENDIF
data_mlz_titlescreen      INCBIN "data/titlescreen.apk"
;data_mlz_titlescreena		INCBIN "data/titlescreena.apk"
;data_mlz_titlescreenb        INCBIN "data/titlescreenb.apk"
data_mlz_sequence4_screen01	INCBIN "data/sequence.4.screen01.apk"
data_mlz_sequence4_screen2	INCBIN "data/sequence.4.screen2b.apk"

;				ORG &4000
;				WRITE DIRECT -1,-1,&c5
;				IF cnf_write_to_files
;					WRITE "bin/data.c5.bin"
;				ENDIF
;data_mlz_eggzausted		INCBIN "data/eggzausted.apk"
