X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fexternals.h;h=fef5f9ccc365b2bc7d29a247ada1e570d75c52e1;hb=25f460eca64d55f980ab57851ffbd9fe58a5793c;hp=4407177a9fdae5902824f49197c4e3ed329875dd;hpb=b34d6a805a50ee4a897b0a53bbc0b89e3eb7f72e;p=pcsx_rearmed.git diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 4407177a..fef5f9cc 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -117,7 +117,6 @@ typedef struct unsigned int bFMod:2; // freq mod (0=off, 1=sound channel, 2=freq channel) unsigned int prevflags:3; // flags from previous block unsigned int bIgnoreLoop:1; // Ignore loop - unsigned int bNewPitch:1; // pitch changed unsigned int bStarting:1; // starting after keyon union { struct { @@ -183,7 +182,21 @@ typedef struct // psx buffers / addresses -#define SB_SIZE (32 + 4) +typedef union +{ + int SB[28 + 4 + 4]; + struct { + int sample[28]; + union { + struct { + int pos; + int val[4]; + } gauss; + int simple[5]; // 28-32 + } interp; + int sinc_old; + }; +} sample_buf; typedef struct { @@ -191,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; @@ -211,11 +219,30 @@ 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; + + unsigned int last_keyon_cycles; + + union { + unsigned char *spuMemC; + unsigned short *spuMem; + }; + unsigned char * pSpuIrq; + unsigned char * pSpuBuffer; short * pS; - void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq - void (CALLBACK *cddavCallback)(short, short); + SPUCHAN * s_chan; + REVERBInfo * rvb; + + int * SSumLR; + + void (CALLBACK *irqCallback)(int); + //void (CALLBACK *cddavCallback)(short, short); void (CALLBACK *scheduleCallback)(unsigned int); const xa_decode_t * xapGlobal; @@ -229,20 +256,11 @@ typedef struct unsigned int * CDDAStart; unsigned int * CDDAEnd; - unsigned int XARepeat; - unsigned int XALastVal; - - int iLeftXAVol; - int iRightXAVol; - - SPUCHAN * s_chan; - REVERBInfo * rvb; - - // buffers - int * SB; - int * SSumLR; - unsigned short regArea[0x400]; + + sample_buf sb[MAXCHAN]; + int interpolation; + sample_buf sb_thread[MAXCHAN]; } SPUInfo; #define regAreaGet(offset) \ @@ -261,6 +279,7 @@ extern SPUInfo spu; void do_samples(unsigned int cycles_to, int do_sync); void schedule_next_irq(void); void check_irq_io(unsigned int addr); +void do_irq_io(int cycles_after); #define do_samples_if_needed(c, sync, samples) \ do { \