From: notaz Date: Fri, 25 Aug 2023 19:39:19 +0000 (+0300) Subject: spu: rm bunch of unused functions X-Git-Tag: r24l~226 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ae52bc928c4b0106b14f2c715e87f1f1c016c75;p=pcsx_rearmed.git spu: rm bunch of unused functions --- diff --git a/frontend/plugin.c b/frontend/plugin.c index 1eac5798..33f3c8d7 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -28,19 +28,13 @@ extern long CALLBACK SPUopen(void); 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); @@ -165,18 +159,12 @@ static const struct { 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), @@ -303,8 +291,6 @@ pc_hook_func (GPU_updateLace, (void), (), PCNT_GPU) 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) @@ -330,8 +316,6 @@ void pcnt_hook_plugins(void) 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); diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index 4f0897e2..6886a6a0 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -71,18 +71,12 @@ CDRsetfilename CDR_setfilename; 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; @@ -314,12 +308,8 @@ static int LoadCDRplugin(const char *CDRdll) { 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; +static void CALLBACK SPU__registerScheduleCb(void (CALLBACK *cb)(unsigned int)) {} #define LoadSpuSym1(dest, name) \ LoadSym(SPU_##dest, SPU##dest, name, TRUE); @@ -336,7 +326,6 @@ static int LoadSPUplugin(const char *SPUdll) { hSPUDriver = SysLoadLibrary(SPUdll); if (hSPUDriver == NULL) { - SPU_configure = NULL; SysMessage (_("Could not load SPU plugin %s!"), SPUdll); return -1; } drv = hSPUDriver; @@ -344,13 +333,8 @@ static int LoadSPUplugin(const char *SPUdll) { 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"); diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index ac89d1ff..f74489f3 100644 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -163,19 +163,13 @@ extern CDRgetTE CDR_getTE; typedef long (CALLBACK* SPUinit)(void); typedef long (CALLBACK* SPUshutdown)(void); typedef long (CALLBACK* SPUclose)(void); -typedef void (CALLBACK* SPUplaySample)(unsigned char); typedef void (CALLBACK* SPUwriteRegister)(unsigned long, unsigned short, unsigned int); typedef unsigned short (CALLBACK* SPUreadRegister)(unsigned long); -typedef void (CALLBACK* SPUwriteDMA)(unsigned short); -typedef unsigned short (CALLBACK* SPUreadDMA)(void); typedef void (CALLBACK* SPUwriteDMAMem)(unsigned short *, int, unsigned int); typedef void (CALLBACK* SPUreadDMAMem)(unsigned short *, int, unsigned int); typedef void (CALLBACK* SPUplayADPCMchannel)(xa_decode_t *, unsigned int, int); typedef void (CALLBACK* SPUregisterCallback)(void (CALLBACK *callback)(void)); typedef void (CALLBACK* SPUregisterScheduleCb)(void (CALLBACK *callback)(unsigned int cycles_after)); -typedef long (CALLBACK* SPUconfigure)(void); -typedef long (CALLBACK* SPUtest)(void); -typedef void (CALLBACK* SPUabout)(void); typedef struct { unsigned char PluginName[8]; uint32_t PluginVersion; @@ -195,18 +189,12 @@ typedef void (CALLBACK* SPUasync)(uint32_t, uint32_t); typedef int (CALLBACK* SPUplayCDDAchannel)(short *, int, unsigned int, int); // SPU function pointers -extern SPUconfigure SPU_configure; -extern SPUabout SPU_about; extern SPUinit SPU_init; extern SPUshutdown SPU_shutdown; -extern SPUtest SPU_test; extern SPUopen SPU_open; extern SPUclose SPU_close; -extern SPUplaySample SPU_playSample; extern SPUwriteRegister SPU_writeRegister; extern SPUreadRegister SPU_readRegister; -extern SPUwriteDMA SPU_writeDMA; -extern SPUreadDMA SPU_readDMA; extern SPUwriteDMAMem SPU_writeDMAMem; extern SPUreadDMAMem SPU_readDMAMem; extern SPUplayADPCMchannel SPU_playADPCMchannel; diff --git a/plugins/dfsound/dma.c b/plugins/dfsound/dma.c index eb85a731..533d95e9 100644 --- a/plugins/dfsound/dma.c +++ b/plugins/dfsound/dma.c @@ -22,20 +22,6 @@ #include "externals.h" #include "registers.h" -//////////////////////////////////////////////////////////////////////// -// READ DMA (one value) -//////////////////////////////////////////////////////////////////////// - -unsigned short CALLBACK SPUreadDMA(void) -{ - unsigned short s = *(unsigned short *)(spu.spuMemC + spu.spuAddr); - check_irq_io(spu.spuAddr); - spu.spuAddr += 2; - spu.spuAddr &= 0x7fffe; - - return s; -} - //////////////////////////////////////////////////////////////////////// // READ DMA (many values) //////////////////////////////////////////////////////////////////////// @@ -60,24 +46,6 @@ void CALLBACK SPUreadDMAMem(unsigned short *pusPSXMem, int iSize, spu.spuAddr = addr; } -//////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////// -// WRITE DMA (one value) -//////////////////////////////////////////////////////////////////////// - -void CALLBACK SPUwriteDMA(unsigned short val) -{ - *(unsigned short *)(spu.spuMemC + spu.spuAddr) = val; - - check_irq_io(spu.spuAddr); - spu.spuAddr += 2; - spu.spuAddr &= 0x7fffe; - spu.bMemDirty = 1; -} - //////////////////////////////////////////////////////////////////////// // WRITE DMA (many values) //////////////////////////////////////////////////////////////////////// diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 4dc762f6..0c4e4f86 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -1563,33 +1563,6 @@ long CALLBACK SPUshutdown(void) 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