X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfsound%2Fexternals.h;h=909639926bc35de62e0db4c6cbaaa837f4531f25;hp=2f3028eefba5de6c1a5cddef31b3da0e2b56a397;hb=650adfd2da779ba8855623362c2900583e22931e;hpb=2b30c1291db9d9801d51cf85f71f40fe54958898 diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 2f3028ee..90963992 100644 --- a/plugins/dfsound/externals.h +++ b/plugins/dfsound/externals.h @@ -46,10 +46,8 @@ // num of channels #define MAXCHAN 24 -// ~ FRAG_MSECS ms of data // note: must be even due to the way reverb works now -#define FRAG_MSECS 2 -#define NSSIZE ((44100 * FRAG_MSECS / 1000 + 1) & ~1) +#define NSSIZE ((44100 / 50 + 16) & ~1) /////////////////////////////////////////////////////////// // struct defines @@ -90,6 +88,7 @@ typedef struct int iSBPos; // mixing stuff int spos; int sinc; + int sinc_inv; unsigned char * pCurr; // current pos in sound mem unsigned char * pLoop; // loop ptr in sound mem @@ -191,7 +190,6 @@ extern int iUseReverb; extern int iUseInterpolation; // MISC -extern int had_dma; extern int decode_pos; extern SPUCHAN s_chan[]; @@ -209,11 +207,21 @@ extern unsigned int dwChannelDead; extern int SSumR[]; extern int SSumL[]; -extern int iCycle; extern short * pS; extern void (CALLBACK *cddavCallback)(unsigned short,unsigned short); +extern unsigned int cycles_played; + +void do_samples(unsigned int cycles_to); +void schedule_next_irq(void); + +#define do_samples_if_needed(c) \ + do { \ + if ((int)((c) - cycles_played) >= 16 * 768) \ + do_samples(c); \ + } while (0) + #endif ///////////////////////////////////////////////////////////