diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/features.cpp | 9 | ||||
-rw-r--r-- | engines/sci/engine/features.h | 5 | ||||
-rw-r--r-- | engines/sci/engine/kernel_tables.h | 57 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 9 |
4 files changed, 39 insertions, 41 deletions
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp index 9251ac69e1..76f3c358d4 100644 --- a/engines/sci/engine/features.cpp +++ b/engines/sci/engine/features.cpp @@ -143,8 +143,17 @@ SciVersion GameFeatures::detectDoSoundType() { // SCI0LATE. Although the last SCI0EARLY game (lsl2) uses SCI0LATE resources _doSoundType = g_sci->getResMan()->detectEarlySound() ? SCI_VERSION_0_EARLY : SCI_VERSION_0_LATE; #ifdef ENABLE_SCI32 + } else if (getSciVersion() >= SCI_VERSION_2_1_MIDDLE && + g_sci->getGameId() != GID_SQ6 && + // Assuming MGDX uses SCI2.1early sound mode since SQ6 does + // and it was released earlier, but not verified (Phar Lap + // Windows-only release) + g_sci->getGameId() != GID_MOTHERGOOSEHIRES) { + _doSoundType = SCI_VERSION_2_1_MIDDLE; } else if (getSciVersion() >= SCI_VERSION_2_1_EARLY) { _doSoundType = SCI_VERSION_2_1_EARLY; + } else if (getSciVersion() >= SCI_VERSION_2) { + _doSoundType = SCI_VERSION_2; #endif } else if (SELECTOR(nodePtr) == -1) { // No nodePtr selector, so this game is definitely using newer diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h index 08611981cf..4a5b9ebb22 100644 --- a/engines/sci/engine/features.h +++ b/engines/sci/engine/features.h @@ -102,11 +102,8 @@ public: case GID_SQ6: return true; case GID_KQ7: - case GID_QFG4: - // (1) KQ7 1.51 (SCI2.1early) uses the non-standard attenuation, but + // KQ7 1.51 (SCI2.1early) uses the non-standard attenuation, but // 2.00b (SCI2.1mid) does not - // (2) QFG4 CD is SCI2.1early; QFG4 floppy is SCI2 and does not use - // the SCI2.1 audio system return getSciVersion() == SCI_VERSION_2_1_EARLY; default: return false; diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h index a0e7ccfef6..e077668df8 100644 --- a/engines/sci/engine/kernel_tables.h +++ b/engines/sci/engine/kernel_tables.h @@ -81,7 +81,6 @@ struct SciKernelMapSubEntry { #define SIG_SOUNDSCI0 SCI_VERSION_0_EARLY, SCI_VERSION_0_LATE #define SIG_SOUNDSCI1EARLY SCI_VERSION_1_EARLY, SCI_VERSION_1_EARLY #define SIG_SOUNDSCI1LATE SCI_VERSION_1_LATE, SCI_VERSION_1_LATE -#define SIG_SOUNDSCI21 SCI_VERSION_2_1_EARLY, SCI_VERSION_3 #define SIGFOR_ALL 0x3f #define SIGFOR_DOS 1 << 0 @@ -152,32 +151,27 @@ static const SciKernelMapSubEntry kDoSound_subops[] = { { SIG_SOUNDSCI1LATE, 19, MAP_CALL(DoSoundGlobalReverb), NULL, NULL }, { SIG_SOUNDSCI1LATE, 20, MAP_CALL(DoSoundUpdate), NULL, NULL }, #ifdef ENABLE_SCI32 - { SIG_SOUNDSCI21, 0, MAP_CALL(DoSoundMasterVolume), "(i)", NULL }, - { SIG_SOUNDSCI21, 1, MAP_CALL(DoSoundMute), "(i)", NULL }, - { SIG_SOUNDSCI21, 2, MAP_EMPTY(DoSoundRestore), NULL, NULL }, - { SIG_SOUNDSCI21, 3, MAP_CALL(DoSoundGetPolyphony), "", NULL }, - { SIG_SOUNDSCI21, 4, MAP_CALL(DoSoundGetAudioCapability), "", NULL }, - { SIG_SOUNDSCI21, 5, MAP_CALL(DoSoundSuspend), "i", NULL }, - { SIG_SOUNDSCI21, 6, MAP_CALL(DoSoundInit), "o", NULL }, - { SIG_SOUNDSCI21, 7, MAP_CALL(DoSoundDispose), "o", NULL }, - { SIG_SOUNDSCI21, 8, MAP_CALL(DoSoundPlay), "o", kDoSoundPlay_workarounds }, - // ^^ TODO: if this is really the only change between SCI1LATE AND SCI21, we could rename the - // SIG_SOUNDSCI1LATE #define to SIG_SINCE_SOUNDSCI1LATE and make it being SCI1LATE+. Although - // I guess there are many more changes somewhere - // TODO: Quest for Glory 4 (SCI2.1) uses the old scheme, we need to detect it accordingly - // signature for SCI21 should be "o" - { SIG_SOUNDSCI21, 9, MAP_CALL(DoSoundStop), "o", NULL }, - { SIG_SOUNDSCI21, 10, MAP_CALL(DoSoundPause), "[o0]i", NULL }, - { SIG_SOUNDSCI21, 11, MAP_CALL(DoSoundFade), "oiiii", kDoSoundFade_workarounds }, - { SIG_SOUNDSCI21, 12, MAP_CALL(DoSoundSetHold), "oi", NULL }, - { SIG_SOUNDSCI21, 13, MAP_EMPTY(DoSoundDummy), NULL, NULL }, - { SIG_SOUNDSCI21, 14, MAP_CALL(DoSoundSetVolume), "oi", NULL }, - { SIG_SOUNDSCI21, 15, MAP_CALL(DoSoundSetPriority), "oi", NULL }, - { SIG_SOUNDSCI21, 16, MAP_CALL(DoSoundSetLoop), "oi", NULL }, - { SIG_SOUNDSCI21, 17, MAP_CALL(DoSoundUpdateCues), "o", NULL }, - { SIG_SOUNDSCI21, 18, MAP_CALL(DoSoundSendMidi), "oiiii", NULL }, - { SIG_SOUNDSCI21, 19, MAP_CALL(DoSoundGlobalReverb), "(i)", NULL }, - { SIG_SOUNDSCI21, 20, MAP_CALL(DoSoundUpdate), "o", NULL }, + { SIG_SCI32, 0, MAP_CALL(DoSoundMasterVolume), "(i)", NULL }, + { SIG_SCI32, 1, MAP_CALL(DoSoundMute), "(i)", NULL }, + { SIG_SCI32, 2, MAP_EMPTY(DoSoundRestore), NULL, NULL }, + { SIG_SCI32, 3, MAP_CALL(DoSoundGetPolyphony), "", NULL }, + { SIG_SCI32, 4, MAP_CALL(DoSoundGetAudioCapability), "", NULL }, + { SIG_SCI32, 5, MAP_CALL(DoSoundSuspend), "i", NULL }, + { SIG_SCI32, 6, MAP_CALL(DoSoundInit), "o", NULL }, + { SIG_SCI32, 7, MAP_CALL(DoSoundDispose), "o", NULL }, + { SIG_SCI32, 8, MAP_CALL(DoSoundPlay), "o", kDoSoundPlay_workarounds }, + { SIG_SCI32, 9, MAP_CALL(DoSoundStop), "o", NULL }, + { SIG_SCI32, 10, MAP_CALL(DoSoundPause), "[o0]i", NULL }, + { SIG_SCI32, 11, MAP_CALL(DoSoundFade), "oiiii", kDoSoundFade_workarounds }, + { SIG_SCI32, 12, MAP_CALL(DoSoundSetHold), "oi", NULL }, + { SIG_SCI32, 13, MAP_EMPTY(DoSoundDummy), NULL, NULL }, + { SIG_SCI32, 14, MAP_CALL(DoSoundSetVolume), "oi", NULL }, + { SIG_SCI32, 15, MAP_CALL(DoSoundSetPriority), "oi", NULL }, + { SIG_SCI32, 16, MAP_CALL(DoSoundSetLoop), "oi", NULL }, + { SIG_SCI32, 17, MAP_CALL(DoSoundUpdateCues), "o", NULL }, + { SIG_SCI32, 18, MAP_CALL(DoSoundSendMidi), "oiiii", NULL }, + { SIG_SCI32, 19, MAP_CALL(DoSoundGlobalReverb), "(i)", NULL }, + { SIG_SCI32, 20, MAP_CALL(DoSoundUpdate), "o", NULL }, #endif SCI_SUBOPENTRY_TERMINATOR }; @@ -233,8 +227,9 @@ static const SciKernelMapSubEntry kDoAudio_subops[] = { { SIG_SCI32, 10, MAP_CALL(DoAudioBitDepth), "(i)", NULL }, { SIG_SCI32, 11, MAP_DUMMY(DoAudioDistort), "(i)", NULL }, { SIG_SCI32, 12, MAP_CALL(DoAudioMixing), "(i)", NULL }, - { SIG_SCI32, 13, MAP_CALL(DoAudioChannels), "(i)", NULL }, - { SIG_SCI32, 14, MAP_CALL(DoAudioPreload), "(i)", NULL }, + { SIG_SCI2, 13, MAP_EMPTY(DoAudioSetBufferSize), "i", NULL }, + { SIG_SINCE_SCI21, 13, MAP_CALL(DoAudioChannels), "(i)", NULL }, + { SIG_SINCE_SCI21, 14, MAP_CALL(DoAudioPreload), "(i)", NULL }, { SIG_SINCE_SCI21MID, 15, MAP_CALL(DoAudioFade), "(iiii)(i)(i)", NULL }, { SIG_SINCE_SCI21MID, 16, MAP_DUMMY(DoAudioFade36), "iiiii(iii)(i)", NULL }, { SIG_SINCE_SCI21MID, 17, MAP_CALL(DoAudioHasSignal), "", NULL }, @@ -670,9 +665,9 @@ static SciKernelMapEntry s_kernelMap[] = { { MAP_CALL(DisposeList), SIG_EVERYWHERE, "l", NULL, NULL }, { MAP_CALL(DisposeScript), SIG_EVERYWHERE, "i(i*)", NULL, kDisposeScript_workarounds }, { MAP_CALL(DisposeWindow), SIG_EVERYWHERE, "i(i)", NULL, NULL }, - { MAP_CALL(DoAudio), SCI_VERSION_NONE, SCI_VERSION_2, SIGFOR_ALL, "i(.*)", NULL, NULL }, // subop + { MAP_CALL(DoAudio), SIG_SCI16, SIGFOR_ALL, "i(.*)", NULL, NULL }, // subop #ifdef ENABLE_SCI32 - { "DoAudio", kDoAudio32, SIG_SINCE_SCI21, SIGFOR_ALL, "(.*)", kDoAudio_subops, NULL }, + { "DoAudio", kDoAudio32, SIG_SCI32, SIGFOR_ALL, "(.*)", kDoAudio_subops, NULL }, #endif { MAP_CALL(DoAvoider), SIG_EVERYWHERE, "o(i)", NULL, NULL }, { MAP_CALL(DoBresen), SIG_EVERYWHERE, "o", NULL, NULL }, diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index e0f9ec34db..995d7319c9 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -435,10 +435,7 @@ void EngineState::saveLoadWithSerializer(Common::Serializer &s) { g_sci->_gfxPalette32->saveLoadWithSerializer(s); g_sci->_gfxRemap32->saveLoadWithSerializer(s); g_sci->_gfxCursor32->saveLoadWithSerializer(s); - // TODO: SCI2 should be using Audio32 too, but is not yet. - if (g_sci->_audio32) { - g_sci->_audio32->saveLoadWithSerializer(s); - } + g_sci->_audio32->saveLoadWithSerializer(s); g_sci->_video32->saveLoadWithSerializer(s); } else #endif @@ -714,10 +711,10 @@ void SoundCommandParser::reconstructPlayList() { initSoundResource(entry); #ifdef ENABLE_SCI32 - if (_soundVersion >= SCI_VERSION_2_1_EARLY && entry->isSample) { + if (_soundVersion >= SCI_VERSION_2 && entry->isSample) { const reg_t &soundObj = entry->soundObj; - if ((int)readSelectorValue(_segMan, soundObj, SELECTOR(loop)) != -1 && + if (readSelectorValue(_segMan, soundObj, SELECTOR(loop)) == 0xFFFF && readSelector(_segMan, soundObj, SELECTOR(handle)) != NULL_REG) { writeSelector(_segMan, soundObj, SELECTOR(handle), NULL_REG); |