spu: rearrange struct to reduce padding
authornotaz <notasas@gmail.com>
Tue, 10 Oct 2023 20:48:42 +0000 (23:48 +0300)
committernotaz <notasas@gmail.com>
Tue, 10 Oct 2023 20:48:42 +0000 (23:48 +0300)
plugins/dfsound/externals.h
plugins/dfsound/registers.c
plugins/dfsound/spu.c

index 297c2c3..4e1a40b 100644 (file)
@@ -204,11 +204,6 @@ typedef struct
  unsigned short  spuStat;\r
 \r
  unsigned int    spuAddr;\r
- union {\r
-  unsigned char  *spuMemC;\r
-  unsigned short *spuMem;\r
- };\r
- unsigned char * pSpuIrq;\r
 \r
  unsigned int    cycles_played;\r
  unsigned int    cycles_dma_end;\r
@@ -224,11 +219,28 @@ typedef struct
  unsigned int    dwChannelsAudible;    // not silent channels\r
  unsigned int    dwChannelDead;        // silent+not useful channels\r
 \r
+ unsigned int    XARepeat;\r
+ unsigned int    XALastVal;\r
+\r
+ int             iLeftXAVol;\r
+ int             iRightXAVol;\r
+\r
+ union {\r
+  unsigned char  *spuMemC;\r
+  unsigned short *spuMem;\r
+ };\r
+ unsigned char * pSpuIrq;\r
+\r
  unsigned char * pSpuBuffer;\r
  short         * pS;\r
 \r
+ SPUCHAN       * s_chan;\r
+ REVERBInfo    * rvb;\r
+\r
+ int           * SSumLR;\r
+\r
  void (CALLBACK *irqCallback)(void);   // func of main emu, called on spu irq\r
- void (CALLBACK *cddavCallback)(short, short);\r
//void (CALLBACK *cddavCallback)(short, short);\r
  void (CALLBACK *scheduleCallback)(unsigned int);\r
 \r
  const xa_decode_t * xapGlobal;\r
@@ -242,19 +254,6 @@ typedef struct
  unsigned int  * CDDAStart;\r
  unsigned int  * CDDAEnd;\r
 \r
- unsigned int    XARepeat;\r
- unsigned int    XALastVal;\r
-\r
- int             iLeftXAVol;\r
- int             iRightXAVol;\r
-\r
- SPUCHAN       * s_chan;\r
- REVERBInfo    * rvb;\r
-\r
- // buffers\r
- void          * unused;\r
- int           * SSumLR;\r
-\r
  unsigned short  regArea[0x400];\r
 \r
  sample_buf      sb[MAXCHAN];\r
index 2796f9c..1e3767a 100644 (file)
@@ -232,11 +232,11 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val,
     //-------------------------------------------------//\r
     case H_CDLeft:\r
       spu.iLeftXAVol=(int16_t)val;\r
-      if(spu.cddavCallback) spu.cddavCallback(0,(int16_t)val);\r
+      //if(spu.cddavCallback) spu.cddavCallback(0,(int16_t)val);\r
       break;\r
     case H_CDRight:\r
       spu.iRightXAVol=(int16_t)val;\r
-      if(spu.cddavCallback) spu.cddavCallback(1,(int16_t)val);\r
+      //if(spu.cddavCallback) spu.cddavCallback(1,(int16_t)val);\r
       break;\r
     //-------------------------------------------------//\r
     case H_FMod1:\r
index 8edcd4d..f29ca4f 100644 (file)
@@ -1609,7 +1609,7 @@ void CALLBACK SPUregisterCallback(void (CALLBACK *callback)(void))
 
 void CALLBACK SPUregisterCDDAVolume(void (CALLBACK *CDDAVcallback)(short, short))
 {
- spu.cddavCallback = CDDAVcallback;
//spu.cddavCallback = CDDAVcallback;
 }
 
 void CALLBACK SPUregisterScheduleCb(void (CALLBACK *callback)(unsigned int))