aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-25 19:57:09 +0000
committerFilippos Karapetis2009-05-25 19:57:09 +0000
commit16d649961774a2ed25f7c92b8b39c1152e9966c2 (patch)
treec2f2c604a8747a70e8474f8830d5a7140d7d9d27 /engines/sci/engine
parent183c9e56ed10eacef4131c0f40cc110b67d6c5fd (diff)
downloadscummvm-rg350-16d649961774a2ed25f7c92b8b39c1152e9966c2.tar.gz
scummvm-rg350-16d649961774a2ed25f7c92b8b39c1152e9966c2.tar.bz2
scummvm-rg350-16d649961774a2ed25f7c92b8b39c1152e9966c2.zip
WIP code for the speech in the floppy version of KQ6 (still needs work)
svn-id: r40894
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/ksound.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index f1d8ab7e45..8322be4d86 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -797,7 +797,7 @@ reg_t kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
break;
}
case _K_SCI1_SOUND_GET_AUDIO_CAPABILITY : {
- return NULL_REG;
+ return make_reg(0, 1);//NULL_REG;
}
case _K_SCI1_SOUND_PLAY_HANDLE : {
int looping = GET_SEL32V(obj, loop);
@@ -996,6 +996,11 @@ reg_t kDoSound(EngineState *s, int funct_nr, int argc, reg_t *argv) {
// Used for speech playback in CD games
reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+ printf("kDoAudio called with %d parameters: ", argc);
+ for (int i = 0; i < argc; i++)
+ printf("%d, ", SKPV(i));
+ printf("\n");
+
Audio::Mixer *mixer = g_system->getMixer();
int sampleLen = 0;
@@ -1012,11 +1017,20 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
// Try to load from an external patch file first
Sci::Resource* audioRes = s->resmgr->findResource(kResourceTypeAudio, UKPV(1), 1);
- if (audioRes) {
- audioStream = s->sound.audioResource->getAudioStream(audioRes, &sampleLen);
- } else {
- // No patch file found, read it from the audio volume
- audioStream = s->sound.audioResource->getAudioStream(UKPV(1), &sampleLen);
+ if (s->_gameName == "KQ5") {
+ if (audioRes) {
+ audioStream = s->sound.audioResource->getAudioStreamKQ5CD(audioRes, &sampleLen);
+ } else {
+ // No patch file found, read it from the audio volume
+ audioStream = s->sound.audioResource->getAudioStreamKQ5CD(UKPV(1), &sampleLen);
+ }
+ } else if (s->_gameName == "Kq6") {
+ if (audioRes) {
+ audioStream = s->sound.audioResource->getAudioStreamKQ6Floppy(audioRes, &sampleLen);
+ } else {
+ // No patch file found, read it from the audio volume
+ audioStream = s->sound.audioResource->getAudioStreamKQ6Floppy(UKPV(1), &sampleLen);
+ }
}
if (audioStream)