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 19:39:19 +0000 (22:39 +0300)
frontend/plugin.c
libpcsxcore/plugins.c
libpcsxcore/plugins.h
plugins/dfsound/dma.c
plugins/dfsound/spu.c

index d2d3dba..0bfc2aa 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);
@@ -123,18 +117,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),
@@ -261,8 +249,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)
@@ -288,8 +274,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 23474f1..a77c728 100644 (file)
@@ -70,18 +70,12 @@ CDRsetfilename        CDR_setfilename;
 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
@@ -313,12 +307,8 @@ static int LoadCDRplugin(const char *CDRdll) {
        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
@@ -335,7 +325,6 @@ static int LoadSPUplugin(const char *SPUdll) {
 \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
@@ -343,13 +332,8 @@ static int LoadSPUplugin(const char *SPUdll) {
        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
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