diff options
author | Martin Kiewitz | 2010-06-24 12:25:47 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-06-24 12:25:47 +0000 |
commit | e5f22da0510065f1d38cfe745c49873f07de6904 (patch) | |
tree | c856914491397ded24996a4331ad5d68cff80b5b /engines/sci | |
parent | f93ca1e4242da27079e6ce4cd4d4e8d569984ec4 (diff) | |
download | scummvm-rg350-e5f22da0510065f1d38cfe745c49873f07de6904.tar.gz scummvm-rg350-e5f22da0510065f1d38cfe745c49873f07de6904.tar.bz2 scummvm-rg350-e5f22da0510065f1d38cfe745c49873f07de6904.zip |
SCI: added objectname and method name printed out when uninitialized temps are read
svn-id: r50212
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/vm.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index fdd2032ce3..6af5783e3b 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -190,17 +190,32 @@ static reg_t validate_read_var(reg_t *r, reg_t *stack_base, int type, int max, i // We need to find correct replacements for each situation manually // FIXME: this should use a table which contains workarounds for gameId, scriptnumber and temp index and // a replacement value - Script *local_script = g_sci->getEngineState()->_segMan->getScriptIfLoaded(g_sci->getEngineState()->xs->local_segment); + EngineState *engine = g_sci->getEngineState(); + Script *local_script = engine->_segMan->getScriptIfLoaded(engine->xs->local_segment); int currentScriptNr = local_script->_nr; - warning("uninitialized read for temp %d, script %d", index, currentScriptNr); + + Common::List<ExecStack>::iterator callIterator = engine->_executionStack.begin(); + ExecStack call = *callIterator; + while (callIterator != engine->_executionStack.end()) { + call = *callIterator; + callIterator++; + } + + const char *objName = engine->_segMan->getObjectName(call.sendp); + const char *selectorName = ""; + if (call.type == EXEC_STACK_TYPE_CALL) { + selectorName = g_sci->getKernel()->getSelectorName(call.selector).c_str(); + } + warning("uninitialized read for temp %d from method %s::%s (script %d)", index, objName, selectorName, currentScriptNr); + Common::String gameId = g_sci->getGameId(); if ((gameId == "laurabow2") && (currentScriptNr == 24) && (index == 5)) return make_reg(0, 0xf); // priority replacement for menu if ((gameId == "freddypharkas") && (currentScriptNr == 24) && (index == 5)) return make_reg(0, 0xf); // priority replacement for menu if ((gameId == "islandbrain") && (currentScriptNr == 140) && (index == 3)) { - r[index] = make_reg(0, 255); - return r[index]; + //r[index] = make_reg(0, 255); + //return r[index]; } error("uninitialized read!"); } |