[Scummvm-cvs-logs] scummvm master -> 12cac260c9acb16180ab4414fecd5748d77886f3

bluegr md5 at scummvm.org
Fri Dec 16 21:05:38 CET 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:
12cac260c9 DREAMWEB: Port 'isryanholding' to C++


Commit: 12cac260c9acb16180ab4414fecd5748d77886f3
    https://github.com/scummvm/scummvm/commit/12cac260c9acb16180ab4414fecd5748d77886f3
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-16T12:04:47-08:00

Commit Message:
DREAMWEB: Port 'isryanholding' to C++

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 254e45c..6129340 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -500,6 +500,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'isitdescribed',
 	'isitright',
 	'isitworn',
+	'isryanholding',
 	'issetobonmap',
 	'keeper',
 	'kernchars',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index ea731fc..0938efc 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2937,44 +2937,6 @@ doselob:
 	useRoutine();
 }
 
-void DreamGenContext::isRyanHolding() {
-	STACK_CHECK;
-	_sub(al, 'A');
-	_sub(ah, 'A');
-	_sub(cl, 'A');
-	_sub(ch, 'A');
-	es = data.word(kExtras);
-	bx = (0+2080+30000);
-	dl = 0;
-searchinv:
-	_cmp(es.byte(bx+2), 4);
-	if (!flags.z())
-		goto nofindininv;
-	_cmp(al, es.byte(bx+12));
-	if (!flags.z())
-		goto nofindininv;
-	_cmp(ah, es.byte(bx+13));
-	if (!flags.z())
-		goto nofindininv;
-	_cmp(cl, es.byte(bx+14));
-	if (!flags.z())
-		goto nofindininv;
-	_cmp(ch, es.byte(bx+15));
-	if (!flags.z())
-		goto nofindininv;
-	al = dl;
-	_cmp(al, (114));
-	return;
-nofindininv:
-	_add(bx, 16);
-	_inc(dl);
-	_cmp(dl, (114));
-	if (!flags.z())
-		goto searchinv;
-	al = dl;
-	_cmp(al, (114));
-}
-
 void DreamGenContext::checkInside() {
 	STACK_CHECK;
 	es = data.word(kExtras);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f22461e..f3cedd8 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -480,7 +480,6 @@ public:
 	void clearBuffers();
 	void getObTextStart();
 	void checkObjectSize();
-	void isRyanHolding();
 	void fillOpen();
 	void useCashCard();
 	void moneyPoke();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 3a9785e..2279d9f 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1774,6 +1774,26 @@ uint16 DreamGenContext::findExObject(const char *id) {
 	return kNumexobjects;
 }
 
+void DreamGenContext::isRyanHolding() {
+	char id[5];
+	id[0] = al;
+	id[1] = ah;
+	id[2] = cl;
+	id[3] = ch;
+	id[4] = '\0';
+	flags._z = isRyanHolding(id);
+}
+
+bool DreamGenContext::isRyanHolding(const char *id) {
+	for (uint16 index = 0; index < kNumexobjects; index++) {
+		DynObject *object = getExAd(index);
+		if (object->mapad[0] == 4 && objectMatches(object, id))
+			return (index == kNumexobjects);
+	}
+
+	return false;
+}
+
 bool DreamBase::isItDescribed(const ObjPos *pos) {
 	uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
 	uint8 result = getSegment(data.word(kSetdesc)).byte(kSettext + offset);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ddaa66f..d3f656d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -383,6 +383,8 @@
 	uint16 findSetObject(const char *id);
 	void findExObject();
 	uint16 findExObject(const char *id);
+	void isRyanHolding();
+	bool isRyanHolding(const char *id);
 	void describeOb();
 	void getOpenedSize();
 	byte getOpenedSizeCPP();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 4e956cd..385bfbb 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -625,13 +625,7 @@ void DreamGenContext::sLabDoorB() {
 		data.byte(kWatchspeed) = 1;
 		data.byte(kSpeedcount) = 1;
 	} else {
-		al = 'S';
-		ah = 'H';
-		cl = 'L';
-		ch = 'D';
-		isRyanHolding();
-
-		if (flags.z()) {
+		if (isRyanHolding("SHLD")) {
 			// No crystal
 			showPuzText(44, 200);
 			putBackObStuff();






More information about the Scummvm-git-logs mailing list