2009-02-17 15:02:16 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2014-02-18 02:34:24 +01:00
|
|
|
*
|
2009-02-17 15:02:16 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-02-18 02:34:24 +01:00
|
|
|
*
|
2009-02-17 15:02:16 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2009-05-14 12:38:50 +00:00
|
|
|
#include "sci/sci.h"
|
2010-02-13 17:44:58 +00:00
|
|
|
#include "sci/engine/features.h"
|
2009-02-27 02:23:40 +00:00
|
|
|
#include "sci/engine/state.h"
|
2009-02-24 05:51:55 +00:00
|
|
|
#include "sci/engine/kernel.h"
|
2009-04-25 08:50:42 +00:00
|
|
|
#include "sci/engine/vm.h" // for Object
|
2010-02-15 00:20:53 +00:00
|
|
|
#include "sci/sound/audio.h"
|
2010-02-13 17:44:58 +00:00
|
|
|
#include "sci/sound/soundcmd.h"
|
2009-02-15 06:10:59 +00:00
|
|
|
|
2011-02-09 01:09:01 +00:00
|
|
|
#include "audio/mixer.h"
|
2011-04-24 11:34:27 +03:00
|
|
|
#include "common/system.h"
|
2009-05-22 22:19:15 +00:00
|
|
|
|
2009-02-21 10:23:36 +00:00
|
|
|
namespace Sci {
|
|
|
|
|
2009-07-06 12:44:55 +00:00
|
|
|
/**
|
|
|
|
* Used for synthesized music playback
|
|
|
|
*/
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDoSound(EngineState *s, int argc, reg_t *argv) {
|
2010-07-08 21:22:59 +00:00
|
|
|
if (!s)
|
|
|
|
return make_reg(0, g_sci->_features->detectDoSoundType());
|
2010-07-09 12:06:41 +00:00
|
|
|
error("not supposed to call this");
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
2010-07-09 12:06:41 +00:00
|
|
|
#define CREATE_DOSOUND_FORWARD(_name_) reg_t k##_name_(EngineState *s, int argc, reg_t *argv) { return g_sci->_soundCmd->k##_name_(argc, argv, s->r_acc); }
|
2010-07-08 18:26:05 +00:00
|
|
|
|
2010-07-09 12:06:41 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundInit)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundPlay)
|
2010-08-02 21:20:43 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundRestore)
|
2010-07-09 12:06:41 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundDispose)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundMute)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundStop)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundStopAll)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundPause)
|
2010-07-20 11:17:33 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundResumeAfterRestore)
|
2010-07-09 12:06:41 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundMasterVolume)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundUpdate)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundFade)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundGetPolyphony)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundUpdateCues)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundSendMidi)
|
2010-11-24 14:21:31 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundGlobalReverb)
|
2010-07-09 12:06:41 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundSetHold)
|
2010-08-02 21:20:43 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundDummy)
|
2010-07-09 12:06:41 +00:00
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundGetAudioCapability)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundSuspend)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundSetVolume)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundSetPriority)
|
|
|
|
CREATE_DOSOUND_FORWARD(DoSoundSetLoop)
|
2010-07-08 18:26:05 +00:00
|
|
|
|
2009-10-25 03:26:20 +00:00
|
|
|
reg_t kDoCdAudio(EngineState *s, int argc, reg_t *argv) {
|
|
|
|
switch (argv[0].toUint16()) {
|
|
|
|
case kSciAudioPlay: {
|
2009-11-04 11:22:46 +00:00
|
|
|
if (argc < 2)
|
|
|
|
return NULL_REG;
|
2009-10-25 03:26:20 +00:00
|
|
|
|
2009-11-04 15:41:40 +00:00
|
|
|
uint16 track = argv[1].toUint16();
|
2009-11-04 11:22:46 +00:00
|
|
|
uint32 startFrame = (argc > 2) ? argv[2].toUint16() * 75 : 0;
|
|
|
|
uint32 totalFrames = (argc > 3) ? argv[3].toUint16() * 75 : 0;
|
2009-10-25 03:26:20 +00:00
|
|
|
|
2010-02-14 12:23:22 +00:00
|
|
|
return make_reg(0, g_sci->_audio->audioCdPlay(track, startFrame, totalFrames));
|
2009-10-25 03:26:20 +00:00
|
|
|
}
|
|
|
|
case kSciAudioStop:
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->audioCdStop();
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-10-25 03:26:20 +00:00
|
|
|
if (getSciVersion() == SCI_VERSION_1_1)
|
|
|
|
return make_reg(0, 1);
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2009-10-25 03:26:20 +00:00
|
|
|
break;
|
|
|
|
case kSciAudioPause:
|
|
|
|
warning("Can't pause CD Audio");
|
|
|
|
break;
|
|
|
|
case kSciAudioResume:
|
|
|
|
// This seems to be hacked up to update the CD instead of resuming
|
|
|
|
// audio like kDoAudio does.
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->audioCdUpdate();
|
2009-10-25 03:26:20 +00:00
|
|
|
break;
|
|
|
|
case kSciAudioPosition:
|
2010-02-14 12:23:22 +00:00
|
|
|
return make_reg(0, g_sci->_audio->audioCdPosition());
|
2010-06-10 20:26:59 +00:00
|
|
|
case kSciAudioWPlay: // CD Audio can't be preloaded
|
2009-10-25 03:26:20 +00:00
|
|
|
case kSciAudioRate: // No need to set the audio rate
|
|
|
|
case kSciAudioVolume: // The speech setting isn't used by CD Audio
|
|
|
|
case kSciAudioLanguage: // No need to set the language
|
|
|
|
break;
|
|
|
|
case kSciAudioCD:
|
|
|
|
// Init
|
|
|
|
return make_reg(0, 1);
|
|
|
|
default:
|
2010-06-17 23:45:38 +00:00
|
|
|
error("kCdDoAudio: Unhandled case %d", argv[0].toUint16());
|
2009-10-25 03:26:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2009-07-06 12:44:55 +00:00
|
|
|
/**
|
|
|
|
* Used for speech playback and digital soundtracks in CD games
|
|
|
|
*/
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
|
2009-10-25 03:26:20 +00:00
|
|
|
// JonesCD uses different functions based on the cdaudio.map file
|
|
|
|
// to use red book tracks.
|
2010-02-13 17:44:58 +00:00
|
|
|
if (g_sci->_features->usesCdTrack())
|
2009-10-25 03:26:20 +00:00
|
|
|
return kDoCdAudio(s, argc, argv);
|
|
|
|
|
2009-05-22 22:19:15 +00:00
|
|
|
Audio::Mixer *mixer = g_system->getMixer();
|
2009-05-25 11:44:24 +00:00
|
|
|
|
2009-06-07 15:53:30 +00:00
|
|
|
switch (argv[0].toUint16()) {
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioWPlay:
|
2009-06-12 23:46:23 +00:00
|
|
|
case kSciAudioPlay: {
|
|
|
|
uint16 module;
|
|
|
|
uint32 number;
|
|
|
|
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->stopAudio();
|
2009-06-12 23:46:23 +00:00
|
|
|
|
|
|
|
if (argc == 2) {
|
|
|
|
module = 65535;
|
|
|
|
number = argv[1].toUint16();
|
2010-01-28 23:11:55 +00:00
|
|
|
} else if (argc == 6 || argc == 8) {
|
2009-06-12 23:46:23 +00:00
|
|
|
module = argv[1].toUint16();
|
2010-06-18 09:37:06 +00:00
|
|
|
number = ((argv[2].toUint16() & 0xff) << 24) |
|
|
|
|
((argv[3].toUint16() & 0xff) << 16) |
|
|
|
|
((argv[4].toUint16() & 0xff) << 8) |
|
|
|
|
(argv[5].toUint16() & 0xff);
|
2012-07-25 12:13:35 +03:00
|
|
|
// Removed warning because of the high amount of console spam
|
|
|
|
/*if (argc == 8) {
|
|
|
|
// TODO: Handle the extra 2 SCI21 params
|
2012-06-11 11:48:49 +03:00
|
|
|
// argv[6] is always 1
|
|
|
|
// argv[7] is the contents of global 229 (0xE5)
|
|
|
|
warning("kDoAudio: Play called with SCI2.1 extra parameters: %04x:%04x and %04x:%04x",
|
|
|
|
PRINT_REG(argv[6]), PRINT_REG(argv[7]));
|
2012-07-25 12:13:35 +03:00
|
|
|
}*/
|
2009-06-12 23:46:23 +00:00
|
|
|
} else {
|
2009-05-27 08:48:57 +00:00
|
|
|
warning("kDoAudio: Play called with an unknown number of parameters (%d)", argc);
|
2009-06-12 23:46:23 +00:00
|
|
|
return NULL_REG;
|
2009-05-25 10:30:19 +00:00
|
|
|
}
|
2009-06-12 23:46:23 +00:00
|
|
|
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: play sample %d, module %d", number, module);
|
2010-06-12 11:41:22 +00:00
|
|
|
|
2010-06-10 20:26:59 +00:00
|
|
|
// return sample length in ticks
|
|
|
|
if (argv[0].toUint16() == kSciAudioWPlay)
|
|
|
|
return make_reg(0, g_sci->_audio->wPlayAudio(module, number));
|
|
|
|
else
|
|
|
|
return make_reg(0, g_sci->_audio->startAudio(module, number));
|
2009-06-12 23:46:23 +00:00
|
|
|
}
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioStop:
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: stop");
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->stopAudio();
|
2009-04-26 02:00:36 +00:00
|
|
|
break;
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioPause:
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: pause");
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->pauseAudio();
|
2009-04-26 02:00:36 +00:00
|
|
|
break;
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioResume:
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: resume");
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->resumeAudio();
|
2009-04-26 02:00:36 +00:00
|
|
|
break;
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioPosition:
|
2011-01-01 12:48:12 +00:00
|
|
|
//debugC(kDebugLevelSound, "kDoAudio: get position"); // too verbose
|
2010-02-14 12:23:22 +00:00
|
|
|
return make_reg(0, g_sci->_audio->getAudioPosition());
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioRate:
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: set audio rate to %d", argv[1].toUint16());
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->setAudioRate(argv[1].toUint16());
|
2009-04-26 02:00:36 +00:00
|
|
|
break;
|
2010-01-01 21:26:46 +00:00
|
|
|
case kSciAudioVolume: {
|
|
|
|
int16 volume = argv[1].toUint16();
|
|
|
|
volume = CLIP<int16>(volume, 0, AUDIO_VOLUME_MAX);
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: set volume to %d", volume);
|
2010-06-22 15:01:45 +00:00
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
if (getSciVersion() >= SCI_VERSION_2_1) {
|
|
|
|
int16 volumePrev = mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) / 2;
|
|
|
|
volumePrev = CLIP<int16>(volumePrev, 0, AUDIO_VOLUME_MAX);
|
|
|
|
mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volume * 2);
|
|
|
|
return make_reg(0, volumePrev);
|
|
|
|
} else
|
|
|
|
#endif
|
2010-01-01 21:26:46 +00:00
|
|
|
mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, volume * 2);
|
2013-04-15 21:35:18 +02:00
|
|
|
break;
|
2010-01-01 21:26:46 +00:00
|
|
|
}
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioLanguage:
|
2009-12-26 13:50:52 +00:00
|
|
|
// In SCI1.1: tests for digital audio support
|
2010-06-12 11:41:22 +00:00
|
|
|
if (getSciVersion() == SCI_VERSION_1_1) {
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: audio capability test");
|
2009-05-26 00:03:41 +00:00
|
|
|
return make_reg(0, 1);
|
2010-06-12 11:41:22 +00:00
|
|
|
} else {
|
2010-01-31 19:45:51 +00:00
|
|
|
int16 language = argv[1].toSint16();
|
2011-11-01 11:59:52 +01:00
|
|
|
|
|
|
|
// athrxx: It seems from disasm that the original KQ5 FM-Towns loads a default language (Japanese) audio map at the beginning
|
|
|
|
// right after loading the video and audio drivers. The -1 language argument in here simply means that the original will stick
|
|
|
|
// with Japanese. Instead of doing that we switch to the language selected in the launcher.
|
|
|
|
if (g_sci->getPlatform() == Common::kPlatformFMTowns && language == -1)
|
|
|
|
language = (g_sci->getLanguage() == Common::JA_JPN) ? K_LANG_JAPANESE : K_LANG_ENGLISH;
|
|
|
|
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: set language to %d", language);
|
2010-01-31 19:45:51 +00:00
|
|
|
|
|
|
|
if (language != -1)
|
2010-02-13 17:44:19 +00:00
|
|
|
g_sci->getResMan()->setAudioLanguage(language);
|
2010-01-31 19:45:51 +00:00
|
|
|
|
2010-06-10 11:18:10 +00:00
|
|
|
kLanguage kLang = g_sci->getSciLanguage();
|
|
|
|
g_sci->setSciLanguage(kLang);
|
|
|
|
|
|
|
|
return make_reg(0, kLang);
|
2010-01-31 19:45:51 +00:00
|
|
|
}
|
2009-04-26 02:00:36 +00:00
|
|
|
break;
|
2009-10-25 03:26:20 +00:00
|
|
|
case kSciAudioCD:
|
2010-06-21 22:58:33 +00:00
|
|
|
|
|
|
|
if (getSciVersion() <= SCI_VERSION_1_1) {
|
2011-01-01 12:48:12 +00:00
|
|
|
debugC(kDebugLevelSound, "kDoAudio: CD audio subop");
|
2010-06-21 22:58:33 +00:00
|
|
|
return kDoCdAudio(s, argc - 1, argv + 1);
|
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
} else {
|
|
|
|
// TODO: This isn't CD Audio in SCI32 anymore
|
|
|
|
warning("kDoAudio: Unhandled case 10, %d extra arguments passed", argc - 1);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
}
|
2010-06-17 12:29:58 +00:00
|
|
|
|
|
|
|
// 3 new subops in Pharkas. kDoAudio in Pharkas sits at seg026:038C
|
|
|
|
case 11:
|
2010-07-30 07:11:57 +00:00
|
|
|
// Not sure where this is used yet
|
2010-06-21 22:58:33 +00:00
|
|
|
warning("kDoAudio: Unhandled case 11, %d extra arguments passed", argc - 1);
|
2010-06-17 12:29:58 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
2010-07-30 07:11:57 +00:00
|
|
|
// Seems to be some sort of audio sync, used in Pharkas. Silenced the
|
|
|
|
// warning due to the high level of spam it produces. (takes no params)
|
2010-06-21 22:58:33 +00:00
|
|
|
//warning("kDoAudio: Unhandled case 12, %d extra arguments passed", argc - 1);
|
2010-06-17 12:29:58 +00:00
|
|
|
break;
|
|
|
|
case 13:
|
2010-07-30 07:11:57 +00:00
|
|
|
// Used in Pharkas whenever a speech sample starts (takes no params)
|
|
|
|
//warning("kDoAudio: Unhandled case 13, %d extra arguments passed", argc - 1);
|
2010-06-17 12:29:58 +00:00
|
|
|
break;
|
2012-07-25 12:13:35 +03:00
|
|
|
case 17:
|
|
|
|
// Seems to be some sort of audio sync, used in SQ6. Silenced the
|
|
|
|
// warning due to the high level of spam it produces. (takes no params)
|
|
|
|
//warning("kDoAudio: Unhandled case 17, %d extra arguments passed", argc - 1);
|
|
|
|
break;
|
2009-05-22 22:19:15 +00:00
|
|
|
default:
|
2010-05-18 15:52:45 +00:00
|
|
|
warning("kDoAudio: Unhandled case %d, %d extra arguments passed", argv[0].toUint16(), argc - 1);
|
2009-02-15 06:10:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
- Changed the unimplemented debug SCI kernel functions (InspectObj, ShowSends, ShowObjs, ShowFree, StackUsage and Profiler) to be dummy functions - we have our own debugger, and don't use these functions for debugging
- Removed the function number parameter from all kernel functions, as it's no longer needed, and removed the FAKE_FUNCT_NR hack
- Removed kUnknown() and kStub()
- Dummy/unknown kernel functions are no longer invoked, and a warning is shown instead, with the paremeters passed to them
Note: there is an evil hack used for debugging scripts in invoke_selector(), which probably no longer works now
svn-id: r44461
2009-09-29 14:24:07 +00:00
|
|
|
reg_t kDoSync(EngineState *s, int argc, reg_t *argv) {
|
2009-10-04 18:38:18 +00:00
|
|
|
SegManager *segMan = s->_segMan;
|
2009-06-07 15:53:30 +00:00
|
|
|
switch (argv[0].toUint16()) {
|
2009-06-07 19:15:55 +00:00
|
|
|
case kSciAudioSyncStart: {
|
|
|
|
ResourceId id;
|
|
|
|
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->stopSoundSync();
|
2009-06-07 19:15:55 +00:00
|
|
|
|
|
|
|
// Load sound sync resource and lock it
|
|
|
|
if (argc == 3) {
|
|
|
|
id = ResourceId(kResourceTypeSync, argv[2].toUint16());
|
|
|
|
} else if (argc == 7) {
|
|
|
|
id = ResourceId(kResourceTypeSync36, argv[2].toUint16(), argv[3].toUint16(), argv[4].toUint16(),
|
|
|
|
argv[5].toUint16(), argv[6].toUint16());
|
|
|
|
} else {
|
|
|
|
warning("kDoSync: Start called with an unknown number of parameters (%d)", argc);
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
2009-04-25 08:50:42 +00:00
|
|
|
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->setSoundSync(id, argv[1], segMan);
|
2009-04-25 08:50:42 +00:00
|
|
|
break;
|
2009-06-07 19:15:55 +00:00
|
|
|
}
|
2010-01-25 01:39:44 +00:00
|
|
|
case kSciAudioSyncNext:
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->doSoundSync(argv[1], segMan);
|
2009-04-25 08:50:42 +00:00
|
|
|
break;
|
2009-05-27 09:07:08 +00:00
|
|
|
case kSciAudioSyncStop:
|
2010-02-14 12:23:22 +00:00
|
|
|
g_sci->_audio->stopSoundSync();
|
2009-04-25 08:50:42 +00:00
|
|
|
break;
|
2009-05-27 09:07:08 +00:00
|
|
|
default:
|
2010-06-17 23:45:38 +00:00
|
|
|
error("DoSync: Unhandled subfunction %d", argv[0].toUint16());
|
2009-04-25 08:50:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2011-01-08 11:19:20 +00:00
|
|
|
#ifdef ENABLE_SCI32
|
|
|
|
|
|
|
|
reg_t kSetLanguage(EngineState *s, int argc, reg_t *argv) {
|
|
|
|
// This is used by script 90 of MUMG Deluxe from the main menu to toggle
|
|
|
|
// the audio language between English and Spanish.
|
|
|
|
// Basically, it instructs the interpreter to switch the audio resources
|
|
|
|
// (resource.aud and associated map files) and load them from the "Spanish"
|
2011-02-10 16:48:29 +00:00
|
|
|
// subdirectory instead.
|
|
|
|
Common::String audioDirectory = s->_segMan->getString(argv[0]);
|
|
|
|
//warning("SetLanguage: set audio resource directory to '%s'", audioDirectory.c_str());
|
|
|
|
g_sci->getResMan()->changeAudioDirectory(audioDirectory);
|
2011-01-08 11:19:20 +00:00
|
|
|
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2013-04-28 13:42:50 -04:00
|
|
|
reg_t kDoSoundPhantasmagoriaMac(EngineState *s, int argc, reg_t *argv) {
|
|
|
|
// Phantasmagoria Mac (and seemingly no other game (!)) uses this
|
|
|
|
// cutdown version of kDoSound.
|
|
|
|
|
|
|
|
switch (argv[0].toUint16()) {
|
|
|
|
case 0:
|
|
|
|
return g_sci->_soundCmd->kDoSoundMasterVolume(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 2:
|
|
|
|
return g_sci->_soundCmd->kDoSoundInit(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 3:
|
|
|
|
return g_sci->_soundCmd->kDoSoundDispose(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 4:
|
|
|
|
return g_sci->_soundCmd->kDoSoundPlay(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 5:
|
|
|
|
return g_sci->_soundCmd->kDoSoundStop(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 8:
|
|
|
|
return g_sci->_soundCmd->kDoSoundSetVolume(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 9:
|
|
|
|
return g_sci->_soundCmd->kDoSoundSetLoop(argc - 1, argv + 1, s->r_acc);
|
|
|
|
case 10:
|
|
|
|
return g_sci->_soundCmd->kDoSoundUpdateCues(argc - 1, argv + 1, s->r_acc);
|
|
|
|
}
|
|
|
|
|
|
|
|
error("Unknown kDoSound Phantasmagoria Mac subop %d", argv[0].toUint16());
|
|
|
|
return s->r_acc;
|
|
|
|
}
|
|
|
|
|
2011-01-08 11:19:20 +00:00
|
|
|
#endif
|
|
|
|
|
2009-02-21 10:23:36 +00:00
|
|
|
} // End of namespace Sci
|