[Scummvm-git-logs] scummvm master -> 234c910fa16aa282f22a2dcb2e98f2d9290d28f2

sev- sev at scummvm.org
Thu May 7 10:29:11 UTC 2020


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e6bd730976 DIRECTOR: LINGO: Added check for decompiler lists for bytecode
234c910fa1 DIRECTOR: LINGO: Added missing bytecode prototypes


Commit: e6bd730976fa3a7945ec7808fdfd8786440d6022
    https://github.com/scummvm/scummvm/commit/e6bd730976fa3a7945ec7808fdfd8786440d6022
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-07T12:25:20+02:00

Commit Message:
DIRECTOR: LINGO: Added check for decompiler lists for bytecode

Changed paths:
    engines/director/lingo/lingo-bytecode.cpp


diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index d85820b9ee..e98198a014 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -209,10 +209,29 @@ static LingoV4TheEntity lingoV4TheEntity[] = {
 
 
 void Lingo::initBytecode() {
+	// All new bytecodes must have respective entry in funcDescr[]
+	// array in lingo-code.cpp, which is used for decompilation
+	//
+	// Check that all opcodes have entries
+	Common::HashMap<inst, bool> list;
+	bool bailout = false;
+
+	// Build reverse hashmap
+	for (FuncHash::iterator it = _functions.begin(); it != _functions.end(); ++it)
+		list[(inst)it->_key] = true;
+
 	for (LingoV4Bytecode *op = lingoV4; op->opcode; op++) {
 		_lingoV4[op->opcode] = op;
+
+		if (!list.contains(op->func)) {
+			warning("Lingo::initBytecode(): Missing prototype for opcode 0x%02x", op->opcode);
+			bailout = true;
+		}
 	}
 
+	if (bailout)
+		error("Lingo::initBytecode(): Add entries to funcDescr[] in lingo-code.cpp");
+
 	for (LingoV4TheEntity *ent = lingoV4TheEntity; ent->bank != 0xff; ent++) {
 		_lingoV4TheEntity[(ent->bank << 8) + ent->firstArg] = ent;
 	}


Commit: 234c910fa16aa282f22a2dcb2e98f2d9290d28f2
    https://github.com/scummvm/scummvm/commit/234c910fa16aa282f22a2dcb2e98f2d9290d28f2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-07T12:28:46+02:00

Commit Message:
DIRECTOR: LINGO: Added missing bytecode prototypes

Changed paths:
    engines/director/lingo/lingo-code.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index e61fcb888a..124f8cdd0c 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -144,6 +144,7 @@ static struct FuncDescr {
 	{ LC::cb_globalassign,	"cb_globalassign",	"i" },
 	{ LC::cb_globalpush,	"cb_globalpush",	"i" },
 	{ LC::cb_list,			"cb_list",			"" },
+	{ LC::cb_proplist,		"cb_proplist",		"" },
 	{ LC::cb_localcall,		"cb_localcall",		"i" },
 	{ LC::cb_methodcall,	"cb_methodcall",	"i" },
 	{ LC::cb_objectpush,	"cb_objectpush",	"i" },
@@ -157,6 +158,8 @@ static struct FuncDescr {
 	{ LC::cb_v4theentitynamepush,"cb_v4theentitynamepush","i" },
 	{ LC::cb_v4theentityassign,"cb_v4theentityassign","i" },
 	{ LC::cb_zeropush,		"cb_zeropush",		"" },
+	{ LC::cb_stackpeek,		"cb_stackpeek",		"i" },
+	{ LC::cb_stackdrop,		"cb_stackdrop",		"i" },
 	{ 0, 0, 0 }
 };
 




More information about the Scummvm-git-logs mailing list