From f006cb910f300382d25be4c01d02e4009fdd43ee Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 16 Jul 2001 15:51:06 +0000 Subject: [PATCH] --- source/sound/xmplay.cpp | 9 +++++++++ source/sound/xmplay.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/source/sound/xmplay.cpp b/source/sound/xmplay.cpp index 5154e1f1a..e7a6ad3aa 100644 --- a/source/sound/xmplay.cpp +++ b/source/sound/xmplay.cpp @@ -169,6 +169,9 @@ void CXMPlaySound::think() for(int i=0;i<24;i++,ch++) { PAUL_DBGMSG("%02d] u:%s l:%d pid:%04x",i,text[ch->m_useType],ch->m_locked,ch->m_playingId); +#ifdef SFX_DEBUG + PAUL_DBGMSG(" sfxId:%d",ch->m_sfxId); +#endif } PAUL_DBGMSG("======="); dump=false; @@ -696,6 +699,9 @@ xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId,int _star XM_Music, // Music _startPattern); // Where to start from markChannelsAsActive(baseChannel,channelCount,SONG,retId,id,255); +#ifdef SFX_DEBUG + m_spuChannelUse[baseChannel].m_sfxId=_startPattern; +#endif setVolume(retId,MAX_VOLUME); } else @@ -843,6 +849,9 @@ xmPlayingId CXMPlaySound::playSfx(xmSampleId _sampleId,xmModId _modId,int _sfxPa _sfxPattern); // SFX pattern to play XM_ClearSFXRange(); markChannelsAsActive(baseChannel,channelCount,SFX,retId,id,_priority); +#ifdef SFX_DEBUG + m_spuChannelUse[baseChannel].m_sfxId=_sfxPattern; +#endif setVolume(retId,MAX_VOLUME); } else diff --git a/source/sound/xmplay.h b/source/sound/xmplay.h index 9f086a500..05ad1d965 100644 --- a/source/sound/xmplay.h +++ b/source/sound/xmplay.h @@ -39,6 +39,12 @@ typedef enum {NOT_PLAYING=-1} xmPlayingId; // 8 bits are the base channel of the playing sound. + +// Define this to store the SFX number in the channel details. Useful for finding tracing sounds +// that are being left locked +//#define SFX_DEBUG + + /*---------------------------------------------------------------------- Structure defintions -------------------- */ @@ -134,6 +140,9 @@ private: u8 m_priority; u8 m_locked; u8 m_vol,m_pan; +#ifdef SFX_DEBUG + u8 m_sfxId; +#endif } spuChannelUse; xmPlayingId getNextSparePlayingId(int _baseChannel);