[Scummvm-cvs-logs] scummvm master -> 6ab4a0ceee71293c100a810c591dde823c2b76ba

tramboi bertrand_augereau at yahoo.fr
Wed Aug 31 22:45:17 CEST 2011


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:
0534b70b6d DREAMWEB: 'getaddir' ported to C++
6ab4a0ceee DREAMWEB: 'compare' ported to C++


Commit: 0534b70b6d73b6d5afbf107021d52f46a13fcbe9
    https://github.com/scummvm/scummvm/commit/0534b70b6d73b6d5afbf107021d52f46a13fcbe9
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-31T15:14:48-07:00

Commit Message:
DREAMWEB: 'getaddir' ported to C++

Changed paths:
    engines/dreamweb/stubs.cpp
    engines/dreamweb/stubs.h



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index e400a5b..923c636 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1207,6 +1207,15 @@ void *DreamGenContext::getanyad(uint8 *value1, uint8 *value2) {
 	}
 }
 
+void *DreamGenContext::getanyaddir(uint8 index, uint8 flag) {
+	if (flag == 4)
+		return getexad(index);
+	else if (flag == 2)
+		return getfreead(index);
+	else
+		return getsetad(index);
+}
+
 SetObject *DreamGenContext::getsetad(uint8 index) {
 	return (SetObject *)segRef(data.word(kSetdat)).ptr(0, 0) + index;
 }
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 7bba6a9..6d431a8 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -163,6 +163,7 @@
 	DynObject *geteitheradCPP();
 	SetObject *getsetad(uint8 index);
 	void *getanyad(uint8 *value1, uint8 *value2);
+	void *getanyaddir(uint8 index, uint8 flag);
 	void setallchanges();
 	void dochange();
 	void dochange(uint8 index, uint8 value, uint8 type);


Commit: 6ab4a0ceee71293c100a810c591dde823c2b76ba
    https://github.com/scummvm/scummvm/commit/6ab4a0ceee71293c100a810c591dde823c2b76ba
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-31T15:39:43-07:00

Commit Message:
DREAMWEB: 'compare' ported to C++

Changed paths:
    devtools/tasmrecover/tasm-recover
    engines/dreamweb/dreamgen.cpp
    engines/dreamweb/dreamgen.h
    engines/dreamweb/stubs.cpp
    engines/dreamweb/stubs.h



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 29d24a5..75da671 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -174,6 +174,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'delthisone',
 	'transferinv',
 	'obicons',
+	'compare',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 58c4619..a426ced 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -10535,23 +10535,6 @@ doselob:
 	useroutine();
 }
 
-void DreamGenContext::compare() {
-	STACK_CHECK;
-	_sub(dl, 'A');
-	_sub(dh, 'A');
-	_sub(cl, 'A');
-	_sub(ch, 'A');
-	push(cx);
-	push(dx);
-	getanyaddir();
-	dx = pop();
-	cx = pop();
-	_cmp(es.word(bx+12), cx);
-	if (!flags.z())
-		return /* (comparefin) */;
-	_cmp(es.word(bx+14), dx);
-}
-
 void DreamGenContext::findsetobject() {
 	STACK_CHECK;
 	_sub(al, 'A');
@@ -17893,7 +17876,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_useelvdoor: useelvdoor(); break;
 		case addr_withwhat: withwhat(); break;
 		case addr_selectob: selectob(); break;
-		case addr_compare: compare(); break;
 		case addr_findsetobject: findsetobject(); break;
 		case addr_findexobject: findexobject(); break;
 		case addr_isryanholding: isryanholding(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 04bef16..3b68002 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -297,7 +297,6 @@ public:
 	static const uint16 addr_isryanholding = 0xc6cc;
 	static const uint16 addr_findexobject = 0xc6c8;
 	static const uint16 addr_findsetobject = 0xc6c4;
-	static const uint16 addr_compare = 0xc6c0;
 	static const uint16 addr_selectob = 0xc6bc;
 	static const uint16 addr_withwhat = 0xc6b8;
 	static const uint16 addr_useelvdoor = 0xc6b4;
@@ -1359,7 +1358,7 @@ public:
 	void showdiscops();
 	void advisor();
 	void additionaltext();
-	//void kernchars();
+	//void compare();
 	void othersmoker();
 	void dofade();
 	//void setuptimedtemp();
@@ -1406,7 +1405,7 @@ public:
 	//void addtopeoplelist();
 	void hangoncurs();
 	void sparkydrip();
-	void compare();
+	//void kernchars();
 	void printcurs();
 	//void convertkey();
 	void outofopen();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 923c636..3a01872 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1717,6 +1717,21 @@ void DreamGenContext::obicons() {
 	}
 }
 
+void DreamGenContext::compare() {
+	char id[4] = { cl, ch, dl, dh };
+	flags._z = compare(al, ah, id);
+}
+
+bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
+	void *ptr = getanyaddir(index, flag);
+	const char *objId = (const char *)(((const uint8 *)ptr) + 12); // whether it is a DynObject or a SetObject
+	for (size_t i = 0; i < 4; ++i) {
+		if(id[i] != objId[i] + 'A')
+			return false;
+	}
+	return true;
+}
+
 bool DreamGenContext::isCD() {
 	// The original sources has two codepaths depending if the game is 'if cd' or not
 	// This is a hack to guess which version to use with the assumption that if we have a cd version
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6d431a8..f99f0d6 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -208,4 +208,6 @@
 	void obpicture();
 	void transferinv();
 	void obicons();
+	void compare();
+	bool compare(uint8 index, uint8 flag, const char id[4]);
 






More information about the Scummvm-git-logs mailing list