diff options
author | Twinaphex | 2014-12-20 20:43:18 +0100 |
---|---|---|
committer | Twinaphex | 2014-12-20 20:43:18 +0100 |
commit | 247fc699be6b3bd95fd9126541e0804cc8dffdd4 (patch) | |
tree | d38e169e68e48a3ccbf8a3805f9cb87197ed894a /plugins/dfsound/externals.h | |
parent | 3e5b01fcef8ef20dacca45ea7a7b0c461e6bd666 (diff) | |
parent | 7931825ed8ef51dab3e37475d8126103ebc9fb6f (diff) | |
download | pcsx_rearmed-247fc699be6b3bd95fd9126541e0804cc8dffdd4.tar.gz pcsx_rearmed-247fc699be6b3bd95fd9126541e0804cc8dffdd4.tar.bz2 pcsx_rearmed-247fc699be6b3bd95fd9126541e0804cc8dffdd4.zip |
Merge pull request #11 from notaz/upstream_merge
Upstream merge
Diffstat (limited to 'plugins/dfsound/externals.h')
-rw-r--r-- | plugins/dfsound/externals.h | 121 |
1 files changed, 58 insertions, 63 deletions
diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h index 2f3028e..7935cb9 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
@@ -167,86 +166,82 @@ typedef struct } REVERBInfo;
///////////////////////////////////////////////////////////
-// SPU.C globals
-///////////////////////////////////////////////////////////
-
-#ifndef _IN_SPU
// psx buffers / addresses
-extern unsigned short regArea[];
-extern unsigned short spuMem[];
-extern unsigned char * spuMemC;
-extern unsigned char * pSpuIrq;
-extern unsigned char * pSpuBuffer;
+typedef struct
+{
+ unsigned short spuCtrl;
+ unsigned short spuStat;
+
+ unsigned int spuAddr;
+ unsigned char * spuMemC;
+ unsigned char * pSpuIrq;
-#define regAreaGet(ch,offset) \
- regArea[((ch<<4)|(offset))>>1]
+ unsigned int cycles_played;
+ int decode_pos;
+ int decode_dirty_ch;
+ unsigned int bSpuInit:1;
+ unsigned int bSPUIsOpen:1;
-// user settings
+ 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 dwChannelDead; // silent+not useful channels
-extern int iVolume;
-extern int iXAPitch;
-extern int iUseReverb;
-extern int iUseInterpolation;
-// MISC
+ unsigned char * pSpuBuffer;
+ short * pS;
-extern int had_dma;
-extern int decode_pos;
+ void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq
+ void (CALLBACK *cddavCallback)(unsigned short,unsigned short);
+ void (CALLBACK *scheduleCallback)(unsigned int);
-extern SPUCHAN s_chan[];
-extern REVERBInfo rvb;
+ int * sRVBStart;
-extern unsigned short spuCtrl;
-extern unsigned short spuStat;
-extern unsigned short spuIrq;
-extern unsigned int spuAddr;
-extern int bSpuInit;
-extern unsigned int dwNewChannel;
-extern unsigned int dwChannelOn;
-extern unsigned int dwPendingChanOff;
-extern unsigned int dwChannelDead;
+ xa_decode_t * xapGlobal;
+ unsigned int * XAFeed;
+ unsigned int * XAPlay;
+ unsigned int * XAStart;
+ unsigned int * XAEnd;
-extern int SSumR[];
-extern int SSumL[];
-extern int iCycle;
-extern short * pS;
+ unsigned int * CDDAFeed;
+ unsigned int * CDDAPlay;
+ unsigned int * CDDAStart;
+ unsigned int * CDDAEnd;
-extern void (CALLBACK *cddavCallback)(unsigned short,unsigned short);
+ unsigned int XARepeat;
+ unsigned int XALastVal;
-#endif
+ int iLeftXAVol;
+ int iRightXAVol;
+
+ int pad[32];
+ unsigned short regArea[0x400];
+ unsigned short spuMem[256*1024];
+} SPUInfo;
///////////////////////////////////////////////////////////
-// XA.C globals
+// SPU.C globals
///////////////////////////////////////////////////////////
-#ifndef _IN_XA
+#ifndef _IN_SPU
-extern xa_decode_t * xapGlobal;
+extern SPUInfo spu;
+extern SPUCHAN s_chan[];
+extern REVERBInfo rvb;
-extern uint32_t * XAFeed;
-extern uint32_t * XAPlay;
-extern uint32_t * XAStart;
-extern uint32_t * XAEnd;
+void do_samples(unsigned int cycles_to);
+void schedule_next_irq(void);
-extern uint32_t * CDDAFeed;
-extern uint32_t * CDDAPlay;
-extern uint32_t * CDDAStart;
-extern uint32_t * CDDAEnd;
+#define regAreaGet(ch,offset) \
+ spu.regArea[((ch<<4)|(offset))>>1]
-extern int iLeftXAVol;
-extern int iRightXAVol;
+#define do_samples_if_needed(c) \
+ do { \
+ if ((int)((c) - spu.cycles_played) >= 16 * 768) \
+ do_samples(c); \
+ } while (0)
#endif
-///////////////////////////////////////////////////////////
-// REVERB.C globals
-///////////////////////////////////////////////////////////
-
-#ifndef _IN_REVERB
-
-extern int * sRVBPlay;
-extern int * sRVBEnd;
-extern int * sRVBStart;
-
-#endif
|