[Scummvm-cvs-logs] scummvm master -> f2829a6a6c033c981514d233119648731ee78310

bluegr md5 at scummvm.org
Tue Dec 6 16:48:02 CET 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:
ddddce3728 DREAMWEB: Simplified mouse button checks (thanks wjp, Tron)
f2829a6a6c DREAMWEB: 'useelvdoor', 'useobject', 'useplinth' ported to C++


Commit: ddddce37288c0b72a1194049ce2b882de17cfd3d
    https://github.com/scummvm/scummvm/commit/ddddce37288c0b72a1194049ce2b882de17cfd3d
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-06T07:42:50-08:00

Commit Message:
DREAMWEB: Simplified mouse button checks (thanks wjp, Tron)

Changed paths:
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index ea39e00..cd5fab9 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2241,7 +2241,7 @@ void DreamGenContext::zoomOnOff() {
 		data.byte(kCommandtype) = 222;
 		commandOnly(39);
 	}
-	if (!(data.word(kMousebutton) & 1) || (data.word(kMousebutton) == data.word(kOldbutton)))
+	if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1)
 		return;
 	data.byte(kZoomon) ^= 1;
 	createPanel();
@@ -3686,7 +3686,7 @@ void DreamGenContext::nextDest() {
 		commandOnly(28);
 	}
 
-	if (!(data.word(kMousebutton) & 1) || (data.word(kMousebutton) == data.word(kOldbutton)))
+	if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1)
 		return;	// nodu
 
 	do {
@@ -3717,7 +3717,7 @@ void DreamGenContext::lastDest() {
 		commandOnly(29);
 	}
 
-	if (!(data.word(kMousebutton) & 1) || (data.word(kMousebutton) == data.word(kOldbutton)))
+	if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1)
 		return;	// nodd
 
 	do {
@@ -3748,7 +3748,7 @@ void DreamGenContext::destSelect() {
 		commandOnly(30);
 	}
 
-	if (!(data.word(kMousebutton) & 1) || (data.word(kMousebutton) == data.word(kOldbutton)))
+	if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1)
 		return;	// notrav
 
 	getDestInfo();


Commit: f2829a6a6c033c981514d233119648731ee78310
    https://github.com/scummvm/scummvm/commit/f2829a6a6c033c981514d233119648731ee78310
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-06T07:46:50-08:00

Commit Message:
DREAMWEB: 'useelvdoor', 'useobject', 'useplinth' ported 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 ed03ffd..52fe408 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -602,13 +602,16 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'useelevator3',
 	'useelevator4',
 	'useelevator5',
+	'useelvdoor',
 	'usefullcart',
 	'useladder',
 	'useladderb',
 	'usehatch',
 	'usemenu',
 	'usemon',
+	'useobject',
 	'useplate',
+	'useplinth',
 	'userailing',
 	'useroutine',
 	'useshield',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8b73753..8f3d73e 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -5026,30 +5026,6 @@ void DreamGenContext::triggerMessage() {
 	data.byte(kLasttrigger) = 0;
 }
 
-void DreamGenContext::useObject() {
-	STACK_CHECK;
-	data.byte(kWithobject) = 255;
-	_cmp(data.byte(kCommandtype), 229);
-	if (flags.z())
-		goto alreadyuse;
-	data.byte(kCommandtype) = 229;
-	bl = data.byte(kCommand);
-	bh = data.byte(kObjecttype);
-	al = 51;
-	commandWithOb();
-alreadyuse:
-	ax = data.word(kMousebutton);
-	_cmp(ax, data.word(kOldbutton));
-	if (flags.z())
-		return /* (nouse) */;
-	_and(ax, 1);
-	if (!flags.z())
-		goto douse;
-	return;
-douse:
-	useRoutine();
-}
-
 void DreamGenContext::runTap() {
 	STACK_CHECK;
 	_cmp(data.byte(kWithobject), 255);
@@ -5208,39 +5184,6 @@ alreadyfull:
 	putBackObStuff();
 }
 
-void DreamGenContext::usePlinth() {
-	STACK_CHECK;
-	_cmp(data.byte(kWithobject), 255);
-	if (!flags.z())
-		goto plinthwith;
-	withWhat();
-	return;
-plinthwith:
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'D';
-	ch = 'K';
-	dl = 'E';
-	dh = 'Y';
-	compare();
-	if (flags.z())
-		goto isrightkey;
-	showFirstUse();
-	putBackObStuff();
-	return;
-isrightkey:
-	_inc(data.byte(kProgresspoints));
-	showSecondUse();
-	data.word(kWatchingtime) = 220;
-	data.word(kReeltowatch) = 0;
-	data.word(kEndwatchreel) = 104;
-	data.byte(kWatchspeed) = 1;
-	data.byte(kSpeedcount) = 1;
-	data.byte(kGetback) = 1;
-	al = data.byte(kRoomafterdream);
-	data.byte(kNewlocation) = al;
-}
-
 void DreamGenContext::chewy() {
 	STACK_CHECK;
 	showFirstUse();
@@ -6322,41 +6265,6 @@ axeondoor:
 	data.byte(kGetback) = 1;
 }
 
-void DreamGenContext::useElvDoor() {
-	STACK_CHECK;
-	_cmp(data.byte(kWithobject), 255);
-	if (!flags.z())
-		goto gotdoorwith;
-	withWhat();
-	return;
-gotdoorwith:
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'A';
-	ch = 'X';
-	dl = 'E';
-	dh = 'D';
-	compare();
-	if (flags.z())
-		goto axeondoor;
-	al = 14;
-	cx = 300;
-	showPuzText();
-	putBackObStuff();
-	return;
-axeondoor:
-	al = 15;
-	cx = 300;
-	showPuzText();
-	_inc(data.byte(kProgresspoints));
-	data.word(kWatchingtime) = 46*2;
-	data.word(kReeltowatch) = 31;
-	data.word(kEndwatchreel) = 77;
-	data.byte(kWatchspeed) = 1;
-	data.byte(kSpeedcount) = 1;
-	data.byte(kGetback) = 1;
-}
-
 void DreamGenContext::withWhat() {
 	STACK_CHECK;
 	createPanel();
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 376815b..74c425c 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -641,7 +641,6 @@ public:
 	void interviewer();
 	void getKeyAndLogo();
 	void selectOb();
-	void usePlinth();
 	void useCooker();
 	void receptionist();
 	void selectSlot();
@@ -689,7 +688,6 @@ public:
 	void poolGuard();
 	void lookAtPlace();
 	void useAxe();
-	void useElvDoor();
 	void findAllOpen();
 	void quitSymbol();
 	void readFromFile();
@@ -794,7 +792,6 @@ public:
 	void openOb();
 	void createFile();
 	void useHole();
-	void useObject();
 	void fadeToWhite();
 	void showLoadOps();
 };
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 9b79e1e..c90f80d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -401,6 +401,9 @@
 	void useFullCart();
 	void useClearBox();
 	void usePlate();
+	void usePlinth();
+	void useElvDoor();
+	void useObject();
 	void openTVDoor();
 	void wearWatch();
 	void wearShades();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 18730ee..e5a616e 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -820,4 +820,77 @@ void DreamGenContext::usePlate() {
 	}
 }
 
+void DreamGenContext::usePlinth() {
+	if (data.byte(kWithobject) == 255) {
+		withWhat();
+		return;
+	}
+
+	char id[4] = { 'D', 'K', 'E', 'Y' };	// TODO: convert to string with trailing zero
+	if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+		// Wrong key
+		showFirstUse();
+		putBackObStuff();
+	} else {
+		data.byte(kProgresspoints)++;
+		showSecondUse();
+		data.word(kWatchingtime) = 220;
+		data.word(kReeltowatch) = 0;
+		data.word(kEndwatchreel) = 104;
+		data.byte(kWatchspeed) = 1;
+		data.byte(kSpeedcount) = 1;
+		data.byte(kGetback) = 1;
+		data.byte(kNewlocation) = data.byte(kRoomafterdream);
+	}
+}
+
+void DreamGenContext::useElvDoor() {
+	if (data.byte(kWithobject) == 255) {
+		withWhat();
+		return;
+	}
+
+	char id[4] = { 'A', 'X', 'E', 'D' };	// TODO: convert to string with trailing zero
+	if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) {
+		// Wrong item
+		cx = 300;
+		al = 14;
+		showPuzText();
+		putBackObStuff();
+	} else {
+		// Axe on door
+		al = 15;
+		cx = 300;
+		showPuzText();
+		_inc(data.byte(kProgresspoints));
+		data.word(kWatchingtime) = 46*2;
+		data.word(kReeltowatch) = 31;
+		data.word(kEndwatchreel) = 77;
+		data.byte(kWatchspeed) = 1;
+		data.byte(kSpeedcount) = 1;
+		data.byte(kGetback) = 1;
+	}
+}
+
+void DreamGenContext::useObject() {
+	data.byte(kWithobject) = 255;
+
+	if (data.byte(kCommandtype) != 229) {
+		data.byte(kCommandtype) = 229;
+		commandWithOb(data.byte(kCommand), data.byte(kObjecttype), 51);
+	}
+
+alreadyuse:
+	ax = data.word(kMousebutton);
+	_cmp(ax, data.word(kOldbutton));
+	if (flags.z())
+		return /* (nouse) */;
+	_and(ax, 1);
+	if (!flags.z())
+		goto douse;
+	return;
+douse:
+	useRoutine();
+}
+
 } /*namespace dreamgen */






More information about the Scummvm-git-logs mailing list