From 324cffbde63902408836f8b6b7833162404edaae Mon Sep 17 00:00:00 2001 From: Scott Percival Date: Tue, 3 Dec 2019 23:06:11 +0800 Subject: DIRECTOR: LINGO: Add cb_v4theentitynamepush --- engines/director/lingo/lingo-bytecode.cpp | 18 ++++++++++++++++++ engines/director/lingo/lingo-code.cpp | 1 + engines/director/lingo/lingo.h | 1 + 3 files changed, 20 insertions(+) diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp index 462650e408..371f55cf13 100644 --- a/engines/director/lingo/lingo-bytecode.cpp +++ b/engines/director/lingo/lingo-bytecode.cpp @@ -63,6 +63,7 @@ static LingoV4Bytecode lingoV4[] = { { 0x55, Lingo::c_jumpifz, "jb" }, { 0x5c, Lingo::cb_v4theentitypush, "b" }, { 0x5d, Lingo::cb_v4theentityassign, "b" }, + { 0x66, Lingo::cb_v4theentitynamepush, "b" }, { 0x81, Lingo::c_intpush, "w" }, { 0x82, Lingo::c_argspush, "w" }, { 0x83, Lingo::c_arraypush, "w" }, @@ -241,6 +242,23 @@ void Lingo::cb_v4theentitypush() { } +void Lingo::cb_v4theentitynamepush() { + int nameId = g_lingo->readInt(); + Common::String name = g_lingo->_namelist[nameId]; + + Datum id; + id.u.s = NULL; + id.type = VOID; + + TheEntity *entity = g_lingo->_theEntities[name]; + + debugC(3, kDebugLingoExec, "cb_v4theentitynamepush: calling getTheEntity(0x%02x, id, kTheNOField)", entity->entity, name.c_str()); + Datum result = g_lingo->getTheEntity(entity->entity, id, kTheNOField); + + g_lingo->push(result); +} + + void Lingo::cb_v4theentityassign() { int bank = g_lingo->readInt(); diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index ff274fdc62..3575dc32eb 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -133,6 +133,7 @@ static struct FuncDescr { { Lingo::c_unk1, "c_unk1", "ii" }, { Lingo::c_unk2, "c_unk2", "iii" }, { Lingo::cb_v4theentitypush,"c_v4theentitypush","i" }, + { Lingo::cb_v4theentitynamepush,"c_v4theentitynamepush","i" }, { Lingo::cb_v4theentityassign,"c_v4theentityassign","i" }, { 0, 0, 0 } }; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 9cbe6c3507..65f985094a 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -348,6 +348,7 @@ public: // bytecode-related instructions static void cb_v4theentitypush(); + static void cb_v4theentitynamepush(); static void cb_v4theentityassign(); void printSTUBWithArglist(const char *funcname, int nargs, const char *prefix = "STUB:"); -- cgit v1.2.3