#ifndef SPU_PLAY
#define SPU_PLAY

#include "PSEmuPro_Decode XA.h"

typedef struct
{
	char          szSPUName[8];          // unique name of spu save state
	unsigned long ulFreezeVersion;       // version... always 1 right now
	unsigned long ulFreezeSize;          // sizeof(SPUFreeze_t) + trailing extra data
	unsigned char cSPUPort[0x200];       // spu registers
	unsigned char cSPURam[0x80000];      // spu ram
	xa_decode_t   xaS;                   // current xa block (if any)
} SPUFreeze_t;

typedef struct                        // own extra data... 
{
	unsigned long Future[256];
} SPUOSSFreeze_t;

typedef struct
{
	unsigned long Tick;
	unsigned long reg;
	unsigned short val;
} WriteRegLog;

void openSPU(void);
void closeSPU(void);
void openSPUFile(const char *cszFileName);
void closeSPUFile(void);
DWORD getSPUFileLength(void);
void setSPUFilePosition(DWORD dwPos);
void renderSPU(BYTE *Buffer, DWORD dwSize);
void updateSPU(void);

#endif