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

tramboi bertrand_augereau at yahoo.fr
Wed Sep 7 16:37:15 CEST 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:
c346bf79b4 DREAMWEB: 'getblockofpixel' ported to C++


Commit: c346bf79b472eefea2a1e6b9ce01c5c3e342de73
    https://github.com/scummvm/scummvm/commit/c346bf79b472eefea2a1e6b9ce01c5c3e342de73
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-09-02T16:05:39-07:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 8238c7e..e892105 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -148,6 +148,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'adjustlen',
 	'finishedwalking',
 	'checkone',
+	'getblockofpixel',
 	'getflagunderp',
 	'walkandexamine',
 	'obname',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 70f84a2..1bcb34c 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2385,30 +2385,6 @@ foundlineend:
 	goto lookforlinestart;
 }
 
-void DreamGenContext::getblockofpixel() {
-	STACK_CHECK;
-	push(cx);
-	push(es);
-	push(di);
-	ax = data.word(kMapxstart);
-	_add(cl, al);
-	ax = data.word(kMapystart);
-	_add(ch, al);
-	checkone();
-	_and(cl, 1);
-	if (!flags.z())
-		goto failrain;
-	di = pop();
-	es = pop();
-	cx = pop();
-	return;
-failrain:
-	di = pop();
-	es = pop();
-	cx = pop();
-	al = 0;
-}
-
 void DreamGenContext::liftnoise() {
 	STACK_CHECK;
 	_cmp(data.byte(kReallocation), 5);
@@ -16969,7 +16945,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_reminders: reminders(); break;
 		case addr_initrain: initrain(); break;
 		case addr_splitintolines: splitintolines(); break;
-		case addr_getblockofpixel: getblockofpixel(); break;
 		case addr_backobject: backobject(); break;
 		case addr_liftnoise: liftnoise(); break;
 		case addr_random: random(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index cbc376e..026b412 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -553,7 +553,6 @@ public:
 	static const uint16 addr_random = 0xc17c;
 	static const uint16 addr_liftnoise = 0xc178;
 	static const uint16 addr_backobject = 0xc170;
-	static const uint16 addr_getblockofpixel = 0xc168;
 	static const uint16 addr_splitintolines = 0xc164;
 	static const uint16 addr_initrain = 0xc160;
 	static const uint16 addr_reminders = 0xc15c;
@@ -1381,7 +1380,7 @@ public:
 	//void updatepeople();
 	//void addtopeoplelist();
 	void hangoncurs();
-	void sparkydrip();
+	//void getblockofpixel();
 	//void kernchars();
 	void printcurs();
 	//void convertkey();
@@ -1629,7 +1628,7 @@ public:
 	void madmanstelly();
 	void constant();
 	void loadroomssample();
-	void getblockofpixel();
+	void sparkydrip();
 	void paltostartpal();
 	void bossman();
 	void getridofpit();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 8ec0dc4..864bba1 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -876,6 +876,19 @@ void DreamGenContext::checkone(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uin
 	*type = tileData[2];
 }
 
+void DreamGenContext::getblockofpixel() {
+	al = getblockofpixel(cl, ch);
+}
+
+uint8 DreamGenContext::getblockofpixel(uint8 x, uint8 y) {
+	uint8 flag, flagEx, type, flagX, flagY;
+	checkone(x + data.word(kMapxstart), y + data.word(kMapystart), &flag, &flagEx, &type, &flagX, &flagY);
+	if (flag & 1)
+		return 0;
+	else
+		return type;
+}
+
 void DreamGenContext::addtopeoplelist() {
 	addtopeoplelist((ReelRoutine *)es.ptr(bx, sizeof(ReelRoutine)));
 }
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 66e32de..ab27274 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -241,4 +241,6 @@
 	uint8 *getobtextstartCPP();
 	void usetext(const uint8 *string);
 	void usetext();
+	void getblockofpixel();
+	uint8 getblockofpixel(uint8 x, uint8 y);
 






More information about the Scummvm-git-logs mailing list