[Scummvm-git-logs] scummvm master -> f9287b26c8ee453f774ecb556460d46456e9ac49

sluicebox 22204938+sluicebox at users.noreply.github.com
Fri Nov 27 19:04:50 UTC 2020


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c71db70d25 SCI: Remove redundant version check from kSciAudioCD
3c71df687b SCI: Return correct kSciAudioCD value on failure
f9287b26c8 SCI: Play KQ6 credits song even when CD audio fails


Commit: c71db70d25eb6fb4ee9a62d03213f0cde0e3b16c
    https://github.com/scummvm/scummvm/commit/c71db70d25eb6fb4ee9a62d03213f0cde0e3b16c
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-11-27T10:58:35-08:00

Commit Message:
SCI: Remove redundant version check from kSciAudioCD

This version check is enforced by kernel tables

Changed paths:
    engines/sci/engine/ksound.cpp


diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 99ded8ab1f..04ef81413d 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -260,15 +260,10 @@ reg_t kDoAudio(EngineState *s, int argc, reg_t *argv) {
 		}
 		break;
 	case kSciAudioCD:
+		debugC(kDebugLevelSound, "kDoAudio: CD audio subop");
+		return kDoCdAudio(s, argc - 1, argv + 1);
 
-		if (getSciVersion() <= SCI_VERSION_1_1) {
-			debugC(kDebugLevelSound, "kDoAudio: CD audio subop");
-			return kDoCdAudio(s, argc - 1, argv + 1);
-		}
-		// fall through
-		// FIXME: fall through intended?
-
-		// 3 new subops in Pharkas CD (including CD demo). kDoAudio in Pharkas sits at seg026:038C
+	// 3 new subops in Pharkas CD (including CD demo). kDoAudio in Pharkas sits at seg026:038C
 	case 11:
 		// Not sure where this is used yet
 		warning("kDoAudio: Unhandled case 11, %d extra arguments passed", argc - 1);


Commit: 3c71df687b462bcceba3c745ef0aaabd3eff322f
    https://github.com/scummvm/scummvm/commit/3c71df687b462bcceba3c745ef0aaabd3eff322f
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-11-27T10:58:35-08:00

Commit Message:
SCI: Return correct kSciAudioCD value on failure

SSCI returns 0 when CD audio track can't be selected

Changed paths:
    engines/sci/sound/audio.cpp


diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 31d00e1dba..c1b64c1021 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -515,8 +515,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) {
 
 		// Subtract one from track. KQ6 starts at track 1, while ScummVM
 		// ignores the data track and considers track 2 to be track 1.
-		g_system->getAudioCDManager()->play(track - 1, 1, start, duration);
-		return 1;
+		return g_system->getAudioCDManager()->play(track - 1, 1, start, duration) ? 1 : 0;
 	} else {
 		// Jones in the Fast Lane CD Audio format
 		uint32 length = 0;


Commit: f9287b26c8ee453f774ecb556460d46456e9ac49
    https://github.com/scummvm/scummvm/commit/f9287b26c8ee453f774ecb556460d46456e9ac49
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2020-11-27T10:58:35-08:00

Commit Message:
SCI: Play KQ6 credits song even when CD audio fails

Changed paths:
    engines/sci/engine/script_patches.cpp


diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 29a68a4063..01ed36b011 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -5527,6 +5527,38 @@ static const uint16 kq6PatchDarkRoomInventory[] = {
 	PATCH_END
 };
 
+// The Girl In The Tower theme plays from a CD audio track during the credits.
+//  In ScummVM this requires an actual CD, or a mounted CD image, or extracting
+//  the audio to a "track1" file ahead of time. If the track can't be played
+//  then there is silence for the entire credits, but the game includes a 5 MB
+//  Audio version to fall back on when CD audio is unavailable. The script plays
+//  this when the CD audio driver fails to load, though this never occurs in our
+//  our implementation and doesn't address a missing track.
+//
+// We ensure that the credits theme always plays by patching the script to also
+//  fall back on the Audio version when CD audio playback fails.
+//
+// Applies to: PC CD
+// Responsible method: sCredits:init
+static const uint16 kq6CDSignatureGirlInTheTowerPlayback[] = {
+	SIG_MAGICDWORD,
+	0x39, 0x05,                         // pushi 05
+	0x39, 0x0a,                         // pushi 0a   [ kSciAudioCD ]
+	0x7a,                               // push2      [ play ]
+	0x7a,                               // push2      [ track ]
+	0x76,                               // push0      [ start ]
+	0x38, SIG_UINT16(0x00ec),           // pushi 00ec [ end ]
+	0x43, 0x75, 0x0a,                   // callk DoAudio 0a
+	0x33,                               // jmp [ skip Audio version ]
+	SIG_END
+};
+
+static const uint16 kq6CDPatchGirlInTheTowerPlayback[] = {
+	PATCH_ADDTOOFFSET(+13),
+	0x2f,                               // bt [ skip Audio version if CD audio succeeded ]
+	PATCH_END
+};
+
 // Audio + subtitles support - SHARED! - used for King's Quest 6 and Laura Bow 2.
 //  This patch gets enabled when the user selects "both" in the ScummVM
 //  "Speech + Subtitles" menu. We currently use global[98d] to hold a kMemory
@@ -5968,13 +6000,14 @@ static const uint16 kq6CDPatchAudioTextMenuSupport[] = {
 
 //          script, description,                                      signature                                 patch
 static const SciScriptPatcherEntry kq6Signatures[] = {
+	{  true,    52, "CD: Girl In The Tower playback",                 1, kq6CDSignatureGirlInTheTowerPlayback,     kq6CDPatchGirlInTheTowerPlayback },
 	{  true,    87, "fix Drink Me bottle",                            1, kq6SignatureDrinkMeFix,                   kq6PatchDrinkMeFix },
 	{ false,    87, "Mac: Drink Me pic",                              1, kq6SignatureMacDrinkMePic,                kq6PatchMacDrinkMePic },
 	{  true,   281, "fix pawnshop genie eye",                         1, kq6SignaturePawnshopGenieEye,             kq6PatchPawnshopGenieEye },
 	{  true,   300, "fix floating off steps",                         2, kq6SignatureCliffStepFloatFix,            kq6PatchCliffStepFloatFix },
 	{  true,   300, "fix floating off steps",                         2, kq6SignatureCliffItemFloatFix,            kq6PatchCliffItemFloatFix },
 	{  true,   405, "fix catacombs room message",                     1, kq6SignatureRoom405LookMessage,           kq6PatchRoom405LookMessage },
-	{  true,   406, "fix catacombs dark room inventory",              1, kq6SignatureDarkRoomInventory,           kq6PatchDarkRoomInventory },
+	{  true,   406, "fix catacombs dark room inventory",              1, kq6SignatureDarkRoomInventory,            kq6PatchDarkRoomInventory },
 	{  true,   407, "fix catacombs room message",                     1, kq6SignatureRoom407LookMessage,           kq6PatchRoom407LookMessage },
 	{  true,   480, "CD: fix wallflower dance",                       1, kq6CDSignatureWallFlowerDanceFix,         kq6CDPatchWallFlowerDanceFix },
 	{  true,   480, "fix getting baby tears",                         1, kq6SignatureGetBabyTears,                 kq6PatchGetBabyTears },




More information about the Scummvm-git-logs mailing list