[Scummvm-cvs-logs] scummvm master -> 6a46429c448aa3899fa93e49dc36cd3617b922c7

tramboi bertrand_augereau at yahoo.fr
Tue Aug 30 12:20:40 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:
6a46429c44 DREAMWEB: 'transferinv' ported to C++


Commit: 6a46429c448aa3899fa93e49dc36cd3617b922c7
    https://github.com/scummvm/scummvm/commit/6a46429c448aa3899fa93e49dc36cd3617b922c7
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-30T03:17:18-07:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index c129b24..f0cfe30 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -170,6 +170,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'paneltomap',
 	'obpicture',
 	'delthisone',
+	'transferinv',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index bfead17..ee03444 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2766,55 +2766,6 @@ void DreamGenContext::createpanel2() {
 	showframe();
 }
 
-void DreamGenContext::transferinv() {
-	STACK_CHECK;
-	di = data.word(kExframepos);
-	push(di);
-	al = data.byte(kExpos);
-	ah = 0;
-	bx = ax;
-	_add(ax, ax);
-	_add(ax, bx);
-	_inc(ax);
-	cx = 6;
-	_mul(cx);
-	es = data.word(kExtras);
-	bx = (0);
-	_add(bx, ax);
-	_add(di, (0+2080));
-	push(bx);
-	al = data.byte(kItemtotran);
-	ah = 0;
-	bx = ax;
-	_add(ax, ax);
-	_add(ax, bx);
-	_inc(ax);
-	cx = 6;
-	_mul(cx);
-	ds = data.word(kFreeframes);
-	bx = (0);
-	_add(bx, ax);
-	si = (0+2080);
-	al = ds.byte(bx);
-	ah = 0;
-	cl = ds.byte(bx+1);
-	ch = 0;
-	_add(si, ds.word(bx+2));
-	dx = ds.word(bx+4);
-	bx = pop();
-	es.byte(bx+0) = al;
-	es.byte(bx+1) = cl;
-	es.word(bx+4) = dx;
-	_mul(cx);
-	cx = ax;
-	push(cx);
-	_movsb(cx, true);
-	cx = pop();
-	ax = pop();
-	es.word(bx+2) = ax;
-	_add(data.word(kExframepos), cx);
-}
-
 void DreamGenContext::transfermap() {
 	STACK_CHECK;
 	di = data.word(kExframepos);
@@ -17732,7 +17683,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_createpanel2: createpanel2(); break;
 		case addr_vsync: vsync(); break;
 		case addr_doshake: doshake(); break;
-		case addr_transferinv: transferinv(); break;
 		case addr_transfermap: transfermap(); break;
 		case addr_fadedos: fadedos(); break;
 		case addr_dofade: dofade(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 963a864..196c630 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -557,7 +557,6 @@ public:
 	static const uint16 addr_dofade = 0xc24c;
 	static const uint16 addr_fadedos = 0xc248;
 	static const uint16 addr_transfermap = 0xc244;
-	static const uint16 addr_transferinv = 0xc240;
 	static const uint16 addr_doshake = 0xc20c;
 	static const uint16 addr_vsync = 0xc208;
 	static const uint16 addr_createpanel2 = 0xc200;
@@ -1775,7 +1774,7 @@ public:
 	void look();
 	void setmouse();
 	//void checkone();
-	void transferinv();
+	//void transferinv();
 	void candles2();
 	void pickupob();
 	void error();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 7c4f43a..f025e38 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -202,4 +202,5 @@
 	void getexpos();
 	void paneltomap();
 	void obpicture();
+	void transferinv();
 
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 00fb171..235d28c 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -415,5 +415,22 @@ void DreamGenContext::paneltomap() {
 	multiget(segRef(data.word(kMapstore)).ptr(0, 0), data.word(kMapxstart) + data.word(kMapadx), data.word(kMapystart) + data.word(kMapady), data.byte(kMapxsize), data.byte(kMapysize));
 }
 
+void DreamGenContext::transferinv() {
+	const Frame *freeFrames = (const Frame *)segRef(data.word(kFreeframes)).ptr(kFrframedata, 0);
+	const Frame *freeFrame = freeFrames + (3 * data.byte(kItemtotran) + 1);
+	Frame *exFrames = (Frame *)segRef(data.word(kExtras)).ptr(kExframedata, 0);
+	Frame *exFrame = exFrames + (3 * data.byte(kExpos) + 1);
+	exFrame->width = freeFrame->width;
+	exFrame->height = freeFrame->height;
+	exFrame->x = freeFrame->x;
+	exFrame->y = freeFrame->y;
+	uint16 byteCount = freeFrame->width * freeFrame->height;
+	const uint8 *src = segRef(data.word(kFreeframes)).ptr(kFrframes + freeFrame->ptr(), byteCount);
+	uint8 *dst = segRef(data.word(kExtras)).ptr(kExframes + data.word(kExframepos), byteCount);
+	memcpy(dst, src, byteCount);
+	exFrame->setPtr(data.word(kExframepos));
+	data.word(kExframepos) += byteCount;
+}
+
 } /*namespace dreamgen */
 






More information about the Scummvm-git-logs mailing list