aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2003-09-05 03:29:29 +0000
committerTravis Howell2003-09-05 03:29:29 +0000
commitdf963e48bd3d6b380f55d2e7d7f674e5fc24000a (patch)
tree91d1e03a3cff1a337f9a85729cd5bf8b35f6859c
parent16f0cce0bb29087607ed2dfb92e9c6cb633e08d1 (diff)
downloadscummvm-rg350-df963e48bd3d6b380f55d2e7d7f674e5fc24000a.tar.gz
scummvm-rg350-df963e48bd3d6b380f55d2e7d7f674e5fc24000a.tar.bz2
scummvm-rg350-df963e48bd3d6b380f55d2e7d7f674e5fc24000a.zip
Corrections for Amiga V2/V3 games from unused.
svn-id: r9994
-rw-r--r--scumm/sound.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index f603e9706f..1baa2f84b2 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -437,19 +437,20 @@ void Sound::playSound(int soundID) {
// Used in Amiga verisons of indy3ega and loom
// Used in Mac. version of indy3ega
if (((_scumm->_features & GF_OLD_BUNDLE) && (_scumm->_gameId == GID_INDY3)) || ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3))) {
- if ((READ_BE_UINT16(ptr + 26) == 0x0001) || READ_BE_UINT16(ptr + 26) == 0x00FF) {
+ if (ptr[26] == 00) {
size = READ_BE_UINT16(ptr + 12);
- rate = 11000;
+ rate = 3579545 / READ_BE_UINT16(ptr + 20);
sound = (char *)malloc(size);
+ int vol = ptr[24] << 1;
memcpy(sound,ptr + READ_BE_UINT16(ptr + 8),size);
if ((_scumm->_features & GF_AMIGA) && (READ_BE_UINT16(ptr + 16) || READ_BE_UINT16(ptr + 6))) {
// the first check is for pitch-bending looped sounds (i.e. "pouring liquid", "biplane dive", etc.)
// the second check is for simple looped sounds
_scumm->_mixer->playRaw(NULL, sound, size, rate,
- SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, 255, 0, soundID,
+ SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, vol, 0, soundID,
READ_BE_UINT16(ptr + 10) - READ_BE_UINT16(ptr + 8),READ_BE_UINT16(ptr + 14));
} else {
- _scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, 255, 0, soundID);
+ _scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, vol, 0, soundID);
}
return;
}
@@ -461,17 +462,25 @@ void Sound::playSound(int soundID) {
size = READ_BE_UINT16(ptr + 6);
int start = READ_BE_UINT16(ptr + 8);
start +=10;
+
rate = 11000;
+ if ((READ_BE_UINT16(ptr + 50) == 0x357c) && (ptr[55] == 6))
+ rate = 3579545 / READ_BE_UINT16(ptr + 52);
+
+ int vol = 255;
+ if ((READ_BE_UINT16(ptr + 56) == 0x357c) && (ptr[61] == 8))
+ vol = READ_BE_UINT16(ptr + 58) * 2;
+
sound = (char *)malloc(size);
memcpy(sound,ptr + start,size);
// Experimental sound looping support
if (start == 108 || start == 106)
_scumm->_mixer->playRaw(NULL, sound, size, rate,
- SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, 255, 0, soundID,
+ SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, vol, 0, soundID,
start,size);
else
- _scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, 255, 0, soundID);
+ _scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, vol, 0, soundID);
return;
}
}