From 0a17555e73b709af0a947c045824a9b9bc253e39 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Aug 2009 23:23:44 +0000 Subject: Enable music support in the finale of Kyrandia 1 Amiga. svn-id: r43335 --- engines/kyra/sequences_lok.cpp | 8 ++++++++ engines/kyra/sound_amiga.cpp | 23 +++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 5b41c3cef8..2f902aa1c5 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -994,6 +994,14 @@ int KyraEngine_LoK::seq_playEnd() { snd_playWanderScoreViaMap(50, 1); setupPanPages(); + if (_flags.platform == Common::kPlatformAmiga) { + _sound->loadSoundFile(kMusicFinale); + + // The original used 0 here. Due to how our Sound code + // is implemented we need to use track 10 here though. + _sound->playTrack(10); + } + _finalA = createWSAMovie(); assert(_finalA); _finalA->open("finala.wsa", 1, 0); diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp index 87bdd443b6..db7a1bc8a0 100644 --- a/engines/kyra/sound_amiga.cpp +++ b/engines/kyra/sound_amiga.cpp @@ -205,10 +205,11 @@ void SoundAmiga::playSoundEffect(uint8 track) { switch (_fileLoaded) { case kFileFinal: case kFileIntro: - assert(track < 40); - - tableEntry = &_tableSfxIntro[track * 8]; - pan = (sfxTableGetPan(tableEntry) != 0); + // We only allow playing of sound effects, which are included in the table. + if (track < 40) { + tableEntry = &_tableSfxIntro[track * 8]; + pan = (sfxTableGetPan(tableEntry) != 0); + } break; case kFileGame: @@ -216,12 +217,14 @@ void SoundAmiga::playSoundEffect(uint8 track) { if (0x61 <= track && track <= 0x63) playTrack(track - 0x4F); - assert(track < 120); - // variable(0x1BFE4) && tableEffectsGame[track].note, which gets set for ingame and unset for finale - // (and some function reverses its state) - if (sfxTableGetNote(&_tableSfxGame[track * 8])) { - tableEntry = &_tableSfxGame[track * 8]; - pan = (sfxTableGetPan(tableEntry) != 0) && (sfxTableGetPan(tableEntry) != 2); + // We only allow playing of sound effects, which are included in the table. + if (track < 120) { + // variable(0x1BFE4) && tableEffectsGame[track].note, which gets set for ingame and unset for finale + // (and some function reverses its state) + if (sfxTableGetNote(&_tableSfxGame[track * 8])) { + tableEntry = &_tableSfxGame[track * 8]; + pan = (sfxTableGetPan(tableEntry) != 0) && (sfxTableGetPan(tableEntry) != 2); + } } break; default: -- cgit v1.2.3