aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorsluicebox2019-10-02 11:30:45 -0700
committersluicebox2019-10-02 11:30:45 -0700
commit2ab281ffa1b2e91dd157158bddb1ceed3672aad5 (patch)
treeb9dd186fec2d1facc3e6bdcf3a3330262e640620 /engines/sci/engine
parent9afaefb7486854e7804bc5a12f86545a7dd8a6f4 (diff)
downloadscummvm-rg350-2ab281ffa1b2e91dd157158bddb1ceed3672aad5.tar.gz
scummvm-rg350-2ab281ffa1b2e91dd157158bddb1ceed3672aad5.tar.bz2
scummvm-rg350-2ab281ffa1b2e91dd157158bddb1ceed3672aad5.zip
SCI32: Add HOYLE5 support for original Save/Load screens
Trac #11174
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kernel_tables.h2
-rw-r--r--engines/sci/engine/script_patches.cpp6
-rw-r--r--engines/sci/engine/workarounds.cpp21
-rw-r--r--engines/sci/engine/workarounds.h1
4 files changed, 29 insertions, 1 deletions
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index f0ad559ba5..396df9181b 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 1fb866db05..ad3402d81d 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 24665c5857..ea1d553eeb 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 17ea81fdda..b244f8ba1b 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[];