***
*** NAME:	Shades Custom Module v1.31
***
*** AUTHOR:	Original replay + music by ???
***		(The original C64 tune (c) Chris Hüelsbeck)
*** 		Resourced and Deli-adapted by [·M·n·O·] (Lasse Jari Hansen).
***
*** E-MAIL:	ljh@sigma.ou.dk
***
*** VERSION:	19-Nov-96 : 1. Aminet release
***		17-Nov-96 : Added CacheClearU()
***		17-Oct-96 : Deli-adaption
***		       92 : Resourcing and Stinger-adaption
***
*** INFO:	Originally used in an OLD Prologic intro (I think...).
***
***		Deli-release handles volume.
***
***		Source released for educational purposes.
***		Feel free to contact me for bug reports or help.
***
***		This is freely distributable: you can do with it
***		what you want - as long as you e-mail me the changes!
***

		incdir	"Include:"
		include	"misc/DeliPlayer.i"
		include "exec/exec_lib.i"

		incdir	"WORK:Aminet/Shades/Source/"


		SECTION Player,Code_c

code_start	PLAYERHEADER PlayerTagArray

		dc.b '$VER: Shades by Chris Hüelsbeck. '
		dc.b 'Ripped and adapted by [·M·n·O·]. '
		dc.b 'Version 1.31 '
		dc.b 'Saturday 16-Nov-96 21:16:54.',0
		even

PlayerTagArray	dc.l	DTP_CustomPlayer,1
		dc.l	DTP_Interrupt,play_music
		dc.l	DTP_InitPlayer,InitPlayer
		dc.l	DTP_EndPlayer,EndPlayer
		dc.l	DTP_InitSound,init_music
		dc.l	DTP_EndSound,end_music
		dc.l	DTP_DeliBase,DELI_base

		dc.l	DTP_Volume,sha_SetVol
		dc.l	TAG_DONE

*-----------------------------------------------------------------------*

InitPlayer	move.l	dtg_AudioAlloc(a5),a0
		jsr	(a0)
		rts

EndPlayer	move.l	dtg_AudioFree(a5),a0
		jsr	(a0)
		rts

*-----------------------------------------------------------------------*

init_music	movem.l	d0-a6,-(sp)
		bsr	lb_0000
		move.l	$4,a6
		jsr	_LVOCacheClearU(a6)
		movem.l	(sp)+,d0-a6
		rts

play_music	movem.l	d0-a6,-(sp)
		move.l	$4,a6
		jsr	_LVOCacheClearU(a6)
		bsr	lb_0000+4
		movem.l	(sp)+,d0-a6
		rts

end_music	movem.l	d0-a6,-(sp)
		moveq	#0,d0
		lea	$dff000,a0
		move	d0,$a8(a0)
		move	d0,$b8(a0)
		move	d0,$c8(a0)
		move	d0,$d8(a0)
		move	#$f,$96(a0)
		movem.l	(sp)+,d0-a6
		rts

wait_dma	movem.l	d0-a6,-(sp)
		move.l	DELI_Base(pc),a0
		move.l	dtg_WaitAudioDMA(a0),a0
		jsr	(a0)
		movem.l	(sp)+,d0-a6
		rts

sha_SetVol	lea	sha_myvol(pc),a0
		move	dtg_SndVol(a5),(a0)
		rts

*-----------------------------------------------------------------------*

DELI_base	dc.l	0

		include	Shades_rep.asm

		even
