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

tramboi bertrand_augereau at yahoo.fr
Wed Aug 24 22:41:44 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:
abb61ec9cf DREAMWEB: 'showpointer' ported to C++


Commit: abb61ec9cf98bfa9170985f6b3b7d9f4dd6d2385
    https://github.com/scummvm/scummvm/commit/abb61ec9cf98bfa9170985f6b3b7d9f4dd6d2385
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-24T15:37:29-07:00

Commit Message:
DREAMWEB: 'showpointer' 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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index f36938c..86b789b 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -152,6 +152,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'showblink',
 	'dumpblink',
 	'dumppointer',
+	'showpointer',
 	'checkcoords',
 	], skip_output = [
 	# These functions are processed but not output
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index b39451b..ffe8d81 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -16336,120 +16336,6 @@ void DreamGenContext::putunderzoom() {
 	multiput();
 }
 
-void DreamGenContext::showpointer() {
-	STACK_CHECK;
-	showblink();
-	di = data.word(kMousex);
-	data.word(kOldpointerx) = di;
-	bx = data.word(kMousey);
-	data.word(kOldpointery) = bx;
-	_cmp(data.byte(kPickup), 1);
-	if (flags.z())
-		goto itsanobject;
-	push(bx);
-	push(di);
-	ds = data.word(kIcons1);
-	al = data.byte(kPointerframe);
-	_add(al, 20);
-	ah = 0;
-	_add(ax, ax);
-	si = ax;
-	_add(ax, ax);
-	_add(si, ax);
-	cx = ds.word(si);
-	_cmp(cl, 12);
-	if (!flags.c())
-		goto notsmallx;
-	cl = 12;
-notsmallx:
-	_cmp(ch, 12);
-	if (!flags.c())
-		goto notsmally;
-	ch = 12;
-notsmally:
-	data.byte(kPointerxs) = cl;
-	data.byte(kPointerys) = ch;
-	push(ds);
-	ds = data.word(kBuffers);
-	si = (0+(228*13)+32+60);
-	multiget();
-	ds = pop();
-	di = pop();
-	bx = pop();
-	push(di);
-	push(bx);
-	al = data.byte(kPointerframe);
-	_add(al, 20);
-	ah = 0;
-	showframe();
-	bx = pop();
-	di = pop();
-	return;
-itsanobject:
-	al = data.byte(kItemframe);
-	ds = data.word(kExtras);
-	_cmp(data.byte(kObjecttype), 4);
-	if (flags.z())
-		goto itsfrominv;
-	ds = data.word(kFreeframes);
-itsfrominv:
-	cl = al;
-	_add(al, al);
-	_add(al, cl);
-	_inc(al);
-	ah = 0;
-	push(ax);
-	_add(ax, ax);
-	si = ax;
-	_add(ax, ax);
-	_add(si, ax);
-	ax = 2080;
-	cx = ds.word(si);
-	_cmp(cl, 12);
-	if (!flags.c())
-		goto notsmallx2;
-	cl = 12;
-notsmallx2:
-	_cmp(ch, 12);
-	if (!flags.c())
-		goto notsmally2;
-	ch = 12;
-notsmally2:
-	data.byte(kPointerxs) = cl;
-	data.byte(kPointerys) = ch;
-	ax = pop();
-	push(di);
-	push(bx);
-	push(ax);
-	push(bx);
-	push(di);
-	push(ds);
-	al = cl;
-	ah = 0;
-	_shr(ax, 1);
-	_sub(data.word(kOldpointerx), ax);
-	_sub(di, ax);
-	al = ch;
-	_shr(ax, 1);
-	_sub(data.word(kOldpointery), ax);
-	_sub(bx, ax);
-	ds = data.word(kBuffers);
-	si = (0+(228*13)+32+60);
-	multiget();
-	ds = pop();
-	di = pop();
-	bx = pop();
-	ax = pop();
-	ah = 128;
-	showframe();
-	bx = pop();
-	di = pop();
-	ds = data.word(kIcons1);
-	al = 3;
-	ah = 128;
-	showframe();
-}
-
 void DreamGenContext::undertextline() {
 	STACK_CHECK;
 	di = data.word(kTextaddressx);
@@ -18805,7 +18691,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_getunderzoom: getunderzoom(); break;
 		case addr_dumpzoom: dumpzoom(); break;
 		case addr_putunderzoom: putunderzoom(); break;
-		case addr_showpointer: showpointer(); break;
 		case addr_undertextline: undertextline(); break;
 		case addr_animpointer: animpointer(); break;
 		case addr_setmouse: setmouse(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 45aa873..a6a32c2 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -87,7 +87,6 @@ public:
 	static const uint16 addr_setmouse = 0xcae0;
 	static const uint16 addr_animpointer = 0xcadc;
 	static const uint16 addr_undertextline = 0xcad0;
-	static const uint16 addr_showpointer = 0xcac4;
 	static const uint16 addr_putunderzoom = 0xcabc;
 	static const uint16 addr_dumpzoom = 0xcab8;
 	static const uint16 addr_getunderzoom = 0xcab4;
@@ -1604,7 +1603,7 @@ public:
 	void useplinth();
 	//void adjustlen();
 	//void quickquit();
-	void showpointer();
+	//void showpointer();
 	void usecooker();
 	void loadmenu();
 	//void aboutturn();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 22a3cf0..94d7a74 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1466,6 +1466,48 @@ void DreamGenContext::checkcoords(const RectWithCallback *rectWithCallbacks) {
 	}
 }
 
+void DreamGenContext::showpointer() {
+	showblink();
+	const Frame *icons1 = ((const Frame *)segRef(data.word(kIcons1)).ptr(0, 0));
+	uint16 x = data.word(kMousex);
+	data.word(kOldpointerx) = data.word(kMousex);
+	uint16 y = data.word(kMousey);
+	data.word(kOldpointery) = data.word(kMousey);
+	if (data.byte(kPickup) == 1) {
+		const Frame *frames;
+		if (data.byte(kObjecttype) != 4)
+			frames = (const Frame *)segRef(data.word(kFreeframes)).ptr(0, 0);
+		else
+			frames = (const Frame *)segRef(data.word(kExtras)).ptr(0, 0);
+		const Frame *frame = frames + (3 * data.byte(kItemframe) + 1);
+		uint8 width = frame->width;
+		uint8 height = frame->height;
+		if (width < 12)
+			width = 12;
+		if (height < 12)
+			height = 12;
+		data.byte(kPointerxs) = width;
+		data.byte(kPointerys) = height;
+		data.word(kOldpointerx) -= width / 2;
+		data.word(kOldpointery) -= height / 2;
+		multiget(segRef(data.word(kBuffers)).ptr(kPointerback, 0), x - width / 2, y - height / 2, width, height);
+		showframe(frames, x, y, 3 * data.byte(kItemframe) + 1, 128);
+		showframe(icons1, x, y, 3, 128);
+	} else {
+		const Frame *frame = icons1 + (data.byte(kPointerframe) + 20);
+		uint8 width = frame->width;
+		uint8 height = frame->height;
+		if (width < 12)
+			width = 12;
+		if (height < 12)
+			height = 12;
+		data.byte(kPointerxs) = width;
+		data.byte(kPointerys) = height;
+		multiget(segRef(data.word(kBuffers)).ptr(kPointerback, 0), x, y, width, height);
+		showframe(icons1, x, y, data.byte(kPointerframe) + 20, 0);
+	}
+}
+
 bool DreamGenContext::isCD() {
 	// The original sources has two codepaths depending if the game is 'if cd' or not
 	// This is a hack to guess which version to use with the assumption that if we have a cd version
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 8fbfda3..dcd715a 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -181,6 +181,7 @@
 	void showblink();
 	void dumpblink();
 	void dumppointer();
+	void showpointer();
 	void checkcoords();
 	void checkcoords(const RectWithCallback *rectWithCallbacks);
 






More information about the Scummvm-git-logs mailing list