From 7285d7ad81bd55b5be49c6e7ee71d0583e84327d Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 10 Oct 2023 23:48:42 +0300 Subject: [PATCH] spu: rearrange struct to reduce padding --- plugins/dfsound/externals.h | 37 ++++++++++++++++++------------------- plugins/dfsound/registers.c | 4 ++-- plugins/dfsound/spu.c | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 297c2c39..4e1a40bc 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -204,11 +204,6 @@ typedef struct unsigned short spuStat; unsigned int spuAddr; - union { - unsigned char *spuMemC; - unsigned short *spuMem; - }; - unsigned char * pSpuIrq; unsigned int cycles_played; unsigned int cycles_dma_end; @@ -224,11 +219,28 @@ typedef struct unsigned int dwChannelsAudible; // not silent channels unsigned int dwChannelDead; // silent+not useful channels + unsigned int XARepeat; + unsigned int XALastVal; + + int iLeftXAVol; + int iRightXAVol; + + union { + unsigned char *spuMemC; + unsigned short *spuMem; + }; + unsigned char * pSpuIrq; + unsigned char * pSpuBuffer; short * pS; + SPUCHAN * s_chan; + REVERBInfo * rvb; + + int * SSumLR; + void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq - void (CALLBACK *cddavCallback)(short, short); + //void (CALLBACK *cddavCallback)(short, short); void (CALLBACK *scheduleCallback)(unsigned int); const xa_decode_t * xapGlobal; @@ -242,19 +254,6 @@ typedef struct unsigned int * CDDAStart; unsigned int * CDDAEnd; - unsigned int XARepeat; - unsigned int XALastVal; - - int iLeftXAVol; - int iRightXAVol; - - SPUCHAN * s_chan; - REVERBInfo * rvb; - - // buffers - void * unused; - int * SSumLR; - unsigned short regArea[0x400]; sample_buf sb[MAXCHAN]; diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index 2796f9c3..1e3767ad 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -232,11 +232,11 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val, //-------------------------------------------------// case H_CDLeft: spu.iLeftXAVol=(int16_t)val; - if(spu.cddavCallback) spu.cddavCallback(0,(int16_t)val); + //if(spu.cddavCallback) spu.cddavCallback(0,(int16_t)val); break; case H_CDRight: spu.iRightXAVol=(int16_t)val; - if(spu.cddavCallback) spu.cddavCallback(1,(int16_t)val); + //if(spu.cddavCallback) spu.cddavCallback(1,(int16_t)val); break; //-------------------------------------------------// case H_FMod1: diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 8edcd4db..f29ca4fa 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -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)) -- 2.39.5