aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-06 14:26:29 +0000
committerMartin Kiewitz2010-07-06 14:26:29 +0000
commitc349d7130c1716b5b87a5cb9f740f8467c16dde4 (patch)
treeff810d95e0250f8a20443b2c3adf8ec0214f3d7d
parenta7cd1534c6d3a325e36db42314e22ff3d8bdc8dd (diff)
downloadscummvm-rg350-c349d7130c1716b5b87a5cb9f740f8467c16dde4.tar.gz
scummvm-rg350-c349d7130c1716b5b87a5cb9f740f8467c16dde4.tar.bz2
scummvm-rg350-c349d7130c1716b5b87a5cb9f740f8467c16dde4.zip
SCI: removing invalid reference error from signature checking, instead adding new type "invalid", so that full call parameter debug information is available
svn-id: r50725
-rw-r--r--engines/sci/console.cpp5
-rw-r--r--engines/sci/engine/kernel.cpp5
-rw-r--r--engines/sci/engine/kernel.h1
3 files changed, 8 insertions, 3 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 7e5d77d99a..e684532b08 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -3149,7 +3149,7 @@ void Console::printBasicVarInfo(reg_t variable) {
int segType = g_sci->getKernel()->findRegType(variable);
SegManager *segMan = g_sci->getEngineState()->_segMan;
- segType &= SIG_TYPE_INTEGER | SIG_TYPE_OBJECT | SIG_TYPE_REFERENCE | SIG_TYPE_NODE | SIG_TYPE_LIST | SIG_TYPE_UNINITIALIZED;
+ segType &= SIG_TYPE_INTEGER | SIG_TYPE_OBJECT | SIG_TYPE_REFERENCE | SIG_TYPE_NODE | SIG_TYPE_LIST | SIG_TYPE_UNINITIALIZED | SIG_TYPE_INVALID;
switch (segType) {
case SIG_TYPE_INTEGER: {
@@ -3173,6 +3173,9 @@ void Console::printBasicVarInfo(reg_t variable) {
case SIG_TYPE_UNINITIALIZED:
DebugPrintf(" (uninitialized)");
break;
+ case SIG_TYPE_INVALID:
+ DebugPrintf(" (invalid)");
+ break;
default:
DebugPrintf(" (??\?)");
}
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 0d0b9a30d3..2a378564bb 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -719,10 +719,10 @@ int Kernel::findRegType(reg_t reg) {
// Otherwise it's an object
SegmentObj *mobj = _segMan->getSegmentObj(reg.segment);
if (!mobj)
- return 0; // Invalid
+ return SIG_TYPE_INVALID;
if (!mobj->isValidOffset(reg.offset))
- error("[KERN] ref %04x:%04x is invalid", PRINT_REG(reg));
+ return SIG_TYPE_INVALID;
switch (mobj->getType()) {
case SEG_TYPE_SCRIPT:
@@ -762,6 +762,7 @@ static const SignatureDebugType signatureDebugTypeList[] = {
{ SIG_TYPE_NULL, "null" },
{ SIG_TYPE_INTEGER, "integer" },
{ SIG_TYPE_UNINITIALIZED, "uninitialized" },
+ { SIG_TYPE_INVALID, "invalid" },
{ SIG_TYPE_OBJECT, "object" },
{ SIG_TYPE_REFERENCE, "reference" },
{ SIG_TYPE_LIST, "list" },
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index a0b91b8601..719db41e8d 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -101,6 +101,7 @@ enum {
SIG_TYPE_NULL = 0x01, // may be 0:0 [0]
SIG_TYPE_INTEGER = 0x02, // may be 0:* [i], automatically also allows null
SIG_TYPE_UNINITIALIZED = 0x04, // may be FFFF:* -> not allowable, only used for comparsion
+ SIG_TYPE_INVALID = 0x08, // invalid segment or offset -> not allowable, only used for comparsion
SIG_TYPE_OBJECT = 0x10, // may be object [o]
SIG_TYPE_REFERENCE = 0x20, // may be reference [r]
SIG_TYPE_LIST = 0x40, // may be list [l]