[Scummvm-cvs-logs] scummvm master -> 7eed29c1a0e02f31d615e5f3780705e43ee4922d

tramboi bertrand_augereau at yahoo.fr
Mon Sep 5 12:02:15 CEST 2011


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

Summary:
7eed29c1a0 DREAMWEB: 'isitdescribed' ported to C++


Commit: 7eed29c1a0e02f31d615e5f3780705e43ee4922d
    https://github.com/scummvm/scummvm/commit/7eed29c1a0e02f31d615e5f3780705e43ee4922d
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-01T18:49:28-07:00

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

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



diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 11d2a51..7309b4f 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -14836,29 +14836,6 @@ notasetid:
 		goto identifyset;
 }
 
-void DreamGenContext::isitdescribed() {
-	STACK_CHECK;
-	push(ax);
-	push(cx);
-	push(es);
-	push(bx);
-	al = es.byte(bx+4);
-	ah = 0;
-	_add(ax, ax);
-	bx = ax;
-	es = data.word(kSetdesc);
-	_add(bx, (0));
-	ax = es.word(bx);
-	_add(ax, (0+(130*2)));
-	bx = ax;
-	dl = es.byte(bx);
-	bx = pop();
-	es = pop();
-	cx = pop();
-	ax = pop();
-	_cmp(dl, 0);
-}
-
 void DreamGenContext::findpathofpoint() {
 	STACK_CHECK;
 	push(ax);
@@ -17915,7 +17892,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_madmanrun: madmanrun(); break;
 		case addr_identifyob: identifyob(); break;
 		case addr_checkifset: checkifset(); break;
-		case addr_isitdescribed: isitdescribed(); break;
 		case addr_findpathofpoint: findpathofpoint(); break;
 		case addr_findfirstpath: findfirstpath(); break;
 		case addr_checkifpathison: checkifpathison(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6a99187..4e5505c 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -113,7 +113,6 @@ public:
 	static const uint16 addr_checkifpathison = 0xca04;
 	static const uint16 addr_findfirstpath = 0xc9f0;
 	static const uint16 addr_findpathofpoint = 0xc9ec;
-	static const uint16 addr_isitdescribed = 0xc9e8;
 	static const uint16 addr_checkifset = 0xc9dc;
 	static const uint16 addr_identifyob = 0xc9d4;
 	static const uint16 addr_madmanrun = 0xc9cc;
@@ -1463,7 +1462,7 @@ public:
 	void candles1();
 	void lookininterface();
 	void manasleep();
-	void isitdescribed();
+	//void isitdescribed();
 	void hotelbell();
 	void loadspeech();
 	void interupttest();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 9e98fd0..5b42e37 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1737,6 +1737,17 @@ bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
 	return true;
 }
 
+void DreamGenContext::isitdescribed() {
+	ObjPos *pos = (ObjPos *)es.ptr(bx, sizeof(ObjPos));
+	flags._z = !isitdescribed(pos);
+}
+
+bool DreamGenContext::isitdescribed(ObjPos *pos) {
+	uint16 offset = segRef(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
+	uint8 result = segRef(data.word(kSetdesc)).byte(kSettext + offset);
+	return result != 0;
+}
+
 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 15ff2ee..6cb96e9 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -218,5 +218,6 @@
 	bool compare(uint8 index, uint8 flag, const char id[4]);
 	void pixelcheckset();
 	bool pixelcheckset(ObjPos *pos, uint8 x, uint8 y);
-
+	void isitdescribed();
+	bool isitdescribed(ObjPos *objPos);
 






More information about the Scummvm-git-logs mailing list