This commit is contained in:
parent
06ec0fdcd6
commit
2a65a60186
4 changed files with 114 additions and 142 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
reverb ( trigger from map? )
|
||||||
|
position
|
||||||
|
adjust channels ( watery-mario64 style music changes )
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*=========================================================================
|
/*=========================================================================
|
||||||
|
|
||||||
sound.cpp
|
sound.cpp
|
||||||
|
@ -22,6 +29,7 @@
|
||||||
#include "system\dbg.h"
|
#include "system\dbg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
|
||||||
|
@ -44,7 +52,7 @@ typedef struct XMFILEDATA
|
||||||
typedef struct SFXDETAILS
|
typedef struct SFXDETAILS
|
||||||
{
|
{
|
||||||
int m_channelMask;
|
int m_channelMask;
|
||||||
int m_pattern; // ..or instrument for loopers
|
int m_pattern; // ..or instrument number for loopers
|
||||||
int m_looping;
|
int m_looping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,39 +65,7 @@ typedef struct SFXDETAILS
|
||||||
Vars
|
Vars
|
||||||
---- */
|
---- */
|
||||||
|
|
||||||
static XMFILEDATA s_xmSongData[CSoundMediator::NUM_SONGIDS]=
|
// Static stuff for CSoundMediator
|
||||||
{
|
|
||||||
{ MUSIC_HYPERMMX_VH, MUSIC_HYPERMMX_VB, MUSIC_HYPERMMX_PXM }, // HYPERMMX
|
|
||||||
{ MUSIC_DROPPOP_VH, MUSIC_DROPPOP_VB, MUSIC_DROPPOP_PXM }, // DROPPOP
|
|
||||||
{ MUSIC_MUSIC_VH, MUSIC_MUSIC_VB, MUSIC_MUSIC_PXM }, // MUSIC
|
|
||||||
};
|
|
||||||
|
|
||||||
static XMFILEDATA s_xmSfxData[CSoundMediator::NUM_SFXBANKIDS]=
|
|
||||||
{
|
|
||||||
{ SFX_INGAME_VH, SFX_INGAME_VB, SFX_INGAME_PXM }, // INGAME
|
|
||||||
};
|
|
||||||
|
|
||||||
static SFXDETAILS s_sfxDetails[]=
|
|
||||||
{
|
|
||||||
{ 1, 6, 1 },
|
|
||||||
{ 1, 1, 0 },
|
|
||||||
{ 1, 2, 0 },
|
|
||||||
{ 1, 0, 1 },
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int CSoundMediator::s_initialised=false;
|
int CSoundMediator::s_initialised=false;
|
||||||
|
|
||||||
int CSoundMediator::s_currentVolume[CSoundMediator::NUM_VOLUMETYPES];
|
int CSoundMediator::s_currentVolume[CSoundMediator::NUM_VOLUMETYPES];
|
||||||
|
@ -106,7 +82,34 @@ static CSpuSound *s_spuSound;
|
||||||
static CXMPlaySound *s_xmplaySound;
|
static CXMPlaySound *s_xmplaySound;
|
||||||
|
|
||||||
|
|
||||||
|
// Songs
|
||||||
|
static XMFILEDATA s_xmSongData[CSoundMediator::NUM_SONGIDS]=
|
||||||
|
{
|
||||||
|
{ MUSIC_HYPERMMX_VH, MUSIC_HYPERMMX_VB, MUSIC_HYPERMMX_PXM }, // HYPERMMX
|
||||||
|
{ MUSIC_DROPPOP_VH, MUSIC_DROPPOP_VB, MUSIC_DROPPOP_PXM }, // DROPPOP
|
||||||
|
{ MUSIC_MUSIC_VH, MUSIC_MUSIC_VB, MUSIC_MUSIC_PXM }, // MUSIC
|
||||||
|
};
|
||||||
|
|
||||||
|
// SFX banks
|
||||||
|
static XMFILEDATA s_xmSfxData[CSoundMediator::NUM_SFXBANKIDS]=
|
||||||
|
{
|
||||||
|
{ SFX_INGAME_VH, SFX_INGAME_VB, SFX_INGAME_PXM }, // INGAME
|
||||||
|
};
|
||||||
|
|
||||||
|
// Individual SFX details
|
||||||
|
static SFXDETAILS s_sfxDetails[]=
|
||||||
|
{
|
||||||
|
{ 1, 6, 1 },
|
||||||
|
{ 1, 1, 0 },
|
||||||
|
{ 1, 2, 0 },
|
||||||
|
{ 1, 0, 1 },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
int s_songChannelCount=10;
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -261,7 +264,7 @@ void CSoundMediator::playSong()
|
||||||
ASSERT(s_songModId!=NO_SONG);
|
ASSERT(s_songModId!=NO_SONG);
|
||||||
ASSERT(s_songPlayingId==NOT_PLAYING);
|
ASSERT(s_songPlayingId==NOT_PLAYING);
|
||||||
|
|
||||||
s_songPlayingId=s_xmplaySound->playSong(s_songSampleId,s_songModId,10); // pkg !?
|
s_songPlayingId=s_xmplaySound->playSong(s_songSampleId,s_songModId,s_songChannelCount);
|
||||||
s_volumeDirty[SONG]=true; // Force a volume update
|
s_volumeDirty[SONG]=true; // Force a volume update
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -334,7 +337,11 @@ xmPlayingId CSoundMediator::playSfx(int _sfxId)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playId=s_xmplaySound->playSfx(s_sfxSampleId,s_sfxModId,sfx->m_pattern,sfx->m_channelMask,20);
|
playId=s_xmplaySound->playSfx(s_sfxSampleId,s_sfxModId,sfx->m_pattern,sfx->m_channelMask,20);
|
||||||
if(playId!=NOT_PLAYING)s_xmplaySound->unlockPlayingId(playId); // We really don't care about one-shot sfx..
|
if(playId!=NOT_PLAYING)
|
||||||
|
{
|
||||||
|
s_xmplaySound->unlockPlayingId(playId); // We really don't care about one-shot sfx..
|
||||||
|
playId=NOT_PLAYING;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s_volumeDirty[SFX]=true; // Force a volume update
|
s_volumeDirty[SFX]=true; // Force a volume update
|
||||||
|
|
||||||
|
@ -348,10 +355,10 @@ xmPlayingId CSoundMediator::playSfx(int _sfxId)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CSoundMediator::stopSfx(xmPlayingId _id)
|
void CSoundMediator::stopSfx(xmPlayingId _playingId)
|
||||||
{
|
{
|
||||||
s_xmplaySound->stopPlayingId(_id);
|
s_xmplaySound->stopPlayingId(_playingId);
|
||||||
s_xmplaySound->unlockPlayingId(_id);
|
s_xmplaySound->unlockPlayingId(_playingId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ public:
|
||||||
static void setSfxBank(SFXBANKID _bankId);
|
static void setSfxBank(SFXBANKID _bankId);
|
||||||
static xmPlayingId playSfx(int _sfxId);
|
static xmPlayingId playSfx(int _sfxId);
|
||||||
// static void setposition(int _playId,vector pos );
|
// static void setposition(int _playId,vector pos );
|
||||||
static void stopSfx(xmPlayingId _id);
|
static void stopSfx(xmPlayingId _playingId);
|
||||||
|
|
||||||
// Speech interface
|
// Speech interface
|
||||||
static void playSpeech(SpeechEquate _speech);
|
static void playSpeech(SpeechEquate _speech);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*=========================================================================
|
/*=========================================================================
|
||||||
|
|
||||||
spu.cpp
|
xmplay.cpp
|
||||||
|
|
||||||
Author: PKG
|
Author: PKG
|
||||||
Created:
|
Created:
|
||||||
|
@ -42,31 +42,10 @@
|
||||||
Tyepdefs && Defines
|
Tyepdefs && Defines
|
||||||
------------------- */
|
------------------- */
|
||||||
|
|
||||||
#define MAX_XM_SONGS 5
|
|
||||||
#define MAX_XM_VABS 5
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Structure defintions
|
Structure defintions
|
||||||
-------------------- */
|
-------------------- */
|
||||||
|
|
||||||
typedef struct XMSong
|
|
||||||
{
|
|
||||||
unsigned char *m_xmData;
|
|
||||||
FileEquate m_file;
|
|
||||||
int m_refCount;
|
|
||||||
// refcount these!
|
|
||||||
};
|
|
||||||
static XMSong s_xmSongs[MAX_XM_SONGS];
|
|
||||||
|
|
||||||
typedef struct XMVab
|
|
||||||
{
|
|
||||||
int m_vabId;
|
|
||||||
FileEquate m_vhFile,m_vbFile;
|
|
||||||
int m_refCount;
|
|
||||||
};
|
|
||||||
static XMVab s_xmVabs[MAX_XM_VABS];
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function Prototypes
|
Function Prototypes
|
||||||
------------------- */
|
------------------- */
|
||||||
|
@ -110,8 +89,8 @@ void CXMPlaySound::initialise()
|
||||||
// Clear internal data
|
// Clear internal data
|
||||||
for(i=0;i<MAX_XM_SONGS;i++)
|
for(i=0;i<MAX_XM_SONGS;i++)
|
||||||
{
|
{
|
||||||
XMSong *song=&s_xmSongs[i];
|
XMMod *mod=&s_xmMods[i];
|
||||||
song->m_refCount=0;
|
mod->m_refCount=0;
|
||||||
}
|
}
|
||||||
for(i=0;i<MAX_XM_VABS;i++)
|
for(i=0;i<MAX_XM_VABS;i++)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +127,6 @@ void CXMPlaySound::shutdown()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int spuflags[24];
|
|
||||||
void CXMPlaySound::think()
|
void CXMPlaySound::think()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -161,9 +139,8 @@ void CXMPlaySound::think()
|
||||||
ch=m_spuChannelUse;
|
ch=m_spuChannelUse;
|
||||||
for(i=0;i<NUM_SPU_CHANNELS;i++)
|
for(i=0;i<NUM_SPU_CHANNELS;i++)
|
||||||
{
|
{
|
||||||
//pkg tidy
|
// Only unlocked stuff needs to be checked
|
||||||
// Only unlocked SFX need to be checked
|
if(ch->m_locked==false&&ch->m_useType!=SILENT)
|
||||||
if(ch->m_locked==false&&ch->m_useType==SFX)
|
|
||||||
{
|
{
|
||||||
id=ch->m_playingId;
|
id=ch->m_playingId;
|
||||||
if(id!=-1)
|
if(id!=-1)
|
||||||
|
@ -183,9 +160,6 @@ PAUL_DBGMSG("%d finished.. ( was on chnl %d )",id,i);
|
||||||
}
|
}
|
||||||
ch++;
|
ch++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0;i<24;i++)
|
|
||||||
spuflags[i]=m_spuChannelUse[i].m_useType;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -214,8 +188,6 @@ xmSampleId CXMPlaySound::loadSampleData(FileEquate _vhFe,FileEquate _vbFe)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PKG - Can be neatened up a bit..
|
|
||||||
|
|
||||||
// Find next free vab slot
|
// Find next free vab slot
|
||||||
vabId=0;
|
vabId=0;
|
||||||
vab=s_xmVabs;
|
vab=s_xmVabs;
|
||||||
|
@ -227,7 +199,6 @@ xmSampleId CXMPlaySound::loadSampleData(FileEquate _vhFe,FileEquate _vbFe)
|
||||||
VhPtr=(u8*)CFileIO::loadFile(_vhFe);
|
VhPtr=(u8*)CFileIO::loadFile(_vhFe);
|
||||||
VbPtr=(u8*)CFileIO::loadFile(_vbFe);
|
VbPtr=(u8*)CFileIO::loadFile(_vbFe);
|
||||||
vab->m_vabId=XM_VABInit(VhPtr,VbPtr);
|
vab->m_vabId=XM_VABInit(VhPtr,VbPtr);
|
||||||
//defragSpuMemory(); somewhere around here..
|
|
||||||
MemFree(VhPtr);
|
MemFree(VhPtr);
|
||||||
MemFree(VbPtr);
|
MemFree(VbPtr);
|
||||||
vab->m_vhFile=_vhFe;
|
vab->m_vhFile=_vhFe;
|
||||||
|
@ -248,43 +219,41 @@ xmSampleId CXMPlaySound::loadSampleData(FileEquate _vhFe,FileEquate _vbFe)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
xmModId CXMPlaySound::loadModData(FileEquate _songFe)
|
xmModId CXMPlaySound::loadModData(FileEquate _modFe)
|
||||||
{
|
{
|
||||||
int songId;
|
int modId;
|
||||||
XMSong *song;
|
XMMod *mod;
|
||||||
|
|
||||||
// Is the song already loaded?
|
// Is the mod already loaded?
|
||||||
song=s_xmSongs;
|
mod=s_xmMods;
|
||||||
for(songId=0;songId<MAX_XM_SONGS;songId++)
|
for(modId=0;modId<MAX_XM_SONGS;modId++)
|
||||||
{
|
{
|
||||||
if(song->m_refCount&&song->m_file==_songFe)
|
if(mod->m_refCount&&mod->m_file==_modFe)
|
||||||
{
|
{
|
||||||
// Yup..
|
// Yup..
|
||||||
song->m_refCount++;
|
mod->m_refCount++;
|
||||||
return(xmModId)songId;
|
return(xmModId)modId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PKG - Can be neatened up a bit..
|
|
||||||
|
|
||||||
// Find next free song slot
|
// Find next free song slot
|
||||||
song=s_xmSongs;
|
mod=s_xmMods;
|
||||||
songId=0;
|
modId=0;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
ASSERT(songId<MAX_XM_SONGS);
|
ASSERT(modId<MAX_XM_SONGS);
|
||||||
if(song->m_refCount==0)
|
if(mod->m_refCount==0)
|
||||||
{
|
{
|
||||||
song->m_xmData=(u8*)CFileIO::loadFile(_songFe);
|
mod->m_xmData=(u8*)CFileIO::loadFile(_modFe);
|
||||||
InitXMData(song->m_xmData,songId,XM_UseS3MPanning);
|
InitXMData(mod->m_xmData,modId,XM_UseS3MPanning);
|
||||||
song->m_file=_songFe;
|
mod->m_file=_modFe;
|
||||||
song->m_refCount=1;
|
mod->m_refCount=1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
songId++;song++;
|
modId++;mod++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (xmModId)songId;
|
return (xmModId)modId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -313,15 +282,15 @@ void CXMPlaySound::dumpSampleData(xmSampleId _sampleId)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CXMPlaySound::dumpModData(xmModId _songId)
|
void CXMPlaySound::dumpModData(xmModId _modId)
|
||||||
{
|
{
|
||||||
XMSong *song;
|
XMMod *mod;
|
||||||
|
|
||||||
song=&s_xmSongs[_songId];
|
mod=&s_xmMods[_modId];
|
||||||
song->m_refCount--;
|
mod->m_refCount--;
|
||||||
if(song->m_refCount==0)
|
if(mod->m_refCount==0)
|
||||||
{
|
{
|
||||||
MemFree(song->m_xmData);
|
MemFree(mod->m_xmData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,9 +316,9 @@ void CXMPlaySound::setStereo(int _stereo)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CXMPlaySound::setVolume(xmPlayingId _songId,unsigned char _volume)
|
void CXMPlaySound::setVolume(xmPlayingId _playingId,unsigned char _volume)
|
||||||
{
|
{
|
||||||
XM_SetMasterVol(_songId,_volume>>1);
|
XM_SetMasterVol(_playingId,_volume>>1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -359,9 +328,9 @@ void CXMPlaySound::setVolume(xmPlayingId _songId,unsigned char _volume)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CXMPlaySound::setPanning(xmPlayingId _songId,char _pan)
|
void CXMPlaySound::setPanning(xmPlayingId _playingId,char _pan)
|
||||||
{
|
{
|
||||||
XM_SetMasterPan(_songId,_pan);
|
XM_SetMasterPan(_playingId,_pan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -379,7 +348,7 @@ xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _songId,int _cha
|
||||||
xmPlayingId retId;
|
xmPlayingId retId;
|
||||||
|
|
||||||
ASSERT(s_xmVabs[_sampleId].m_refCount!=0);
|
ASSERT(s_xmVabs[_sampleId].m_refCount!=0);
|
||||||
ASSERT(s_xmSongs[_songId].m_refCount!=0);
|
ASSERT(s_xmMods[_songId].m_refCount!=0);
|
||||||
|
|
||||||
baseChannel=findSpareChannels(_channelCount,255);
|
baseChannel=findSpareChannels(_channelCount,255);
|
||||||
if(baseChannel!=-1)
|
if(baseChannel!=-1)
|
||||||
|
@ -444,9 +413,6 @@ PAUL_DBGMSG("unlocking %d",_playingId);
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CXMPlaySound::stopPlayingId(xmPlayingId _playingId)
|
void CXMPlaySound::stopPlayingId(xmPlayingId _playingId)
|
||||||
{
|
{
|
||||||
// ASSERT(m_spuChannelUse[_playingId].m_locked!=true); // Unlock channel first!
|
|
||||||
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
spuChannelUse *ch;
|
spuChannelUse *ch;
|
||||||
|
|
||||||
|
@ -507,7 +473,7 @@ xmPlayingId CXMPlaySound::playSfx(xmSampleId _sampleId,xmModId _songId,int _sfxP
|
||||||
xmPlayingId retId;
|
xmPlayingId retId;
|
||||||
|
|
||||||
ASSERT(s_xmVabs[_sampleId].m_refCount!=0);
|
ASSERT(s_xmVabs[_sampleId].m_refCount!=0);
|
||||||
ASSERT(s_xmSongs[_songId].m_refCount!=0);
|
ASSERT(s_xmMods[_songId].m_refCount!=0);
|
||||||
|
|
||||||
// Count channels
|
// Count channels
|
||||||
maskCopy=_playMask;
|
maskCopy=_playMask;
|
||||||
|
@ -634,32 +600,8 @@ int CXMPlaySound::findSpareChannels(int _channelCount,int _priority)
|
||||||
i=j;
|
i=j;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// PKG - Add priority stuff here!!
|
||||||
// Couldn't find one.. can we kill off a lower priority sound?
|
|
||||||
if(valid==false)
|
|
||||||
{
|
|
||||||
int lowestPrioity=_priority;
|
|
||||||
int possibleBase=-1;
|
|
||||||
int id;
|
|
||||||
|
|
||||||
// Find the lowest priority sound with enuf spare channels
|
|
||||||
i=0;
|
|
||||||
while(i<24)
|
|
||||||
{
|
|
||||||
if(m_spuChannelUse[i].m_priority<=lowestPriority&&m_spuChannelUse[j].m_useType!=SILENT)
|
|
||||||
{
|
|
||||||
valid=true;
|
|
||||||
id=m_spuChannelUse[i].m_id;
|
|
||||||
for(j=i;j<i+_channelCount&&valid;j++)
|
|
||||||
{
|
|
||||||
if(m_spuChannelUse[j].m_id!=id) valid=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// Can't play it :(
|
// Can't play it :(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,14 +49,14 @@ public:
|
||||||
void think();
|
void think();
|
||||||
|
|
||||||
xmSampleId loadSampleData(FileEquate _vhFe,FileEquate _vbFe);
|
xmSampleId loadSampleData(FileEquate _vhFe,FileEquate _vbFe);
|
||||||
xmModId loadModData(FileEquate _songFe);
|
xmModId loadModData(FileEquate _modFe);
|
||||||
void dumpSampleData(xmSampleId _sampleId);
|
void dumpSampleData(xmSampleId _sampleId);
|
||||||
void dumpModData(xmModId _songId);
|
void dumpModData(xmModId _modId);
|
||||||
|
|
||||||
void setStereo(int _stereo);
|
void setStereo(int _stereo);
|
||||||
|
|
||||||
void setVolume(xmPlayingId _songId,unsigned char _volume);
|
void setVolume(xmPlayingId _playingId,unsigned char _volume);
|
||||||
void setPanning(xmPlayingId _songId,char _pan);
|
void setPanning(xmPlayingId _playingId,char _pan);
|
||||||
|
|
||||||
xmPlayingId playSong(xmSampleId _sampleId,xmModId _songId,int _channelCount);
|
xmPlayingId playSong(xmSampleId _sampleId,xmModId _songId,int _channelCount);
|
||||||
xmPlayingId playSfx(xmSampleId _sampleId,xmModId _songId,int _sfxPattern,int _playMask,u8 _priority);
|
xmPlayingId playSfx(xmSampleId _sampleId,xmModId _songId,int _sfxPattern,int _playMask,u8 _priority);
|
||||||
|
@ -69,8 +69,11 @@ public:
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
MAX_XM_HEADERS=8,
|
MAX_XM_SONGS=5, // How many mods our internal loader copes with
|
||||||
MAX_SONG_HEADERS=24,
|
MAX_XM_VABS=5, // How many vabs our internal loader copes with
|
||||||
|
|
||||||
|
MAX_SONG_HEADERS=24, // Number of mods that xmplay can play at once
|
||||||
|
MAX_XM_HEADERS=MAX_XM_SONGS, // Number of mods that xmplay can load at once
|
||||||
|
|
||||||
NUM_SPU_CHANNELS=24,
|
NUM_SPU_CHANNELS=24,
|
||||||
};
|
};
|
||||||
|
@ -83,10 +86,28 @@ private:
|
||||||
LOOPINGSFX,
|
LOOPINGSFX,
|
||||||
} CHANNELUSETYPE;
|
} CHANNELUSETYPE;
|
||||||
|
|
||||||
|
// Internal representation of loaded songs
|
||||||
|
typedef struct XMMod
|
||||||
|
{
|
||||||
|
unsigned char *m_xmData;
|
||||||
|
FileEquate m_file;
|
||||||
|
int m_refCount;
|
||||||
|
// refcount these!
|
||||||
|
};
|
||||||
|
|
||||||
|
// Internal representation of loaded vabs
|
||||||
|
typedef struct XMVab
|
||||||
|
{
|
||||||
|
int m_vabId;
|
||||||
|
FileEquate m_vhFile,m_vbFile;
|
||||||
|
int m_refCount;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Structure that records what is going on for each SPU channel
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
CHANNELUSETYPE m_useType;
|
CHANNELUSETYPE m_useType;
|
||||||
xmPlayingId m_playingId; // extern id
|
xmPlayingId m_playingId;
|
||||||
u8 m_internalId;
|
u8 m_internalId;
|
||||||
u8 m_priority;
|
u8 m_priority;
|
||||||
u8 m_locked;
|
u8 m_locked;
|
||||||
|
@ -100,6 +121,8 @@ private:
|
||||||
|
|
||||||
unsigned char *m_fhPtr[MAX_XM_HEADERS];
|
unsigned char *m_fhPtr[MAX_XM_HEADERS];
|
||||||
unsigned char *m_songPtr[MAX_SONG_HEADERS];
|
unsigned char *m_songPtr[MAX_SONG_HEADERS];
|
||||||
|
XMMod s_xmMods[MAX_XM_SONGS];
|
||||||
|
XMVab s_xmVabs[MAX_XM_VABS];
|
||||||
spuChannelUse m_spuChannelUse[NUM_SPU_CHANNELS];
|
spuChannelUse m_spuChannelUse[NUM_SPU_CHANNELS];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue