aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Percival2019-11-30 09:42:14 +0800
committerScott Percival2019-12-02 21:57:09 +0800
commit13cffcd6a2a910eb28ea62e7b7531daa625f6c20 (patch)
treeef8319a574cc4a5d0b5856065f27f2e6f6a21bb4
parenta45da2eb03139d48b98f3f520cfdf23b164a77c1 (diff)
downloadscummvm-rg350-13cffcd6a2a910eb28ea62e7b7531daa625f6c20.tar.gz
scummvm-rg350-13cffcd6a2a910eb28ea62e7b7531daa625f6c20.tar.bz2
scummvm-rg350-13cffcd6a2a910eb28ea62e7b7531daa625f6c20.zip
DIRECTOR: Add stubs for c_jump and c_jumpif
-rw-r--r--engines/director/lingo/lingo-bytecode.cpp15
-rw-r--r--engines/director/lingo/lingo-code.cpp11
-rw-r--r--engines/director/lingo/lingo.h2
3 files changed, 26 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index 6155c3d2b4..c08a8457fa 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -58,12 +58,17 @@ static LingoV4Bytecode lingoV4[] = {
{ 0x43, Lingo::c_arraypush, "b" },
{ 0x44, Lingo::c_constpush, "bv" },
{ 0x45, Lingo::c_symbolpush, "b" },
+ { 0x53, Lingo::c_jump, "bj" },
+ { 0x54, Lingo::c_jump, "bnj" },
+ { 0x55, Lingo::c_jumpif, "bj" },
{ 0x5c, Lingo::c_v4theentitypush, "b" },
{ 0x5d, Lingo::c_v4theentityassign, "b" },
{ 0x81, Lingo::c_intpush, "w" },
{ 0x82, Lingo::c_argspush, "w" },
{ 0x83, Lingo::c_arraypush, "w" },
{ 0x84, Lingo::c_constpush, "wv" },
+ { 0x93, Lingo::c_jump, "wj" },
+ { 0x95, Lingo::c_jumpif, "wj" },
{ 0, 0, 0 }
};
@@ -476,6 +481,7 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
uint16 pointer = startOffset - codeStoreOffset;
Common::Array<uint32> offsetList;
+ Common::Array<uint32> jumpList;
while (pointer < startOffset + length - codeStoreOffset) {
uint8 opcode = codeStore[pointer];
@@ -502,10 +508,16 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
break;
case 'v':
if (arg % 6) {
- warning("Opcode 0x%02x arg %d not multiple of 6!", opcode, arg);
+ warning("Opcode 0x%02x arg %d not a multiple of 6!", opcode, arg);
}
arg /= 6;
break;
+ case 'n':
+ arg *= -1;
+ break;
+ case 'j':
+ jumpList.push_back(offsetList.size());
+ break;
default:
break;
}
@@ -540,7 +552,6 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
}
}
}
-
}
free(codeStore);
}
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index ff9ae2428a..0fc99b344f 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -108,6 +108,8 @@ static struct FuncDescr {
{ Lingo::c_lt, "c_lt", "" },
{ Lingo::c_ge, "c_ge", "" },
{ Lingo::c_le, "c_le", "" },
+ { Lingo::c_jump, "c_jump", "i" },
+ { Lingo::c_jumpif, "c_jumpif", "i" },
{ Lingo::c_repeatwhilecode,"c_repeatwhilecode","oo" },
{ Lingo::c_repeatwithcode,"c_repeatwithcode","ooooos" },
{ Lingo::c_exitRepeat, "c_exitRepeat", "" },
@@ -892,6 +894,15 @@ void Lingo::c_le() {
g_lingo->push(d1);
}
+void Lingo::c_jump() {
+ warning("STUB: c_jump()");
+}
+
+void Lingo::c_jumpif() {
+ g_lingo->pop();
+ warning("STUB: c_jumpif()");
+}
+
void Lingo::c_repeatwhilecode(void) {
Datum d;
int savepc = g_lingo->_pc;
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index e4f8a5968f..937d2eff39 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -309,6 +309,8 @@ public:
static void c_lt();
static void c_ge();
static void c_le();
+ static void c_jump();
+ static void c_jumpif();
static void c_call();
void call(Common::String name, int nargs);