diff -ur ScummVM-cvs20040621/scumm/intern.h ScummVM-cvs20040621+hack/scumm/intern.h
old
|
new
|
|
596 | 596 | void o6_readFile(); |
597 | 597 | void o6_rename(); |
598 | 598 | void o6_writeFile(); |
599 | | void o6_setVolume(); |
| 599 | void o6_soundOps(); |
600 | 600 | void o6_seekFilePos(); |
601 | 601 | void o6_localizeArray(); |
602 | 602 | void o6_redimArray(); |
diff -ur ScummVM-cvs20040621/scumm/script_v6he.cpp ScummVM-cvs20040621+hack/scumm/script_v6he.cpp
old
|
new
|
|
331 | 331 | OPCODE(o6_deleteFile), |
332 | 332 | OPCODE(o6_rename), |
333 | 333 | /* E0 */ |
334 | | OPCODE(o6_setVolume), |
| 334 | OPCODE(o6_soundOps), |
335 | 335 | OPCODE(o6_unknownE1), |
336 | 336 | OPCODE(o6_localizeArray), |
337 | 337 | OPCODE(o6_pickVarRandom), |
… |
… |
|
402 | 402 | |
403 | 403 | void ScummEngine_v6he::o6_startSound() { |
404 | 404 | // 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(). |
405 | 408 | int offset = pop(); |
406 | 409 | debug(2, "o6_startSound: offset %d", offset); |
407 | 410 | _sound->addSoundToQueue(pop()); |
… |
… |
|
1136 | 1139 | } |
1137 | 1140 | } |
1138 | 1141 | |
1139 | | void ScummEngine_v6he::o6_setVolume() { |
| 1142 | void ScummEngine_v6he::o6_soundOps() { |
1140 | 1143 | byte subOp = fetchScriptByte(); |
1141 | | int soundVolumeMaster; |
1142 | 1144 | int volume = pop(); |
1143 | 1145 | switch (subOp) { |
1144 | 1146 | case 0xde: |
1145 | 1147 | _mixer->setMusicVolume(volume); |
1146 | 1148 | break; |
1147 | 1149 | 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); |
1150 | 1154 | break; |
1151 | 1155 | } |
1152 | 1156 | } |
diff -ur ScummVM-cvs20040621/scumm/script_v7he.cpp ScummVM-cvs20040621+hack/scumm/script_v7he.cpp
old
|
new
|
|
331 | 331 | OPCODE(o6_deleteFile), |
332 | 332 | OPCODE(o6_rename), |
333 | 333 | /* E0 */ |
334 | | OPCODE(o6_setVolume), |
| 334 | OPCODE(o6_soundOps), |
335 | 335 | OPCODE(o6_unknownE1), |
336 | 336 | OPCODE(o6_localizeArray), |
337 | 337 | OPCODE(o6_pickVarRandom), |
diff -ur ScummVM-cvs20040621/scumm/sound.cpp ScummVM-cvs20040621+hack/scumm/sound.cpp
old
|
new
|
|
68 | 68 | _mouthSyncMode(false), |
69 | 69 | _endOfMouthSync(false), |
70 | 70 | _curSoundPos(0), |
| 71 | _overrideFreq(0), |
71 | 72 | _currentCDSound(0), |
72 | 73 | _soundsPaused(false), |
73 | 74 | _sfxMode(0) { |
… |
… |
|
140 | 141 | _soundQuePos = 0; |
141 | 142 | } |
142 | 143 | |
| 144 | void Sound::setOverrideFreq(int freq) { |
| 145 | _overrideFreq = freq; |
| 146 | } |
| 147 | |
143 | 148 | void Sound::playSound(int soundID) { |
144 | 149 | byte *ptr; |
145 | 150 | char *sound; |
… |
… |
|
182 | 187 | |
183 | 188 | size = READ_BE_UINT32(ptr+4) - 8; |
184 | 189 | // 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; |
186 | 196 | |
187 | 197 | // Allocate a sound buffer, copy the data into it, and play |
188 | 198 | sound = (char *)malloc(size); |
diff -ur ScummVM-cvs20040621/scumm/sound.h ScummVM-cvs20040621+hack/scumm/sound.h
old
|
new
|
|
70 | 70 | uint16 _mouthSyncTimes[64]; |
71 | 71 | uint _curSoundPos; |
72 | 72 | |
| 73 | int _overrideFreq; |
| 74 | |
73 | 75 | int _currentCDSound; |
74 | 76 | public: |
75 | 77 | PlayingSoundHandle _talkChannelHandle; // Handle of mixer channel actor is talking on |
… |
… |
|
82 | 84 | void addSoundToQueue(int sound); |
83 | 85 | void addSoundToQueue2(int sound); |
84 | 86 | void processSoundQues(); |
| 87 | void setOverrideFreq(int freq); |
85 | 88 | void playSound(int sound); |
86 | 89 | void startTalkSound(uint32 offset, uint32 b, int mode, PlayingSoundHandle *handle = NULL); |
87 | 90 | void stopTalkSound(); |