diff options
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 10 | ||||
-rw-r--r-- | engines/director/lingo/lingo.cpp | 14 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 2 |
3 files changed, 26 insertions, 0 deletions
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 16c8a1848f..84557650fd 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -58,6 +58,11 @@ void Lingo::execute(uint pc) { if (debugChannelSet(5, kDebugLingoExec)) printStack("Stack before: ", current); + if (debugChannelSet(9, kDebugLingoExec)) { + debug("Vars after"); + printAllVars(); + } + debugC(1, kDebugLingoExec, "[%3d]: %s", current, instr.c_str()); _pc++; @@ -66,6 +71,11 @@ void Lingo::execute(uint pc) { if (debugChannelSet(5, kDebugLingoExec)) printStack("Stack after: ", current); + if (debugChannelSet(9, kDebugLingoExec)) { + debug("Vars after"); + printAllVars(); + } + if (_pc >= (*_currentScript).size()) { warning("Lingo::execute(): Bad PC (%d)", _pc); break; diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 0956adeaa8..9c94bc6a96 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -487,4 +487,18 @@ void Lingo::executeImmediateScripts(Frame *frame) { } } +void Lingo::printAllVars() { + debugN(" Local vars: "); + for (SymbolHash::iterator i = _localvars->begin(); i != _localvars->end(); ++i) { + debugN("%s, ", (*i)._key.c_str()); + } + debug(""); + + debugN(" Global vars: "); + for (SymbolHash::iterator i = _globalvars.begin(); i != _globalvars.end(); ++i) { + debugN("%s, ", (*i)._key.c_str()); + } + debug(""); +} + } // End of namespace Director diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index f9a6661701..caaac44a67 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -231,6 +231,8 @@ public: int alignTypes(Datum &d1, Datum &d2); + void printAllVars(); + int code1(inst code) { _currentScript->push_back(code); return _currentScript->size() - 1; } int code2(inst code_1, inst code_2) { int o = code1(code_1); code1(code_2); return o; } int code3(inst code_1, inst code_2, inst code_3) { int o = code1(code_1); code1(code_2); code1(code_3); return o; } |