From 0e365131ac58b7504e9e16b08a8b3125b6b37027 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 17 Jun 2010 12:29:58 +0000 Subject: Fixed wPlayAudio, and added some documentation on the 3 new kDoAudio subops. Digital sounds in Pharkas work again svn-id: r49928 --- engines/sci/engine/ksound.cpp | 16 +++++++++++++--- engines/sci/sound/audio.cpp | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'engines/sci') diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 8cf9400353..d4af4ade5c 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -174,9 +174,19 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) { case kSciAudioCD: debugC(2, kDebugLevelSound, "kDoAudio: CD audio subop"); return kDoCdAudio(s, argc - 1, argv + 1); - // TODO: There are 3 more functions used in Freddy Pharkas (11, 12 and 13) and new within sierra sci - // Details currently unknown - // kDoAudio sits at seg026:038C + + // 3 new subops in Pharkas. kDoAudio in Pharkas sits at seg026:038C + case 11: + warning("kDoAudio: Unhandled case %d, %d extra arguments passed", argv[0].toUint16(), argc - 1); + break; + case 12: + // Seems to be audio sync, used in Pharkas, silenced warning cause of the spam it produces + //warning("kDoAudio: Unhandled case %d, %d extra arguments passed", argv[0].toUint16(), argc - 1); + break; + case 13: + // Used in Pharkas whenever a speech sample starts + warning("kDoAudio: Unhandled case %d, %d extra arguments passed", argv[0].toUint16(), argc - 1); + break; default: warning("kDoAudio: Unhandled case %d, %d extra arguments passed", argv[0].toUint16(), argc - 1); } diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index ac3ef54c9a..0e235ee400 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -82,7 +82,7 @@ int AudioPlayer::wPlayAudio(uint16 module, uint32 tuple) { // sample length and return that. wPlayAudio should *not* actually start the sample. int sampleLen = 0; - Audio::AudioStream *audioStream = getAudioStream(module, tuple, &sampleLen); + Audio::AudioStream *audioStream = getAudioStream(tuple, module, &sampleLen); if (!audioStream) warning("wPlayAudio: unable to create stream for audio tuple %d, module %d", tuple, module); delete audioStream; -- cgit v1.2.3