diff options
author | Travis Howell | 2006-01-16 09:27:36 +0000 |
---|---|---|
committer | Travis Howell | 2006-01-16 09:27:36 +0000 |
commit | a4906b2f2b212a2174a7fe33b9d40adb64a5ca4c (patch) | |
tree | e59dcad850ace89b89e081666034c7a8028889bc | |
parent | 631797d7e004bf1bdddd6c129694307b6a19e4f5 (diff) | |
download | scummvm-rg350-a4906b2f2b212a2174a7fe33b9d40adb64a5ca4c.tar.gz scummvm-rg350-a4906b2f2b212a2174a7fe33b9d40adb64a5ca4c.tar.bz2 scummvm-rg350-a4906b2f2b212a2174a7fe33b9d40adb64a5ca4c.zip |
Small correction to sound opcodes in HE games.
svn-id: r20053
-rw-r--r-- | scumm/sound_he.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/scumm/sound_he.cpp b/scumm/sound_he.cpp index 8b0c209640..766388e63b 100644 --- a/scumm/sound_he.cpp +++ b/scumm/sound_he.cpp @@ -107,7 +107,7 @@ int Sound::getSoundVar(int sound, int var) { } if (chan != -1) { - debug(0, "getSoundVar: sound %d var %d result %d", sound, var, _heChannel[chan].soundVars[var]); + debug(1, "getSoundVar: sound %d var %d result %d", sound, var, _heChannel[chan].soundVars[var]); return _heChannel[chan].soundVars[var]; } else { return 0; @@ -124,7 +124,7 @@ void Sound::setSoundVar(int sound, int var, int val) { } if (chan != -1) { - debug(0, "setSoundVar: sound %d var %d val %d", sound, var, val); + debug(1, "setSoundVar: sound %d var %d val %d", sound, var, val); _heChannel[chan].soundVars[var] = val; } } @@ -220,7 +220,7 @@ void Sound::processSoundCode() { break; } - debug(1, "Channel %d Timer %d Time %d", chan,tmr, time); + debug(1, "Channel %d Timer %d Time %d", chan, tmr, time); if (time >= tmr) break; @@ -263,14 +263,18 @@ void Sound::processSoundOpcodes(int sound, byte *codePtr, int *soundVars) { case 48: // Add var = READ_LE_UINT16(codePtr); codePtr += 2;; val = READ_LE_UINT16(codePtr); codePtr += 2;; - + if (edi == 2) { + val = getSoundVar(sound, val); + } val = getSoundVar(sound, var) + val; setSoundVar(sound, var, val); break; case 56: // Subtract var = READ_LE_UINT16(codePtr); codePtr += 2;; val = READ_LE_UINT16(codePtr); codePtr += 2;; - + if (edi == 2) { + val = getSoundVar(sound, val); + } val = getSoundVar(sound, var) - val; setSoundVar(sound, var, val); break; @@ -280,7 +284,6 @@ void Sound::processSoundOpcodes(int sound, byte *codePtr, int *soundVars) { if (edi == 2) { val = getSoundVar(sound, val); } - val = getSoundVar(sound, var) * val; setSoundVar(sound, var, val); break; @@ -322,12 +325,12 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) { debug(0,"playHESound: soundID %d heOffset %d heChannel %d heFlags %d", soundID, heOffset, heChannel, heFlags); - if (soundID > _vm->_numSounds) { - if (soundID >= 10000) { - // Special codes, used in pjgames - return; - } + if (soundID >= 10000) { + // Special codes, used in pjgames + return; + } + if (soundID > _vm->_numSounds) { int music_offs; char buf[32], buf1[128]; Common::File musicFile; |