aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/workarounds.h
diff options
context:
space:
mode:
authorsluicebox2019-06-03 18:21:36 -0700
committersluicebox2019-06-09 15:35:57 -0700
commit56ea963cea3cdf04c44d3d6f545df664f4a27e8d (patch)
tree2286aa7b32f52de2185b7a9206b49c1f5824880a /engines/sci/engine/workarounds.h
parent9326f2f31d4cd33131c8c384694369f4b27ed600 (diff)
downloadscummvm-rg350-56ea963cea3cdf04c44d3d6f545df664f4a27e8d.tar.gz
scummvm-rg350-56ea963cea3cdf04c44d3d6f545df664f4a27e8d.tar.bz2
scummvm-rg350-56ea963cea3cdf04c44d3d6f545df664f4a27e8d.zip
SCI: Create message workaround system
Adds a new workaround system for known broken messages and their corresponding audio and sync resources. This replaces all special cases in c++ and several script patches with data structures and generic handling. Common message bugs: - Wrong tuple requested by game script - Wrong tuple in message resource - Wrong message text that exists in another record - Missing message text - Audio or sync resource with different tuple than message
Diffstat (limited to 'engines/sci/engine/workarounds.h')
-rw-r--r--engines/sci/engine/workarounds.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h
index 284936b4a5..17ea81fdda 100644
--- a/engines/sci/engine/workarounds.h
+++ b/engines/sci/engine/workarounds.h
@@ -113,6 +113,49 @@ extern const SciWorkaroundEntry kScrollWindowAdd_workarounds[];
extern SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroundEntry *workaroundList, SciCallOrigin *trackOrigin);
+enum SciMessageWorkaroundType {
+ MSG_WORKAROUND_NONE, // only used by terminator or when no workaround was found
+ MSG_WORKAROUND_REMAP, // use a different tuple instead
+ MSG_WORKAROUND_FAKE, // use a hard-coded response
+ MSG_WORKAROUND_EXTRACT // use text from a different record, optionally a substring
+};
+
+enum SciMedia {
+ SCI_MEDIA_ALL,
+ SCI_MEDIA_FLOPPY,
+ SCI_MEDIA_CD
+};
+
+struct SciMessageWorkaroundSolution {
+ SciMessageWorkaroundType type;
+ int module;
+ byte noun;
+ byte verb;
+ byte cond;
+ byte seq;
+ byte talker;
+ uint32 substringIndex;
+ uint32 substringLength;
+ const char *text;
+};
+
+struct SciMessageWorkaroundEntry {
+ SciGameId gameId;
+ SciMedia media;
+ kLanguage language;
+ int roomNumber;
+ int module;
+ byte noun;
+ byte verb;
+ byte cond;
+ byte seq;
+ SciMessageWorkaroundSolution solution;
+};
+
+extern SciMessageWorkaroundSolution findMessageWorkaround(int module, byte noun, byte verb, byte cond, byte seq);
+extern ResourceId remapAudio36ResourceId(const ResourceId &resourceId);
+extern ResourceId remapSync36ResourceId(const ResourceId &resourceId);
+
} // End of namespace Sci
#endif // SCI_ENGINE_WORKAROUNDS_H