Ticket #8346: fbear-notes.diff

File fbear-notes.diff, 4.1 KB (added by eriktorbjorn, 20 years ago)

Patch against a June 21 CVS snapshot

  • scumm/intern.h

    diff -ur ScummVM-cvs20040621/scumm/intern.h ScummVM-cvs20040621+hack/scumm/intern.h
    old new  
    596596        void o6_readFile();
    597597        void o6_rename();
    598598        void o6_writeFile();
    599         void o6_setVolume();
     599        void o6_soundOps();
    600600        void o6_seekFilePos();
    601601        void o6_localizeArray();
    602602        void o6_redimArray();
  • scumm/script_v6he.cpp

    diff -ur ScummVM-cvs20040621/scumm/script_v6he.cpp ScummVM-cvs20040621+hack/scumm/script_v6he.cpp
    old new  
    331331                OPCODE(o6_deleteFile),
    332332                OPCODE(o6_rename),
    333333                /* E0 */
    334                 OPCODE(o6_setVolume),
     334                OPCODE(o6_soundOps),
    335335                OPCODE(o6_unknownE1),
    336336                OPCODE(o6_localizeArray),
    337337                OPCODE(o6_pickVarRandom),
     
    402402
    403403void ScummEngine_v6he::o6_startSound() {
    404404        // Seems to range between 952 - 9000
     405        // In Fatty Bear's Birthday Surprise the piano uses offsets 1 - 23 to
     406        // indicate which note to play, but only when using the standard piano
     407        // sound. See also o6_soundOps().
    405408        int offset = pop();
    406409        debug(2, "o6_startSound: offset %d", offset);
    407410        _sound->addSoundToQueue(pop());
     
    11361139        }
    11371140}
    11381141
    1139 void ScummEngine_v6he::o6_setVolume() {
     1142void ScummEngine_v6he::o6_soundOps() {
    11401143        byte subOp = fetchScriptByte();
    1141         int soundVolumeMaster;
    11421144        int volume = pop();
    11431145        switch (subOp) {
    11441146        case 0xde:
    11451147                _mixer->setMusicVolume(volume);
    11461148                break;
    11471149        case 0xe0:
    1148                 soundVolumeMaster = ConfMan.getInt("master_volume");
    1149                 _mixer->setVolume(volume * soundVolumeMaster / 255);
     1150                // Fatty Bear's Birthday surprise uses this when playing the
     1151                // piano, but only when using one of the digitized instruments.
     1152                // See also o6_startSound().
     1153                _sound->setOverrideFreq(volume);
    11501154                break;
    11511155        }
    11521156}
  • scumm/script_v7he.cpp

    diff -ur ScummVM-cvs20040621/scumm/script_v7he.cpp ScummVM-cvs20040621+hack/scumm/script_v7he.cpp
    old new  
    331331                OPCODE(o6_deleteFile),
    332332                OPCODE(o6_rename),
    333333                /* E0 */
    334                 OPCODE(o6_setVolume),
     334                OPCODE(o6_soundOps),
    335335                OPCODE(o6_unknownE1),
    336336                OPCODE(o6_localizeArray),
    337337                OPCODE(o6_pickVarRandom),
  • scumm/sound.cpp

    diff -ur ScummVM-cvs20040621/scumm/sound.cpp ScummVM-cvs20040621+hack/scumm/sound.cpp
    old new  
    6868        _mouthSyncMode(false),
    6969        _endOfMouthSync(false),
    7070        _curSoundPos(0),
     71        _overrideFreq(0),
    7172        _currentCDSound(0),
    7273        _soundsPaused(false),
    7374        _sfxMode(0) {
     
    140141        _soundQuePos = 0;
    141142}
    142143
     144void Sound::setOverrideFreq(int freq) {
     145        _overrideFreq = freq;
     146}
     147
    143148void Sound::playSound(int soundID) {
    144149        byte *ptr;
    145150        char *sound;
     
    182187
    183188                size = READ_BE_UINT32(ptr+4) - 8;
    184189                // FIXME - what value here ?!? 11025 is just a guess based on strings in w32 bin, prev guess 8000
    185                 rate = 11025;
     190                if (_overrideFreq) {
     191                        // Used by the piano in Fatty Bear's Birthday Surprise
     192                        rate = _overrideFreq;
     193                        _overrideFreq = 0;
     194                } else
     195                        rate = 11025;
    186196
    187197                // Allocate a sound buffer, copy the data into it, and play
    188198                sound = (char *)malloc(size);
  • scumm/sound.h

    diff -ur ScummVM-cvs20040621/scumm/sound.h ScummVM-cvs20040621+hack/scumm/sound.h
    old new  
    7070        uint16 _mouthSyncTimes[64];
    7171        uint _curSoundPos;
    7272
     73        int _overrideFreq;
     74
    7375        int _currentCDSound;
    7476public:
    7577        PlayingSoundHandle _talkChannelHandle;  // Handle of mixer channel actor is talking on
     
    8284        void addSoundToQueue(int sound);
    8385        void addSoundToQueue2(int sound);
    8486        void processSoundQues();
     87        void setOverrideFreq(int freq);
    8588        void playSound(int sound);
    8689        void startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle *handle = NULL);
    8790        void stopTalkSound();