diff options
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/drivers/adlib.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/drivers/amigamac.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/drivers/cms.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/drivers/fb01.cpp | 1 | ||||
-rw-r--r-- | engines/sci/sound/drivers/midi.cpp | 4 | ||||
-rw-r--r-- | engines/sci/sound/drivers/pcjr.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 28 |
7 files changed, 31 insertions, 11 deletions
diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index 65a8e2e3da..f00c99d5b5 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -26,6 +26,8 @@ #include "sci/sci.h" #include "common/file.h" +#include "common/system.h" +#include "common/textconsole.h" #include "audio/fmopl.h" #include "audio/softsynth/emumidi.h" diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 030b095cc9..7ee8d21f86 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -30,6 +30,8 @@ #include "common/file.h" #include "common/frac.h" #include "common/memstream.h" +#include "common/system.h" +#include "common/textconsole.h" #include "common/util.h" namespace Sci { diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp index 051fa7f1fd..47c59a1e3d 100644 --- a/engines/sci/sound/drivers/cms.cpp +++ b/engines/sci/sound/drivers/cms.cpp @@ -29,6 +29,8 @@ #include "audio/softsynth/cms.h" #include "audio/mixer.h" +#include "common/system.h" + #include "sci/resource.h" namespace Sci { diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp index 971c2ff92d..f217738bb2 100644 --- a/engines/sci/sound/drivers/fb01.cpp +++ b/engines/sci/sound/drivers/fb01.cpp @@ -30,6 +30,7 @@ #include "common/file.h" #include "common/system.h" +#include "common/textconsole.h" namespace Sci { diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp index 9eef867aeb..f36aac3a2a 100644 --- a/engines/sci/sound/drivers/midi.cpp +++ b/engines/sci/sound/drivers/midi.cpp @@ -745,7 +745,7 @@ uint8 MidiPlayer_Midi::getGmInstrument(const Mt32ToGmMap &Mt32Ins) { void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { // FIXME: Clean this up int memtimbres, patches; - uint8 group, number, keyshift, finetune, bender_range; + uint8 group, number, keyshift, /*finetune,*/ bender_range; uint8 *patchpointer; uint32 pos; int i; @@ -784,7 +784,7 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { group = *patchpointer; number = *(patchpointer + 1); keyshift = *(patchpointer + 2); - finetune = *(patchpointer + 3); + //finetune = *(patchpointer + 3); bender_range = *(patchpointer + 4); debugCN(kDebugLevelSound, " [%03d] ", i); diff --git a/engines/sci/sound/drivers/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp index 063332577e..4b1efb3c87 100644 --- a/engines/sci/sound/drivers/pcjr.cpp +++ b/engines/sci/sound/drivers/pcjr.cpp @@ -27,6 +27,9 @@ #include "audio/softsynth/emumidi.h" +#include "common/debug.h" +#include "common/system.h" + namespace Sci { #define VOLUME_SHIFT 3 diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 9ad964b67e..a2b09eab4c 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -325,14 +325,6 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { return acc; } - // If the current volume of the slot is the same as the target volume, - // return without performing any fading. This fixes the music in room - // 406 in KQ6 (bug #3267956), where the game scripts ask for the background - // music to be played, and then faded to volume 127 (but the music is - // already at volume 127) and subsequently stopped. - if (argc >= 4 && musicSlot->volume == CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX)) - return acc; - switch (argc) { case 1: // SCI0 // SCI0 fades out all the time and when fadeout is done it will also @@ -353,7 +345,25 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { musicSlot->fadeStep = volume > musicSlot->fadeTo ? -5 : 5; musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo(); musicSlot->fadeTicker = 0; - musicSlot->stopAfterFading = (argc == 5) ? (argv[4].toUint16() != 0) : false; + + if (argc == 5) { + // TODO: We currently treat this argument as a boolean, but may + // have to handle different non-zero values differently. (e.g., + // some KQ6 scripts pass 3 here) + musicSlot->stopAfterFading = (argv[4].toUint16() != 0); + } else { + musicSlot->stopAfterFading = false; + } + + // WORKAROUND/HACK: In the labyrinth in KQ6, when falling in the pit and + // lighting the lantern, the game scripts perform a fade in of the game + // music, but set it to stop after fading. Remove that flag here. This is + // marked as both a workaround and a hack because this issue could be a + // problem with our fading code and an incorrect handling of that + // parameter, or a script bug in that scene. Fixes bug #3267956. + if (g_sci->getGameId() == GID_KQ6 && g_sci->getEngineState()->currentRoomNumber() == 406 && + musicSlot->resourceId == 400) + musicSlot->stopAfterFading = false; break; default: |