#ifndef _PPCPRAGMA_EXPANSION_H
#define _PPCPRAGMA_EXPANSION_H
#ifdef __GNUC__
#ifndef _PPCINLINE__EXPANSION_H
#include <ppcinline/expansion.h>
#endif
#else

#ifndef POWERUP_PPCLIB_INTERFACE_H
#include <powerup/ppclib/interface.h>
#endif

#ifndef POWERUP_GCCLIB_PROTOS_H
#include <powerup/gcclib/powerup_protos.h>
#endif

#ifndef NO_PPCINLINE_STDARG
#define NO_PPCINLINE_STDARG
#endif/* SAS C PPC inlines */

#ifndef DBPLAYER_BASE_NAME
#define DBPLAYER_BASE_NAME DBPlayerBase
#endif /* !PLAYERP61_BASE_NAME */

#define DBM_StartModule(mod,size,amid,freq,flags) _DBM_StartModule(DBPLAYER_BASE_NAME,mod,size,amid,freq,flags)

static __inline ULONG 
_DBM_StartModule (void *DBPlayerBase, APTR mod, ULONG size, ULONG amid, ULONG freq, ULONG flags)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.a0		=(ULONG) mod;
	MyCaos.d0		=(ULONG) size;
	MyCaos.d1		=(ULONG) amid;
	MyCaos.d2		=(ULONG) freq;
	MyCaos.d3		=(ULONG) flags;
	MyCaos.caos_Un.Offset	=	(-0x1e);
	MyCaos.a6		=(ULONG) DBPlayerBase;	
	return((ULONG)PPCCallOS(&MyCaos));
}

#define DBM_StopModule() _DBM_StopModule(DBPLAYER_BASE_NAME)

static __inline VOID
_DBM_StopModule (void *DBPlayerBase)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.caos_Un.Offset	=	(-0x24);
	MyCaos.a6		=(ULONG) DBPlayerBase;	
	PPCCallOS(&MyCaos);
}

#define DBM_SetPosition(song,patt) _DBM_SetPosition(DBPLAYER_BASE_NAME,song,patt)

static __inline VOID
_DBM_SetPosition (void *DBPlayerBase, UWORD song, UWORD patt)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.d0		=(ULONG) song;
	MyCaos.d1		=(ULONG) patt;
	MyCaos.caos_Un.Offset	=	(-0x2a);
	MyCaos.a6		=(ULONG) DBPlayerBase;	
	PPCCallOS(&MyCaos);
}

#define DBM_SetVolume(volume) _DBM_SetVolume(DBPLAYER_BASE_NAME,volume)

static __inline VOID
_DBM_SetVolume(void *DBPlayerBase, WORD volume)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.d0		=(ULONG) volume;
	MyCaos.caos_Un.Offset	=	(-0x30);
	MyCaos.a6		=(ULONG) DBPlayerBase;	
	PPCCallOS(&MyCaos);
}

#define DBM_WaitPosition(song,patt) _DBM_WaitPosition(DBPLAYER_BASE_NAME,song,patt)

static __inline BOOL
_DBM_WaitPosition(void *DBPlayerBase, WORD song, WORD patt)
{
struct Caos	MyCaos;
	MyCaos.M68kCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.PPCCacheMode	=	IF_CACHEFLUSHALL;
	MyCaos.d0		=(ULONG) song;
	MyCaos.d1		=(ULONG) patt;
	MyCaos.caos_Un.Offset	=	(-0x36);
	MyCaos.a6		=(ULONG) DBPlayerBase;	
	return((BOOL)PPCCallOS(&MyCaos));
}

#endif /* SASC Pragmas */
#endif /* !_PPCPRAGMA_AMIGAGUIDE_H */
