spu: rm bunch of unused functions
authornotaz <notasas@gmail.com>
Fri, 25 Aug 2023 19:39:19 +0000 (22:39 +0300)
committernotaz <notasas@gmail.com>
Fri, 25 Aug 2023 23:11:49 +0000 (02:11 +0300)
frontend/plugin.c
libpcsxcore/plugins.c
libpcsxcore/plugins.h
plugins/dfsound/dma.c
plugins/dfsound/spu.c

index 1eac579..33f3c8d 100644 (file)
@@ -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);
index 4f0897e..6886a6a 100644 (file)
@@ -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;\r
+static void CALLBACK SPU__registerScheduleCb(void (CALLBACK *cb)(unsigned int)) {}\r
 
 #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");
index ac89d1f..f74489f 100644 (file)
@@ -163,19 +163,13 @@ extern CDRgetTE              CDR_getTE;
 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
@@ -195,18 +189,12 @@ typedef void (CALLBACK* SPUasync)(uint32_t, uint32_t);
 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
index eb85a73..533d95e 100644 (file)
 #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
@@ -60,24 +46,6 @@ void CALLBACK SPUreadDMAMem(unsigned short *pusPSXMem, int iSize,
  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
index 4dc762f..0c4e4f8 100644 (file)
@@ -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