aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-10-01 08:53:10 +0000
committerWillem Jan Palenstijn2009-10-01 08:53:10 +0000
commit168257df24ea78bbeab562096fe780778ad83382 (patch)
treec3e5c1f217a335dd31c0dedca3d90f9b83a39122
parent24d649b972235d85d0e4d96de4607fa87d4f26c1 (diff)
downloadscummvm-rg350-168257df24ea78bbeab562096fe780778ad83382.tar.gz
scummvm-rg350-168257df24ea78bbeab562096fe780778ad83382.tar.bz2
scummvm-rg350-168257df24ea78bbeab562096fe780778ad83382.zip
SCI: Remove outdated debugging hack.
In the past, a negative selector value was used to identify a callk stack frame. Currently a type of EXEC_STACK_TYPE_KERNEL already does that. svn-id: r44510
-rw-r--r--engines/sci/console.cpp2
-rw-r--r--engines/sci/engine/vm.cpp3
-rw-r--r--engines/sci/engine/vm.h8
3 files changed, 2 insertions, 11 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 1cba6077d2..770885f3d3 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2003,7 +2003,7 @@ bool Console::cmdBacktrace(int argc, const char **argv) {
break;
case EXEC_STACK_TYPE_KERNEL: // Kernel function
- printf(" %x:[%x] k%s(", i, call.origin, _vm->getKernel()->getKernelName(kMagicSelectorOffset - call.selector).c_str());
+ printf(" %x:[%x] k%s(", i, call.origin, _vm->getKernel()->getKernelName(call.selector).c_str());
break;
case EXEC_STACK_TYPE_VARSELECTOR:
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 65e0170075..b6a474cb8f 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -953,8 +953,7 @@ void run_vm(EngineState *s, int restoring) {
ExecStack *xstack;
xstack = add_exec_stack_entry(s, NULL_REG, NULL, NULL_REG, argc, argv - 1, 0, NULL_REG,
s->_executionStack.size()-1, SCI_XS_CALLEE_LOCALS);
- // Debugging hack to identify kernel function
- xstack->selector = kMagicSelectorOffset - opparams[0];
+ xstack->selector = opparams[0];
xstack->type = EXEC_STACK_TYPE_KERNEL;
// Call kernel function
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index 9247bfa350..530a293081 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -102,14 +102,6 @@ enum SelectorType {
kSelectorMethod
};
-enum {
- /**
- * Magic offset, used to compute fake selector values for use in ExecStack
- * when doing a callk. See the callk code in vm.cpp for details.
- */
- kMagicSelectorOffset = -42
-};
-
struct Class {
int script; /**< number of the script the class is in, -1 for non-existing */
reg_t reg; /**< offset; script-relative offset, segment: 0 if not instantiated */