aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo/lingo-code.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2020-01-01 02:10:30 +0100
committerEugene Sandulenko2020-01-01 02:10:30 +0100
commit7995def290ac572c8bdf7f95b07694eeda891409 (patch)
treec9d18faec3834f0628d15d1de2a0dff4d0d15a76 /engines/director/lingo/lingo-code.cpp
parent0d934b6735cba711fbdd627211da5a97a3f5386f (diff)
downloadscummvm-rg350-7995def290ac572c8bdf7f95b07694eeda891409.tar.gz
scummvm-rg350-7995def290ac572c8bdf7f95b07694eeda891409.tar.bz2
scummvm-rg350-7995def290ac572c8bdf7f95b07694eeda891409.zip
DIRECTOR: LINGO: Moved all codes to separate class to lessen Lingo class pollution
Diffstat (limited to 'engines/director/lingo/lingo-code.cpp')
-rw-r--r--engines/director/lingo/lingo-code.cpp351
1 files changed, 177 insertions, 174 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 53e1cd98af..d0805c9662 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -48,99 +48,102 @@
#include "director/score.h"
#include "director/util.h"
#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-code.h"
namespace Director {
+LC *g_lc;
+
static struct FuncDescr {
const inst func;
const char *name;
const char *args;
} funcDescr[] = {
{ 0, "STOP", "" },
- { Lingo::c_xpop, "c_xpop", "" },
- { Lingo::c_argcpush, "c_argcpush", "i" },
- { Lingo::c_argcnoretpush, "c_argcnoretpush", "i" },
- { Lingo::c_arraypush, "c_arraypush", "i" },
- { Lingo::c_printtop, "c_printtop", "" },
- { Lingo::c_intpush, "c_intpush", "i" },
- { Lingo::c_voidpush, "c_voidpush", "" },
- { Lingo::c_floatpush, "c_floatpush", "f" },
- { Lingo::c_stringpush, "c_stringpush", "s" },
- { Lingo::c_symbolpush, "c_symbolpush", "s" }, // D3
- { Lingo::c_namepush, "c_namepush", "i" },
- { Lingo::c_varpush, "c_varpush", "s" },
- { Lingo::c_setImmediate,"c_setImmediate","i" },
- { Lingo::c_assign, "c_assign", "" },
- { Lingo::c_eval, "c_eval", "s" },
- { Lingo::c_theentitypush,"c_theentitypush","ii" }, // entity, field
- { Lingo::c_theentityassign,"c_theentityassign","ii" },
- { Lingo::c_objectfieldpush,"c_objectfieldpush","si" }, // object, field
- { Lingo::c_objectfieldassign,"c_objectfieldassign","si" },
- { Lingo::c_swap, "c_swap", "" },
- { Lingo::c_add, "c_add", "" },
- { Lingo::c_sub, "c_sub", "" },
- { Lingo::c_mul, "c_mul", "" },
- { Lingo::c_div, "c_div", "" },
- { Lingo::c_mod, "c_mod", "" },
- { Lingo::c_negate, "c_negate", "" },
- { Lingo::c_ampersand, "c_ampersand", "" },
- { Lingo::c_after, "c_after", "" }, // D3
- { Lingo::c_before, "c_before", "" }, // D3
- { Lingo::c_concat, "c_concat", "" },
- { Lingo::c_contains, "c_contains", "" },
- { Lingo::c_starts, "c_starts", "" },
- { Lingo::c_intersects, "c_intersects", "" },
- { Lingo::c_within, "c_within", "" },
- { Lingo::c_field, "c_field", "" },
- { Lingo::c_of, "c_of", "" },
- { Lingo::c_charOf, "c_charOf", "" }, // D3
- { Lingo::c_charToOf, "c_charToOf", "" }, // D3
- { Lingo::c_itemOf, "c_itemOf", "" }, // D3
- { Lingo::c_itemToOf, "c_itemToOf", "" }, // D3
- { Lingo::c_lineOf, "c_lineOf", "" }, // D3
- { Lingo::c_lineToOf, "c_lineToOf", "" }, // D3
- { Lingo::c_wordOf, "c_wordOf", "" }, // D3
- { Lingo::c_wordToOf, "c_wordToOf", "" }, // D3
- { Lingo::c_and, "c_and", "" },
- { Lingo::c_or, "c_or", "" },
- { Lingo::c_not, "c_not", "" },
- { Lingo::c_eq, "c_eq", "" },
- { Lingo::c_neq, "c_neq", "" },
- { Lingo::c_gt, "c_gt", "" },
- { Lingo::c_lt, "c_lt", "" },
- { Lingo::c_ge, "c_ge", "" },
- { Lingo::c_le, "c_le", "" },
- { Lingo::c_jump, "c_jump", "i" },
- { Lingo::c_jumpifz, "c_jumpifz", "i" },
- { Lingo::c_repeatwhilecode,"c_repeatwhilecode","oo" },
- { Lingo::c_repeatwithcode,"c_repeatwithcode","ooooos" },
- { Lingo::c_exitRepeat, "c_exitRepeat", "" },
- { Lingo::c_ifcode, "c_ifcode", "oooi" },
- { Lingo::c_tellcode, "c_tellcode", "o" },
- { Lingo::c_tell, "c_tell", "" },
- { Lingo::c_telldone, "c_telldone", "" },
- { Lingo::c_whencode, "c_whencode", "os" },
- { Lingo::c_goto, "c_goto", "" },
- { Lingo::c_gotoloop, "c_gotoloop", "" },
- { Lingo::c_gotonext, "c_gotonext", "" },
- { Lingo::c_gotoprevious,"c_gotoprevious","" },
- { Lingo::c_play, "c_play", "" },
- { Lingo::c_playdone, "c_playdone", "" },
- { Lingo::c_call, "c_call", "si" },
- { Lingo::c_procret, "c_procret", "" },
- { Lingo::c_global, "c_global", "s" },
- { Lingo::c_property, "c_property", "s" },
- { Lingo::c_instance, "c_instance", "s" },
- { Lingo::c_open, "c_open", "" },
- { Lingo::c_hilite, "c_hilite", "" },
- { Lingo::c_unk, "c_unk", "i" },
- { Lingo::c_unk1, "c_unk1", "ii" },
- { Lingo::c_unk2, "c_unk2", "iii" },
- { Lingo::cb_call, "cb_call", "i" },
- { Lingo::cb_localcall, "cb_localcall", "i" },
- { Lingo::cb_v4theentitypush,"c_v4theentitypush","i" },
- { Lingo::cb_v4theentitynamepush,"c_v4theentitynamepush","i" },
- { Lingo::cb_v4theentityassign,"c_v4theentityassign","i" },
+ { LC::c_xpop, "c_xpop", "" },
+ { LC::c_argcpush, "c_argcpush", "i" },
+ { LC::c_argcnoretpush, "c_argcnoretpush", "i" },
+ { LC::c_arraypush, "c_arraypush", "i" },
+ { LC::c_printtop, "c_printtop", "" },
+ { LC::c_intpush, "c_intpush", "i" },
+ { LC::c_voidpush, "c_voidpush", "" },
+ { LC::c_floatpush, "c_floatpush", "f" },
+ { LC::c_stringpush, "c_stringpush", "s" },
+ { LC::c_symbolpush, "c_symbolpush", "s" }, // D3
+ { LC::c_namepush, "c_namepush", "i" },
+ { LC::c_varpush, "c_varpush", "s" },
+ { LC::c_setImmediate,"c_setImmediate","i" },
+ { LC::c_assign, "c_assign", "" },
+ { LC::c_eval, "c_eval", "s" },
+ { LC::c_theentitypush,"c_theentitypush","ii" }, // entity, field
+ { LC::c_theentityassign,"c_theentityassign","ii" },
+ { LC::c_objectfieldpush,"c_objectfieldpush","si" }, // object, field
+ { LC::c_objectfieldassign,"c_objectfieldassign","si" },
+ { LC::c_swap, "c_swap", "" },
+ { LC::c_add, "c_add", "" },
+ { LC::c_sub, "c_sub", "" },
+ { LC::c_mul, "c_mul", "" },
+ { LC::c_div, "c_div", "" },
+ { LC::c_mod, "c_mod", "" },
+ { LC::c_negate, "c_negate", "" },
+ { LC::c_ampersand, "c_ampersand", "" },
+ { LC::c_after, "c_after", "" }, // D3
+ { LC::c_before, "c_before", "" }, // D3
+ { LC::c_concat, "c_concat", "" },
+ { LC::c_contains, "c_contains", "" },
+ { LC::c_starts, "c_starts", "" },
+ { LC::c_intersects, "c_intersects", "" },
+ { LC::c_within, "c_within", "" },
+ { LC::c_field, "c_field", "" },
+ { LC::c_of, "c_of", "" },
+ { LC::c_charOf, "c_charOf", "" }, // D3
+ { LC::c_charToOf, "c_charToOf", "" }, // D3
+ { LC::c_itemOf, "c_itemOf", "" }, // D3
+ { LC::c_itemToOf, "c_itemToOf", "" }, // D3
+ { LC::c_lineOf, "c_lineOf", "" }, // D3
+ { LC::c_lineToOf, "c_lineToOf", "" }, // D3
+ { LC::c_wordOf, "c_wordOf", "" }, // D3
+ { LC::c_wordToOf, "c_wordToOf", "" }, // D3
+ { LC::c_and, "c_and", "" },
+ { LC::c_or, "c_or", "" },
+ { LC::c_not, "c_not", "" },
+ { LC::c_eq, "c_eq", "" },
+ { LC::c_neq, "c_neq", "" },
+ { LC::c_gt, "c_gt", "" },
+ { LC::c_lt, "c_lt", "" },
+ { LC::c_ge, "c_ge", "" },
+ { LC::c_le, "c_le", "" },
+ { LC::c_jump, "c_jump", "i" },
+ { LC::c_jumpifz, "c_jumpifz", "i" },
+ { LC::c_repeatwhilecode,"c_repeatwhilecode","oo" },
+ { LC::c_repeatwithcode,"c_repeatwithcode","ooooos" },
+ { LC::c_exitRepeat, "c_exitRepeat", "" },
+ { LC::c_ifcode, "c_ifcode", "oooi" },
+ { LC::c_tellcode, "c_tellcode", "o" },
+ { LC::c_tell, "c_tell", "" },
+ { LC::c_telldone, "c_telldone", "" },
+ { LC::c_whencode, "c_whencode", "os" },
+ { LC::c_goto, "c_goto", "" },
+ { LC::c_gotoloop, "c_gotoloop", "" },
+ { LC::c_gotonext, "c_gotonext", "" },
+ { LC::c_gotoprevious,"c_gotoprevious","" },
+ { LC::c_play, "c_play", "" },
+ { LC::c_playdone, "c_playdone", "" },
+ { LC::c_call, "c_call", "si" },
+ { LC::c_procret, "c_procret", "" },
+ { LC::c_global, "c_global", "s" },
+ { LC::c_property, "c_property", "s" },
+ { LC::c_instance, "c_instance", "s" },
+ { LC::c_open, "c_open", "" },
+ { LC::c_hilite, "c_hilite", "" },
+ { LC::c_unk, "c_unk", "i" },
+ { LC::c_unk1, "c_unk1", "ii" },
+ { LC::c_unk2, "c_unk2", "iii" },
+ { LC::cb_call, "cb_call", "i" },
+ { LC::cb_localcall, "cb_localcall", "i" },
+ { LC::cb_v4theentitypush,"c_v4theentitypush","i" },
+ { LC::cb_v4theentitynamepush,"c_v4theentitynamepush","i" },
+ { LC::cb_v4theentityassign,"c_v4theentityassign","i" },
{ 0, 0, 0 }
};
@@ -172,11 +175,11 @@ Datum Lingo::pop(void) {
return ret;
}
-void Lingo::c_xpop() {
+void LC::c_xpop() {
g_lingo->pop();
}
-void Lingo::c_printtop(void) {
+void LC::c_printtop(void) {
Datum d = g_lingo->pop();
switch (d.type) {
@@ -216,34 +219,34 @@ void Lingo::c_printtop(void) {
}
}
-void Lingo::c_intpush() {
+void LC::c_intpush() {
Datum d;
d.u.i = g_lingo->readInt();
d.type = INT;
g_lingo->push(d);
}
-void Lingo::c_voidpush() {
+void LC::c_voidpush() {
Datum d;
d.u.s = NULL;
d.type = VOID;
g_lingo->push(d);
}
-void Lingo::c_floatpush() {
+void LC::c_floatpush() {
Datum d;
d.u.f = g_lingo->readFloat();
d.type = FLOAT;
g_lingo->push(d);
}
-void Lingo::c_stringpush() {
+void LC::c_stringpush() {
char *s = g_lingo->readString();
g_lingo->push(Datum(new Common::String(s)));
}
-void Lingo::c_symbolpush() {
+void LC::c_symbolpush() {
char *s = g_lingo->readString();
warning("STUB: c_symbolpush()");
@@ -252,13 +255,13 @@ void Lingo::c_symbolpush() {
g_lingo->push(Datum(new Common::String(s)));
}
-void Lingo::c_namepush() {
+void LC::c_namepush() {
Datum d;
int i = g_lingo->readInt();
g_lingo->push(Datum(new Common::String(g_lingo->_namelist[i])));
}
-void Lingo::c_argcpush() {
+void LC::c_argcpush() {
Datum d;
int argsSize = g_lingo->readInt();
@@ -267,7 +270,7 @@ void Lingo::c_argcpush() {
g_lingo->push(d);
}
-void Lingo::c_argcnoretpush() {
+void LC::c_argcnoretpush() {
Datum d;
int argsSize = g_lingo->readInt();
@@ -276,7 +279,7 @@ void Lingo::c_argcnoretpush() {
g_lingo->push(d);
}
-void Lingo::c_arraypush() {
+void LC::c_arraypush() {
Datum d;
int arraySize = g_lingo->readInt();
@@ -290,7 +293,7 @@ void Lingo::c_arraypush() {
g_lingo->push(d);
}
-void Lingo::c_varpush() {
+void LC::c_varpush() {
Common::String name(g_lingo->readString());
Datum d;
@@ -324,11 +327,11 @@ void Lingo::c_varpush() {
g_lingo->push(d);
}
-void Lingo::c_setImmediate() {
+void LC::c_setImmediate() {
g_lingo->_immediateMode = g_lingo->readInt();
}
-void Lingo::c_assign() {
+void LC::c_assign() {
Datum d1, d2;
d1 = g_lingo->pop();
d2 = g_lingo->pop();
@@ -391,7 +394,7 @@ void Lingo::c_assign() {
d1.u.sym->type = d2.type;
}
-bool Lingo::verify(Symbol *s) {
+bool LC::verify(Symbol *s) {
if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING && s->type != POINT && s->type != SYMBOL) {
warning("attempt to evaluate non-variable '%s'", s->name.c_str());
@@ -404,14 +407,14 @@ bool Lingo::verify(Symbol *s) {
return true;
}
-void Lingo::c_eval() {
- g_lingo->c_varpush();
+void LC::c_eval() {
+ g_lc->c_varpush();
Datum d;
d = g_lingo->pop();
if (d.type == HANDLER) {
- g_lingo->call(*d.u.s, 0);
+ g_lc->call(*d.u.s, 0);
delete d.u.s;
return;
}
@@ -421,7 +424,7 @@ void Lingo::c_eval() {
return;
}
- if (!g_lingo->verify(d.u.sym))
+ if (!g_lc->verify(d.u.sym))
return;
d.type = d.u.sym->type;
@@ -444,7 +447,7 @@ void Lingo::c_eval() {
g_lingo->push(d);
}
-void Lingo::c_theentitypush() {
+void LC::c_theentitypush() {
Datum id = g_lingo->pop();
int entity = g_lingo->readInt();
@@ -454,7 +457,7 @@ void Lingo::c_theentitypush() {
g_lingo->push(d);
}
-void Lingo::c_theentityassign() {
+void LC::c_theentityassign() {
Datum id = g_lingo->pop();
int entity = g_lingo->readInt();
@@ -464,7 +467,7 @@ void Lingo::c_theentityassign() {
g_lingo->setTheEntity(entity, id, field, d);
}
-void Lingo::c_objectfieldpush() {
+void LC::c_objectfieldpush() {
Common::String object(g_lingo->readString());
int field = g_lingo->readInt();
@@ -472,7 +475,7 @@ void Lingo::c_objectfieldpush() {
g_lingo->push(d);
}
-void Lingo::c_objectfieldassign() {
+void LC::c_objectfieldassign() {
Common::String object(g_lingo->readString());
int field = g_lingo->readInt();
@@ -481,14 +484,14 @@ void Lingo::c_objectfieldassign() {
g_lingo->setObjectField(object, field, d);
}
-void Lingo::c_swap() {
+void LC::c_swap() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
g_lingo->push(d2);
g_lingo->push(d1);
}
-void Lingo::c_add() {
+void LC::c_add() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -500,7 +503,7 @@ void Lingo::c_add() {
g_lingo->push(d1);
}
-void Lingo::c_sub() {
+void LC::c_sub() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -512,7 +515,7 @@ void Lingo::c_sub() {
g_lingo->push(d1);
}
-void Lingo::c_mul() {
+void LC::c_mul() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -524,7 +527,7 @@ void Lingo::c_mul() {
g_lingo->push(d1);
}
-void Lingo::c_div() {
+void LC::c_div() {
Datum d2 = g_lingo->pop();
if ((d2.type == INT && d2.u.i == 0) ||
@@ -541,7 +544,7 @@ void Lingo::c_div() {
g_lingo->push(d1);
}
-void Lingo::c_mod() {
+void LC::c_mod() {
Datum d2 = g_lingo->pop();
d2.toInt();
@@ -556,7 +559,7 @@ void Lingo::c_mod() {
g_lingo->push(d1);
}
-void Lingo::c_negate() {
+void LC::c_negate() {
Datum d = g_lingo->pop();
if (d.type == INT)
@@ -567,7 +570,7 @@ void Lingo::c_negate() {
g_lingo->push(d);
}
-void Lingo::c_ampersand() {
+void LC::c_ampersand() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -581,7 +584,7 @@ void Lingo::c_ampersand() {
g_lingo->push(d1);
}
-void Lingo::c_after() {
+void LC::c_after() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -595,7 +598,7 @@ void Lingo::c_after() {
g_lingo->push(d1);
}
-void Lingo::c_before() {
+void LC::c_before() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -609,7 +612,7 @@ void Lingo::c_before() {
g_lingo->push(d1);
}
-void Lingo::c_concat() {
+void LC::c_concat() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -624,7 +627,7 @@ void Lingo::c_concat() {
g_lingo->push(d1);
}
-void Lingo::c_contains() {
+void LC::c_contains() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -647,7 +650,7 @@ void Lingo::c_contains() {
g_lingo->push(d1);
}
-void Lingo::c_starts() {
+void LC::c_starts() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -670,7 +673,7 @@ void Lingo::c_starts() {
g_lingo->push(d1);
}
-void Lingo::c_intersects() {
+void LC::c_intersects() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -679,7 +682,7 @@ void Lingo::c_intersects() {
g_lingo->push(d1);
}
-void Lingo::c_within() {
+void LC::c_within() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -688,7 +691,7 @@ void Lingo::c_within() {
g_lingo->push(d1);
}
-void Lingo::c_field() {
+void LC::c_field() {
Datum d1 = g_lingo->pop();
warning("STUB: c_field: %d", d1.u.i);
@@ -696,7 +699,7 @@ void Lingo::c_field() {
g_lingo->push(d1);
}
-void Lingo::c_of() {
+void LC::c_of() {
Datum first_char = g_lingo->pop();
Datum last_char = g_lingo->pop();
Datum first_word = g_lingo->pop();
@@ -716,7 +719,7 @@ void Lingo::c_of() {
}
-void Lingo::c_charOf() {
+void LC::c_charOf() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -725,7 +728,7 @@ void Lingo::c_charOf() {
g_lingo->push(d1);
}
-void Lingo::c_charToOf() {
+void LC::c_charToOf() {
Datum d3 = g_lingo->pop();
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -735,7 +738,7 @@ void Lingo::c_charToOf() {
g_lingo->push(d1);
}
-void Lingo::c_itemOf() {
+void LC::c_itemOf() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -744,7 +747,7 @@ void Lingo::c_itemOf() {
g_lingo->push(d1);
}
-void Lingo::c_itemToOf() {
+void LC::c_itemToOf() {
Datum d3 = g_lingo->pop();
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -754,7 +757,7 @@ void Lingo::c_itemToOf() {
g_lingo->push(d1);
}
-void Lingo::c_lineOf() {
+void LC::c_lineOf() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -763,7 +766,7 @@ void Lingo::c_lineOf() {
g_lingo->push(d1);
}
-void Lingo::c_lineToOf() {
+void LC::c_lineToOf() {
Datum d3 = g_lingo->pop();
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -773,7 +776,7 @@ void Lingo::c_lineToOf() {
g_lingo->push(d1);
}
-void Lingo::c_wordOf() {
+void LC::c_wordOf() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -782,7 +785,7 @@ void Lingo::c_wordOf() {
g_lingo->push(d1);
}
-void Lingo::c_wordToOf() {
+void LC::c_wordToOf() {
Datum d3 = g_lingo->pop();
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -792,7 +795,7 @@ void Lingo::c_wordToOf() {
g_lingo->push(d1);
}
-void Lingo::c_and() {
+void LC::c_and() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -804,7 +807,7 @@ void Lingo::c_and() {
g_lingo->push(d1);
}
-void Lingo::c_or() {
+void LC::c_or() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -816,7 +819,7 @@ void Lingo::c_or() {
g_lingo->push(d1);
}
-void Lingo::c_not() {
+void LC::c_not() {
Datum d = g_lingo->pop();
d.toInt();
@@ -826,7 +829,7 @@ void Lingo::c_not() {
g_lingo->push(d);
}
-void Lingo::c_eq() {
+void LC::c_eq() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -842,7 +845,7 @@ void Lingo::c_eq() {
g_lingo->push(d1);
}
-void Lingo::c_neq() {
+void LC::c_neq() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -858,7 +861,7 @@ void Lingo::c_neq() {
g_lingo->push(d1);
}
-void Lingo::c_gt() {
+void LC::c_gt() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -871,7 +874,7 @@ void Lingo::c_gt() {
g_lingo->push(d1);
}
-void Lingo::c_lt() {
+void LC::c_lt() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -884,7 +887,7 @@ void Lingo::c_lt() {
g_lingo->push(d1);
}
-void Lingo::c_ge() {
+void LC::c_ge() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -897,7 +900,7 @@ void Lingo::c_ge() {
g_lingo->push(d1);
}
-void Lingo::c_le() {
+void LC::c_le() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -910,12 +913,12 @@ void Lingo::c_le() {
g_lingo->push(d1);
}
-void Lingo::c_jump() {
+void LC::c_jump() {
uint jump = g_lingo->readInt();
g_lingo->_pc = jump;
}
-void Lingo::c_jumpifz() {
+void LC::c_jumpifz() {
uint jump = g_lingo->readInt();
Datum test = g_lingo->pop();
test.toInt();
@@ -924,7 +927,7 @@ void Lingo::c_jumpifz() {
}
}
-void Lingo::c_repeatwhilecode(void) {
+void LC::c_repeatwhilecode(void) {
Datum d;
int savepc = g_lingo->_pc;
@@ -954,7 +957,7 @@ void Lingo::c_repeatwhilecode(void) {
g_lingo->_pc = end + savepc - 1; /* next stmt */
}
-void Lingo::c_repeatwithcode(void) {
+void LC::c_repeatwithcode(void) {
Datum d;
int savepc = g_lingo->_pc;
@@ -999,11 +1002,11 @@ void Lingo::c_repeatwithcode(void) {
g_lingo->_pc = end + savepc - 1; /* next stmt */
}
-void Lingo::c_exitRepeat(void) {
+void LC::c_exitRepeat(void) {
g_lingo->_exitRepeat = true;
}
-void Lingo::c_ifcode() {
+void LC::c_ifcode() {
Datum d;
int savepc = g_lingo->_pc; /* then part */
@@ -1035,7 +1038,7 @@ void Lingo::c_ifcode() {
}
}
-void Lingo::c_whencode() {
+void LC::c_whencode() {
Datum d;
uint start = g_lingo->_pc;
uint end = g_lingo->readInt() + start - 1;
@@ -1064,16 +1067,16 @@ void Lingo::c_whencode() {
g_lingo->_pc = end + 1;
}
-void Lingo::c_tellcode() {
+void LC::c_tellcode() {
warning("STUB: c_tellcode");
}
-void Lingo::c_tell() {
+void LC::c_tell() {
Datum d1 = g_lingo->pop();
warning("STUB: c_tell %d", d1.u.i);
}
-void Lingo::c_telldone() {
+void LC::c_telldone() {
warning("STUB: c_telldone");
}
@@ -1081,7 +1084,7 @@ void Lingo::c_telldone() {
//************************
// Built-in functions
//************************
-void Lingo::c_goto() {
+void LC::c_goto() {
Datum mode = g_lingo->pop();
Datum frame, movie;
@@ -1094,19 +1097,19 @@ void Lingo::c_goto() {
g_lingo->func_goto(frame, movie);
}
-void Lingo::c_gotoloop() {
+void LC::c_gotoloop() {
g_lingo->func_gotoloop();
}
-void Lingo::c_gotonext() {
+void LC::c_gotonext() {
g_lingo->func_gotonext();
}
-void Lingo::c_gotoprevious() {
+void LC::c_gotoprevious() {
g_lingo->func_gotoprevious();
}
-void Lingo::c_play() {
+void LC::c_play() {
Datum mode = g_lingo->pop();
Datum frame, movie;
@@ -1119,23 +1122,23 @@ void Lingo::c_play() {
g_lingo->func_play(frame, movie);
}
-void Lingo::c_playdone() {
+void LC::c_playdone() {
g_lingo->func_playdone();
}
-void Lingo::c_call() {
+void LC::c_call() {
Common::String name(g_lingo->readString());
int nargs = g_lingo->readInt();
- g_lingo->call(name, nargs);
+ g_lc->call(name, nargs);
}
-void Lingo::call(Common::String name, int nargs) {
+void LC::call(Common::String name, int nargs) {
bool dropArgs = false;
if (debugChannelSet(3, kDebugLingoExec))
- printSTUBWithArglist(name.c_str(), nargs, "call:");
+ g_lingo->printSTUBWithArglist(name.c_str(), nargs, "call:");
Symbol *sym = g_lingo->getHandler(name);
@@ -1181,14 +1184,14 @@ void Lingo::call(Common::String name, int nargs) {
}
if (sym->type == BLTIN || sym->type == FBLTIN || sym->type == RBLTIN) {
- if (sym->u.bltin == b_factory) {
+ if (sym->u.bltin == g_lingo->b_factory) {
g_lingo->factoryCall(name, nargs);
} else {
- int stackSize = _stack.size() - nargs;
+ int stackSize = g_lingo->_stack.size() - nargs;
(*sym->u.bltin)(nargs);
- int stackNewSize = _stack.size();
+ int stackNewSize = g_lingo->_stack.size();
if (sym->type == FBLTIN || sym->type == RBLTIN) {
if (stackNewSize - stackSize != 1)
@@ -1229,7 +1232,7 @@ void Lingo::call(Common::String name, int nargs) {
g_lingo->_returning = false;
}
-void Lingo::c_procret() {
+void LC::c_procret() {
if (!g_lingo->_callstack.size()) {
warning("c_procret: Call stack underflow");
g_lingo->_returning = true;
@@ -1254,7 +1257,7 @@ void Lingo::c_procret() {
g_lingo->_returning = true;
}
-void Lingo::c_global() {
+void LC::c_global() {
Common::String name(g_lingo->readString());
Symbol *s = g_lingo->lookupVar(name.c_str(), false);
@@ -1266,19 +1269,19 @@ void Lingo::c_global() {
s->global = true;
}
-void Lingo::c_property() {
+void LC::c_property() {
Common::String name(g_lingo->readString());
warning("STUB: c_property()");
}
-void Lingo::c_instance() {
+void LC::c_instance() {
Common::String name(g_lingo->readString());
warning("STUB: c_instance(%s)", name.c_str());
}
-void Lingo::c_factory() {
+void LC::c_factory() {
Common::String name(g_lingo->readString());
Datum d;
@@ -1290,7 +1293,7 @@ void Lingo::c_factory() {
g_lingo->push(d);
}
-void Lingo::c_open() {
+void LC::c_open() {
Datum d2 = g_lingo->pop();
Datum d1 = g_lingo->pop();
@@ -1300,7 +1303,7 @@ void Lingo::c_open() {
warning("STUB: c_open(%s, %s)", d1.u.s->c_str(), d2.u.s->c_str());
}
-void Lingo::c_hilite() {
+void LC::c_hilite() {
Datum first_char = g_lingo->pop();
Datum last_char = g_lingo->pop();
Datum first_word = g_lingo->pop();
@@ -1317,18 +1320,18 @@ void Lingo::c_hilite() {
cast_id.u.i);
}
-void Lingo::c_unk() {
+void LC::c_unk() {
uint opcode = g_lingo->readInt();
warning("STUB: opcode 0x%02x", opcode);
}
-void Lingo::c_unk1() {
+void LC::c_unk1() {
uint opcode = g_lingo->readInt();
uint arg1 = g_lingo->readInt();
warning("STUB: opcode 0x%02x (%d)", opcode, arg1);
}
-void Lingo::c_unk2() {
+void LC::c_unk2() {
uint opcode = g_lingo->readInt();
uint arg1 = g_lingo->readInt();
uint arg2 = g_lingo->readInt();