
                .filename 	"EXTERNAL"
		.ORG		$8000		

; STEP1: 	STARTING SET UP
		
		DI
		CALL	PLAYER_OFF
		


; STEP2:	MUSIC RAM BUFFER

                LD      HL,BUFFER_DEC        	;* $40 BYTES FREE RAM MEMORY 
                LD      [CANAL_A],HL		;* $10 BYTES x CHANNEL SHOULD BE ENOUGHT
                				
                LD      HL,BUFFER_DEC+$10        	
                LD      [CANAL_B],HL       	

                LD      HL,BUFFER_DEC+$20       	
                LD      [CANAL_C],HL 

                LD      HL,BUFFER_DEC+$30       	
                LD      [CANAL_P],HL 
		

                LD      A,0             	; SONG #0 (THE 1ST OF THE LIST)
                CALL    CARGA_CANCION


;STEP3:		ENABLE INTERRUPT

		EI
	
LOOP:		HALT				
		CALL	INICIO			;CALL INICIO EVERY 1/50s			
		JR	LOOP

BUFFER_DEC:     DS      $20*4		;************************* mucha atencion!!!!
					; aqui se decodifica la cancion hay que dejar suficiente espacio libre.
					;*************************
                


		
;STEP4:		INCLUDE MUSIC DATA

.INCLUDE		"EXTERNAL.MUS.ASM"

;		SONGS LABELS

SONG_0:		.INCBIN	"EXTERNAL.MUS"		;SONG #0 - INCLUDE ALL YOUR SONGS HERE
						;SONG #1...
;		SONGS TABLE

TABLA_SONG:	DW	SONG_0

;PLAYER______________________________

.INCLUDE	"WYZproPlay47bZX.txt"
