aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo-code.cpp21
-rw-r--r--engines/director/lingo/lingo-codegen.cpp2
-rw-r--r--engines/director/lingo/lingo.cpp1
-rw-r--r--engines/director/lingo/lingo.h1
4 files changed, 24 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 6072977d07..0769a0f8cb 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -51,6 +51,27 @@
namespace Director {
+static struct FuncDescr {
+ const inst func;
+ const char *name;
+ const char *args;
+} funcDescr[] = {
+ { Lingo::c_xpop, "c_xpop", "" },
+ { Lingo::c_printtop, "c_printtop", "" },
+ { Lingo::c_constpush, "c_constpush", "i" },
+ { Lingo::c_voidpush, "c_voidpush", "" },
+ { Lingo::c_fconstpush, "c_fconstpush", "f" },
+ { 0, 0, 0 }
+};
+
+void Lingo::initFuncs() {
+ Symbol sym;
+ for (FuncDescr *fnc = funcDescr; fnc->name; fnc++) {
+ sym.u.func = fnc->func;
+ _functions[(void *)sym.u.s] = new FuncDesc(fnc->name, fnc->args);
+ }
+}
+
void Lingo::push(Datum d) {
_stack.push_back(d);
}
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index d84d5c7081..ff1fbed5d0 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, "%s", instr.c_str());
+ debugC(1, kDebugLingoExec, "E: %s", instr.c_str());
for (uint i = 0; i < _stack.size(); i++) {
debugCN(5, kDebugLingoExec, "%d ", _stack[i].u.i);
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 96e6f868a2..9aea9593e9 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -86,6 +86,7 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_eventHandlerTypes[t->handler] = t->name;
initBuiltIns();
+ initFuncs();
initTheEntities();
_currentScript = 0;
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 7a5fba064d..911abb6552 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -185,6 +185,7 @@ public:
void processEvent(LEvent event, int entityId);
void initBuiltIns();
+ void initFuncs();
void initTheEntities();
Common::String *toLowercaseMac(Common::String *s);