diff options
author | Travis Howell | 2004-02-09 14:53:13 +0000 |
---|---|---|
committer | Travis Howell | 2004-02-09 14:53:13 +0000 |
commit | 36c9dc8b5b6c4b8d1654f08e068d7c758f34fa25 (patch) | |
tree | c0c419ee6c221198e64f21bf4fd6ef9f9eafe1d8 /scumm | |
parent | e98d5983da0ef68c53366a9433dfdb181933bf79 (diff) | |
download | scummvm-rg350-36c9dc8b5b6c4b8d1654f08e068d7c758f34fa25.tar.gz scummvm-rg350-36c9dc8b5b6c4b8d1654f08e068d7c758f34fa25.tar.bz2 scummvm-rg350-36c9dc8b5b6c4b8d1654f08e068d7c758f34fa25.zip |
Add opcode
svn-id: r12795
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 27 |
2 files changed, 17 insertions, 12 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 8a7ac5450e..005a6d9b6a 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -584,7 +584,7 @@ protected: void o6_rename(); void o6_writeFile(); void o6_findAllObjects(); - void o6_unknownE0(); + void o6_setVolume(); void o6_unknownE1(); void o6_unknownE4(); void o6_seekFile(); diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 3cbabe6fe3..935965a2fa 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -329,7 +329,7 @@ void ScummEngine_v6he::setupOpcodes() { OPCODE(o6_deleteFile), OPCODE(o6_rename), /* E0 */ - OPCODE(o6_unknownE0), + OPCODE(o6_setVolume), OPCODE(o6_unknownE1), OPCODE(o6_localizeArray), OPCODE(o6_pickVarRandom), @@ -1114,16 +1114,21 @@ void ScummEngine_v6he::o6_unknownE1() { push(area); } -void ScummEngine_v6he::o6_unknownE0() { - int a = fetchScriptByte(); - a -= 222; - if (a != 0) { - a -= 2; - if (a != 0) - return; - warning("o6_unknownE0(%d) stub", pop()); - } else { - warning("o6_uknownE0, sound volume %d stub", pop()); +void ScummEngine_v6he::o6_setVolume() { + byte subOp = fetchScriptByte(); + int soundVolumeMaster; + int volume = pop(); + switch (subOp) { + case 222: + if (_imuse) + _imuse->set_music_volume(volume); + else + _mixer->setMusicVolume(volume); + break; + case 224: + soundVolumeMaster = ConfMan.getInt("master_volume"); + _mixer->setVolume(volume * soundVolumeMaster / 255); + break; } } |