[Scummvm-cvs-logs] scummvm master -> 27f5661dfc5d49571499501e68db96fe30d272de

bluegr md5 at scummvm.org
Mon Dec 12 22:40:09 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:
27f5661dfc DREAMWEB: Port 'useslab' to C++


Commit: 27f5661dfc5d49571499501e68db96fe30d272de
    https://github.com/scummvm/scummvm/commit/27f5661dfc5d49571499501e68db96fe30d272de
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-12T13:39:29-08:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 95925a8..6efa0c0 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -808,6 +808,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'userailing',
 	'useroutine',
 	'useshield',
+	'useslab',
 	'usetempcharset',
 	'usetext',
 	'usetimedtext',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 3cc0c4e..a2d8c2c 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3637,56 +3637,6 @@ alreadyfull:
 	putBackObStuff();
 }
 
-void DreamGenContext::useSLab() {
-	STACK_CHECK;
-	_cmp(data.byte(kWithobject), 255);
-	if (!flags.z())
-		goto slabwith;
-	withWhat();
-	return;
-slabwith:
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'J';
-	ch = 'E';
-	dl = 'W';
-	dh = 'L';
-	compare();
-	if (flags.z())
-		goto nextslab;
-	cx = 300;
-	al = 14;
-	showPuzText();
-	putBackObStuff();
-	return;
-nextslab:
-	al = data.byte(kWithobject);
-	getExAd();
-	es.byte(bx+2) = 0;
-	al = data.byte(kCommand);
-	push(ax);
-	removeSetObject();
-	ax = pop();
-	_inc(al);
-	push(ax);
-	placeSetObject();
-	ax = pop();
-	_cmp(al, 54);
-	if (!flags.z())
-		goto notlastslab;
-	al = 0;
-	turnPathOn();
-	data.word(kWatchingtime) = 22;
-	data.word(kReeltowatch) = 35;
-	data.word(kEndwatchreel) = 48;
-	data.byte(kWatchspeed) = 1;
-	data.byte(kSpeedcount) = 1;
-notlastslab:
-	_inc(data.byte(kProgresspoints));
-	showFirstUse();
-	data.byte(kGetback) = 1;
-}
-
 void DreamGenContext::useOpenBox() {
 	STACK_CHECK;
 	_cmp(data.byte(kWithobject), 255);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index b87d9c6..6e8400b 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -508,7 +508,6 @@ public:
 	void dirCom();
 	void endGameSeq();
 	void findFirstPath();
-	void useSLab();
 	void useAltar();
 	void startTalk();
 	void getAnyAd();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index a6e29f2..ff7c110 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -331,6 +331,7 @@
 	void useWindow();
 	void useHatch();
 	void useLighter();
+	void useSLab();
 	void wheelSound();
 	void callHotelLift();
 	void useShield();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index eb32811..f6d6b2f 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -1281,4 +1281,37 @@ void DreamGenContext::useControl() {
 	}
 }
 
+void DreamGenContext::useSLab() {
+	if (data.byte(kWithobject) == 255) {
+		withWhat();
+		return;
+	}
+
+	char id[4] = { 'J', 'E', 'W', 'L' };	// TODO: convert to string with trailing zero
+	if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+		showPuzText(14, 300);
+		putBackObStuff();
+		return;
+	}
+
+	DynObject *exObject = getExAd(data.byte(kWithobject));
+	exObject->mapad[0] = 0;
+
+	removeSetObject(data.byte(kCommand));
+	placeSetObject(data.byte(kCommand) + 1);
+	if (data.byte(kCommand) + 1 == 54) {
+		// Last slab
+		turnPathOn(0);
+		data.word(kWatchingtime) = 22;
+		data.word(kReeltowatch) = 35;
+		data.word(kEndwatchreel) = 48;
+		data.byte(kWatchspeed) = 1;
+		data.byte(kSpeedcount) = 1;
+	}
+
+	data.byte(kProgresspoints)++;
+	showFirstUse();
+	data.byte(kGetback) = 1;
+}
+
 } // End of namespace DreamGen






More information about the Scummvm-git-logs mailing list