X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfsound%2Fexternals.h;h=f6fc4409d3f3fb50a8e9451b03a90263d4efdb3a;hp=d1d081af744fecfd5eef463fab390c950431c818;hb=05c7cec77522f04857f655474574469a5e66661d;hpb=9ad8abfa940cd5c13eb0653639ea86736b65a2c4 diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index d1d081af..f6fc4409 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -28,6 +28,11 @@ #define noinline #define unlikely(x) x #endif +#if defined(__GNUC__) && !defined(_TMS320C6X) +#define preload __builtin_prefetch +#else +#define preload(...) +#endif #define PSE_LT_SPU 4 #define PSE_SPU_ERR_SUCCESS 0 @@ -110,8 +115,6 @@ typedef struct int iRightVolume; // right volume ADSRInfoEx ADSRX; int iRawPitch; // raw pitch (0...3fff) - - int SB[32+4]; } SPUCHAN; /////////////////////////////////////////////////////////// @@ -123,8 +126,6 @@ typedef struct int VolLeft; int VolRight; - int iRVBLeft; - int iRVBRight; int FB_SRC_A; // (offset) int FB_SRC_B; // (offset) @@ -175,13 +176,18 @@ typedef struct // psx buffers / addresses +#define SB_SIZE (32 + 4) + typedef struct { unsigned short spuCtrl; unsigned short spuStat; unsigned int spuAddr; - unsigned char * spuMemC; + union { + unsigned char *spuMemC; + unsigned short *spuMem; + }; unsigned char * pSpuIrq; unsigned int cycles_played; @@ -203,8 +209,6 @@ typedef struct void (CALLBACK *cddavCallback)(unsigned short,unsigned short); void (CALLBACK *scheduleCallback)(unsigned int); - int * sRVBStart; - xa_decode_t * xapGlobal; unsigned int * XAFeed; unsigned int * XAPlay; @@ -222,9 +226,15 @@ typedef struct int iLeftXAVol; int iRightXAVol; - int pad[32]; + SPUCHAN * s_chan; + REVERBInfo * rvb; + + // buffers + int * SB; + int * SSumLR; + + int pad[29]; unsigned short regArea[0x400]; - unsigned short spuMem[256*1024]; } SPUInfo; /////////////////////////////////////////////////////////// @@ -234,19 +244,17 @@ typedef struct #ifndef _IN_SPU extern SPUInfo spu; -extern SPUCHAN s_chan[]; -extern REVERBInfo rvb; -void do_samples(unsigned int cycles_to); +void do_samples(unsigned int cycles_to, int do_sync); void schedule_next_irq(void); #define regAreaGet(ch,offset) \ spu.regArea[((ch<<4)|(offset))>>1] -#define do_samples_if_needed(c) \ +#define do_samples_if_needed(c, sync) \ do { \ - if ((int)((c) - spu.cycles_played) >= 16 * 768) \ - do_samples(c); \ + if (sync || (int)((c) - spu.cycles_played) >= 16 * 768) \ + do_samples(c, sync); \ } while (0) #endif