diff options
author | Eugene Sandulenko | 2019-12-28 23:46:50 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-29 00:51:16 +0100 |
commit | ecaebf7cedba882185c1b87f12a01bc84d91f879 (patch) | |
tree | 497f526eab2634b4464c63f831427c5ecff3fdd9 /engines | |
parent | 6ab1d6ac7b0a60294f9a41953ccbf956280526cb (diff) | |
download | scummvm-rg350-ecaebf7cedba882185c1b87f12a01bc84d91f879.tar.gz scummvm-rg350-ecaebf7cedba882185c1b87f12a01bc84d91f879.tar.bz2 scummvm-rg350-ecaebf7cedba882185c1b87f12a01bc84d91f879.zip |
DIRECTOR: LINGO: Print variable lists as an extra debug step
Diffstat (limited to 'engines')
-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; } |