aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-17 10:30:32 +0200
committerEugene Sandulenko2016-08-17 10:35:54 +0200
commitd6086f8036d6a4346dafeb6343670c4e80818f81 (patch)
tree5f9bdefdbc61c04590de590e340bc1e4aabca004 /engines/director
parent49c68ba15590b9881908b162ca09291937b42130 (diff)
downloadscummvm-rg350-d6086f8036d6a4346dafeb6343670c4e80818f81.tar.gz
scummvm-rg350-d6086f8036d6a4346dafeb6343670c4e80818f81.tar.bz2
scummvm-rg350-d6086f8036d6a4346dafeb6343670c4e80818f81.zip
DIRECTOR: Lingo: Initial function parameter tracing
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-codegen.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index a9659f7603..8e054b4505 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -55,7 +55,7 @@ void Lingo::execute(int pc) {
for(_pc = pc; (*_currentScript)[_pc] != STOP && !_returning;) {
Common::String instr = decodeInstruction(_pc);
- debugC(1, kDebugLingoExec, "E: %s", instr.c_str());
+ debugC(1, kDebugLingoExec, "[%3d]: %s", _pc, instr.c_str());
for (uint i = 0; i < _stack.size(); i++) {
debugCN(5, kDebugLingoExec, "%d ", _stack[i].u.i);
@@ -69,13 +69,39 @@ void Lingo::execute(int pc) {
Common::String Lingo::decodeInstruction(int pc) {
Symbol sym;
+ Common::String res;
- sym.u.func = (*_currentScript)[pc];
+ sym.u.func = (*_currentScript)[pc++];
if (_functions.contains((void *)sym.u.s)) {
- return _functions[(void *)sym.u.s]->name;
+ res = _functions[(void *)sym.u.s]->name;
+ const char *pars = _functions[(void *)sym.u.s]->proto;
+ inst i;
+
+ while (*pars) {
+ switch (*pars++) {
+ case 'i':
+ {
+ i = (*_currentScript)[pc++];
+ int v = READ_UINT32(&i);
+
+ res += Common::String::format(" %d", v);
+ break;
+ }
+ case 'o':
+ {
+ i = (*_currentScript)[pc++];
+ int v = READ_UINT32(&i);
+
+ res += Common::String::format(" [%5d]", v);
+ break;
+ }
+ }
+ }
} else {
- return "<unknown>";
+ res = "<unknown>";
}
+
+ return res;
}
Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) {