X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fdfsound%2Fexternals.h;h=4407177a9fdae5902824f49197c4e3ed329875dd;hb=403a6290ffad888ab6e3ca05ce4736f052e4147f;hp=4fb3b9317c092d245f3b87a8ede0e3fc7b86f2d5;hpb=d56340b165b4a7ef25bc3c7509d4f2315843bc31;p=pcsx_rearmed.git diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 4fb3b931..4407177a 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -24,6 +24,9 @@ // generic defines ///////////////////////////////////////////////////////// +//#define log_unhandled printf +#define log_unhandled(...) + #ifdef __GNUC__ #define noinline __attribute__((noinline)) #define unlikely(x) __builtin_expect((x), 0) @@ -113,9 +116,16 @@ typedef struct unsigned int bNoise:1; // noise active flag unsigned int bFMod:2; // freq mod (0=off, 1=sound channel, 2=freq channel) unsigned int prevflags:3; // flags from previous block - - int iLeftVolume; // left volume - int iRightVolume; // right volume + unsigned int bIgnoreLoop:1; // Ignore loop + unsigned int bNewPitch:1; // pitch changed + unsigned int bStarting:1; // starting after keyon + union { + struct { + int iLeftVolume; // left volume + int iRightVolume; // right volume + }; + int iVolume[2]; + }; ADSRInfoEx ADSRX; int iRawPitch; // raw pitch (0...3fff) } SPUCHAN; @@ -188,6 +198,7 @@ typedef struct unsigned char * pSpuIrq; unsigned int cycles_played; + unsigned int cycles_dma_end; int decode_pos; int decode_dirty_ch; unsigned int bSpuInit:1; @@ -197,17 +208,17 @@ typedef struct unsigned int dwNoiseVal; // global noise generator unsigned int dwNoiseCount; unsigned int dwNewChannel; // flags for faster testing, if new channel starts - unsigned int dwChannelOn; // not silent channels + unsigned int dwChannelsAudible; // not silent channels unsigned int dwChannelDead; // silent+not useful channels unsigned char * pSpuBuffer; short * pS; void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq - void (CALLBACK *cddavCallback)(unsigned short,unsigned short); + void (CALLBACK *cddavCallback)(short, short); void (CALLBACK *scheduleCallback)(unsigned int); - xa_decode_t * xapGlobal; + const xa_decode_t * xapGlobal; unsigned int * XAFeed; unsigned int * XAPlay; unsigned int * XAStart; @@ -231,10 +242,14 @@ typedef struct int * SB; int * SSumLR; - int pad[29]; unsigned short regArea[0x400]; } SPUInfo; +#define regAreaGet(offset) \ + spu.regArea[((offset) - 0xc00)>>1] +#define regAreaGetCh(ch, offset) \ + spu.regArea[((ch<<4)|(offset))>>1] + /////////////////////////////////////////////////////////// // SPU.C globals /////////////////////////////////////////////////////////// @@ -245,13 +260,11 @@ 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); -#define regAreaGet(ch,offset) \ - spu.regArea[((ch<<4)|(offset))>>1] - -#define do_samples_if_needed(c, sync) \ +#define do_samples_if_needed(c, sync, samples) \ do { \ - if (sync || (int)((c) - spu.cycles_played) >= 16 * 768) \ + if (sync || (int)((c) - spu.cycles_played) >= (samples) * 768) \ do_samples(c, sync); \ } while (0)