[Scummvm-cvs-logs] scummvm master -> 3a5e17d5525bfe1f42a465247b47f4b74d6f5c6c

tramboi bertrand_augereau at yahoo.fr
Mon Sep 5 12:46:07 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:
483fae0c56 DREAMWEB: 'checkifset' ported to C++
3a5e17d552 DREAMWEB: Removal of stubs that became useless


Commit: 483fae0c564973ff27878133749c51fc8111304f
    https://github.com/scummvm/scummvm/commit/483fae0c564973ff27878133749c51fc8111304f
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-01T19:33:37-07:00

Commit Message:
DREAMWEB: 'checkifset' ported 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/vgagrafx.cpp



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index b87d80c..7967acc 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -180,6 +180,8 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'turnpathoff',
 	'turnanypathon',
 	'turnanypathoff',
+	'isitdescribed',
+	'checkifset',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 7309b4f..d59ff61 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -14795,47 +14795,6 @@ nothingund:
 	blank();
 }
 
-void DreamGenContext::checkifset() {
-	STACK_CHECK;
-	es = data.word(kBuffers);
-	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5);
-	cx = 127;
-identifyset:
-	_cmp(es.byte(bx+4), 255);
-	if (flags.z())
-		goto notasetid;
-	_cmp(al, es.byte(bx));
-	if (flags.c())
-		goto notasetid;
-	_cmp(al, es.byte(bx+2));
-	if (!flags.c())
-		goto notasetid;
-	_cmp(ah, es.byte(bx+1));
-	if (flags.c())
-		goto notasetid;
-	_cmp(ah, es.byte(bx+3));
-	if (!flags.c())
-		goto notasetid;
-	pixelcheckset();
-	if (flags.z())
-		goto notasetid;
-	isitdescribed();
-	if (flags.z())
-		goto notasetid;
-	al = es.byte(bx+4);
-	ah = 1;
-	obname();
-	al = 0;
-	_cmp(al, 1);
-	return;
-notasetid:
-	_sub(bx, 5);
-	_dec(cx);
-	_cmp(cx, -1);
-	if (!flags.z())
-		goto identifyset;
-}
-
 void DreamGenContext::findpathofpoint() {
 	STACK_CHECK;
 	push(ax);
@@ -17891,7 +17850,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_mainscreen: mainscreen(); break;
 		case addr_madmanrun: madmanrun(); break;
 		case addr_identifyob: identifyob(); break;
-		case addr_checkifset: checkifset(); 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 4e5505c..a27665b 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_checkifset = 0xc9dc;
 	static const uint16 addr_identifyob = 0xc9d4;
 	static const uint16 addr_madmanrun = 0xc9cc;
 	static const uint16 addr_mainscreen = 0xc9c8;
@@ -1440,7 +1439,6 @@ public:
 	void selectslot2();
 	void runtap();
 	//void domix();
-	void priesttext();
 	//void paneltomap();
 	//void obname();
 	void getridoftemp3();
@@ -1449,7 +1447,7 @@ public:
 	void runendseq();
 	void dumpdiarykeys();
 	void disablesoundint();
-	void checkifset();
+	void priesttext();
 	//void showallex();
 	void openpoolboss();
 	void buttontwo();
@@ -1651,6 +1649,7 @@ public:
 	void bossman();
 	void getridofpit();
 	void convnum();
+	//void checkifset();
 	void nothelderror();
 	//void readheader();
 	void getsetad();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 5b42e37..ff79a90 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1738,11 +1738,11 @@ bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
 }
 
 void DreamGenContext::isitdescribed() {
-	ObjPos *pos = (ObjPos *)es.ptr(bx, sizeof(ObjPos));
+	const ObjPos *pos = (const ObjPos *)es.ptr(bx, sizeof(ObjPos));
 	flags._z = !isitdescribed(pos);
 }
 
-bool DreamGenContext::isitdescribed(ObjPos *pos) {
+bool DreamGenContext::isitdescribed(const 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;
@@ -1755,5 +1755,34 @@ bool DreamGenContext::isCD() {
 	// Maybe detect the version during game id?
 	return (data.byte(kSpeechloaded) == 1);
 }
+
+void DreamGenContext::checkifset() {
+	flags._z = !checkifset(al, ah);
+}
+
+bool DreamGenContext::checkifset(uint8 x, uint8 y) {
+	const ObjPos *setList = (const ObjPos *)segRef(data.word(kBuffers)).ptr(kSetlist, sizeof(ObjPos) * 128);
+	for (size_t i = 0; i < 128; ++i) {
+		const ObjPos *pos = setList + 127 - i;
+		if (pos->index == 0xff)
+			continue;
+		if (x < pos->xMin)
+			continue;
+		if (x >= pos->xMax)
+			continue;
+		if (y < pos->yMin)
+			continue;
+		if (y >= pos->yMax)
+			continue;
+		if (! pixelcheckset(pos, x, y))
+			continue;
+		if (! isitdescribed(pos))
+			continue;
+		obname(pos->index, 1);
+		return true;
+	}
+	return false;
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6cb96e9..f6d57c1 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -217,7 +217,9 @@
 	void compare();
 	bool compare(uint8 index, uint8 flag, const char id[4]);
 	void pixelcheckset();
-	bool pixelcheckset(ObjPos *pos, uint8 x, uint8 y);
+	bool pixelcheckset(const ObjPos *pos, uint8 x, uint8 y);
 	void isitdescribed();
-	bool isitdescribed(ObjPos *objPos);
+	bool isitdescribed(const ObjPos *objPos);
+	void checkifset();
+	bool checkifset(uint8 x, uint8 y);
 
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 8d437c2..be3f58c 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -458,11 +458,11 @@ void DreamGenContext::transferinv() {
 void DreamGenContext::pixelcheckset() {
 	uint8 x = al;
 	uint8 y = ah;
-	ObjPos *pos = (ObjPos *)es.ptr(bx, sizeof(ObjPos));
+	const ObjPos *pos = (const ObjPos *)es.ptr(bx, sizeof(ObjPos));
 	flags._z = !pixelcheckset(pos, x, y);
 }
 
-bool DreamGenContext::pixelcheckset(ObjPos *pos, uint8 x, uint8 y) {
+bool DreamGenContext::pixelcheckset(const ObjPos *pos, uint8 x, uint8 y) {
 	x -= pos->xMin;
 	y -= pos->yMin;
 	SetObject *setObject = getsetad(pos->index);


Commit: 3a5e17d5525bfe1f42a465247b47f4b74d6f5c6c
    https://github.com/scummvm/scummvm/commit/3a5e17d5525bfe1f42a465247b47f4b74d6f5c6c
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-01T19:33:38-07:00

Commit Message:
DREAMWEB: Removal of stubs that became useless

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



diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index ff79a90..d63e884 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1737,11 +1737,6 @@ bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
 	return true;
 }
 
-void DreamGenContext::isitdescribed() {
-	const ObjPos *pos = (const ObjPos *)es.ptr(bx, sizeof(ObjPos));
-	flags._z = !isitdescribed(pos);
-}
-
 bool DreamGenContext::isitdescribed(const ObjPos *pos) {
 	uint16 offset = segRef(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
 	uint8 result = segRef(data.word(kSetdesc)).byte(kSettext + offset);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index f6d57c1..da743c0 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -216,9 +216,7 @@
 	void obicons();
 	void compare();
 	bool compare(uint8 index, uint8 flag, const char id[4]);
-	void pixelcheckset();
 	bool pixelcheckset(const ObjPos *pos, uint8 x, uint8 y);
-	void isitdescribed();
 	bool isitdescribed(const ObjPos *objPos);
 	void checkifset();
 	bool checkifset(uint8 x, uint8 y);
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index be3f58c..53db811 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -455,13 +455,6 @@ void DreamGenContext::transferinv() {
 	data.word(kExframepos) += byteCount;
 }
 
-void DreamGenContext::pixelcheckset() {
-	uint8 x = al;
-	uint8 y = ah;
-	const ObjPos *pos = (const ObjPos *)es.ptr(bx, sizeof(ObjPos));
-	flags._z = !pixelcheckset(pos, x, y);
-}
-
 bool DreamGenContext::pixelcheckset(const ObjPos *pos, uint8 x, uint8 y) {
 	x -= pos->xMin;
 	y -= pos->yMin;






More information about the Scummvm-git-logs mailing list