diff options
-rw-r--r-- | sky/music/musicbase.cpp | 8 | ||||
-rw-r--r-- | sky/music/musicbase.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sky/music/musicbase.cpp b/sky/music/musicbase.cpp index 327e216c3e..cec29d7e29 100644 --- a/sky/music/musicbase.cpp +++ b/sky/music/musicbase.cpp @@ -45,6 +45,7 @@ void SkyMusicBase::loadSection(uint8 pSection) _currentSection = pSection; _musicData = _skyDisk->loadFile(_driverFileBase + FILES_PER_SECTION * pSection, NULL); _allowedCommands = 0; + _playTime = 0; _musicTempo0 = 0x78; // init constants taken from idb file, area ~0x1060 _musicTempo1 = 0xC0; _onNextPoll.doReInit = false; @@ -136,6 +137,12 @@ void SkyMusicBase::loadNewMusic(void) error("Music %d requested but doesn't exist in file.\n", _onNextPoll.musicToProcess); return; } + + if ((_onNextPoll.musicToProcess == 6) && (_currentSection == 5) && (_playTime < 3456)) + return ; + + _playTime = 0; + if (_currentMusic != 0) stopMusic(); @@ -165,6 +172,7 @@ void SkyMusicBase::pollMusic(void) loadNewMusic(); _aktTime += _tempo; + _playTime++; for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) { newTempo = _channels[cnt]->process((uint16)(_aktTime >> 16)); diff --git a/sky/music/musicbase.h b/sky/music/musicbase.h index db69647f5d..657de9d5b0 100644 --- a/sky/music/musicbase.h +++ b/sky/music/musicbase.h @@ -69,6 +69,7 @@ protected: uint8 _musicTempo1; // given once per music uint32 _tempo; // calculated from musicTempo0 and musicTempo1 uint32 _aktTime; + uint32 _playTime; Actions _onNextPoll; SkyChannelBase *_channels[10]; OSystem::MutexRef _mutex; |