ADDEXPLO
	;ld A,sfx_explodeA	
	;call SND_SfxPlay
	
	CALL ADDEXPLO0
	JR NZ,ADEXP0
	ld (last_explo),HL
	CALL ADDEXPLO2
.ADEXP0
	RET
.last_explo
	dw 0
 ;
ADDEXPLO0	
	LD HL,EXPLOBUFF
	LD B,20
.ADDEXPLO1	
	LD A,(HL)
	AND A
 	RET Z
 	INC L
 	INC L
 	INC L
 	DJNZ ADDEXPLO1
	ld HL,EXPLOBUFF	;first explosion !
	;DEC A			;check if possible A = 1 so ret with Z=set !
	inc B	;here we are sure B =0 so INC B makes Z=0
 	RET
 ;
ADDEXPLO2	
	LD (CIRCHOLD2),HL
	LD E,(IY+6)
 	LD D,(IY+7)
 	INC DE
	INC DE
	LD A,(DE)
	
.ADDEXPLO2_E2
 	AND 240
 	;JR Z,ADDEXPLO3
	ret z
	
	;do sound
	push AF
	push BC
	ld B,sfx_explodeA
	cp #10
	jr z,ADDEXPLO4
	inc B
	cp #20
	jr z,ADDEXPLO4
	cp #30
	jr z,ADDEXPLO4
	inc B
	
	
	
	;or 1
;PUSH HL
  ;LD L,FULL+2
  ;LD H,8
 ;CP 1*16
  ;JR Z,ADDEXPLO4
 ;LD H,10
  ;CP 4*16
  ;JR Z,ADDEXPLO4
 ;LD H,9
.ADDEXPLO4

	ld A,B
	call SND_SfxPlay
	
	pop BC
	pop AF

 ;CALL BEEP
  ;POP HL
;
.ADDEXPLO2BIS
 	OR 8
 	LD (HL),A
 	INC L
 	LD A,(CIRCHOLD1)
	LD (HL),A
 	INC L
 	LD A,(CIRCHOLD1+1)
	LD (HL),A
	
 .ADDEXPLO3	
 ;update score
	ld A,(DE)
	dec A
	
	ret z ;score = 0 , no scoring !
	
	and 15
	call SCORE_Add
	
	
	RET
	
.EXPLODE
	SetMaster NeutralMaster	;not solid
	LD B,20
	LD HL,EXPLOBUFF
.EXPLODE0	
	LD A,(HL)
 	;AND A
	or A
 	JR NZ,EXPLODE2
.EXPLODE1	
	INC L
	INC L
	INC L
.EXPLODE1A	
	DJNZ EXPLODE0
	RET

.EXPLODE2	

	;DEC (HL)
	;LD A,(HL)
	dec A
	ld (HL),A
 	AND 15
	CP 15
 	JR NZ,EXPLODE3
	LD (HL),0
 	JR EXPLODE1
.EXPLODE3	
	LD C,A
	LD A,(HL)
 	AND 240
 	;RRCA
	SRL A
	SUB 8

 	LD DE,EXPLO1
	;ADD E
 	ADD C
	
	and 31	;be sure to stay in explo table !
	
	add E	;now we can check in table
	
 	LD E,A
	LD A,(DE)
 	AND A
 	JR Z,EXPLODE1
.EXPLODE4	
	PUSH BC
 	INC HL
	LD C,(HL)
 	INC HL
	LD B,(HL)
 	PUSH HL
 	CALL USPGADD
	CALL SPNS
 	POP HL
	POP BC
	INC HL
	JR EXPLODE1A


	
align 32 
;put explo here because need to be aligned
EXPLO1	DEFB 81,80,79,78,77,76,75,75
EXPLO2	DEFB 87,86,85,84,83,82,75,75
EXPLO3	DEFB 87,86,85,84,83,82,75,75
EXPLO4	DEFB 97,97,95,95,95,94,94,94
	
	
