aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorScott Percival2019-12-04 01:04:09 +0800
committerScott Percival2019-12-04 01:12:41 +0800
commit412d504f4ea843c057ef34a46fbc1f867d594250 (patch)
tree7ddc49f653d4ac4e0e9c16318c01b9bdab2c5104 /engines
parent2d3da1aa31f126dbfa225a958c2b2f17a7f9bf0a (diff)
downloadscummvm-rg350-412d504f4ea843c057ef34a46fbc1f867d594250.tar.gz
scummvm-rg350-412d504f4ea843c057ef34a46fbc1f867d594250.tar.bz2
scummvm-rg350-412d504f4ea843c057ef34a46fbc1f867d594250.zip
DIRECTOR: LINGO: Fix cb_v4theentitynamepush to consume an argc
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo-bytecode.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index 9e8e374c32..06283d93b0 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -55,6 +55,7 @@ static LingoV4Bytecode lingoV4[] = {
{ 0x1d, Lingo::c_telldone, "" },
{ 0x41, Lingo::c_intpush, "b" },
{ 0x42, Lingo::c_argcpush, "b" },
+ { 0x43, Lingo::c_argcnoretpush, "b" },
{ 0x44, Lingo::c_constpush, "bv" },
{ 0x45, Lingo::c_symbolpush, "b" },
{ 0x53, Lingo::c_jump, "jb" },
@@ -67,7 +68,7 @@ static LingoV4Bytecode lingoV4[] = {
{ 0x66, Lingo::cb_v4theentitynamepush, "b" },
{ 0x81, Lingo::c_intpush, "w" },
{ 0x82, Lingo::c_argcpush, "w" },
- { 0x83, Lingo::c_arraypush, "w" },
+ { 0x83, Lingo::c_argcnoretpush, "w" },
{ 0x84, Lingo::c_constpush, "wv" },
{ 0x93, Lingo::c_jump, "jw" },
{ 0x94, Lingo::c_jump, "jwn" },
@@ -190,6 +191,9 @@ void Lingo::cb_localcall() {
Datum nargs = g_lingo->pop();
if ((nargs.type == ARGC) || (nargs.type == ARGCNORET)) {
warning("STUB: cb_localcall(%s)", name.c_str());
+ for (int i = 0; i < nargs.u.i; i++) {
+ g_lingo->pop();
+ }
} else {
warning("cb_localcall: first arg should be of type ARGC or ARGCNORET, not %s", nargs.type2str());
@@ -274,6 +278,18 @@ void Lingo::cb_v4theentitypush() {
void Lingo::cb_v4theentitynamepush() {
+ Datum args = g_lingo->pop();
+ if ((args.type == ARGC) || (args.type == ARGCNORET)) {
+ if (args.u.i > 0) {
+ warning("cb_v4theentitynamepush: expecting argc to be 0, not %d", args.u.i);
+ for (int i = 0; i < args.u.i; i++) {
+ g_lingo->pop();
+ }
+ }
+ } else {
+ warning("cb_v4theentitynamepush: expecting first arg to be of type ARGC or ARGCNORET, not %s", args.type2str());
+ }
+
int nameId = g_lingo->readInt();
Common::String name = g_lingo->_namelist[nameId];