[Scummvm-git-logs] scummvm master -> 7c1fb8bee1890f831adde61a98d94a563f9d14fa

sluicebox 22204938+sluicebox at users.noreply.github.com
Wed Oct 2 20:40:19 CEST 2019


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

Summary:
2ab281ffa1 SCI32: Add HOYLE5 support for original Save/Load screens
7c1fb8bee1 SCI: Return correct value from kFileIOWriteString


Commit: 2ab281ffa1b2e91dd157158bddb1ceed3672aad5
    https://github.com/scummvm/scummvm/commit/2ab281ffa1b2e91dd157158bddb1ceed3672aad5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2019-10-02T11:30:45-07:00

Commit Message:
SCI32: Add HOYLE5 support for original Save/Load screens

Trac #11174

Changed paths:
    engines/sci/detection_tables.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/workarounds.cpp
    engines/sci/engine/workarounds.h


diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 16f51a9..f279f9a 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -1194,6 +1194,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
                           GUIO_LINKSPEECHTOSFX, \
                           GUIO_NOASPECT)
 
+// versions with bridge or poker have save/load screens
+#define GUIO_HOYLE5_SAVELOAD GUIO6(GUIO_NOMIDI, \
+                                   GUIO_NOLAUNCHLOAD, \
+                                   GUIO_LINKMUSICTOSFX, \
+                                   GUIO_LINKSPEECHTOSFX, \
+                                   GUIO_NOASPECT, \
+                                   GAMEOPTION_ORIGINAL_SAVELOAD )
+
 	// Hoyle 5 (Hoyle Classic Games) - Windows demo
 	{"hoyle5", "Demo", {
 		{"ressci.000", 0, "98a39ae535dd01714ac313f8ba925045", 7260363},
@@ -1207,7 +1215,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"ressci.000", 0, "55ae04012a73abc15b93debf60a7df71", 16909704},
 		{"resmap.000", 0, "daf64a91344a7934fe4374765267c2af", 5767},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5 },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5_SAVELOAD },
 
 	// Hoyle 5 (Hoyle Classic Games for Laptops) - Windows
 	// SCI 2.100.002
@@ -1216,7 +1224,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"ressci.000", 0, "ca50cf09f80a5f982a965afea852cc42", 3278849},
 		{"resmap.000", 0, "d5eef6f2529313e950c4d78251a95b1e", 4213},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5 },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5_SAVELOAD },
 
 	// Hoyle Bridge - Windows
 	{"hoyle5bridge", "", {
@@ -1224,7 +1232,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		{"ressci.000", 0, "b83cba09229d3003df9e0c864843f962", 16842499},
 		{"resmap.000", 0, "7b3e3030b0ad5f341053c18afce7d176", 5647},
 		AD_LISTEND},
-		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5 },
+		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5_SAVELOAD },
 
 	// Hoyle Children's Collection - Windows
 	{"hoyle5children", "", {
@@ -1251,6 +1259,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
 		Common::EN_ANY, Common::kPlatformWindows, ADGF_DROPPLATFORM, GUIO_HOYLE5 },
 
 #undef GUIO_HOYLE5
+#undef GUIO_HOYLE5_SAVELOAD
 
 #endif // ENABLE_SCI32
 
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index f0ad559..396df91 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -328,7 +328,7 @@ static const SciKernelMapSubEntry kFileIO_subops[] = {
 	{ SIG_SINCE_SCI21MID, 15, MAP_CALL(FileIOReadWord),            "i",                    NULL },
 	{ SIG_SCI21MID_LATE,  16, MAP_CALL(FileIOWriteWord),           "ii",                   NULL },
 	{ SIG_SCI3,           16, MAP_CALL(FileIOWriteWord),           "i[.!]",                NULL },
-	{ SIG_SINCE_SCI21MID, 17, "FileIOCheckFreeSpace", kCheckFreeSpace, "i(r)",             NULL },
+	{ SIG_SINCE_SCI21MID, 17, "FileIOCheckFreeSpace", kCheckFreeSpace, "i(r)",             kFileIOCheckFreeSpace_workarounds },
 	{ SIG_SINCE_SCI21MID, 18, MAP_CALL(FileIOGetCWD),              "r",                    NULL },
 	{ SIG_SINCE_SCI21MID, 19, MAP_CALL(FileIOIsValidDirectory),    "[ro]",                 NULL },
 #endif
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 1fb866d..ad3402d 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -2149,6 +2149,9 @@ static const SciScriptPatcherEntry hoyle5Signatures[] = {
 	// which is invoked via kWinDLL. We need to reverse the logic in PENGIN16.DLL and call it directly, in order to get this
 	// game to work properly. Until then, this game entry will be disabled.
 	{  true,   975, "disable Poker",                               1, hoyle5SignaturePoker,             hoyle5PatchDisableGame },
+	{  true, 64990, "increase number of save games (1/2)",         1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
+	{  true, 64990, "increase number of save games (2/2)",         1, sci2NumSavesSignature2,           sci2NumSavesPatch2 },
+	{  true, 64990, "disable change directory button",             1, sci2ChangeDirSignature,           sci2ChangeDirPatch },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 
@@ -2187,6 +2190,9 @@ static const SciScriptPatcherEntry hoyle5BridgeSignatures[] = {
 	{  true,   975, "disable Crazy Eights",                        1, hoyle5SignatureCrazyEights,       hoyle5PatchDisableGame },
 	{  true,   975, "disable Old Maid",                            1, hoyle5SignatureOldMaid,           hoyle5PatchDisableGame },
 	{  true,   975, "disable Checkers",                            1, hoyle5SignatureCheckers,          hoyle5PatchDisableGame },
+	{  true, 64990, "increase number of save games (1/2)",         1, sci2NumSavesSignature1,           sci2NumSavesPatch1 },
+	{  true, 64990, "increase number of save games (2/2)",         1, sci2NumSavesSignature2,           sci2NumSavesPatch2 },
+	{  true, 64990, "disable change directory button",             1, sci2ChangeDirSignature,           sci2ChangeDirPatch },
 	SCI_SIGNATUREENTRY_TERMINATOR
 };
 
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 24665c5..ea1d553 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -746,11 +746,32 @@ const SciWorkaroundEntry kGetAngle_workarounds[] = {
 
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kFileIOOpen_workarounds[] = {
+	{ GID_HOYLE5,         -1, 64990,  0,            "Restore", "doit",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when checking for bridgesg.cat or poker.cat when showing restore dialog
 	{ GID_TORIN,       61000, 61000,  0,       "roSierraLogo", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo
 	{ GID_TORIN,       61100, 61100,  0,     "roPickAChapter", "init",                      NULL,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Missing second argument when the game checks for autosave.cat after the Sierra logo in the demo
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
+//                Game: Hoyle 5
+//      Calling method: subroutine at offset 0x1074
+//   Subroutine offset: 0x1432 (script 64990)
+// Applies to at least: English PC
+static const uint16 sig_kFileIOCheckFreeSpace_hoyle5_1[] = {
+	0x7e, SIG_ADDTOOFFSET(2),        // line N
+	0x7d, 0x73, 0x61, 0x76, 0x65,    // file "save.sc"
+	0x2e, 0x73, 0x63, 0x00,
+	0x3f, 0x02,                      // link 02
+	0x7e, SIG_ADDTOOFFSET(2),        // line N
+	0x38, SIG_UINT16(0x008d),        // pushi new
+	SIG_END
+};
+
+//    gameID,           room,script,lvl,          object-name, method-name,              local-call-signature, index-range,   workaround
+const SciWorkaroundEntry kFileIOCheckFreeSpace_workarounds[] = {
+	{ GID_HOYLE5,         -1, 64990,  0,              "Save", "update",   sig_kFileIOCheckFreeSpace_hoyle5_1,     0,     0, { WORKAROUND_STILLCALL, 0 } }, // Extra argument when checking for free space when showing save dialog
+	SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
 //    gameID,           room,script,lvl,          object-name, method-name, local-call-signature, index-range,   workaround
 const SciWorkaroundEntry kFindKey_workarounds[] = {
 	{ GID_ECOQUEST2,     100,   999,  0,            "myList", "contains",                   NULL,     0,     0, { WORKAROUND_FAKE, 0 } }, // When Noah Greene gives Adam the Ecorder, and just before the game gives a demonstration, a null reference to a list is passed - bug #4987
diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h
index 17ea81f..b244f8b 100644
--- a/engines/sci/engine/workarounds.h
+++ b/engines/sci/engine/workarounds.h
@@ -74,6 +74,7 @@ extern const SciWorkaroundEntry kDoAudioResume_workarounds[];
 extern const SciWorkaroundEntry kDoSoundPlay_workarounds[];
 extern const SciWorkaroundEntry kDoSoundFade_workarounds[];
 extern const SciWorkaroundEntry kFileIOOpen_workarounds[];
+extern const SciWorkaroundEntry kFileIOCheckFreeSpace_workarounds[];
 extern const SciWorkaroundEntry kFindKey_workarounds[];
 extern const SciWorkaroundEntry kFrameOut_workarounds[];
 extern const SciWorkaroundEntry kDeleteKey_workarounds[];


Commit: 7c1fb8bee1890f831adde61a98d94a563f9d14fa
    https://github.com/scummvm/scummvm/commit/7c1fb8bee1890f831adde61a98d94a563f9d14fa
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2019-10-02T11:35:34-07:00

Commit Message:
SCI: Return correct value from kFileIOWriteString

Fixes corrupt save games in Hoyle5, bug #11174

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


diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index e3d4fb2..156d294 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -757,10 +757,10 @@ reg_t kFileIOWriteString(EngineState *s, int argc, reg_t *argv) {
 	FileHandle *f = getFileFromHandle(s, handle);
 
 	if (f && f->_out) {
-		f->_out->write(str.c_str(), str.size());
+		uint32 bytesWritten = f->_out->write(str.c_str(), str.size());
 		if (getSciVersion() <= SCI_VERSION_0_LATE)
 			return s->r_acc;	// SCI0 semantics: no value returned
-		return NULL_REG;
+		return make_reg(0, bytesWritten);
 	}
 
 	if (getSciVersion() <= SCI_VERSION_0_LATE)





More information about the Scummvm-git-logs mailing list