extern long CALLBACK SPUinit(void);
extern long CALLBACK SPUshutdown(void);
extern long CALLBACK SPUclose(void);
-extern void CALLBACK SPUplaySample(unsigned char);
extern void CALLBACK SPUwriteRegister(unsigned long, unsigned short, unsigned int);
extern unsigned short CALLBACK SPUreadRegister(unsigned long);
-extern void CALLBACK SPUwriteDMA(unsigned short);
-extern unsigned short CALLBACK SPUreadDMA(void);
extern void CALLBACK SPUwriteDMAMem(unsigned short *, int, unsigned int);
extern void CALLBACK SPUreadDMAMem(unsigned short *, int, unsigned int);
extern void CALLBACK SPUplayADPCMchannel(void *, unsigned int, int);
extern void CALLBACK SPUregisterCallback(void (*cb)(void));
extern void CALLBACK SPUregisterScheduleCb(void (*cb)(unsigned int));
-extern long CALLBACK SPUconfigure(void);
-extern long CALLBACK SPUtest(void);
-extern void CALLBACK SPUabout(void);
extern long CALLBACK SPUfreeze(unsigned int, void *, unsigned int);
extern void CALLBACK SPUasync(unsigned int, unsigned int);
extern int CALLBACK SPUplayCDDAchannel(short *, int, unsigned int, int);
DUMMY_CDR(CDRreadCDDA),
DUMMY_CDR(CDRgetTE),
/* SPU */
- DIRECT_SPU(SPUconfigure),
- DIRECT_SPU(SPUabout),
DIRECT_SPU(SPUinit),
DIRECT_SPU(SPUshutdown),
- DIRECT_SPU(SPUtest),
DIRECT_SPU(SPUopen),
DIRECT_SPU(SPUclose),
-// DIRECT_SPU(SPUplaySample), // unused?
DIRECT_SPU(SPUwriteRegister),
DIRECT_SPU(SPUreadRegister),
- DIRECT_SPU(SPUwriteDMA),
- DIRECT_SPU(SPUreadDMA),
DIRECT_SPU(SPUwriteDMAMem),
DIRECT_SPU(SPUreadDMAMem),
DIRECT_SPU(SPUplayADPCMchannel),
pc_hook_func (SPU_writeRegister, (unsigned long a0, unsigned short a1, uint32_t a2), (a0, a1, a2), PCNT_SPU)
pc_hook_func_ret(unsigned short,SPU_readRegister, (unsigned long a0), (a0), PCNT_SPU)
-pc_hook_func (SPU_writeDMA, (unsigned short a0), (a0), PCNT_SPU)
-pc_hook_func_ret(unsigned short,SPU_readDMA, (void), (), PCNT_SPU)
pc_hook_func (SPU_writeDMAMem, (unsigned short *a0, int a1, uint32_t a2), (a0, a1, a2), PCNT_SPU)
pc_hook_func (SPU_readDMAMem, (unsigned short *a0, int a1, uint32_t a2), (a0, a1, a2), PCNT_SPU)
pc_hook_func (SPU_playADPCMchannel, (void *a0, unsigned int a1, int a2), (a0, a1, a2), PCNT_SPU)
hook_it(GPU_updateLace);
hook_it(SPU_writeRegister);
hook_it(SPU_readRegister);
- hook_it(SPU_writeDMA);
- hook_it(SPU_readDMA);
hook_it(SPU_writeDMAMem);
hook_it(SPU_readDMAMem);
hook_it(SPU_playADPCMchannel);
CDRreadCDDA CDR_readCDDA;
CDRgetTE CDR_getTE;
-SPUconfigure SPU_configure;
-SPUabout SPU_about;
SPUinit SPU_init;
SPUshutdown SPU_shutdown;
-SPUtest SPU_test;
SPUopen SPU_open;
SPUclose SPU_close;
-SPUplaySample SPU_playSample;
SPUwriteRegister SPU_writeRegister;
SPUreadRegister SPU_readRegister;
-SPUwriteDMA SPU_writeDMA;
-SPUreadDMA SPU_readDMA;
SPUwriteDMAMem SPU_writeDMAMem;
SPUreadDMAMem SPU_readDMAMem;
SPUplayADPCMchannel SPU_playADPCMchannel;
return 0;
}
-void *hSPUDriver = NULL;
-
-long CALLBACK SPU__configure(void) { return 0; }
-void CALLBACK SPU__about(void) {}
-long CALLBACK SPU__test(void) { return 0; }
-void CALLBACK SPU__registerScheduleCb(void (CALLBACK *cb)(unsigned int)) {}
+static void *hSPUDriver = NULL;\r
+static void CALLBACK SPU__registerScheduleCb(void (CALLBACK *cb)(unsigned int)) {}\r
#define LoadSpuSym1(dest, name) \
LoadSym(SPU_##dest, SPU##dest, name, TRUE);
hSPUDriver = SysLoadLibrary(SPUdll);
if (hSPUDriver == NULL) {
- SPU_configure = NULL;
SysMessage (_("Could not load SPU plugin %s!"), SPUdll); return -1;
}
drv = hSPUDriver;
LoadSpuSym1(shutdown, "SPUshutdown");
LoadSpuSym1(open, "SPUopen");
LoadSpuSym1(close, "SPUclose");
- LoadSpuSym0(configure, "SPUconfigure");
- LoadSpuSym0(about, "SPUabout");
- LoadSpuSym0(test, "SPUtest");
LoadSpuSym1(writeRegister, "SPUwriteRegister");
LoadSpuSym1(readRegister, "SPUreadRegister");
- LoadSpuSym1(writeDMA, "SPUwriteDMA");
- LoadSpuSym1(readDMA, "SPUreadDMA");
LoadSpuSym1(writeDMAMem, "SPUwriteDMAMem");
LoadSpuSym1(readDMAMem, "SPUreadDMAMem");
LoadSpuSym1(playADPCMchannel, "SPUplayADPCMchannel");
typedef long (CALLBACK* SPUinit)(void); \r
typedef long (CALLBACK* SPUshutdown)(void); \r
typedef long (CALLBACK* SPUclose)(void); \r
-typedef void (CALLBACK* SPUplaySample)(unsigned char); \r
typedef void (CALLBACK* SPUwriteRegister)(unsigned long, unsigned short, unsigned int);\r
typedef unsigned short (CALLBACK* SPUreadRegister)(unsigned long);\r
-typedef void (CALLBACK* SPUwriteDMA)(unsigned short);\r
-typedef unsigned short (CALLBACK* SPUreadDMA)(void);\r
typedef void (CALLBACK* SPUwriteDMAMem)(unsigned short *, int, unsigned int);\r
typedef void (CALLBACK* SPUreadDMAMem)(unsigned short *, int, unsigned int);\r
typedef void (CALLBACK* SPUplayADPCMchannel)(xa_decode_t *, unsigned int, int);\r
typedef void (CALLBACK* SPUregisterCallback)(void (CALLBACK *callback)(void));\r
typedef void (CALLBACK* SPUregisterScheduleCb)(void (CALLBACK *callback)(unsigned int cycles_after));\r
-typedef long (CALLBACK* SPUconfigure)(void);\r
-typedef long (CALLBACK* SPUtest)(void);\r
-typedef void (CALLBACK* SPUabout)(void);\r
typedef struct {\r
unsigned char PluginName[8];\r
uint32_t PluginVersion;\r
typedef int (CALLBACK* SPUplayCDDAchannel)(short *, int, unsigned int, int);\r
\r
// SPU function pointers\r
-extern SPUconfigure SPU_configure;\r
-extern SPUabout SPU_about;\r
extern SPUinit SPU_init;\r
extern SPUshutdown SPU_shutdown;\r
-extern SPUtest SPU_test;\r
extern SPUopen SPU_open;\r
extern SPUclose SPU_close;\r
-extern SPUplaySample SPU_playSample;\r
extern SPUwriteRegister SPU_writeRegister;\r
extern SPUreadRegister SPU_readRegister;\r
-extern SPUwriteDMA SPU_writeDMA;\r
-extern SPUreadDMA SPU_readDMA;\r
extern SPUwriteDMAMem SPU_writeDMAMem;\r
extern SPUreadDMAMem SPU_readDMAMem;\r
extern SPUplayADPCMchannel SPU_playADPCMchannel;\r
#include "externals.h"\r
#include "registers.h"\r
\r
-////////////////////////////////////////////////////////////////////////\r
-// READ DMA (one value)\r
-////////////////////////////////////////////////////////////////////////\r
-\r
-unsigned short CALLBACK SPUreadDMA(void)\r
-{\r
- unsigned short s = *(unsigned short *)(spu.spuMemC + spu.spuAddr);\r
- check_irq_io(spu.spuAddr);\r
- spu.spuAddr += 2;\r
- spu.spuAddr &= 0x7fffe;\r
-\r
- return s;\r
-}\r
-\r
////////////////////////////////////////////////////////////////////////\r
// READ DMA (many values)\r
////////////////////////////////////////////////////////////////////////\r
spu.spuAddr = addr;\r
}\r
\r
-////////////////////////////////////////////////////////////////////////\r
-////////////////////////////////////////////////////////////////////////\r
-////////////////////////////////////////////////////////////////////////\r
-\r
-////////////////////////////////////////////////////////////////////////\r
-// WRITE DMA (one value)\r
-////////////////////////////////////////////////////////////////////////\r
- \r
-void CALLBACK SPUwriteDMA(unsigned short val)\r
-{\r
- *(unsigned short *)(spu.spuMemC + spu.spuAddr) = val;\r
-\r
- check_irq_io(spu.spuAddr);\r
- spu.spuAddr += 2;\r
- spu.spuAddr &= 0x7fffe;\r
- spu.bMemDirty = 1;\r
-}\r
-\r
////////////////////////////////////////////////////////////////////////\r
// WRITE DMA (many values)\r
////////////////////////////////////////////////////////////////////////\r
return 0;
}
-// SPUTEST: we don't test, we are always fine ;)
-long CALLBACK SPUtest(void)
-{
- return 0;
-}
-
-// SPUCONFIGURE: call config dialog
-long CALLBACK SPUconfigure(void)
-{
-#ifdef _MACOSX
- DoConfiguration();
-#else
-// StartCfgTool("CFG");
-#endif
- return 0;
-}
-
-// SPUABOUT: show about window
-void CALLBACK SPUabout(void)
-{
-#ifdef _MACOSX
- DoAbout();
-#else
-// StartCfgTool("ABOUT");
-#endif
-}
-
// SETUP CALLBACKS
// this functions will be called once,
// passes a callback that should be called on SPU-IRQ/cdda volume change