summaryrefslogtreecommitdiff
path: root/plugins/dfsound
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/dfsound')
-rw-r--r--plugins/dfsound/externals.h2
-rw-r--r--plugins/dfsound/spu.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/dfsound/externals.h b/plugins/dfsound/externals.h
index 3143c6df..b8a5c43d 100644
--- a/plugins/dfsound/externals.h
+++ b/plugins/dfsound/externals.h
@@ -276,7 +276,7 @@ extern unsigned long spuAddr;
extern int bEndThread;
extern int bThreadEnded;
extern int bSpuInit;
-extern unsigned long dwNewChannel;
+extern uint32_t dwNewChannel;
extern int SSumR[];
extern int SSumL[];
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index f6c8ebd5..40e32094 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -109,7 +109,7 @@ static HANDLE hMainThread;
static pthread_t thread = (pthread_t)-1; // thread id (linux)
#endif
-unsigned long dwNewChannel=0; // flags for faster testing, if new channel starts
+uint32_t dwNewChannel=0; // flags for faster testing, if new channel starts
void (CALLBACK *irqCallback)(void)=0; // func of main emu, called on spu irq
void (CALLBACK *cddavCallback)(unsigned short,unsigned short)=0;
@@ -596,7 +596,10 @@ static void *MAINThread(void *arg)
for(ch=0;ch<MAXCHAN;ch++) // loop em all... we will collect 1 ms of sound of each playing channel
{
- if(s_chan[ch].bNew) StartSound(ch); // start new sound
+ if(s_chan[ch].bNew) {
+ StartSound(ch); // start new sound
+ dwNewChannel&=~(1<<ch); // clear new channel bit
+ }
if(!s_chan[ch].bOn) continue; // channel not playing? next
if(s_chan[ch].iActFreq!=s_chan[ch].iUsedFreq) // new psx frequency?