X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fexternals.h;h=9fb58ad24dac580f0d0eb2e279789ff8b7df1ca1;hb=38e4048faeaccf7fdc6084f64866f2ea52bb97f1;hp=1cfef66147f7d4facea77425f7fdb28e826f15fd;hpb=6c9db47c7c54b925e00a96b17faa05e17d6af262;p=pcsx_rearmed.git diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 1cfef661..9fb58ad2 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -15,6 +15,9 @@ * * ***************************************************************************/ +#ifndef __P_SOUND_EXTERNALS_H__ +#define __P_SOUND_EXTERNALS_H__ + #include ///////////////////////////////////////////////////////// @@ -114,8 +117,14 @@ 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 - int iLeftVolume; // left volume - int iRightVolume; // right volume + 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; @@ -173,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; + signed short val[4]; + } gauss; + int simple[5]; // 28-32 + } interp; + int sinc_old; + }; +} sample_buf; typedef struct { @@ -188,6 +211,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; @@ -207,7 +231,7 @@ typedef struct 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; @@ -228,11 +252,13 @@ typedef struct REVERBInfo * rvb; // buffers - int * SB; + void * unused; int * SSumLR; - int pad[29]; unsigned short regArea[0x400]; + + sample_buf sb[MAXCHAN]; + int interpolation; } SPUInfo; #define regAreaGet(offset) \ @@ -250,12 +276,14 @@ 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 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) #endif +#endif /* __P_SOUND_EXTERNALS_H__ */