This commit is contained in:
Paul 2001-01-19 16:25:05 +00:00
parent 6b9db03dcf
commit 35ffb99e01
13 changed files with 53 additions and 32 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -404,7 +404,7 @@ GFX_DATA_OUT += $(MC_HEADER_OUT)
MUSIC_IN_DIR := data/music MUSIC_IN_DIR := data/music
MUSIC_OUT_DIR := $(DATA_OUT)/music MUSIC_OUT_DIR := $(DATA_OUT)/music
MUSIC_LIST := title hypermmx droppop music ingame MUSIC_LIST := ingame sb-title
MUSIC_ALL_IN := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).PXM $(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).VH $(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).VB) MUSIC_ALL_IN := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).PXM $(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).VH $(MUSIC_IN_DIR)/$(MUSIC)/$(MUSIC).VB)
MUSIC_ALL_OUT := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_OUT_DIR)/$(MUSIC).PXM $(MUSIC_OUT_DIR)/$(MUSIC).VH $(MUSIC_OUT_DIR)/$(MUSIC).VB) MUSIC_ALL_OUT := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_OUT_DIR)/$(MUSIC).PXM $(MUSIC_OUT_DIR)/$(MUSIC).VH $(MUSIC_OUT_DIR)/$(MUSIC).VB)

View File

@ -54,10 +54,6 @@
#include "locale\textdbase.h" #include "locale\textdbase.h"
#endif #endif
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
#ifndef __DATA_STRUCTS_HEADER__ #ifndef __DATA_STRUCTS_HEADER__
#include "Dstructs.h" #include "Dstructs.h"
#endif #endif
@ -147,9 +143,6 @@ void CFrontEndScene::init()
m_font=new ("frontendfont") FontBank(); m_font=new ("frontendfont") FontBank();
m_font->initialise(&standardFont); m_font->initialise(&standardFont);
m_font->setJustification(FontBank::JUST_CENTRE); m_font->setJustification(FontBank::JUST_CENTRE);
CSoundMediator::setSong(CSoundMediator::SONG_TITLE);
CSoundMediator::playSong();
} }
@ -168,8 +161,6 @@ void CFrontEndScene::shutdown()
{ {
s_modeCodes[i]->shutdown(); s_modeCodes[i]->shutdown();
} }
CSoundMediator::dumpSong();
} }

View File

@ -58,6 +58,10 @@
#include "system\vid.h" #include "system\vid.h"
#endif #endif
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -170,6 +174,9 @@ void CFrontEndMainTitles::select()
ASSERT(s_image); ASSERT(s_image);
SetScreenImage(s_image); SetScreenImage(s_image);
CSoundMediator::setSong(CSoundMediator::SONG_TITLE);
CSoundMediator::playSong();
CFader::setFadingIn(); CFader::setFadingIn();
} }
@ -181,6 +188,8 @@ void CFrontEndMainTitles::select()
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CFrontEndMainTitles::unselect() void CFrontEndMainTitles::unselect()
{ {
CSoundMediator::dumpSong();
ClearScreenImage(); ClearScreenImage();
MemFree(s_image); s_image=NULL; MemFree(s_image); s_image=NULL;
} }

View File

@ -80,7 +80,7 @@ private:
enum enum
{ {
DEMO_TIMEOUT_IN_SECONDS=30, DEMO_TIMEOUT_IN_SECONDS=45,
}; };
POLY_FT4 *prepareSeaPortionFT4(struct sFrameHdr *_fh,int _x,int _y,int _w,int _h,int _rgb); POLY_FT4 *prepareSeaPortionFT4(struct sFrameHdr *_fh,int _x,int _y,int _w,int _h,int _rgb);

View File

@ -62,6 +62,10 @@
#include "system\vid.h" #include "system\vid.h"
#endif #endif
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -327,6 +331,9 @@ void CFrontEndOptions::select()
m_exitFlag=false; m_exitFlag=false;
m_closingDown=false; m_closingDown=false;
CSoundMediator::setSong(CSoundMediator::SONG_OPTIONS);
CSoundMediator::playSong();
CFader::setFadingIn(); CFader::setFadingIn();
} }
@ -338,6 +345,8 @@ void CFrontEndOptions::select()
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CFrontEndOptions::unselect() void CFrontEndOptions::unselect()
{ {
CSoundMediator::dumpSong();
m_modeMenus[m_mode]->unselect(); m_modeMenus[m_mode]->unselect();
} }

View File

@ -47,11 +47,17 @@ adjust channels ( watery-mario64 style music changes )
Structure defintions Structure defintions
-------------------- */ -------------------- */
typedef struct XMFILEDATA typedef struct XMSONGDATA
{
FileEquate m_vh,m_vb,m_pxm;
int m_startPattern;
};
typedef struct XMSFXFILEDATA
{ {
FileEquate m_vh,m_vb,m_pxm; FileEquate m_vh,m_vb,m_pxm;
}; };
typedef struct SFXDETAILS typedef struct SFXDETAILS
{ {
int m_channelMask; int m_channelMask;
@ -78,6 +84,7 @@ int CSoundMediator::s_volumeDirty[CSoundMediator::NUM_VOLUMETYPES];
xmSampleId CSoundMediator::s_songSampleId=NO_SAMPLE; xmSampleId CSoundMediator::s_songSampleId=NO_SAMPLE;
xmModId CSoundMediator::s_songModId=NO_SONG; xmModId CSoundMediator::s_songModId=NO_SONG;
xmPlayingId CSoundMediator::s_songPlayingId=NOT_PLAYING; xmPlayingId CSoundMediator::s_songPlayingId=NOT_PLAYING;
int CSoundMediator::s_songStartPattern=0;
xmSampleId CSoundMediator::s_sfxSampleId=NO_SAMPLE; xmSampleId CSoundMediator::s_sfxSampleId=NO_SAMPLE;
xmModId CSoundMediator::s_sfxModId=NO_SONG; xmModId CSoundMediator::s_sfxModId=NO_SONG;
@ -86,17 +93,18 @@ static CXMPlaySound *s_xmplaySound;
// Songs // Songs
static XMFILEDATA s_xmSongData[CSoundMediator::NUM_SONGIDS]= static XMSONGDATA s_xmSongData[CSoundMediator::NUM_SONGIDS]=
{ {
{ MUSIC_HYPERMMX_VH, MUSIC_HYPERMMX_VB, MUSIC_HYPERMMX_PXM }, // SONG_HYPERMMX { MUSIC_INGAME_VH, MUSIC_INGAME_VB, MUSIC_INGAME_PXM, 0 }, // SONG_INGAME
{ MUSIC_DROPPOP_VH, MUSIC_DROPPOP_VB, MUSIC_DROPPOP_PXM }, // SONG_DROPPOP { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0 }, // SONG_TITLE
{ MUSIC_MUSIC_VH, MUSIC_MUSIC_VB, MUSIC_MUSIC_PXM }, // SONG_MUSIC { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0xa }, // SONG_OPTIONS
{ MUSIC_INGAME_VH, MUSIC_INGAME_VB, MUSIC_INGAME_PXM }, // SONG_INGAME { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0x13 }, // SONG_MEMORYCARD
{ MUSIC_TITLE_VH, MUSIC_TITLE_VB, MUSIC_TITLE_PXM }, // SONG_TITLE { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0x14 }, // SONG_GAMECOMPLETE
{ MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0x23 }, // SONG_GAMEOVER
}; };
// SFX banks // SFX banks
static XMFILEDATA s_xmSfxData[CSoundMediator::NUM_SFXBANKIDS]= static XMSFXFILEDATA s_xmSfxData[CSoundMediator::NUM_SFXBANKIDS]=
{ {
{ SFX_INGAME_VH, SFX_INGAME_VB, SFX_INGAME_PXM }, // SFX_INGAME { SFX_INGAME_VH, SFX_INGAME_VB, SFX_INGAME_PXM }, // SFX_INGAME
}; };
@ -268,7 +276,7 @@ void CSoundMediator::setReverbType(REVERBTYPE _type)
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CSoundMediator::setSong(SONGID _songId) void CSoundMediator::setSong(SONGID _songId)
{ {
XMFILEDATA *song; XMSONGDATA *song;
ASSERT(s_songSampleId==NO_SAMPLE); ASSERT(s_songSampleId==NO_SAMPLE);
ASSERT(s_songModId==NO_SONG); ASSERT(s_songModId==NO_SONG);
@ -276,6 +284,7 @@ void CSoundMediator::setSong(SONGID _songId)
song=&s_xmSongData[_songId]; song=&s_xmSongData[_songId];
s_songModId=s_xmplaySound->loadModData(song->m_pxm); s_songModId=s_xmplaySound->loadModData(song->m_pxm);
s_songSampleId=s_xmplaySound->loadSampleData(song->m_vh,song->m_vb); s_songSampleId=s_xmplaySound->loadSampleData(song->m_vh,song->m_vb);
s_songStartPattern=song->m_startPattern;
} }
@ -291,7 +300,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); s_songPlayingId=s_xmplaySound->playSong(s_songSampleId,s_songModId,s_songStartPattern);
// s_volumeDirty[SONG]=true; // Force a volume update // s_volumeDirty[SONG]=true; // Force a volume update
} }
@ -329,14 +338,14 @@ void CSoundMediator::dumpSong()
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
void CSoundMediator::setSfxBank(SFXBANKID _bankId) void CSoundMediator::setSfxBank(SFXBANKID _bankId)
{ {
XMFILEDATA *song; XMSFXFILEDATA *sfx;
ASSERT(s_sfxSampleId==NO_SAMPLE); ASSERT(s_sfxSampleId==NO_SAMPLE);
ASSERT(s_sfxModId==NO_SONG); ASSERT(s_sfxModId==NO_SONG);
song=&s_xmSfxData[_bankId]; sfx=&s_xmSfxData[_bankId];
s_sfxModId=s_xmplaySound->loadModData(song->m_pxm); s_sfxModId=s_xmplaySound->loadModData(sfx->m_pxm);
s_sfxSampleId=s_xmplaySound->loadSampleData(song->m_vh,song->m_vb); s_sfxSampleId=s_xmplaySound->loadSampleData(sfx->m_vh,sfx->m_vb);
} }

View File

@ -49,11 +49,12 @@ class CSoundMediator
public: public:
typedef enum SONGID typedef enum SONGID
{ {
SONG_HYPERMMX,
SONG_DROPPOP,
SONG_MUSIC,
SONG_INGAME, SONG_INGAME,
SONG_TITLE, SONG_TITLE,
SONG_OPTIONS,
SONG_MEMORYCARD,
SONG_GAMECOMPLETE,
SONG_GAMEOVER,
NUM_SONGIDS, NUM_SONGIDS,
}; };
typedef enum SFXBANKID typedef enum SFXBANKID
@ -135,6 +136,8 @@ private:
static xmSampleId s_songSampleId; static xmSampleId s_songSampleId;
static xmModId s_songModId; static xmModId s_songModId;
static xmPlayingId s_songPlayingId; static xmPlayingId s_songPlayingId;
static int s_songStartPattern;
static xmSampleId s_sfxSampleId; static xmSampleId s_sfxSampleId;
static xmModId s_sfxModId; static xmModId s_sfxModId;

View File

@ -559,7 +559,7 @@ void CXMPlaySound::stopAndUnlockAllSound()
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId) xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId,int _startPattern)
{ {
int channelCount,baseChannel; int channelCount,baseChannel;
XMVab *vab; XMVab *vab;
@ -585,7 +585,7 @@ xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId)
XM_Loop, // Play song continuously XM_Loop, // Play song continuously
-1, // Play all channels -1, // Play all channels
XM_Music, // Music XM_Music, // Music
0); // Begin at the beginning _startPattern); // Where to start from
markChannelsAsActive(baseChannel,channelCount,SONG,retId,id,255); markChannelsAsActive(baseChannel,channelCount,SONG,retId,id,255);
setVolume(retId,MAX_VOLUME); setVolume(retId,MAX_VOLUME);
//PAUL_DBGMSG("playSong %d/%d ( on %d-%d )",retId,id,baseChannel,baseChannel+channelCount-1); //PAUL_DBGMSG("playSong %d/%d ( on %d-%d )",retId,id,baseChannel,baseChannel+channelCount-1);

View File

@ -75,7 +75,7 @@ public:
void stopAndUnlockAllSound(); void stopAndUnlockAllSound();
xmPlayingId playSong(xmSampleId _sampleId,xmModId _modId); xmPlayingId playSong(xmSampleId _sampleId,xmModId _modId,int _startPattern=0);
xmPlayingId playSfx(xmSampleId _sampleId,xmModId _modId,int _sfxPattern,int _playMask,u8 _priority); xmPlayingId playSfx(xmSampleId _sampleId,xmModId _modId,int _sfxPattern,int _playMask,u8 _priority);
xmPlayingId playLoopingSfx(xmSampleId _sampleId,xmModId _modId,int _soundId,u8 _priority,int _pitch=0x400); xmPlayingId playLoopingSfx(xmSampleId _sampleId,xmModId _modId,int _soundId,u8 _priority,int _pitch=0x400);