Ticket #9302: 0001-SCI-do-not-fade-rhythm-channel.patch

File 0001-SCI-do-not-fade-rhythm-channel.patch, 2.3 KB (added by tsoliman, 14 years ago)

patch to skip channel 9 volume adjustment only if fading

  • engines/sci/sound/midiparser_sci.cpp

    From 1e0a42170cdb7181b6d62e11432368576eaf5a4b Mon Sep 17 00:00:00 2001
    From: Tarek Soliman <tarek@bashasoliman.com>
    Date: Fri, 1 Apr 2011 00:11:58 -0500
    Subject: [PATCH] SCI: do not fade rhythm channel
    
    Fading currently fades all channels including rhythm.
    I believe SSCI doesn't fade rhythm or has another way
    of handling the problem that occurs in the QFG2
    shema dance sequence.
    ---
     engines/sci/sound/midiparser_sci.cpp |    4 ++--
     engines/sci/sound/midiparser_sci.h   |    2 +-
     engines/sci/sound/music.cpp          |    2 +-
     3 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
    index 0b9d761..63f0424 100644
    a b void MidiParser_SCI::setMasterVolume(byte masterVolume) {  
    714714        }
    715715}
    716716
    717 void MidiParser_SCI::setVolume(byte volume) {
     717void MidiParser_SCI::setVolume(byte volume, bool fade) {
    718718        assert(volume <= MUSIC_VOLUME_MAX);
    719719        _volume = volume;
    720720
    void MidiParser_SCI::setVolume(byte volume) {  
    732732        case SCI_VERSION_2_1:
    733733                // Send previous channel volumes again to actually update the volume
    734734                for (int i = 0; i < 15; i++)
    735                         if (_channelRemap[i] != -1)
     735                        if (_channelRemap[i] != -1 && !(fade && i == 9))
    736736                                sendToDriver(0xB0 + i, 7, _channelVolume[i]);
    737737                break;
    738738
  • engines/sci/sound/midiparser_sci.h

    diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
    index 39de425..8ea0a73 100644
    a b public:  
    6666        void sendInitCommands();
    6767        void unloadMusic();
    6868        void setMasterVolume(byte masterVolume);
    69         void setVolume(byte volume);
     69        void setVolume(byte volume, bool fade=false);
    7070        void stop() {
    7171                _abort_parse = true;
    7272                allNotesOff();
  • engines/sci/sound/music.cpp

    diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
    index 956db50..0b8c0fc 100644
    a b void MusicEntry::doFade() {  
    771771
    772772                // Only process MIDI streams in this thread, not digital sound effects
    773773                if (pMidiParser) {
    774                         pMidiParser->setVolume(volume);
     774                        pMidiParser->setVolume(volume, true);
    775775                }
    776776
    777777                fadeSetVolume = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream