; $VER: CUST.Megasquad.asm (13.06.99)
; by Kyzer/CSG

	include	misc/deliplayer.i

	SECTION	player,code
	PLAYERHEADER tags

	dc.b	'$VER: CUST.Megasquad 1.0 (13.06.99)'
	dc.b	' by Clay Hellman, rip by Kyzer <kyzer@4u.net>',0
	cnop	0,4

tags	dc.l	DTP_CustomPlayer,1
	dc.l	DTP_InitPlayer,initply
	dc.l	DTP_InitSound,mt_init
	dc.l	DTP_Interrupt,mt_play
;	dc.l	DTP_EndSound,mt_end
	dc.l	DTP_EndPlayer,endply
	dc.l	DTP_NewSubSongRange,subsong
	dc.l	DTP_DeliBase,delibas
	dc.l	TAG_DONE

subsong	dc.w	4,1,6
delibas	dc.l	0

initply	move.l	dtg_AudioAlloc(a5),a0
	jmp	(a0)
endply	move.l	dtg_AudioFree(a5),a0
	jmp	(a0)

mt_init	movem.l	d0-d7/a0-a6,-(sp)
	move.l	delibas(pc),a5
	move.w	dtg_SndNum(a5),d0
	jsr	MT_INIT
.done	movem.l	(sp)+,d0-d7/a0-a6
	rts

mt_play	movem.l	d0-d7/a0-a6,-(sp)
	jsr	MT_INT
	movem.l	(sp)+,d0-d7/a0-a6
	rts

mt_end	lea	$dff000,a0
	moveq	#0,d0
	move.w	d0,$a8(a0)
	move.w	d0,$b8(a0)
	move.w	d0,$c8(a0)
	move.w	d0,$d8(a0)
	move.w	#$f,$96(a0)
	rts

 	section	mega,code,chip
	include	megasquad.asm
