[Scummvm-cvs-logs] scummvm master -> 250fac9895afff4f07bd727bbdc79764d691fece

tramboi bertrand_augereau at yahoo.fr
Sun Oct 9 16:17:41 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:
14569bd62a DREAMWEB: 'zoomonoff' ported to C++
250fac9895 DREAMWEB: object.cpp to replicate object.asm


Commit: 14569bd62a7c09394269ff37203aee88a10bc3a1
    https://github.com/scummvm/scummvm/commit/14569bd62a7c09394269ff37203aee88a10bc3a1
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-10-09T08:53:09-07:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index c4bcbb1..cb5b4db 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -207,6 +207,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'madman',
 	'loadgame',
 	'savegame',
+	'zoomonoff',
 	'doload'
 	])
 generator.generate('dreamweb') #start routine
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a76a269..e0bb1b1 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -12360,47 +12360,6 @@ void DreamGenContext::findtext1() {
 	si = ax;
 }
 
-void DreamGenContext::zoomonoff() {
-	STACK_CHECK;
-	_cmp(data.word(kWatchingtime), 0);
-	if (!flags.z())
-		{ blank(); return; };
-	_cmp(data.byte(kPointermode), 2);
-	if (flags.z())
-		{ blank(); return; };
-	_cmp(data.byte(kCommandtype), 222);
-	if (flags.z())
-		goto alreadyonoff;
-	data.byte(kCommandtype) = 222;
-	al = 39;
-	commandonly();
-alreadyonoff:
-	ax = data.word(kMousebutton);
-	_cmp(ax, data.word(kOldbutton));
-	if (flags.z())
-		return /* (nozoomonoff) */;
-	_and(ax, 1);
-	if (!flags.z())
-		goto dozoomonoff;
-	return;
-dozoomonoff:
-	al = data.byte(kZoomon);
-	_xor(al, 1);
-	data.byte(kZoomon) = al;
-	createpanel();
-	data.byte(kNewobs) = 0;
-	drawfloor();
-	printsprites();
-	reelsonscreen();
-	showicon();
-	getunderzoom();
-	undertextline();
-	al = 39;
-	commandonly();
-	readmouse();
-	worktoscreenm();
-}
-
 void DreamGenContext::saveload() {
 	STACK_CHECK;
 	_cmp(data.word(kWatchingtime), 0);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index acba57a..d81c7cd 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1927,5 +1927,36 @@ uint8 *DreamGenContext::getobtextstartCPP() {
 	return result;
 }
 
+void DreamGenContext::zoomonoff() {
+	if (data.word(kWatchingtime) != 0) {
+		blank();
+		return;
+	}
+	if (data.byte(kPointermode) == 2) {
+		blank();
+		return;
+	}
+	if (data.byte(kCommandtype) != 222) {
+		data.byte(kCommandtype) = 222;
+		commandonly(39);
+	}
+	if (data.word(kMousebutton) == data.word(kOldbutton))
+		return;
+	if ((data.word(kMousebutton) & 1) == 0)
+		return;
+	data.byte(kZoomon) ^= 1;
+	createpanel();
+	data.byte(kNewobs) = 0;
+	drawfloor();
+	printsprites();
+	reelsonscreen();
+	showicon();
+	getunderzoom();
+	undertextline();
+	commandonly(39);
+	readmouse();
+	worktoscreenm();
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index d25a8d1..f757c19 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -246,4 +246,3 @@
 	void bresenhams();
 	void examineobtext();
 
-


Commit: 250fac9895afff4f07bd727bbdc79764d691fece
    https://github.com/scummvm/scummvm/commit/250fac9895afff4f07bd727bbdc79764d691fece
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-10-09T09:04:08-07:00

Commit Message:
DREAMWEB: object.cpp to replicate object.asm

Changed paths:
  A engines/dreamweb/object.cpp
    engines/dreamweb/module.mk
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/module.mk b/engines/dreamweb/module.mk
index 8cacbdc..21429dc 100644
--- a/engines/dreamweb/module.mk
+++ b/engines/dreamweb/module.mk
@@ -6,6 +6,7 @@ MODULE_OBJS := \
 	detection.o \
 	dreamweb.o \
 	dreamgen.o \
+	object.o \
 	pathfind.o \
 	print.o \
 	saveload.o \
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
new file mode 100644
index 0000000..99dfa4d
--- /dev/null
+++ b/engines/dreamweb/object.cpp
@@ -0,0 +1,101 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "dreamweb/dreamweb.h"
+
+namespace DreamGen {
+
+void DreamGenContext::fillryan() {
+	uint8 *inv = segRef(data.word(kBuffers)).ptr(kRyaninvlist, 60);
+	findallryan(inv);
+	inv += data.byte(kRyanpage) * 2 * 10;
+	for (size_t i = 0; i < 2; ++i) {
+		for (size_t j = 0; j < 5; ++j) {
+			uint8 objIndex = *inv++;
+			uint8 objType = *inv++;
+			obtoinv(objIndex, objType, kInventx + j * kItempicsize, kInventy + i * kItempicsize);
+		}
+	}
+	showryanpage();
+}
+
+void DreamGenContext::isitworn() {
+	flags._z = isitworn((const DynObject *)es.ptr(bx, sizeof(DynObject)));
+}
+
+bool DreamGenContext::isitworn(const DynObject *object) {
+	return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A');
+}
+
+void DreamGenContext::makeworn() {
+	makeworn((DynObject *)es.ptr(bx, sizeof(DynObject)));
+}
+
+void DreamGenContext::makeworn(DynObject *object) {
+	object->id[0] = 'W'-'A';
+	object->id[1] = 'E'-'A';
+}
+
+void DreamGenContext::obtoinv() {
+	obtoinv(al, ah, di, bx);
+}
+
+void DreamGenContext::obtoinv(uint8 index, uint8 flag, uint16 x, uint16 y) {
+	Frame *icons1 = (Frame *)segRef(data.word(kIcons1)).ptr(0, 0);
+	showframe(icons1, x - 2, y - 1, 10, 0);
+	if (index == 0xff)
+		return;
+
+	Frame *extras = (Frame *)segRef(data.word(kExtras)).ptr(0, 0);
+	Frame *frees = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0);
+	Frame *frames = (flag == 4) ? extras : frees;
+	showframe(frames, x + 18, y + 19, 3 * index + 1, 128);
+	const DynObject *object = (const DynObject *)getanyaddir(index, flag);
+	bool worn = isitworn(object);
+	if (worn)
+		showframe(icons1, x - 3, y - 2, 7, 0);
+}
+
+void DreamGenContext::obpicture() {
+	if (data.byte(kObjecttype) == 1)
+		return;
+	Frame *frames;
+	if (data.byte(kObjecttype) == 4)
+		frames = (Frame *)segRef(data.word(kExtras)).ptr(0, 0);
+	else
+		frames = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0);
+	uint8 frame = 3 * data.byte(kCommand) + 1;
+	showframe(frames, 160, 68, frame, 0x80);
+}
+
+void DreamGenContext::obicons() {
+	uint8 value1, value2;
+	getanyad(&value1, &value2);
+	if (value1 == 0xff) {
+		showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 260, 1, 1, 0);
+	} else {
+		showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 210, 1, 4, 0);
+	}
+}
+
+} /*namespace dreamgen */
+
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index d81c7cd..e3295b3 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1696,28 +1696,6 @@ void DreamGenContext::printmessage(uint16 x, uint16 y, uint8 index, uint8 maxWid
 	printdirect(&string, x, &y, maxWidth, centered);
 }
 
-void DreamGenContext::obpicture() {
-	if (data.byte(kObjecttype) == 1)
-		return;
-	Frame *frames;
-	if (data.byte(kObjecttype) == 4)
-		frames = (Frame *)segRef(data.word(kExtras)).ptr(0, 0);
-	else
-		frames = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0);
-	uint8 frame = 3 * data.byte(kCommand) + 1;
-	showframe(frames, 160, 68, frame, 0x80);
-}
-
-void DreamGenContext::obicons() {
-	uint8 value1, value2;
-	getanyad(&value1, &value2);
-	if (value1 == 0xff) {
-		showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 260, 1, 1, 0);
-	} else {
-		showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 210, 1, 4, 0);
-	}
-}
-
 void DreamGenContext::compare() {
 	char id[4] = { cl, ch, dl, dh };
 	flags._z = compare(al, ah, id);
@@ -1775,43 +1753,6 @@ bool DreamGenContext::checkifset(uint8 x, uint8 y) {
 	return false;
 }
 
-void DreamGenContext::isitworn() {
-	flags._z = isitworn((const DynObject *)es.ptr(bx, sizeof(DynObject)));
-}
-
-bool DreamGenContext::isitworn(const DynObject *object) {
-	return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A');
-}
-
-void DreamGenContext::makeworn() {
-	makeworn((DynObject *)es.ptr(bx, sizeof(DynObject)));
-}
-
-void DreamGenContext::makeworn(DynObject *object) {
-	object->id[0] = 'W'-'A';
-	object->id[1] = 'E'-'A';
-}
-
-void DreamGenContext::obtoinv() {
-	obtoinv(al, ah, di, bx);
-}
-
-void DreamGenContext::obtoinv(uint8 index, uint8 flag, uint16 x, uint16 y) {
-	Frame *icons1 = (Frame *)segRef(data.word(kIcons1)).ptr(0, 0);
-	showframe(icons1, x - 2, y - 1, 10, 0);
-	if (index == 0xff)
-		return;
-
-	Frame *extras = (Frame *)segRef(data.word(kExtras)).ptr(0, 0);
-	Frame *frees = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0);
-	Frame *frames = (flag == 4) ? extras : frees;
-	showframe(frames, x + 18, y + 19, 3 * index + 1, 128);
-	const DynObject *object = (const DynObject *)getanyaddir(index, flag);
-	bool worn = isitworn(object);
-	if (worn)
-		showframe(icons1, x - 3, y - 2, 7, 0);
-}
-
 void DreamGenContext::showryanpage() {
 	Frame *icons1 = (Frame *)segRef(data.word(kIcons1)).ptr(0, 0);
 	showframe(icons1, kInventx + 167, kInventy - 12, 12, 0);
@@ -1837,20 +1778,6 @@ void DreamGenContext::findallryan(uint8 *inv) {
 	}
 }
 
-void DreamGenContext::fillryan() {
-	uint8 *inv = segRef(data.word(kBuffers)).ptr(kRyaninvlist, 60);
-	findallryan(inv);
-	inv += data.byte(kRyanpage) * 2 * 10;
-	for (size_t i = 0; i < 2; ++i) {
-		for (size_t j = 0; j < 5; ++j) {
-			uint8 objIndex = *inv++;
-			uint8 objType = *inv++;
-			obtoinv(objIndex, objType, kInventx + j * kItempicsize, kInventy + i * kItempicsize);
-		}
-	}
-	showryanpage();
-}
-
 void DreamGenContext::hangon() {
 	hangon(cx);
 }






More information about the Scummvm-git-logs mailing list