notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spu: make fmod work in threaded mode
[pcsx_rearmed.git]
/
plugins
/
dfsound
/
externals.h
diff --git
a/plugins/dfsound/externals.h
b/plugins/dfsound/externals.h
index
2db75ac
..
297c2c3
100644
(file)
--- a/
plugins/dfsound/externals.h
+++ b/
plugins/dfsound/externals.h
@@
-15,12
+15,18
@@
* *
\r
***************************************************************************/
\r
\r
* *
\r
***************************************************************************/
\r
\r
+#ifndef __P_SOUND_EXTERNALS_H__
\r
+#define __P_SOUND_EXTERNALS_H__
\r
+
\r
#include <stdint.h>
\r
\r
/////////////////////////////////////////////////////////
\r
// generic defines
\r
/////////////////////////////////////////////////////////
\r
\r
#include <stdint.h>
\r
\r
/////////////////////////////////////////////////////////
\r
// generic defines
\r
/////////////////////////////////////////////////////////
\r
\r
+//#define log_unhandled printf
\r
+#define log_unhandled(...)
\r
+
\r
#ifdef __GNUC__
\r
#define noinline __attribute__((noinline))
\r
#define unlikely(x) __builtin_expect((x), 0)
\r
#ifdef __GNUC__
\r
#define noinline __attribute__((noinline))
\r
#define unlikely(x) __builtin_expect((x), 0)
\r
@@
-110,9
+116,15
@@
typedef struct
unsigned int bNoise:1; // noise active flag
\r
unsigned int bFMod:2; // freq mod (0=off, 1=sound channel, 2=freq channel)
\r
unsigned int prevflags:3; // flags from previous block
\r
unsigned int bNoise:1; // noise active flag
\r
unsigned int bFMod:2; // freq mod (0=off, 1=sound channel, 2=freq channel)
\r
unsigned int prevflags:3; // flags from previous block
\r
-
\r
- int iLeftVolume; // left volume
\r
- int iRightVolume; // right volume
\r
+ unsigned int bIgnoreLoop:1; // Ignore loop
\r
+ unsigned int bStarting:1; // starting after keyon
\r
+ union {
\r
+ struct {
\r
+ int iLeftVolume; // left volume
\r
+ int iRightVolume; // right volume
\r
+ };
\r
+ int iVolume[2];
\r
+ };
\r
ADSRInfoEx ADSRX;
\r
int iRawPitch; // raw pitch (0...3fff)
\r
} SPUCHAN;
\r
ADSRInfoEx ADSRX;
\r
int iRawPitch; // raw pitch (0...3fff)
\r
} SPUCHAN;
\r
@@
-170,7
+182,21
@@
typedef struct
\r
// psx buffers / addresses
\r
\r
\r
// psx buffers / addresses
\r
\r
-#define SB_SIZE (32 + 4)
\r
+typedef union
\r
+{
\r
+ int SB[28 + 4 + 4];
\r
+ struct {
\r
+ int sample[28];
\r
+ union {
\r
+ struct {
\r
+ int pos;
\r
+ signed short val[4];
\r
+ } gauss;
\r
+ int simple[5]; // 28-32
\r
+ } interp;
\r
+ int sinc_old;
\r
+ };
\r
+} sample_buf;
\r
\r
typedef struct
\r
{
\r
\r
typedef struct
\r
{
\r
@@
-185,6
+211,7
@@
typedef struct
unsigned char * pSpuIrq;
\r
\r
unsigned int cycles_played;
\r
unsigned char * pSpuIrq;
\r
\r
unsigned int cycles_played;
\r
+ unsigned int cycles_dma_end;
\r
int decode_pos;
\r
int decode_dirty_ch;
\r
unsigned int bSpuInit:1;
\r
int decode_pos;
\r
int decode_dirty_ch;
\r
unsigned int bSpuInit:1;
\r
@@
-194,17
+221,17
@@
typedef struct
unsigned int dwNoiseVal; // global noise generator
\r
unsigned int dwNoiseCount;
\r
unsigned int dwNewChannel; // flags for faster testing, if new channel starts
\r
unsigned int dwNoiseVal; // global noise generator
\r
unsigned int dwNoiseCount;
\r
unsigned int dwNewChannel; // flags for faster testing, if new channel starts
\r
- unsigned int dwChannel
On;
// not silent channels
\r
+ unsigned int dwChannel
sAudible;
// not silent channels
\r
unsigned int dwChannelDead; // silent+not useful channels
\r
\r
unsigned char * pSpuBuffer;
\r
short * pS;
\r
\r
void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq
\r
unsigned int dwChannelDead; // silent+not useful channels
\r
\r
unsigned char * pSpuBuffer;
\r
short * pS;
\r
\r
void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq
\r
- void (CALLBACK *cddavCallback)(
unsigned short,unsigned
short);
\r
+ void (CALLBACK *cddavCallback)(
short,
short);
\r
void (CALLBACK *scheduleCallback)(unsigned int);
\r
\r
void (CALLBACK *scheduleCallback)(unsigned int);
\r
\r
-
xa_decode_t
* xapGlobal;
\r
+
const xa_decode_t
* xapGlobal;
\r
unsigned int * XAFeed;
\r
unsigned int * XAPlay;
\r
unsigned int * XAStart;
\r
unsigned int * XAFeed;
\r
unsigned int * XAPlay;
\r
unsigned int * XAStart;
\r
@@
-225,13
+252,21
@@
typedef struct
REVERBInfo * rvb;
\r
\r
// buffers
\r
REVERBInfo * rvb;
\r
\r
// buffers
\r
-
int * SB
;
\r
+
void * unused
;
\r
int * SSumLR;
\r
\r
int * SSumLR;
\r
\r
- int pad[29];
\r
unsigned short regArea[0x400];
\r
unsigned short regArea[0x400];
\r
+
\r
+ sample_buf sb[MAXCHAN];
\r
+ int interpolation;
\r
+ sample_buf sb_thread[MAXCHAN];
\r
} SPUInfo;
\r
\r
} SPUInfo;
\r
\r
+#define regAreaGet(offset) \
\r
+ spu.regArea[((offset) - 0xc00)>>1]
\r
+#define regAreaGetCh(ch, offset) \
\r
+ spu.regArea[((ch<<4)|(offset))>>1]
\r
+
\r
///////////////////////////////////////////////////////////
\r
// SPU.C globals
\r
///////////////////////////////////////////////////////////
\r
///////////////////////////////////////////////////////////
\r
// SPU.C globals
\r
///////////////////////////////////////////////////////////
\r
@@
-242,15
+277,14
@@
extern SPUInfo spu;
\r
void do_samples(unsigned int cycles_to, int do_sync);
\r
void schedule_next_irq(void);
\r
\r
void do_samples(unsigned int cycles_to, int do_sync);
\r
void schedule_next_irq(void);
\r
+void check_irq_io(unsigned int addr);
\r
\r
\r
-#define regAreaGet(ch,offset) \
\r
- spu.regArea[((ch<<4)|(offset))>>1]
\r
-
\r
-#define do_samples_if_needed(c, sync) \
\r
+#define do_samples_if_needed(c, sync, samples) \
\r
do { \
\r
do { \
\r
- if (sync || (int)((c) - spu.cycles_played) >=
16
* 768) \
\r
+ if (sync || (int)((c) - spu.cycles_played) >=
(samples)
* 768) \
\r
do_samples(c, sync); \
\r
} while (0)
\r
\r
#endif
\r
\r
do_samples(c, sync); \
\r
} while (0)
\r
\r
#endif
\r
\r
+#endif /* __P_SOUND_EXTERNALS_H__ */
\r