diff --git a/data/Music/sb-title/SB-TITLE.VB b/data/Music/sb-title/SB-TITLE.VB new file mode 100644 index 000000000..7223d9d44 Binary files /dev/null and b/data/Music/sb-title/SB-TITLE.VB differ diff --git a/data/Music/sb-title/SB-TITLE.VH b/data/Music/sb-title/SB-TITLE.VH new file mode 100644 index 000000000..f0a10cc2a Binary files /dev/null and b/data/Music/sb-title/SB-TITLE.VH differ diff --git a/data/Music/sb-title/sb-title.pxm b/data/Music/sb-title/sb-title.pxm new file mode 100644 index 000000000..f4e98f757 Binary files /dev/null and b/data/Music/sb-title/sb-title.pxm differ diff --git a/data/Music/sb-title/sb-title.xm b/data/Music/sb-title/sb-title.xm new file mode 100644 index 000000000..9821208ff Binary files /dev/null and b/data/Music/sb-title/sb-title.xm differ diff --git a/makefile.gfx b/makefile.gfx index 7d557e68b..6132933bb 100644 --- a/makefile.gfx +++ b/makefile.gfx @@ -404,7 +404,7 @@ GFX_DATA_OUT += $(MC_HEADER_OUT) MUSIC_IN_DIR := data/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_OUT := $(foreach MUSIC,$(MUSIC_LIST),$(MUSIC_OUT_DIR)/$(MUSIC).PXM $(MUSIC_OUT_DIR)/$(MUSIC).VH $(MUSIC_OUT_DIR)/$(MUSIC).VB) diff --git a/source/frontend/frontend.cpp b/source/frontend/frontend.cpp index 1380daabd..5fff8032c 100644 --- a/source/frontend/frontend.cpp +++ b/source/frontend/frontend.cpp @@ -54,10 +54,6 @@ #include "locale\textdbase.h" #endif -#ifndef __SOUND_SOUND_H__ -#include "sound\sound.h" -#endif - #ifndef __DATA_STRUCTS_HEADER__ #include "Dstructs.h" #endif @@ -147,9 +143,6 @@ void CFrontEndScene::init() m_font=new ("frontendfont") FontBank(); m_font->initialise(&standardFont); m_font->setJustification(FontBank::JUST_CENTRE); - - CSoundMediator::setSong(CSoundMediator::SONG_TITLE); - CSoundMediator::playSong(); } @@ -168,8 +161,6 @@ void CFrontEndScene::shutdown() { s_modeCodes[i]->shutdown(); } - - CSoundMediator::dumpSong(); } diff --git a/source/frontend/maintitl.cpp b/source/frontend/maintitl.cpp index eadaba0e6..fb1d409ca 100644 --- a/source/frontend/maintitl.cpp +++ b/source/frontend/maintitl.cpp @@ -58,6 +58,10 @@ #include "system\vid.h" #endif +#ifndef __SOUND_SOUND_H__ +#include "sound\sound.h" +#endif + /* Std Lib ------- */ @@ -170,6 +174,9 @@ void CFrontEndMainTitles::select() ASSERT(s_image); SetScreenImage(s_image); + CSoundMediator::setSong(CSoundMediator::SONG_TITLE); + CSoundMediator::playSong(); + CFader::setFadingIn(); } @@ -181,6 +188,8 @@ void CFrontEndMainTitles::select() ---------------------------------------------------------------------- */ void CFrontEndMainTitles::unselect() { + CSoundMediator::dumpSong(); + ClearScreenImage(); MemFree(s_image); s_image=NULL; } diff --git a/source/frontend/maintitl.h b/source/frontend/maintitl.h index 52fe8089e..e64939fd1 100644 --- a/source/frontend/maintitl.h +++ b/source/frontend/maintitl.h @@ -80,7 +80,7 @@ private: 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); diff --git a/source/frontend/options.cpp b/source/frontend/options.cpp index 42c595571..7be5fa7eb 100644 --- a/source/frontend/options.cpp +++ b/source/frontend/options.cpp @@ -62,6 +62,10 @@ #include "system\vid.h" #endif +#ifndef __SOUND_SOUND_H__ +#include "sound\sound.h" +#endif + /* Std Lib ------- */ @@ -327,6 +331,9 @@ void CFrontEndOptions::select() m_exitFlag=false; m_closingDown=false; + CSoundMediator::setSong(CSoundMediator::SONG_OPTIONS); + CSoundMediator::playSong(); + CFader::setFadingIn(); } @@ -338,6 +345,8 @@ void CFrontEndOptions::select() ---------------------------------------------------------------------- */ void CFrontEndOptions::unselect() { + CSoundMediator::dumpSong(); + m_modeMenus[m_mode]->unselect(); } diff --git a/source/sound/sound.cpp b/source/sound/sound.cpp index 3a10b3d95..1af0b59ed 100644 --- a/source/sound/sound.cpp +++ b/source/sound/sound.cpp @@ -47,11 +47,17 @@ adjust channels ( watery-mario64 style music changes ) 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; }; - typedef struct SFXDETAILS { int m_channelMask; @@ -78,6 +84,7 @@ int CSoundMediator::s_volumeDirty[CSoundMediator::NUM_VOLUMETYPES]; xmSampleId CSoundMediator::s_songSampleId=NO_SAMPLE; xmModId CSoundMediator::s_songModId=NO_SONG; xmPlayingId CSoundMediator::s_songPlayingId=NOT_PLAYING; +int CSoundMediator::s_songStartPattern=0; xmSampleId CSoundMediator::s_sfxSampleId=NO_SAMPLE; xmModId CSoundMediator::s_sfxModId=NO_SONG; @@ -86,17 +93,18 @@ static CXMPlaySound *s_xmplaySound; // 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_DROPPOP_VH, MUSIC_DROPPOP_VB, MUSIC_DROPPOP_PXM }, // SONG_DROPPOP - { MUSIC_MUSIC_VH, MUSIC_MUSIC_VB, MUSIC_MUSIC_PXM }, // SONG_MUSIC - { MUSIC_INGAME_VH, MUSIC_INGAME_VB, MUSIC_INGAME_PXM }, // SONG_INGAME - { MUSIC_TITLE_VH, MUSIC_TITLE_VB, MUSIC_TITLE_PXM }, // SONG_TITLE + { MUSIC_INGAME_VH, MUSIC_INGAME_VB, MUSIC_INGAME_PXM, 0 }, // SONG_INGAME + { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0 }, // SONG_TITLE + { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0xa }, // SONG_OPTIONS + { MUSIC_SB_TITLE_VH, MUSIC_SB_TITLE_VB, MUSIC_SB_TITLE_PXM, 0x13 }, // SONG_MEMORYCARD + { 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 -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 }; @@ -268,7 +276,7 @@ void CSoundMediator::setReverbType(REVERBTYPE _type) ---------------------------------------------------------------------- */ void CSoundMediator::setSong(SONGID _songId) { - XMFILEDATA *song; + XMSONGDATA *song; ASSERT(s_songSampleId==NO_SAMPLE); ASSERT(s_songModId==NO_SONG); @@ -276,6 +284,7 @@ void CSoundMediator::setSong(SONGID _songId) song=&s_xmSongData[_songId]; s_songModId=s_xmplaySound->loadModData(song->m_pxm); 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_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 } @@ -329,14 +338,14 @@ void CSoundMediator::dumpSong() ---------------------------------------------------------------------- */ void CSoundMediator::setSfxBank(SFXBANKID _bankId) { - XMFILEDATA *song; + XMSFXFILEDATA *sfx; ASSERT(s_sfxSampleId==NO_SAMPLE); ASSERT(s_sfxModId==NO_SONG); - song=&s_xmSfxData[_bankId]; - s_sfxModId=s_xmplaySound->loadModData(song->m_pxm); - s_sfxSampleId=s_xmplaySound->loadSampleData(song->m_vh,song->m_vb); + sfx=&s_xmSfxData[_bankId]; + s_sfxModId=s_xmplaySound->loadModData(sfx->m_pxm); + s_sfxSampleId=s_xmplaySound->loadSampleData(sfx->m_vh,sfx->m_vb); } diff --git a/source/sound/sound.h b/source/sound/sound.h index 020533dd7..fe14288f3 100644 --- a/source/sound/sound.h +++ b/source/sound/sound.h @@ -49,11 +49,12 @@ class CSoundMediator public: typedef enum SONGID { - SONG_HYPERMMX, - SONG_DROPPOP, - SONG_MUSIC, SONG_INGAME, SONG_TITLE, + SONG_OPTIONS, + SONG_MEMORYCARD, + SONG_GAMECOMPLETE, + SONG_GAMEOVER, NUM_SONGIDS, }; typedef enum SFXBANKID @@ -135,6 +136,8 @@ private: static xmSampleId s_songSampleId; static xmModId s_songModId; static xmPlayingId s_songPlayingId; + static int s_songStartPattern; + static xmSampleId s_sfxSampleId; static xmModId s_sfxModId; diff --git a/source/sound/xmplay.cpp b/source/sound/xmplay.cpp index 63616add1..1a7f4ff14 100644 --- a/source/sound/xmplay.cpp +++ b/source/sound/xmplay.cpp @@ -559,7 +559,7 @@ void CXMPlaySound::stopAndUnlockAllSound() Params: Returns: ---------------------------------------------------------------------- */ -xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId) +xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId,int _startPattern) { int channelCount,baseChannel; XMVab *vab; @@ -585,7 +585,7 @@ xmPlayingId CXMPlaySound::playSong(xmSampleId _sampleId,xmModId _modId) XM_Loop, // Play song continuously -1, // Play all channels XM_Music, // Music - 0); // Begin at the beginning + _startPattern); // Where to start from markChannelsAsActive(baseChannel,channelCount,SONG,retId,id,255); setVolume(retId,MAX_VOLUME); //PAUL_DBGMSG("playSong %d/%d ( on %d-%d )",retId,id,baseChannel,baseChannel+channelCount-1); diff --git a/source/sound/xmplay.h b/source/sound/xmplay.h index 778aee509..e4fa02e2d 100644 --- a/source/sound/xmplay.h +++ b/source/sound/xmplay.h @@ -75,7 +75,7 @@ public: 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 playLoopingSfx(xmSampleId _sampleId,xmModId _modId,int _soundId,u8 _priority,int _pitch=0x400);