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;\r
CDRgetTE CDR_getTE;\r
\r
-SPUconfigure SPU_configure;\r
-SPUabout SPU_about;\r
SPUinit SPU_init;\r
SPUshutdown SPU_shutdown;\r
-SPUtest SPU_test;\r
SPUopen SPU_open;\r
SPUclose SPU_close;\r
-SPUplaySample SPU_playSample;\r
SPUwriteRegister SPU_writeRegister;\r
SPUreadRegister SPU_readRegister;\r
-SPUwriteDMA SPU_writeDMA;\r
-SPUreadDMA SPU_readDMA;\r
SPUwriteDMAMem SPU_writeDMAMem;\r
SPUreadDMAMem SPU_readDMAMem;\r
SPUplayADPCMchannel SPU_playADPCMchannel;\r
return 0;\r
}\r
\r
-void *hSPUDriver = NULL;\r
-\r
-long CALLBACK SPU__configure(void) { return 0; }\r
-void CALLBACK SPU__about(void) {}\r
-long CALLBACK SPU__test(void) { return 0; }\r
-void CALLBACK SPU__registerScheduleCb(void (CALLBACK *cb)(unsigned int)) {}\r
+static void *hSPUDriver = NULL;\r
+static void CALLBACK SPU__registerScheduleCb(void (CALLBACK *cb)(unsigned int)) {}\r
\r
#define LoadSpuSym1(dest, name) \\r
LoadSym(SPU_##dest, SPU##dest, name, TRUE);\r
\r
hSPUDriver = SysLoadLibrary(SPUdll);\r
if (hSPUDriver == NULL) {\r
- SPU_configure = NULL;\r
SysMessage (_("Could not load SPU plugin %s!"), SPUdll); return -1;\r
}\r
drv = hSPUDriver;\r
LoadSpuSym1(shutdown, "SPUshutdown");\r
LoadSpuSym1(open, "SPUopen");\r
LoadSpuSym1(close, "SPUclose");\r
- LoadSpuSym0(configure, "SPUconfigure");\r
- LoadSpuSym0(about, "SPUabout");\r
- LoadSpuSym0(test, "SPUtest");\r
LoadSpuSym1(writeRegister, "SPUwriteRegister");\r
LoadSpuSym1(readRegister, "SPUreadRegister"); \r
- LoadSpuSym1(writeDMA, "SPUwriteDMA");\r
- LoadSpuSym1(readDMA, "SPUreadDMA");\r
LoadSpuSym1(writeDMAMem, "SPUwriteDMAMem");\r
LoadSpuSym1(readDMAMem, "SPUreadDMAMem");\r
LoadSpuSym1(playADPCMchannel, "SPUplayADPCMchannel");\r
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