diff options
author | Max Horn | 2010-07-21 14:54:06 +0000 |
---|---|---|
committer | Max Horn | 2010-07-21 14:54:06 +0000 |
commit | 175d6e297d5d50a96f1af6ddc2e37c7c56f84763 (patch) | |
tree | 2fb46d548c652019a27e160beedcaffd54f43e7a /engines/sci/engine | |
parent | 2ed45d3719a9d75f35aff7cc80b23468e1ceac3e (diff) | |
download | scummvm-rg350-175d6e297d5d50a96f1af6ddc2e37c7c56f84763.tar.gz scummvm-rg350-175d6e297d5d50a96f1af6ddc2e37c7c56f84763.tar.bz2 scummvm-rg350-175d6e297d5d50a96f1af6ddc2e37c7c56f84763.zip |
SCI: More rest of the workaround defs to workarounds.h
svn-id: r51090
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kernel.h | 27 | ||||
-rw-r--r-- | engines/sci/engine/workarounds.h | 31 |
2 files changed, 32 insertions, 26 deletions
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 8de95f56ef..8467a640af 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -40,6 +40,7 @@ namespace Sci { struct Node; // from segment.h struct List; // from segment.h struct SelectorCache; // from selector.h +struct SciWorkaroundEntry; // from workarounds.h /** * @defgroup VocabularyResources Vocabulary resources in SCI @@ -120,32 +121,6 @@ enum { /* Generic description: */ typedef reg_t KernelFunctionCall(EngineState *s, int argc, reg_t *argv); -enum SciWorkaroundType { - WORKAROUND_NONE, // only used by terminator or when no workaround was found - WORKAROUND_IGNORE, // ignore kernel call - WORKAROUND_STILLCALL, // still do kernel call - WORKAROUND_FAKE // fake kernel call / replace temp value / fake opcode -}; - -struct SciWorkaroundSolution { - SciWorkaroundType type; - uint16 value; -}; - -struct SciWorkaroundEntry { - SciGameId gameId; - int roomNr; - int scriptNr; - int16 inheritanceLevel; - const char *objectName; - const char *methodName; - int localCallOffset; - int index; - SciWorkaroundSolution newValue; -}; - -#define SCI_WORKAROUNDENTRY_TERMINATOR { (SciGameId)0, -1, -1, 0, NULL, NULL, -1, 0, { WORKAROUND_NONE, 0 } } - struct KernelSubFunction { KernelFunctionCall *function; const char *name; diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h index be066d5fc7..9f38ab13ee 100644 --- a/engines/sci/engine/workarounds.h +++ b/engines/sci/engine/workarounds.h @@ -26,8 +26,37 @@ #ifndef SCI_ENGINE_WORKAROUNDS_H #define SCI_ENGINE_WORKAROUNDS_H +#include "sci/engine/vm_types.h" +#include "sci/sci.h" + namespace Sci { +enum SciWorkaroundType { + WORKAROUND_NONE, // only used by terminator or when no workaround was found + WORKAROUND_IGNORE, // ignore kernel call + WORKAROUND_STILLCALL, // still do kernel call + WORKAROUND_FAKE // fake kernel call / replace temp value / fake opcode +}; + +struct SciWorkaroundSolution { + SciWorkaroundType type; + uint16 value; +}; + +struct SciWorkaroundEntry { + SciGameId gameId; + int roomNr; + int scriptNr; + int16 inheritanceLevel; + const char *objectName; + const char *methodName; + int localCallOffset; + int index; + SciWorkaroundSolution newValue; +}; + +#define SCI_WORKAROUNDENTRY_TERMINATOR { (SciGameId)0, -1, -1, 0, NULL, NULL, -1, 0, { WORKAROUND_NONE, 0 } } + // gameID, room,script,lvl, object-name, method-name, call,index, workaround static const SciWorkaroundEntry opcodeDivWorkarounds[] = { { GID_QFG1VGA, 301, 928, 0, "Blink", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // when entering inn, gets called with 1 parameter, but 2nd parameter is used for div which happens to be an object @@ -159,6 +188,8 @@ static const SciWorkaroundEntry kStrCpy_workarounds[] = { SCI_WORKAROUNDENTRY_TERMINATOR }; +#undef FAKE + } // End of namespace Sci #endif // SCI_ENGINE_WORKAROUNDS_H |