aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v5.cpp
diff options
context:
space:
mode:
authorFlorian Kagerer2010-08-18 21:38:43 +0000
committerFlorian Kagerer2010-08-18 21:38:43 +0000
commit29a5c6a45b90e64cf5d618da4cdcd6e6da3425fb (patch)
tree16a964ac2f849c71399028e3debaf0faef45b447 /engines/scumm/script_v5.cpp
parentc04d3e46899194af3558f611af634dc7124ab7c2 (diff)
downloadscummvm-rg350-29a5c6a45b90e64cf5d618da4cdcd6e6da3425fb.tar.gz
scummvm-rg350-29a5c6a45b90e64cf5d618da4cdcd6e6da3425fb.tar.bz2
scummvm-rg350-29a5c6a45b90e64cf5d618da4cdcd6e6da3425fb.zip
SCUMM/FM-TOWNS: start rewriting audio code
- Start rewriting audio code for FM-TOWNS versions of Loom, Indy3 and Monkey Island 1 using the recently added code in towns_audio.cpp (Zak should work the same way, but I can't test, since I don't own that one). - All sound types (pcm, euphony and cd audio) now support volume and balance control (e.g. try walking into/out of the kitchen and opening/closing the door in the Scumm Bar in Monkey Island 1 or walking into/out of the circus tent). - Pcm sounds now support proper loop start/end and note offsets (e.g. try out the hammer sound in the forge in LOOM for example). - some other minor improvements - The FM-Towns versions of Indy 4 and Monkey Island 2 are not affected. I don't have Monkey Island 2, but I presume that it will work like Indy 4. Adding support for these will be a separate task, since they work quite differently. svn-id: r52198
Diffstat (limited to 'engines/scumm/script_v5.cpp')
-rw-r--r--engines/scumm/script_v5.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 556f5b0af1..39e691c891 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -29,6 +29,7 @@
#include "scumm/scumm_v3.h"
#include "scumm/scumm_v5.h"
#include "scumm/sound.h"
+#include "scumm/player_towns.h"
#include "scumm/util.h"
#include "scumm/verbs.h"
@@ -1595,21 +1596,18 @@ void ScummEngine_v5::o5_resourceRoutines() {
debug(0, "o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
break;
case 35:
- // TODO: Might be used to set CD volume in FM-TOWNS Loom
- foo = getVarOrDirectByte(PARAM_2);
- debug(0, "o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
+ if (_townsPlayer)
+ _townsPlayer->setVolumeCD(getVarOrDirectByte(PARAM_2), resid);
break;
case 36:
- // TODO: Sets the loudness of a sound resource. Used in Indy3 and Zak.
foo = getVarOrDirectByte(PARAM_2);
bar = fetchScriptByte();
- debug(0, "o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
+ if (_townsPlayer)
+ _townsPlayer->setSoundVolume(resid, foo, bar);
break;
case 37:
- // TODO: Sets the pitch of a sound resource (pitch = foo - center semitones.
- // "center" is at 0x32 in the sfx resource (always 0x3C in zak256, but sometimes different in Indy3).
- foo = getVarOrDirectByte(PARAM_2);
- debug(0, "o5_resourceRoutines %d not yet handled (script %d)", op, vm.slot[_currentScript].number);
+ if (_townsPlayer)
+ _townsPlayer->setSoundNote(resid, getVarOrDirectByte(PARAM_2));
break;
default:
@@ -1981,6 +1979,7 @@ void ScummEngine_v5::o5_startMusic() {
break;
case 0xFF:
// TODO: Might return current CD volume in FM-TOWNS Loom. See also bug #805691.
+ result = _townsPlayer->getCurrentCdaVolume();
break;
default:
// TODO: return track length in seconds. We'll have to extend Sound and OSystem for this.