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

bluegr bluegr at gmail.com
Thu Aug 30 22:51:36 CEST 2018


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:
18837ded6e SCI32: Add audio volume sync support for Hoyle5
e32237ecb4 SCI32: update the fallback detector for Hoyle5, some cleanup
dd7c000e44 SCI32: Hide the unavailable games in the Hoyle 5 derived collections


Commit: 18837ded6ef9318bc4473ccccd09f8f43157c3aa
    https://github.com/scummvm/scummvm/commit/18837ded6ef9318bc4473ccccd09f8f43157c3aa
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-30T23:51:00+03:00

Commit Message:
SCI32: Add audio volume sync support for Hoyle5

Changed paths:
    engines/sci/engine/features.cpp
    engines/sci/engine/guest_additions.cpp
    engines/sci/engine/guest_additions.h
    engines/sci/engine/vm.h


diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index 7172a6f..06fa046 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -574,6 +574,7 @@ bool GameFeatures::audioVolumeSyncUsesGlobals() const {
 	switch (g_sci->getGameId()) {
 	case GID_GK1:
 	case GID_GK2:
+	case GID_HOYLE5:
 	case GID_LSL6HIRES:
 	case GID_LSL7:
 	case GID_PHANTASMAGORIA:
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index 06d8d9a..6e15a52 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -112,8 +112,7 @@ bool GuestAdditions::shouldSyncAudioToScummVM() const {
 		} else if ((gameId == GID_GK1 || gameId == GID_SQ6) && (objName == "musicBar" ||
 																objName == "soundBar")) {
 			return true;
-		} else if (gameId == GID_PQ4 && (objName == "increaseVolume" ||
-										 objName == "decreaseVolume")) {
+		} else if (gameId == GID_GK2 && objName == "soundSlider") {
 			return true;
 		} else if (gameId == GID_KQ7 && (objName == "volumeUp" ||
 										 objName == "volumeDown")) {
@@ -121,14 +120,11 @@ bool GuestAdditions::shouldSyncAudioToScummVM() const {
 		} else if (gameId == GID_LSL6HIRES && (objName == "hiResMenu" ||
 											   objName == "volumeDial")) {
 			return true;
-		} else if (gameId == GID_MOTHERGOOSEHIRES && objName == "MgButtonBar") {
-			return true;
-		} else if (gameId == GID_PQSWAT && (objName == "volumeDownButn" ||
-											objName == "volumeUpButn")) {
-			return true;
-		} else if (gameId == GID_SHIVERS && objName == "spVolume") {
+		} else if ((gameId == GID_LSL7 || gameId == GID_TORIN) && (objName == "oMusicScroll" ||
+																   objName == "oSFXScroll" ||
+																   objName == "oAudioScroll")) {
 			return true;
-		} else if (gameId == GID_GK2 && objName == "soundSlider") {
+		} else if (gameId == GID_MOTHERGOOSEHIRES && objName == "MgButtonBar") {
 			return true;
 		} else if (gameId == GID_PHANTASMAGORIA && (objName == "midiVolDown" ||
 													objName == "midiVolUp" ||
@@ -137,9 +133,13 @@ bool GuestAdditions::shouldSyncAudioToScummVM() const {
 			return true;
 		} else if (gameId == GID_PHANTASMAGORIA2 && objName == "foo2") {
 			return true;
-		} else if ((gameId == GID_LSL7 || gameId == GID_TORIN) && (objName == "oMusicScroll" ||
-																   objName == "oSFXScroll" ||
-																   objName == "oAudioScroll")) {
+		} else if (gameId == GID_PQ4 && (objName == "increaseVolume" ||
+										 objName == "decreaseVolume")) {
+			return true;
+		} else if (gameId == GID_PQSWAT && (objName == "volumeDownButn" ||
+											objName == "volumeUpButn")) {
+			return true;
+		} else if (gameId == GID_SHIVERS && objName == "spVolume") {
 			return true;
 #endif
 		}
@@ -163,6 +163,8 @@ void GuestAdditions::writeVarHook(const int type, const int index, const reg_t v
 				syncAudioVolumeGlobalsToScummVM(index, value);
 			} else if (g_sci->getGameId() == GID_GK1) {
 				syncGK1StartupVolumeFromScummVM(index, value);
+			} else if (g_sci->getGameId() == GID_HOYLE5 && index == kGlobalVarHoyle5MusicVolume) {
+				syncHoyle5VolumeFromScummVM((ConfMan.getInt("music_volume") + 1) * kHoyle5VolumeMax / Audio::Mixer::kMaxMixerVolume);
 			} else if (g_sci->getGameId() == GID_RAMA && !g_sci->isDemo() && index == kGlobalVarRamaMusicVolume) {
 				syncRamaVolumeFromScummVM((ConfMan.getInt("music_volume") + 1) * kRamaVolumeMax / Audio::Mixer::kMaxMixerVolume);
 			}
@@ -1004,6 +1006,13 @@ void GuestAdditions::syncAudioVolumeGlobalsFromScummVM() const {
 		break;
 	}
 
+	case GID_HOYLE5: {
+		const int16 musicVolume = (ConfMan.getInt("music_volume") + 1) * kHoyle5VolumeMax / Audio::Mixer::kMaxMixerVolume;
+		syncHoyle5VolumeFromScummVM(musicVolume);
+		syncHoyle5UI(musicVolume);
+		break;
+	}
+
 	case GID_LSL6HIRES: {
 		const int16 musicVolume = (ConfMan.getInt("music_volume") + 1) * kLSL6HiresUIVolumeMax / Audio::Mixer::kMaxMixerVolume;
 		syncLSL6HiresVolumeFromScummVM(musicVolume);
@@ -1136,6 +1145,11 @@ void GuestAdditions::syncGK2VolumeFromScummVM(const int16 musicVolume) const {
 	}
 }
 
+void GuestAdditions::syncHoyle5VolumeFromScummVM(const int16 musicVolume) const {
+	_state->variables[VAR_GLOBAL][kGlobalVarHoyle5MusicVolume] = make_reg(0, musicVolume);
+	g_sci->_soundCmd->setMasterVolume(ConfMan.getBool("mute") ? 0 : (musicVolume * MUSIC_MASTERVOLUME_MAX / kHoyle5VolumeMax));
+}
+
 void GuestAdditions::syncLSL6HiresVolumeFromScummVM(const int16 musicVolume) const {
 	_state->variables[VAR_GLOBAL][kGlobalVarLSL6HiresMusicVolume] = make_reg(0, musicVolume);
 	g_sci->_soundCmd->setMasterVolume(ConfMan.getBool("mute") ? 0 : (musicVolume * MUSIC_MASTERVOLUME_MAX / kLSL6HiresUIVolumeMax));
@@ -1195,6 +1209,15 @@ void GuestAdditions::syncAudioVolumeGlobalsToScummVM(const int index, const reg_
 		}
 		break;
 
+	case GID_HOYLE5:
+		if (index == kGlobalVarHoyle5MusicVolume) {
+			const int16 masterVolume = value.toSint16() * Audio::Mixer::kMaxMixerVolume / kHoyle5VolumeMax;
+			ConfMan.setInt("music_volume", masterVolume);
+			ConfMan.setInt("sfx_volume", masterVolume);
+			ConfMan.setInt("speech_volume", masterVolume);
+		}
+		break;
+
 	case GID_LSL6HIRES:
 		if (index == kGlobalVarLSL6HiresMusicVolume) {
 			const int16 musicVolume = value.toSint16() * Audio::Mixer::kMaxMixerVolume / kLSL6HiresUIVolumeMax;
@@ -1299,6 +1322,10 @@ void GuestAdditions::syncInGameUI(const int16 musicVolume, const int16 sfxVolume
 		syncQFG4UI(musicVolume);
 		break;
 
+	case GID_HOYLE5:
+		syncHoyle5UI(musicVolume);
+		break;
+
 	case GID_SHIVERS:
 		syncShivers1UI(sfxVolume);
 		break;
@@ -1344,6 +1371,22 @@ void GuestAdditions::syncGK2UI() const {
 	}
 }
 
+void GuestAdditions::syncHoyle5UI(const int16 musicVolume) const {
+	const reg_t sliderId = _segMan->findObjectByName("volumeSlider");
+	if (!sliderId.isNull()) {
+		const int16 yPosition = 167 - musicVolume * 145 / 10;
+		writeSelectorValue(_segMan, sliderId, SELECTOR(y), yPosition);
+
+		// There does not seem to be any good way to learn whether the
+		// volume slider is visible (and thus eligible for
+		// kUpdateScreenItem)
+		const reg_t planeId = readSelector(_segMan, sliderId, SELECTOR(plane));
+		if (g_sci->_gfxFrameout->getPlanes().findByObject(planeId) != nullptr) {
+			g_sci->_gfxFrameout->kernelUpdateScreenItem(sliderId);
+		}
+	}
+}
+
 void GuestAdditions::syncLSL6HiresUI(const int16 musicVolume) const {
 	const reg_t musicDialId = _segMan->findObjectByName("volumeDial");
 	if (!musicDialId.isNull()) {
diff --git a/engines/sci/engine/guest_additions.h b/engines/sci/engine/guest_additions.h
index ba6adf3..b49fe9d 100644
--- a/engines/sci/engine/guest_additions.h
+++ b/engines/sci/engine/guest_additions.h
@@ -45,6 +45,7 @@ enum {
 
 	kRamaVolumeMax         = 16,
 	kLSL6HiresUIVolumeMax  = 13,
+	kHoyle5VolumeMax       = 8,
 	kLSL6HiresSubtitleFlag = 105
 };
 #endif
@@ -387,6 +388,7 @@ private:
 	void syncGK1VolumeFromScummVM(const int16 musicVolume, const int16 dacVolume) const;
 
 	void syncGK2VolumeFromScummVM(const int16 musicVolume) const;
+	void syncHoyle5VolumeFromScummVM(const int16 musicVolume) const;
 	void syncLSL6HiresVolumeFromScummVM(const int16 musicVolume) const;
 	void syncPhant2VolumeFromScummVM(const int16 masterVolume) const;
 	void syncRamaVolumeFromScummVM(const int16 musicVolume) const;
@@ -416,6 +418,7 @@ private:
 
 	void syncGK1UI() const;
 	void syncGK2UI() const;
+	void syncHoyle5UI(const int16 musicVolume) const;
 	void syncLSL6HiresUI(const int16 musicVolume) const;
 	void syncMGDXUI(const int16 musicVolume) const;
 	void syncPhant1UI(const int16 oldMusicVolume, const int16 musicVolume, reg_t &musicGlobal, const int16 oldDacVolume, const int16 dacVolume, reg_t &dacGlobal) const;
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 9cb88e3..19d4dea 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -176,7 +176,8 @@ enum GlobalVar {
 	// a master volume that affects both music *and* sound effects
 	kGlobalVarPhant2MasterVolume   = 236, // 0 to 127
 	kGlobalVarPhant2ControlPanel   = 250,
-	kGlobalVarShivers1Score        = 349
+	kGlobalVarShivers1Score        = 349,
+	kGlobalVarHoyle5MusicVolume    = 897
 };
 
 /** Number of kernel calls in between gcs; should be < 50000 */


Commit: e32237ecb438452b8b57f674a5d86e944aab5982
    https://github.com/scummvm/scummvm/commit/e32237ecb438452b8b57f674a5d86e944aab5982
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-30T23:51:01+03:00

Commit Message:
SCI32: update the fallback detector for Hoyle5, some cleanup

Changed paths:
    engines/sci/detection.cpp


diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index b0d78f7..e948d2a 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -227,76 +227,77 @@ struct OldNewIdTableEntry {
 };
 
 static const OldNewIdTableEntry s_oldNewTable[] = {
-	{ "archive",    "chest",            SCI_VERSION_NONE     },
-	{ "arthur",		"camelot",			SCI_VERSION_NONE     },
-	{ "brain",      "castlebrain",      SCI_VERSION_1_MIDDLE },	// Amiga
-	{ "brain",      "castlebrain",      SCI_VERSION_1_LATE   },
-	{ "demo",		"christmas1988",	SCI_VERSION_NONE     },
-	{ "card",       "christmas1990",    SCI_VERSION_1_EARLY, },
-	{ "card",       "christmas1992",    SCI_VERSION_1_1      },
-	{ "RH Budget",	"cnick-longbow",	SCI_VERSION_NONE     },
+	{ "archive",    "chest",            SCI_VERSION_NONE       },
+	{ "arthur",		"camelot",			SCI_VERSION_NONE       },
+	{ "brain",      "castlebrain",      SCI_VERSION_1_MIDDLE   },	// Amiga
+	{ "brain",      "castlebrain",      SCI_VERSION_1_LATE     },
+	{ "demo",		"christmas1988",	SCI_VERSION_NONE       },
+	{ "card",       "christmas1990",    SCI_VERSION_1_EARLY,   },
+	{ "card",       "christmas1992",    SCI_VERSION_1_1        },
+	{ "RH Budget",	"cnick-longbow",	SCI_VERSION_NONE       },
 	// iceman is the same
-	{ "icedemo",	"iceman",			SCI_VERSION_NONE     },
+	{ "icedemo",	"iceman",			SCI_VERSION_NONE       },
 	// longbow is the same
-	{ "eco",		"ecoquest",			SCI_VERSION_NONE     },
-	{ "eco2",		"ecoquest2",		SCI_VERSION_NONE     },	// EcoQuest 2 demo
-	{ "rain",		"ecoquest2",		SCI_VERSION_NONE     },	// EcoQuest 2 full
-	{ "tales",		"fairytales",		SCI_VERSION_NONE     },
-	{ "fp",			"freddypharkas",	SCI_VERSION_NONE     },
-	{ "emc",		"funseeker",		SCI_VERSION_NONE     },
-	{ "gk",			"gk1",				SCI_VERSION_NONE     },
+	{ "eco",		"ecoquest",			SCI_VERSION_NONE       },
+	{ "eco2",		"ecoquest2",		SCI_VERSION_NONE       },	// EcoQuest 2 demo
+	{ "rain",		"ecoquest2",		SCI_VERSION_NONE       },	// EcoQuest 2 full
+	{ "tales",		"fairytales",		SCI_VERSION_NONE       },
+	{ "fp",			"freddypharkas",	SCI_VERSION_NONE       },
+	{ "emc",		"funseeker",		SCI_VERSION_NONE       },
+	{ "gk",			"gk1",				SCI_VERSION_NONE       },
 	// gk2 is the same
-	{ "gk2demo",	"gk2",				SCI_VERSION_NONE     },
-	{ "hoyledemo",	"hoyle1",			SCI_VERSION_NONE     },
-	{ "cardgames",	"hoyle1",			SCI_VERSION_NONE     },
-	{ "solitare",	"hoyle2",			SCI_VERSION_NONE     },
-	// hoyle3 is the same
-	// hoyle4 is the same
-	{ "brain",      "islandbrain",      SCI_VERSION_1_1      },
-	{ "demo000",	"kq1sci",			SCI_VERSION_NONE     },
-	{ "kq1",		"kq1sci",			SCI_VERSION_NONE     },
-	{ "kq4",		"kq4sci",			SCI_VERSION_NONE     },
+	{ "gk2demo",	"gk2",				SCI_VERSION_NONE       },
+	{ "hoyledemo",	"hoyle1",			SCI_VERSION_NONE       },
+	{ "cardgames",	"hoyle1",			SCI_VERSION_NONE       },
+	{ "solitare",	"hoyle2",			SCI_VERSION_NONE       },
+	{ "hoyle3",	    "hoyle3",			SCI_VERSION_NONE       },
+	{ "hoyle4",	    "hoyle4",			SCI_VERSION_1_1        },
+	{ "hoyle4",	    "hoyle5",			SCI_VERSION_2_1_MIDDLE },
+	{ "brain",      "islandbrain",      SCI_VERSION_1_1        },
+	{ "demo000",	"kq1sci",			SCI_VERSION_NONE       },
+	{ "kq1",		"kq1sci",			SCI_VERSION_NONE       },
+	{ "kq4",		"kq4sci",			SCI_VERSION_NONE       },
 	// kq5 is the same
 	// kq6 is the same
-	{ "kq7cd",		"kq7",				SCI_VERSION_NONE     },
-	{ "quizgame-demo", "kquestions",    SCI_VERSION_NONE     },
-	{ "mm1",		"laurabow",			SCI_VERSION_NONE     },
-	{ "cb1",		"laurabow",			SCI_VERSION_NONE     },
-	{ "lb2",		"laurabow2",		SCI_VERSION_NONE     },
-	{ "rh",			"longbow",			SCI_VERSION_NONE     },
-	{ "ll1",		"lsl1sci",			SCI_VERSION_NONE     },
-	{ "lsl1",		"lsl1sci",			SCI_VERSION_NONE     },
+	{ "kq7cd",		"kq7",				SCI_VERSION_NONE       },
+	{ "quizgame-demo", "kquestions",    SCI_VERSION_NONE       },
+	{ "mm1",		"laurabow",			SCI_VERSION_NONE       },
+	{ "cb1",		"laurabow",			SCI_VERSION_NONE       },
+	{ "lb2",		"laurabow2",		SCI_VERSION_NONE       },
+	{ "rh",			"longbow",			SCI_VERSION_NONE       },
+	{ "ll1",		"lsl1sci",			SCI_VERSION_NONE       },
+	{ "lsl1",		"lsl1sci",			SCI_VERSION_NONE       },
 	// lsl2 is the same
-	{ "lsl3",		"lsl3",				SCI_VERSION_NONE     },
-	{ "ll5",		"lsl5",				SCI_VERSION_NONE     },
+	{ "lsl3",		"lsl3",				SCI_VERSION_NONE       },
+	{ "ll5",		"lsl5",				SCI_VERSION_NONE       },
 	// lsl5 is the same
 	// lsl6 is the same
-	{ "mg",			"mothergoose",		SCI_VERSION_NONE     },
-	{ "twisty",		"pepper",			SCI_VERSION_NONE     },
-	{ "scary",      "phantasmagoria",   SCI_VERSION_NONE     },
+	{ "mg",			"mothergoose",		SCI_VERSION_NONE       },
+	{ "twisty",		"pepper",			SCI_VERSION_NONE       },
+	{ "scary",      "phantasmagoria",   SCI_VERSION_NONE       },
 	// TODO: distinguish the full version of Phantasmagoria from the demo
-	{ "pq1",		"pq1sci",			SCI_VERSION_NONE     },
-	{ "pq",			"pq2",				SCI_VERSION_NONE     },
+	{ "pq1",		"pq1sci",			SCI_VERSION_NONE       },
+	{ "pq",			"pq2",				SCI_VERSION_NONE       },
 	// pq3 is the same
 	// pq4 is the same
-	{ "hq",			"qfg1",				SCI_VERSION_NONE     },	// QFG1 SCI0/EGA
-	{ "glory",      "qfg1",             SCI_VERSION_0_LATE   },	// QFG1 SCI0/EGA
-	{ "trial",		"qfg2",				SCI_VERSION_NONE     },
-	{ "hq2demo",	"qfg2",				SCI_VERSION_NONE     },
+	{ "hq",			"qfg1",				SCI_VERSION_NONE       },	// QFG1 SCI0/EGA
+	{ "glory",      "qfg1",             SCI_VERSION_0_LATE     },	// QFG1 SCI0/EGA
+	{ "trial",		"qfg2",				SCI_VERSION_NONE       },
+	{ "hq2demo",	"qfg2",				SCI_VERSION_NONE       },
 	// rama is the same
 	// TODO: distinguish the full version of rama from the demo
-	{ "thegame",	"slater",			SCI_VERSION_NONE     },
-	{ "sq1demo",	"sq1sci",			SCI_VERSION_NONE     },
-	{ "sq1",		"sq1sci",			SCI_VERSION_NONE     },
+	{ "thegame",	"slater",			SCI_VERSION_NONE       },
+	{ "sq1demo",	"sq1sci",			SCI_VERSION_NONE       },
+	{ "sq1",		"sq1sci",			SCI_VERSION_NONE       },
 	// sq3 is the same
 	// sq4 is the same
 	// sq5 is the same
 	// sq6 is the same
 	// TODO: distinguish the full version of SQ6 from the demo
 	// torin is the same
-
-
-	// TODO: SCI3 IDs
+	{ "l7",			"lsl7",				SCI_VERSION_NONE       },
+	{ "p2",			"phantasmagoria2",	SCI_VERSION_NONE       },
+	{ "lite",		"lighthouse",		SCI_VERSION_NONE       },
 
 	{ "", "", SCI_VERSION_NONE }
 };
@@ -379,15 +380,6 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R
 		return "qfg3";
 	}
 
-	if (sierraId == "l7")
-		return "lsl7";
-
-	if (sierraId == "p2")
-		return "phantasmagoria2";
-
-	if (sierraId == "lite")
-		return "lighthouse";
-
 	return sierraId;
 }
 


Commit: dd7c000e4449aac857646e720c6cb455c8ad20e2
    https://github.com/scummvm/scummvm/commit/dd7c000e4449aac857646e720c6cb455c8ad20e2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2018-08-30T23:51:01+03:00

Commit Message:
SCI32: Hide the unavailable games in the Hoyle 5 derived collections

The derived collections include Hoyle Children's Collection and Hoyle
Bridge. Each collection includes a subset of the games in the full
version, Hoyle Classic Games

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 a61c9b6..bbe00be 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -910,6 +910,150 @@ static const uint16 hoyle5PatchSpinLoop[] = {
 	PATCH_END
 };
 
+// There are two derived collections of Hoyle Classic Games:
+// 1) The Hoyle Children's Collection, which includes the following games:
+// - Crazy Eights (script 100)
+// - Old Maid (script 200)
+// - Checkers (script 1200)
+// 2) Hoyle Bridge, which includes the following games:
+// - Bridge (script 700)
+// In these two collections, the scripts for the other games have been removed.
+// Choosing any other game than the above results in a "No script found" error.
+// The original game did not show the game selection screen, as there were
+// direct shortucts to each game.
+// Since we do show the game selection screen, we remove all the games
+// which from the ones below, which are not included in each version:
+// - Crazy Eights (script 100)
+// - Old Maid (script 200)
+// - Hearts (script 300)
+// - Gin Rummy (script 400)
+// - Cribbage (script 500)
+// - Klondike / Solitaire (script 600)
+// - Bridge (script 700)
+// - Poker (script 1100)
+// - Checkers (script 1200)
+// - Backgammon (script 1300)
+static const uint16 hoyle5SignatureCrazyEights[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0x9c, 0x01,      // lofsa chooseCrazy8s
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureOldMaid[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0x2c, 0x02,      // lofsa chooseOldMaid
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureHearts[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0xdc, 0x03,      // lofsa chooseHearts
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureGinRummy[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0xbc, 0x02,      // lofsa chooseGinRummy
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureCribbage[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0x4c, 0x03,      // lofsa chooseCribbage
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureKlondike[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0xfc, 0x04,      // lofsa chooseKlondike
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureBridge[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0x6c, 0x04,      // lofsa chooseBridge
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignaturePoker[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0x8c, 0x05,      // lofsa choosePoker
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureCheckers[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0x1c, 0x06,      // lofsa chooseCheckers
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5SignatureBackgammon[] = {
+	SIG_MAGICDWORD,
+	0x38, 0x8e, 0x00,      // pushi 008e
+	0x76,                  // push0
+	0x38, 0xf0, 0x02,      // pushi 02f0
+	0x76,                  // push0
+	0x72, 0xac, 0x06,      // lofsa chooseBackgammon
+	0x4a, 0x08, 0x00,      // send  0008
+	SIG_END
+};
+
+static const uint16 hoyle5PatchDisableGame[] = {
+	0x35, 0x00,                      // ldi 00
+	0x35, 0x00,                      // ldi 00
+	0x35, 0x00,                      // ldi 00
+	0x35, 0x00,                      // ldi 00
+	0x35, 0x00,                      // ldi 00
+	0x35, 0x00,                      // ldi 00
+	0x35, 0x00,                      // ldi 00
+	PATCH_END
+};
+
 //          script, description,                                      signature                         patch
 static const SciScriptPatcherEntry hoyle5Signatures[] = {
 	{  true,     3, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
@@ -919,6 +1063,40 @@ static const SciScriptPatcherEntry hoyle5Signatures[] = {
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 
+//          script, description,                                      signature                         patch
+static const SciScriptPatcherEntry hoyle5ChildrensCollectionSignatures[] = {
+	{  true,     3, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true,    23, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true,   500, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true, 64937, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true,   975, "disable Gin Rummy",                           1, hoyle5SignatureGinRummy,          hoyle5PatchDisableGame },
+	{  true,   975, "disable Cribbage",                            1, hoyle5SignatureCribbage,          hoyle5PatchDisableGame },
+	{  true,   975, "disable Klondike",                            1, hoyle5SignatureKlondike,          hoyle5PatchDisableGame },
+	{  true,   975, "disable Bridge",                              1, hoyle5SignatureBridge,            hoyle5PatchDisableGame },
+	{  true,   975, "disable Poker",                               1, hoyle5SignaturePoker,             hoyle5PatchDisableGame },
+	{  true,   975, "disable Hearts",                              1, hoyle5SignatureHearts,            hoyle5PatchDisableGame },
+	{  true,   975, "disable Backgammon",                          1, hoyle5SignatureBackgammon,        hoyle5PatchDisableGame },
+	SCI_SIGNATUREENTRY_TERMINATOR
+};
+
+//          script, description,                                      signature                         patch
+static const SciScriptPatcherEntry hoyle5BridgeSignatures[] = {
+	{  true,     3, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true,    23, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true,   500, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true, 64937, "remove kGetTime spin",                        1, hoyle5SignatureSpinLoop,          hoyle5PatchSpinLoop },
+	{  true,   975, "disable Gin Rummy",                           1, hoyle5SignatureGinRummy,          hoyle5PatchDisableGame },
+	{  true,   975, "disable Cribbage",                            1, hoyle5SignatureCribbage,          hoyle5PatchDisableGame },
+	{  true,   975, "disable Klondike",                            1, hoyle5SignatureKlondike,          hoyle5PatchDisableGame },
+	{  true,   975, "disable Poker",                               1, hoyle5SignaturePoker,             hoyle5PatchDisableGame },
+	{  true,   975, "disable Hearts",                              1, hoyle5SignatureHearts,            hoyle5PatchDisableGame },
+	{  true,   975, "disable Backgammon",                          1, hoyle5SignatureBackgammon,        hoyle5PatchDisableGame },
+	{  true,   975, "disable Crazy Eights",                        1, hoyle5SignatureCrazyEights,       hoyle5PatchDisableGame },
+	{  true,   975, "disable Old Maid",                            1, hoyle5SignatureOldMaid,           hoyle5PatchDisableGame },
+	{  true,   975, "disable Checkers",                            1, hoyle5SignatureCheckers,          hoyle5PatchDisableGame },
+	SCI_SIGNATUREENTRY_TERMINATOR
+};
+
 #pragma mark -
 #pragma mark Gabriel Knight 1
 
@@ -7647,7 +7825,15 @@ void ScriptPatcher::processScript(uint16 scriptNr, SciSpan<byte> scriptData) {
 		break;
 #ifdef ENABLE_SCI32
 	case GID_HOYLE5:
-		signatureTable = hoyle5Signatures;
+		if (g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 100)) &&
+			g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700)))
+			signatureTable = hoyle5Signatures;
+		else if (g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 100)) &&
+			    !g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700)))
+			signatureTable = hoyle5ChildrensCollectionSignatures;
+		else if (!g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 100)) &&
+			      g_sci->getResMan()->testResource(ResourceId(kResourceTypeScript, 700)))
+			signatureTable = hoyle5BridgeSignatures;
 		break;
 	case GID_GK1:
 		signatureTable = gk1Signatures;





More information about the Scummvm-git-logs mailing list