;********************************
;*** LEVEL 0 - R-TYPE 2 STYLE ***
;********************************

ORG level_start

IF output_files
write "bin/level0.lvl"
ENDIF

START	DEFB SYNC1
SYNCHRO	DEFW 0000

START1	DEFB 0 ;tst_pos
START2	DEFB 0
START3	DEFB 0

SYNCHRO1	DEFW SYNC1 ;tst_sync ;SYNC1
SYNCHRO2	DEFW 0
SYNCHRO3	DEFW 0

TSPRADD		DEFW 0
TADD		DEFW 0

SEQTABLE	DEFW SQTABLE
SPEVENT1	DEFW SPEV1
SPEVENT2	DEFW SPEV2
;DEFB 0,0,0

;palette stuff 16 colors+border
.lvl_pal
	db 0,26,11,6,3,20,10,2,1,25,16,18,9,15,23,24
	db 0
	db 0,20,2,3,0,10,1,1,0,12,3,9,0,3,10,15
	db 0
	db 0,11,1,3,0,1,0,1,0,3,0,9,0,3,1,6
	db 0
	db 0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3
	db 0
	
.lvl_floating_color
	db 15
.lvl_music
	db #FF	;no music 
.lvl_skip
	dw 0	;music to skip on music restart
.lvl_init
	dw	l0_init	;called after loading
.lvl_reinit
	dw	l0_reinit	;called each time player dies
	
.l0_init
	ret
.l0_reinit

	;setup music
	ld A,#FE
	ld HL,lvl_zik
	call MUSIC_Play 

	;be sure to have full volume
	xor A
	ld (LVL_NextMusik),A
	call MUSIC_SetVolume
	
	;boss music
	ld HL,lvl_zik_boss
	ld (music_alt),HL
	
	;boss phase
	xor A
	ld (boss_phase),A
	ld (boss_wait),A
	ld (action_16_rotate),A
	;inc A
	;inc A
	;inc A
	ld (boss_current_attack),A
	
	ld A,20
	ld (action_15_turret_flash),A
	ld (action_12_barrier_flash),A
	
	call l0_genFences	;get fence sprites
	call l0_genBullets	;get color bullets sprites
	
	;ld A,141
	;call action_13_computeSprite
	
	ret
;compute bullets type
.l0_genBullets
	ld DE,l0_bulletsTable
	ld B,5
	ld A,141
.l0_genBullets_loop
	push BC
	push AF
	push DE
	
	call TSPGADD
	inc HL	;global flags
	inc HL	;tile flags
	pop DE
	ldi
	ldi
	pop AF
	inc A
	pop BC
	djnz l0_genBullets_loop	

	ret
.l0_bulletsTable
	ds 10,0

;gen fence sprites
.l0_genFences
	ld DE,l0_fence_table
	ld B,4
	ld A,130
.l0_genFences_loop
	push BC
	push AF
	push DE
	
	call TSPGADD
	
	pop DE
	inc HL	;global flags
	inc HL	;tile 1 flags
	
	ldi		;tile 1 address
	ldi
	
	inc HL	;tile 2 flags
	
	ldi		;tile 2 address
	ldi
	
	pop AF
	inc A
	pop BC
	djnz l0_genFences_loop

	ret


.l0_fence_table
	ds 16,0	;4*2*2
;enemies	
.SQTABLE
	dw en01_redship
	dw en02_jumper_phase1
	dw en03_jumper_phase2
	dw en04_missle
	dw en05_genA
	dw en06_shipA
	dw en07_genB
	dw en08_shipB
	dw en09_turret_low
	dw en10_turret_hi
	dw en11_dummy
	dw en12_tank
	dw en13_podder_blue
	dw en14_podder_blue2
	dw en15_podder_mssle
	dw en16_boss
	dw en17_barrier
	dw en_18_ball_red1
	dw en_19_ball_red2
	dw en_20_ball_red3
	dw en_21_ball_red4
	dw en_22_ball_redbig
	dw en_23_turretup
	dw en_24_turretdn
	dw en_25_hyper_bullet
	dw en_26	;0
	dw en_27	;1
	dw en_28	;2
	dw en_29	;3
	dw en_30	;4
	dw en_31	;5
	dw en_32	;6
	dw en_33	;7
	dw en_34	;8
	dw en_35	;9
	dw en_36	;10
	dw en_37	;11
	dw en_38	;12
	dw en_39	;13
	dw en_40	;14
	dw en_41	;15
	dw en_42_ball_tur 
	dw en_43_ball_tur
	dw en_44_podder

;action 1
.SPEV1
	dw actionA01_null			;0
	dw actionA02_missleLup		;1
	dw actionA03				;2
	dw actionA04_gen			;3
	dw actionA05_gen			;4
	dw actionA06_turret			;5
	dw action07_tank			;6
	dw action_08_podder			;7
	dw action_09_bullet			;8 free
	dw actionA01_null  			;9 free
	dw action_11_boss			;10
	dw action_12_barrier		;11
	dw action_13_ball			;12
	dw action_14_bigball		;13
	dw action_15_turret			;14
	dw action_16_hyperbullet	;15

;action 2
.SPEV2
	dw actionB01_null
	dw actionB02	;reserved for balls
	dw actionB03
	dw actionB04
	dw actionB05
	dw actionB06
	dw actionB07
	dw actionB08
	dw actionB09
	dw actionB0A
	
;	LEVEL	A - ATTACK WAVES
;
;	1ST BYTE = TILENO
;	2ND BYTE
;		BITS 0-2 = TILESCROLL
;		BITS 3-4 = TILEPOS
;		BITS 5-7 =
;	3RD BYTE = SEQUENCE NUMBER
;	4TH BYTE = INITIAL X POSITION
;	5TH BYTE = INITIAL Y POSITION
;	(TILESCROLL = FRAME OR BITPOS)
;
.SYNC1
;enemy types to spawn in generators
	LVL_SetSpec1	0,1,6
	LVL_SetSpec2	0,1,8

;bullets	
	DEFB 0,1,99,4,4
	
	;db 0,1,9,33,15
	;dummy for slot 0,1,2
	FORCE_Slot	1,0,1,11,-5,0
	FORCE_Slot	3,0,1,11,-5,0
	FORCE_Slot	4,0,1,11,-5,0
	
	

;generator 1	
	;db 0,1,5,27,2
	FORCE_Slot 2,0,1,5,27,2
	
	db 0,1,14,33,5
	
;turrets	
	db 1,1,10,33,6
	db 2,1,10,33,6
	
	db 2,8,13,33,10
	
;generator 2	
	;db 3,17,7,33,2
	FORCE_Slot 1,3,17,7,33,2



	
;red ships wave 1
	db 6,0,1,32,9
	db 6,4,1,32,14
	db 6,8,1,32,10	

	db 6,12,12,33,14	
	db 6,24,12,33,14	
	db 7,4,12,33,14	
	db 7,16,12,33,14	
	db 7,28,12,33,14	

	
;turrets	
	db 9,1,9,33,12
	db 10,1,9,33,12	
	
	;db 1,0,6,16,6
	;db 1,4,6,16,6
	;db 1,8,6,16,6

	;db 1,0,2,20,20
	;db 1,0,4,32,10



	db 11,1,15,33,5
	

;jumper 1	
	FORCE_Slot 0,12,16,2,26,20
	
;turrets	
	FORCE_Slot 20,13,1,9,33,12
	FORCE_Slot 21,14,1,9,33,12	

;jumper 2	
	FORCE_Slot 1,15,16,2,14,20
	


;generator 2
	LVL_SetSpec1	17,0,6
	FORCE_Slot 3,17,1,5,33,2

	db 21,0,12,33,14
	db 21,12,12,33,14
	db 21,24,12,33,14

tst_pos		EQU 21
tst_sync	EQU $
	
;red ships wave 2
	db 22,4,12,33,14
	db 22,16,12,33,14

	db 23,0,1,32,5






	
	;db 22,28,12,33,14
	;db 23,8,12,33,14


	
;last turrets serie
	db 23,1,9,33,14
	db 23,1,10,33,4
	
	db 23,2,1,32,13
	;FORCE_Slot 17,
	db 23,3,1,32,9
	
	
	
	db 23,9,1,32,4
	db 23,10,1,32,14
	db 23,11,1,32,9
	
	
	
	db 23,18,1,32,6
	db 23,20,1,32,13
	db 23,22,1,32,10
	
	db 24,1,9,33,14
	db 24,1,10,33,4
	
	;db 25,1,9,33,14
	;db 25,1,10,33,4
	
	;db 26,1,9,33,14
	;db 26,1,10,33,4
	
	CHECK_POINT	27,0
	
	db	27,1,44,33,9	;red bonus
	
	

	;boss music
	LVL_Music	32,0,#FE
	
	
	
	SCROLL_Stop 34,1	
	
	;color change
	LVL_FLcolor 34,1,8
	;boss itself
	FORCE_Slot 1,34,1,16,33,9
	;up barrier
	FORCE_Slot 2,34,1,17,11,0
	;down barrier
	FORCE_Slot 3,34,1,17,11,19
	;up turret
	FORCE_Slot 4,34,1,23,28,1
	;db turret
	FORCE_Slot 5,34,1,24,28,17
	
	;db 38,1,25,18,9
	
	;db 38,1,22,15,10
	;db 38,1,18,15,5
	;db 38,1,18,15,15
	
	db 255,255,255,255,255
	
;
;	1ST BYTE
 ;		BITS 0-3 = SPECIAL EVENT 1
;		BITS 0-4 = SPECIAL EVENT 2
;	2ND BYTE = HIT POINTS
;	3RD BYTE
;		BITS 0-3 = POINT VALUE
;		BITS 4-7 = EXPLOSION TYPE
;	BYTES ARE NOW PAIRED TO MAKE UP
;	ADDRESS OF SPRITE PATTERNS
;	WORD 0 = END OF SEQUENCE
;

;		BIT 2 = UP
;		BIT 3 = DOWN
;		BIT 4 = LEFT
;		BIT 5 = RIGHT

;last podder
.en_44_podder
	db 7+#20,1,#20+2
	repeat 4:dw en14_podder1_sp00_step6:rend
	dw 0

;turrets bullets
.en_42_ball_tur
	db 12+#80,1,0
	repeat 4:dw en42_spr:rend:dw 0
.en_43_ball_tur
	db 12+#60,1,0
	repeat 4:dw en42_spr:rend:dw 0	
.en42_spr
	repeat 15:db 4,0:rend
	db 4,128
	

;up
.en_26
	db 8,63,0
	dw en_26_sp
	dw #FFFF
.en_26_sp
	db 152,4+128
;up/half-right
.en_27
	db 8,63,0
	dw en_27_sp
	dw #FFFF
.en_27_sp
	db 153,4+32,153,4+128
;up/right
.en_28
	db 8,63,0
	dw en_28_sp
	dw #FFFF
.en_28_sp
	db 154,4+32+128
;half-up/right
.en_29
	db 8,63,0
	dw en_29_sp
	dw #FFFF
.en_29_sp
	db 155,4+32,155,32+128
;right
.en_30
	db 8,63,0
	dw en_30_sp
	dw #FFFF
.en_30_sp
	db 156,32+128
;half-down/right
.en_31
	db 8,63,0
	dw en_31_sp
	dw #FFFF
.en_31_sp
	db 157,32+8,157,32+128
;right/down
.en_32
	db 8,63,0
	dw en_32_sp
	dw #FFFF
.en_32_sp
	db 158,32+8+128
;half-right/down
.en_33
	db 8,63,0
	dw en_33_sp
	dw #FFFF
.en_33_sp
	db 159,32+8,159,8+128
;down
.en_34
	db 8,63,0
	dw en_34_sp
	dw #FFFF
.en_34_sp
	db 160,8+128
;down/half-left
.en_35
	db 8,63,0
	dw en_35_sp,#FFFF
.en_35_sp
	db 161,8+16,161,8+128
;down/left
.en_36
	db 8,63,0
	dw en_36_sp,#FFFF
.en_36_sp
	db 162,8+16+128
;half-down/left
.en_37
	db 8,63,0
	dw en_37_sp,#FFFF
.en_37_sp
	db 163,8+16,163,16+128
;left
.en_38
	db 8,63,0
	dw en_38_sp,#FFFF
.en_38_sp
	db 164,16+128
;left/half-up
.en_39
	db 8,63,0
	dw en_39_sp,#FFFF
.en_39_sp
	db 165,16+4,165,16+128
;left/up
.en_40
	db 8,63,0
	dw en_40_sp,#FFFF
.en_40_sp
	db 166,16+4+128
;half-left/up
.en_41
	db 8,63,0
	dw en_41_sp,#FFFF
.en_41_sp
	db 167,16+4,167,4+128
	
	

	
.en_25_hyper_bullet
	db 15,40,#20+5
	dw en_25_hyper_bullet_spr
	dw #FFFF
.en_25_hyper_bullet_spr
	db 142,64,141,64,143,64,141,128
	
.en_23_turretup
	db 14,32,#20+5
	dw en_turret_dn
	dw en_turret_dn
	dw en_turret_fire
	dw en_turret_up
	dw en_turret_fire
	dw en_turret_up
	dw en_turret_fire
	dw en_turret_dn
	dw en_turret_up
	dw en_turret_fire
	dw #FFFF
.en_24_turretdn
	db 14+#10,32,#20+5
	dw en_turret_up
	dw en_turret_fire
	dw en_turret_dn
	dw en_turret_fire
	dw en_turret_up
	dw en_turret_up
	dw en_turret_fire
	dw en_turret_dn
	dw en_turret_dn
	dw en_turret_fire
	dw en_turret_up
	dw en_turret_fire
	dw en_turret_up
	dw en_turret_fire
	dw en_turret_dn
	dw en_turret_fire
	dw en_turret_dn
	dw #FFFF
	
.en_turret_up
	db 80,4,80,4+128
.en_turret_dn
	db 80,8,80,8+128
.en_turret_fire
	db 80,0,80,64,80,0,80,128

.en_22_ball_redbig
	db 13,2,0
	repeat 2:dw en22_redbig_spr:rend
	dw 0
.en22_redbig_spr
	repeat 7
	db 140,16
	rend
	db 140,128

.en_18_ball_red1
	db 12+#20,1,0
	repeat 4:dw en18_red_spr:rend:dw 0
.en_19_ball_red2
	db 12+#40,1,0
	repeat 4:dw en18_red_spr:rend:dw 0
.en_20_ball_red3
	db 12+#60,1,0
	repeat 4:dw en18_red_spr:rend:dw 0
.en_21_ball_red4
	db 12+#80,1,0
	repeat 4:dw en18_red_spr:rend:dw 0	
	
.en18_red_spr
repeat 15:db 0,0:rend
db 0,128


.en17_barrier
	db 11,63,0
	dw en17_barrier_sp00
	dw #FFFF
.en17_barrier_sp00
	db 123,128+1
	
.en16_boss
	db 10,62,#30+10
	dw en16_boss_sp00
	dw #FFFF
.en16_boss_sp00
	db 125,0,126,0,127,0,128,0,127,0,126,128

.en01_redship
	db 0,64+1,16+2
;repeat 6
;	dw en01_redship_sp00
;rend
	repeat 3:dw en01_redship_sp00:rend
	dw 0
.en02_jumper_phase1
	db 1,62,#40+8
	dw en02_jumper_sp00
	dw 0
	
.en03_jumper_phase2
	db 2,50,#40+8
	dw en02_jumper_sp01	;stable
	dw en02_jumper_sp02	;open half
	dw en02_jumper_sp03	;open full
	dw en02_jumper_sp04	;shoot and down 2
	dw en02_jumper_sp02 ;open half
	dw en02_jumper_sp06	;closed and down 2
	dw en02_jumper_sp02 ;open half
	;dw en02_jumper_sp03	;open full
	;dw en02_jumper_sp04	;shoot and down 2
	;dw en02_jumper_sp02 ;open half
	dw en02_jumper_sp06 ;closed and down 2
	dw en02_jumper_sp02	;open half
	dw en02_jumper_sp03	;open full
	dw en02_jumper_sp08 ;shoot and up 2
	dw en02_jumper_sp02	;open half
	dw en02_jumper_sp05	;closed up 2
	dw en02_jumper_sp02	;open half
	dw en02_jumper_sp03 ;open full
	dw en02_jumper_sp08 ;shoot and up 2
	dw en02_jumper_sp02	;open half
	;dw en02_jumper_sp05	;closed up 2
	
	

	dw #FFFF

.en04_missle
	db 0,63,#20
repeat 4
	dw en04_missle_sp00
rend
	dw 0
;ship generator 1	
.en05_genA
	db 3,50,#40+10
repeat 4:dw en05_gen_sp00:rend	;closed
	dw en05_gen_sp01			;half open
repeat 6:dw en05_gen_sp02:rend	;full open and spawn
	dw en05_gen_sp01			;half open
repeat 8:dw en05_gen_sp00:rend	;closed
	dw 0
	
;ship 1
.en06_shipA
	db 0,64+1,#10+2
	dw en06_sp00
	dw 0
	
;ship generator 2	
.en07_genB
	db 4,50,#40+10
repeat 10:dw en05_gen_sp00:rend	;closed
	dw en05_gen_sp01			;half open
repeat 6:dw en05_gen_sp02:rend	;full open and spawn
	dw en05_gen_sp01			;half open
repeat 3:dw en05_gen_sp00:rend	;closed
	dw 0
	
;ship 2
.en08_shipB
	db 0,64+1,#10+2
	dw en08_sp00
	dw 0
	
;ground turret
.en09_turret_low
	db 5,64+1,#10+1
repeat 10:dw en09_sp00:rend
	dw 0
	
;ceiling turret
.en10_turret_hi
	db 5,64+1,#10+1
repeat 10:dw en10_sp00:rend
	dw 0
	
.en11_dummy
	db 0,63,0
	dw en11_dummy_sp00
	dw #FFFF
.en11_dummy_sp00
	db 1,128
	
.en12_tank
	db 6,64+16,#20+2
repeat 4
	dw en12_tank_sp00
rend
	dw 0
	
.en12_tank_sp00
repeat 8
	db 70,0,71,16
rend
	db 70,0,71,16+128
	
.en13_podder_blue
	db 7+#20,1,#20+2
	dw en13_podder1_sp00_step1
	dw en13_podder1_sp00_step2
repeat 3
	dw en13_podder1_sp00_step3
rend
	dw en13_podder1_sp00_step4
repeat 2
	dw en13_podder1_sp00_step5
rend
	dw 0
.en13_podder1_sp00_step1
repeat 3
	db 163,16
	db 163,0
rend
repeat 4
	db 163,16+8
	db 163,0
rend
	db 163,16+8
	db 163,128

.en13_podder1_sp00_step2
	db 162,0,162,128
.en13_podder1_sp00_step3
	db 160,16,160,0
	db 161,16,161,0
	db 164,16,164,0
	db 161,16,161,128
	
.en13_podder1_sp00_step4
repeat 4
	db 163,1+32+4
	db 163,1
rend
	db 163,1+32+4
	db 163,1+128
.en13_podder1_sp00_step5
repeat 8
	db 163,1+32
	db 163,1
rend
	db 163,1+32
	db 163,1+128
	
.en14_podder_blue2
	db 7+#10,1,#20+2
	dw en14_podder1_sp00_step6
	dw en14_podder1_sp00_step7
	dw en14_podder1_sp00_step6
	dw en14_podder1_sp00_step6
	dw en14_podder1_sp00_step6

	dw 0
.en14_podder1_sp00_step6
repeat 8
	db 163,16
	db 163,0
rend
	db 163,16
	db 163,128
	
.en14_podder1_sp00_step7
repeat 3
	db 163,16+8
	db 163,0
rend
	db 163,16+8
	db 163,128
	
.en15_podder_mssle
	db 7+#40,1,#20+2
	dw en14_podder1_sp00_step6
	dw en14_podder1_sp00_step7
	dw en14_podder1_sp00_step6
	dw en14_podder1_sp00_step6
	dw en14_podder1_sp00_step6
	dw 0

;	1ST BYTE = SPRITE NUMBER
;
;	2ND BYTE =
;		BITS 0-1 = ORIENTATION
;		BIT 2 = UP
;		BIT 3 = DOWN
;		BIT 4 = LEFT
;		BIT 5 = RIGHT
;		BIT 6 =
;		BIT 7 = END OF PATTERN
;

.en01_redship_sp00
	;db 1,16,2,16,3,16,4,16,5,16,6,16+128
	db 1,16,1,16,2,16,2,16,3,16,3,16,4,16,4,16,5,16,5,16,6,16,6,16+128
	
.en02_jumper_sp00
repeat 9
	db 7,4
rend
repeat 8
	db 7,4,7,0
rend
	db 7,128
.en02_jumper_sp01					;closed stable * 2
repeat 7
	db 13,0
rend
	db 13,128
.en02_jumper_sp02					;open half
	db 15,0,15,128
.en02_jumper_sp03					;open full
	db 17,0,17,0,17,0,17,128		
.en02_jumper_sp04					;open shoot down 2
	db 17,64,17,8,17,0,17,8+128
.en02_jumper_sp05					;closed up 2
	db 13,0,13,4,13,0,13,4+128
.en02_jumper_sp06					;closed down 2
	db 13,0,13,8,13,0,13,8+128
.en02_jumper_sp07					;closed stable
	db 13,0,13,0,13,0,13,128
.en02_jumper_sp08
	db 17,64,17,4,17,0,17,4+128		;shoot up 2
	
.en04_missle_sp00
	db 25,16,26,16
	db 25,16,26,16
	db 25,16,26,16
	db 25,16,26,16+128
;enemies 1 generator	
.en05_gen_sp00
	db 27,16,27,0,29,0,29,0,31,0,31,0,33,0,33,0
	db 27,16,27,0,29,0,29,0,31,0,31,0,33,0,33,128
.en05_gen_sp01
	db 35,16,35,0,37,0,37,0,39,0,39,0,41,0,41,128
.en05_gen_sp02
	db 43,16+64,43,0,45,0,45,0,47,64,47,0,49,0,49,0
	db 43,16+64,43,0,45,0,45,0,47,64,47,0,49,0,49,128
;enemies 1
.en06_sp00
repeat 8:db	51,3+8:rend		;down 8
repeat 2:db 52,3+8+16:rend	;down/left 2
repeat 4:db 53,3+16:rend	;left 8
repeat 4:db 52,1+4+16:rend	;up/left  2
repeat 14:db 53,3+16:rend	;left	10

db 53,3+16+128				;end

;enemies 2
.en08_sp00
repeat 5:db 51,2+8:rend 		;6 down 
repeat 3:db 52,3+8+16:rend		;2 down left
repeat 2:db 51,2+8:rend			;2 left
repeat 2:db 52,2+8+32:rend		;2 down/right
repeat 4:db 53,32:rend			;4 right
repeat 2:db 52,4+32:rend		;2 up/right
repeat 2:db 51,4:rend			;2 up
repeat 2:db 52,4+32:rend		;2 up/right
repeat 30:db 53,32:rend			;right
db 53,32+128					;end

.en09_sp00	
	db 55,16,55,0,58,0,58,0,61,0,61,0,64,0,64,0
	db 55,16,55,0,58,0,58,0,61,0,61,0,64,0,64,0
	db 55,16,55,0,58,0,58,0,61,0,61,0,64,0,64,0
	db 55,16,55,0,58,0,58,0,61,0,61,0,64,0,64,128
	
.en10_sp00
	db 55,16+2,55,2,58,2,58,2,61,2,61,2,64,2,64,2
	db 55,16+2,55,2,58,2,58,2,61,2,61,2,64,2,64,2
	db 55,16+2,55,2,58,2,58,2,61,2,61,2,64,2,64,2
	db 55,16+2,55,2,58,2,58,2,61,2,61,2,64,2,64,2+128	

.actionA01_null
	jp c,TV5
	jp TV1
	
.actionA02_missleLup
	jp c,TV5
;check damaged

	ld L,0
	jr z,actionA02_missleUp_NoDamage
	
	;touch sound	
	SetNullMaster
	call SND_SfxPlay 
	
	;ld A,(FRAME)
	;and 1
	;ld L,A
	ld L,1
.actionA02_missleUp_NoDamage
	ld A,L
	ld (actionA2_sprOffset),A
	
;down part is immortal	
	SaveMaster		;this part is immortal
	SetNullMaster

 	EX AF,AF'
 	PUSH AF:PUSH BC:PUSH DE
	
	repeat 5
	inc B
	rend

;compute sprite	
	ld A,(FRAME)
	;and 1
	;add A
	and 2
	add 9
	;ld L,A

	;ld A,(actionA2_sprOffset)
	;add L
	
	call TSPGADD
	call SPNS

 	POP DE:POP BC:POP AF
	EX AF,AF'
	
	ld A,(DE)
	cp 128
	jr c,actionA02_NotEnd

;spawn phase 2	
	ld HL,actionA02_spawn+1
	ld (HL),C
	inc HL
	ld (HL),B
	dec HL
	dec HL
	call FORCESYNC	
	
	ld (IY+0),0
	
	;RestoreMaster
	;jp TV5
	
.actionA02_NotEnd	
		
	
	RestoreMaster
	
;add damage offset (0/1)	
	ld A,(actionA2_sprOffset)
	ld L,A
	ex AF,AF'
	add L
	ex AF,AF'
	
	jp TV1
.actionA2_sprOffset
	db 0
.actionA02_spawn
	db 3,0,0
	
.actionA03	
	jp c,TV5
	
		jp c,TV5
;check damaged
	ld L,0
	jr z,actionA03_NoDamage
	
	;touch sound	
	SetNullMaster
	call SND_SfxPlay
	
	;ld A,(FRAME)
	;and 1
	;ld L,A
	ld L,1
.actionA03_NoDamage
	ld A,L
	ld (actionA3_sprOffset),A
	
	
	SaveMaster		;this part is immortal
	SetMaster 0	
;save all
	EX AF,AF'
 	PUSH AF:PUSH BC:PUSH DE	
;save pos for second part
	push BC
;reactors

	
	repeat 4
	inc B
	rend
	
	ld A,(FRAME)
	and 2
	;add A
	add 21
	ld L,A

	ld A,(actionA3_sprOffset)
	add L
	
	call TSPGADD
	call SPNS
	
	
	
;restore pos and draw second part
	pop BC
	
	inc C
	inc C
	
	ld A,(actionA3_sprOffset)
	add 19
	
	call TSPGADD
	call SPNS
	
	POP DE:POP BC:POP AF
	EX AF,AF'
	
	RestoreMaster
	
	ld A,(DE)
	bit 6,A
	call nz,actionA3_spawnMissle
	
;add damage offset (0/1)	
	ld A,(actionA3_sprOffset)
	ld L,A
	ex AF,AF'
	add L
	ex AF,AF'	
	
	jp TV1
.actionA3_spawnMissle

	push BC
	
	ld HL,actionA3_spawn+1
	
	dec C
	inc B

	ld (HL),C
	inc HL
	ld (HL),B
	dec HL
	dec HL
	
	call FORCESYNC
	
	pop BC
	ret
.actionA3_sprOffset
	db 0
.actionA3_spawn
	db 4,0,0
	
;ceiling generator	
;for gen 1
.actionA05_gen
	ld A,(SCR_SPEC2)
	jr actionA04_genEntry
.actionA04_gen
	ld A,(SCR_SPEC1)
.actionA04_genEntry
	ld (actionA04_cond),A
	jp c,TV5
	jr z,action04_nodamage
	;ld A,(FRAME)
	;and 1
	;ld L,A
	;ld L,1
	;ex AF,AF'
	;add L
	;inc A
	;ex AF,AF'
	SetNullMaster
	call SND_SfxPlay 
	
	
.action04_nodamage
	ld A,(DE)
	bit 6,A
	call nz,action04_spawn	
	jp TV1
.action04_spawn	
	push BC
	inc C
	ld HL,action04_enspawn
actionA04_cond EQU $+1
	ld A,0
	ld (HL),A
	inc HL
	ld (HL),C
	inc HL
	ld (HL),B
	dec HL
	dec HL
	call FORCESYNC
	pop BC
	ret

.action04_enspawn
	db 0,0,0

;turrets	
.actionA06_turret	
	jp c,TV5
	
	ld A,(SHIPX)
	sub C
	jr c,action06_turretShipxBehind
	jr nc,action06_turretShipxFront	
	
.actionA06_turretNoMove	
	jp TV1
.action06_turretShipxBehind
	neg
	cp 3
	jr c,actionA06_turretNoMove	
	ex AF,AF'
	dec A
	ex AF,AF'
	jr actionA06_turretNoMove	

.action06_turretShipxFront	
	cp 3
	jr c,actionA06_turretNoMove	
	ex AF,AF'
	inc A
	ex AF,AF'
	jr actionA06_turretNoMove	
	
.action07_tank
	jp c,TV5
	
	ld A,(SHIPX)
	sub C
	jr c,action07_shipBehind
	jr nc,action07_shipFront
	
.action07_movedone
	
	
	EX AF,AF'
 	PUSH AF:PUSH BC:PUSH DE	
;low part of the tank

	inc B
	inc B
	inc B
	
	ld A,(FRAME)
	and 1
	neg
	add 67
	
	call TSPGADD
	call SPNS
	
	POP DE:POP BC:POP AF
	EX AF,AF'
	
	jp TV1
	
.action07_shipBehind
	neg
	cp 3
	jr c,action07_movedone
	ex AF,AF'
	sub 2
	ex AF,AF'
	jr action07_movedone
.action07_shipFront
	cp 3
	jr c,action07_movedone
	ex AF,AF'
	add 2
	ex AF,AF'
	jr action07_movedone

;.action_10_podder_missle
;	jr nc,podder_run
;	ld L,4
;	call JEW_Spawn
;	jp TV5
	
;.action_09_podder_red
;	jr nc,podder_run
;	ld L,2
;	call JEW_Spawn
;	jp TV5
	
.action_08_podder
	jr nc,podder_run
	;ld L,1
	ld L,(IY+5)
	srl L
	srl L
	srl L
	srl L
	;ld L,A	
	call JEW_Spawn
	jp TV5	
.podder_run	
	LD (IY+3),C
	LD (IY+4),B
	
	LD A,(DE)

	PUSH DE
	PUSH AF
 	EX AF,AF'
 	CALL USPGADD
	POP AF
 	AND 3
	jp NZ,THEM6
 	CALL SPNS
 	jp THEM9
	
.boss_attack0
	ld A,(boss_counter)
	inc A
	ld (boss_counter),A
	;cp 10
	;jp c,action_11_boss_done
	push AF
	and 7
	call z,boss_attack2_spawn
	pop AF
	cp 17
	jp c,action_11_boss_done
	
	;push BC
	;ld BC,0
	;ld A,22
	;call action14_spawn
	;pop BC
	
	ld A,3
	ld HL,#0420
	call boss_setup_next
	jp action_11_boss_done

	
	
.boss_attack1
	ld A,(boss_counter)
	inc A
	ld (boss_counter),A
	cp 20
	jp c,action_11_boss_done
	push BC
	ld BC,#00FE
	ld A,25
	call action14_spawn
	
	ld A,sfx_boss0shoot2
	call SND_SfxPlay
	
	pop BC
	ld A,6
	ld L,0
	call boss_setup_next
	ld A,(FRAME)
	and %00001111
	;or 1
	ld (action16_counter),A
	ld A,1
	ld (action_16_rotate),A
	ld A,8
	ld (action_16_rate),A
	
	jp action_11_boss_done
.boss_attack2
	ld A,(boss_counter)
	inc A
	ld (boss_counter),A
	push AF
	and 7
	call z,boss_attack2_spawn
	pop AF
	cp 33
	jp c,action_11_boss_done

	
	ld A,3
	ld HL,#0418
	call boss_setup_next
	jp action_11_boss_done
.boss_attack2_spawn	
	push AF
	push BC
	ld BC,0
	ld A,22
	call action14_spawn
	
	
	ld A,sfx_boss0Shoot
	call SND_SfxPlay
	
	pop BC
	pop AF
	ret
.boss_attack3
	ld A,(boss_counter)
	inc A
	ld (boss_counter),A
	cp 20
	jp c,action_11_boss_done
	push BC
	ld BC,#00FE
	ld A,25
	call action14_spawn
	
	ld A,sfx_boss0shoot2
	call SND_SfxPlay
	
	pop BC
	ld A,6
	ld L,0
	call boss_setup_next
	xor A
	ld (action16_counter),A
	ld A,1
	ld (action_16_rotate),A
	ld A,4
	ld (action_16_rate),A
	jp action_11_boss_done	
	
;this fucking shitty boss , i am too tired
.action_11_boss
	jr nc,action_11_boss_alive
	ld A,5
	ld (boss_phase),A	
	ld (IY+0),62
	
	push BC
	push BC
	call ADDEXPLO0
	pop BC
	ld (HL),72
	inc L
	
	dec C
	dec C
	
	ld (HL),C
	inc L
	
	dec B
	ld (HL),B
	
	ld A,sfx_explodeC
	call SND_SfxPlay
	pop BC
	
	jr action_11_boss_nottouched
	
.action_11_boss_alive
	;ex AF,AF'
	;ld A,(boss_current_attack)
	;add 125
	;ex AF,AF'

;color key
	jr z,action_11_boss_nottouched
	ex AF,AF'
	ld A,129
	ex AF,AF'
	SetNullMaster
	ld A,sfx_touchboss
	call SND_SfxPlay
	
.action_11_boss_nottouched

	ld A,(action_15_turret_flash)
	or A
	jr z,action_11_boss_notturretflash
	dec A
	ld (action_15_turret_flash),A
	
	
.action_11_boss_notturretflash

	ld A,(action_12_barrier_flash)
	or A
	jr z,action_11_nobarrierflash
	dec A
	ld (action_12_barrier_flash),A
	
.action_11_nobarrierflash
	ld A,(boss_phase)
	or A
	jr nz,action_11_boss_not0
;action 0 , go left
	dec C
	ld A,C
	cp 23
	jp nc,action_11_boss_done
	
	ld A,1
	ld (boss_phase),A

	
	;ld A,(boss_current_attack)	
	;add 141
	;call action_13_computeSprite
	jp action_11_boss_done
	
;action 1 , open
.action_11_boss_not0
	cp 1
	jr nz,action_11_boss_not1
	ld A,(boss_open)
	or A
	call z,boss_open_sound
	inc A
	ld (boss_open),A
	cp 2
	jp c,action_11_boss_done
	ld A,2
	ld L,0	
	;ld A,3
	;ld HL,#0210
	call boss_setup_next	
	jp action_11_boss_done

.action_11_boss_not1	
;action 2 , attack
	cp 2
	jr nz,action_11_boss_not2
	
	ld A,(boss_current_attack)
	or A
	jp z,boss_attack0
	cp 1
	jp z,boss_attack1
	cp 2
	jp z,boss_attack2
	cp 3
	jp z,boss_attack3
	
	jp action_11_boss_done
	
.action_11_boss_not2
;action 3 , wait and jump to next action
	cp 3
	jr nz,action_11_boss_not3

	ld A,(boss_counter)
	dec A
	ld (boss_counter),A
	jp nz,action_11_boss_done
	
	ld A,(boss_next_action)
	ld (boss_phase),A
	jp action_11_boss_done
	
.action_11_boss_not3
;action 4 , close before reshooting
	cp 4
	jr nz,action_11_boss_not4
	ld A,(boss_open)
	cp 2
	call z,boss_open_sound
	dec A
	ld (boss_open),A
	jp nz,action_11_boss_done
	ld A,3
	ld HL,#010A
	call boss_setup_next
	jp action_11_boss_done
	
.action_11_boss_not4
;action 5 , close and return
	cp 5
	jr nz,action_11_boss_not5
	
	ld A,(boss_current_attack)
	cp 3
	jr nz,action11_not_end
	
	push BC
	call ADDEXPLO0
	ld (HL),72
	inc L
	
	ld A,R
	and 7
	add -4
	add (IY+3)
	
	ld (HL),A
	inc L
	
	ld A,R
	and 3
	add -2
	add (IY+4)
	ld (HL),A
	
	ld A,sfx_explodeC
	call SND_SfxPlay
	pop BC
	
.action11_not_end
	ld A,(boss_open)
	cp 2
	call z,boss_open_sound
	dec A
	cp #FF
	jr z,action11_boss_closed
	ld (boss_open),A
.action11_boss_closed
	inc C
	ld A,C
	cp 33
	jr c,action_11_boss_done
	ld A,3
	ld HL,30
	call boss_setup_next
	
	ld A,(boss_current_attack)
	inc A
	cp 4
	jr nc,action_11_boss_end
	ld (boss_current_attack),A	
	
	;spawn turrets
	ld A,28
	ld H,SEQBUFF_high
	
	ld L,27+3
	ld (HL),A
	
	ld L,27+3+9
	ld (HL),A
	
	ld A,20
	ld (action_15_turret_flash),A
	
	jr action_11_boss_done
.action_11_boss_end
	call BIG_EXPLO_Start
	ld A,4+128	;jump to level 4 !
	ld (END_LEVEL_Jump),A
	ld A,12-1	;give 5K
	call SCORE_Add
	
.action_11_boss_not5
;action 6 , close and return for waiting attack end
	cp 6
	jr nz,action_11_boss_not6
	
	ld A,(boss_open)
	cp 2
	call z,boss_open_sound
	dec A
	cp #FF
	jr z,action11_boss6_closed
	ld (boss_open),A
.action11_boss6_closed
	inc C
	ld A,C
	cp 29
	jr c,action_11_boss_done
	ld A,7
	ld L,0
	call boss_setup_next
	ld A,1
	ld (boss_wait),A
	
.action_11_boss_not6
;action 7 , wait end of current attack
	cp 7
	jr nz,action_11_boss_not7
	ld A,(boss_wait)
	or A
	jr nz,action_11_boss_done
;let's go for first action
	ld A,3
	ld HL,10
	call boss_setup_next

	
.action_11_boss_not7

.action_11_boss_done

	ld (IY+3),C
	ld (IY+4),B

	SaveMaster
	SetNullMaster
;draw main cylinder
	EX AF,AF'
 	PUSH AF:PUSH BC:PUSH DE	

	
	ld A,120
	
	dec B
	dec B
	
	
	call TSPGADD
	call SPNS
	

;left part down
	LD C,(IY+3)
 	LD B,(IY+4)
	dec B
	dec B
	push BC
	push BC
	dec C
	inc B
	push BC
	ld A,(boss_open)
	;srl A
	push AF
	add 2
	add B
	ld B,A
	ld A,122
	call TSPGADD
	call SPFS
;left part up
	pop AF
	neg
	pop BC
	add B
	ld B,A
	ld A,122
	call TSPGADD
	call SPNS
	
;right part down
	pop BC
	ld A,(boss_open)
	srl A
	push AF
	add B
	add 3
	ld B,A
	ld A,121
	call TSPGADD
	call SPFS
	
	pop AF
	pop BC
	neg
	add B
	ld B,A
	ld A,121
	call TSPGADD
	call SPNS

	

	
	

	POP DE:POP BC:POP AF
	EX AF,AF'
	
	RestoreMaster

	jp TV1
.boss_setup_next
	ld (boss_phase),A
	ld A,H
	ld (boss_next_action),A
	ld A,L
	ld (boss_counter),A
	ret
.boss_open_sound
	push AF
	ld A,sfx_boss0Open
	call SND_SfxPlay
	pop AF
	ret


.boss_phase
	db 0
.boss_open
	db 0
.boss_counter
	db 0
.boss_next_action
	db 0
.boss_current_attack
	db 0
.boss_wait
	db 0
	
.action_12_barrier

action_12_barrier_flash	EQU $+1
	ld A,0
	or A
	jr z,action_12_barrier_noflash
	
	ld A,(FRAME)
	and 1
	jp nz,TV5
	
.action_12_barrier_noflash
	EX AF,AF'
 	PUSH AF:PUSH BC:PUSH DE
	ex AF,AF'
	
	;first , compute screen address
	
	inc C
	ld A,B
	add A ;*2
	add ATTR_Addr_low
	ld L,A
	ld H,ATTR_Addr_High	;HL point on address for Y
	ld A,(HL)
	inc L
	ld H,(HL)
	add C ;do not forget to add X to array address
	ld L,A
	
	
	push HL
	
	;draw second sprite
	ld A,C
	add 16
	ld C,A
	ex AF,AF'
	call TSPGADD
	call SPNS
	
	
	;compute now sprite address
	ld A,(FRAME)
	and 3
	add A
	add A	;4 bytes , 2 tiles per sprite
	
	ld E,A
	ld D,0
	ld HL,l0_fence_table
	add HL,DE
	ex DE,HL
	
	pop HL; restore screen address
	
	ld B,8

;compute attr flipY
	ld A,(FRAME)
	and 4	;isolate bit 2
	add A	;change to bit 4
	add A
	or 1	;+1
	or 128	;solid !
	
.action12_drawfence_loop
	push DE
	push BC
	

	
	call action12_drawsprite
	inc L
	call action12_drawsprite
	inc L
	
	
	pop BC
	pop DE
	djnz action12_drawfence_loop
	

	POP DE:POP BC:POP AF
	EX AF,AF'
	jp TV1
.action12_drawsprite
	push AF
	push HL
	ld (HL),A	;attr
	inc H
	ld (HL),#C6	;bank
	inc H
	ld A,(DE)
	ld (HL),A	;tile
	inc H
	inc DE
	ld A,(DE)
	ld (HL),A
	inc H
	inc DE
	ld (HL),0	;master
	pop HL
	pop AF
	ret
	
.action_13_ball
	jp c,TV5
	push DE

;compute sprite	
	ex AF,AF'
	add A
	ld E,A
	ld D,0
	ld HL,l0_bulletsTable
	add HL,DE
	
	ld A,(HL)
	ld (action_13_spr1),A
	inc HL
	ld A,(HL)
	ld (action_13_spr2),A
	
;get current action
	ld A,(IY+5)
	and %11110000
	rrca
	rrca
	rrca
	rrca
	dec A	;first is action #1
	ld E,A

;*9
	add A
	add A
	add A
	add E
;get in table
	ld E,A
	ld D,0
	ld IX,action13_table
	add IX,DE
;warning BC inverted , B = x , C = y	
	ld A,(IY+3)
	add (IX+0)
	cp 32
	jp nc,action_13_ball_kill
	ld B,A
	ld A,(IY+4)
	add (IX+1)
	cp 20
	jr nc,action_13_ball_kill
	ld C,A
	
	call LAZER_IsSolid
	or A
	jr z,action_13_ball_validate_move
;compute solution 1	
	ld A,(IY+3)
	add (IX+2)
	ld B,A
	ld A,(IY+4)
	add (IX+3)
	ld C,A
	call LAZER_IsSolid
	;save result
	ld (action_13_ball_saveA),A
	ld (action_13_ball_saveA+1),BC
	ld (action_13_ball_saveA+3),HL
;compute solution 2	
	ld A,(IY+3)
	add (IX+4)
	ld B,A
	ld A,(IY+4)
	add (IX+5)
	ld C,A
	call LAZER_IsSolid	
	
	ld E,A
	ld A,(action_13_ball_saveA)
	cp E
	jr c,action13_SolutionB		;A<B
	jr z,action13_SolutionEqual	;A=B
	
	ld A,(IX+8)
	jr action_13_ball_newdirection
	
.action13_SolutionB	
	ld BC,(action_13_ball_saveA+1)
	ld HL,(action_13_ball_saveA+3)
	ld A,(IX+7)
	jr action_13_ball_newdirection

	
.action13_SolutionEqual	
	ld B,(IY+3)
	ld C,(IY+4)
	call LAZER_ComputePos
	ld A,(IX+6)

.action_13_ball_newdirection
	inc A
	add A
	add A
	add A
	add A
	or 12
	ld (IY+5),A

.action_13_ball_validate_move
;writing new pos in reverse order	
	ld (IY+3),B
	ld (IY+4),C
	
;draw it
	ld (HL),1
	inc H
	ld (HL),#C6
	inc H
action_13_spr1	EQU $+1
	ld (HL),0
	inc H
action_13_spr2	EQU $+1	
	ld (HL),0
	inc H
	ld A,(MASTER)
	ld (HL),A

	pop DE
	jp TV3
.action_13_ball_kill
	ld (IY+0),0
	pop DE
	jp TV3
.action_13_ball_saveA
	db 0,0,0,0,0	;result , new pos , new address
;.action_13_computeSprite
	;call TSPGADD
	;inc HL
	;inc HL
	;ld A,(HL)
	;ld (action_13_spr1),A
	;inc HL
	;ld A,(HL)
	;ld (action_13_spr2),A
	;ret

	
;move table
;clockwise , 0 = up
;byte x,y move									IX+0,IX+1
;byte x,y 	checkA								IX+2,IX+3
;byte x,y 	checkB								IX+4,IX+5
;byte e,l,g	solution Equal,Lower,Greater		IX+6,IX+7,IX+8
;total = 9 bytes
.action13_table
;up
db	0,-1		
db	0,0			
db	0,0			
db	4,4,4			
;up/right
db	1,-1
db	1,0
db	0,-1
db	5,3,7
;right
db	1,0
db	0,0
db	0,0
db	6,6,6
;right/down
db	1,1
db	1,0
db	0,1
db	7,1,5
;down
db	0,1
db	0,0
db	0,0
db	0,0,0
;left/down
db	-1,1
db	-1,0
db	0,1
db	1,7,3
;left
db	-1,0
db	0,0
db	0,0
db	2,2,2
;left/up
db	-1,-1
db	0,-1
db	-1,0
db	3,1,5

.action_14_bigball
	jr c,action_14_bigballDie
	dec C
	jp TV1
	
.action_14_bigballDie	

	ld (IY+0),1	;prevent respawning on this one

	push DE
	
	ld A,21
	ld BC,0
	call action14_spawn
	
	ld A,18
	ld BC,1
	call action14_spawn
	
	ld A,19
	ld BC,#0101
	call action14_spawn
	
	ld A,20
	ld BC,#0100
	call action14_spawn
	
	
	pop DE
	
	ld (IY+0),0
	
	jp TV5
.action14_spawn
	ld HL,action14_spawnobj
	push HL
	ld (HL),A
	inc HL
	ld A,(IY+3)
	add C
	ld (HL),A
	inc HL
	ld A,(IY+4)
	add B
	ld (HL),A	
	pop HL
	call FORCESYNC
	ret

.action14_spawnobj
	db 0,0,0
	
.action_15_turret
	jp c,action_15_dead_turret
	jr z,action_15_notTouched
	
	ld A,(FRAME)
	and 1
	jr nz,action_15_notTouched
	
	ex AF,AF'
	inc A
	ex AF,AF'
	xor A
	call SND_SfxPlay
	
.action_15_notTouched
	
action_15_turret_flash EQU $+1	
	ld A,0
	or A
	jr z,action_15_turretnotflash
	
	ld A,(FRAME)
	and 1
	jp z,TV4
	jp tv1
	
.action_15_turretnotflash	
	ld A,C
	cp 32
	jr nc,action_15_dead_turret
	
	ld A,(DE)
	bit 6,A
	jp z,TV1
	
	;ld A,(FRAME)
	;and 7
	;cp 1
	;jp nz,TV1
action_15_shoot_counter	EQU $+1
	ld A,0
	inc A
	ld (action_15_shoot_counter),A
	cp 5
	jp nz,TV1
	xor A
	ld (action_15_shoot_counter),A
	
	push BC
	
	ld A,(IY+5)
	and %00010000
	rrca
	rrca
	rrca
	rrca	
	add 42
	ld BC,#00FF
	call action14_spawn
	
	;ld A,21
	;ld BC,#01FF
	;call action14_spawn

	pop BC
	jp TV1
.action_15_dead_turret
;default life
	ld A,(en_23_turretup+1)
	ld (IY+0),A
	ld C,#F0
	jp TV1

	
.action_16_hyperbullet
	;jp c,TV5
	jp nc,action_16_alive
	
	xor A
	ld (boss_wait),A
	
	jp TV5
.action_16_alive

	jr z,action_16_not_touched
	
	ld A,(FRAME)
	and 1
	jr z,action_16_not_touched
	
	ex AF,AF'
	ld A,144
	ex AF,AF'
	
	xor A
	call SND_SfxPlay
	
.action_16_not_touched
	
	ld A,(boss_wait)
	or A
	jr z,action_16_move
	
	;ld A,(DE)
	;bit 6,A
	;jp z,TV1

action16_counter	EQU $+1
	ld A,0
	;inc A
action_16_rate	EQU $+1
	add 4
	and 15
	ld (action16_counter),A
	
	ld L,A
	
	ld A,(action_16_rotate)
	or A
	jr z,action16_notRotate
	
	ld A,(FRAME)
	and %11110000
	srl A
	srl A
	srl A
	srl A
.action16_notRotate	
	add L
	and 15

	
	push BC
	
	ld BC,0
	add 26
	call action14_spawn
	
	ld A,sfx_hyperbullet
	call SND_SfxPlay
	
	pop BC
	
	jp TV1
.action_16_move
	ld A,(en_25_hyper_bullet+1)
	ld (IY+0),A
	ld A,(FRAME)
	and 3
	jp nz,TV1
	dec C
	jp TV1
.action_16_rotate
	db 0

	
.action_09_bullet
	jp c,TV5
	
	SetMaster NeutralMaster+1
	
	ld A,C
	cp 32
	jr nc,action_09_bulletkill
	
	ld A,B
	cp 20
	jr nc,action_09_bulletkill
	
	jp TV1
.action_09_bulletkill
	ld (IY+0),0
	jp TV5



.actionB01_null
.actionB02	;action 2 to A are null , used for balls
.actionB03
.actionB04
.actionB05
.actionB06
.actionB07
.actionB08
.actionB09
.actionB0A
	jp TV3

.lvl_zik
	incbin "snd/rtype-0.raw"
.lvl_zik_boss
	incbin "snd/rtypeboss0.raw"
	