;end level part for music
.END_LVL_PlayMusic
;be sure to be in full music mode	
	;xor A
	;call SND_SetMode
	
	xor A
	ld (LVL_NextMusik),A
	call MUSIC_SetVolume
	
;music is 11 for level 0
	ld C,11
	ld A,(current_lvl)
	or A
	jr nz,END_LEVEL_NormalMusic
	ld C,14
.END_LEVEL_NormalMusic	
	ld A,C
	call MUSIC_Play	
	
	ret
	
;end level level completed flag
.END_LVL_SetFlag
	ld HL,1

	ld A,(current_lvl)
	or A
	jr z,END_LVL_SetFlagDone	
	
	ld B,A	
.END_LVL_SetFlagLoop
	add HL,HL
	djnz END_LVL_SetFlagLoop

.END_LVL_SetFlagDone	
	ex DE,HL
	
	ld HL,level_list
	ld A,(HL)
	or E
	ld (HL),A
	inc HL
	ld A,(HL)
	or D
	ld (HL),A
	
	ret
	

	