[Scummvm-cvs-logs] scummvm master -> 5bfe1f22d59471c50e0a6e65fb2dbf79e67fdf89

tramboi bertrand_augereau at yahoo.fr
Tue Aug 30 00:50:42 CEST 2011


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
081bdece0c DREAMWEB: More reversing of DynObject struct
7624083cdc DREAMWEB: 'getexpos' ported to C++
5bfe1f22d5 DREAMWEB: 'paneltomap' ported to C++


Commit: 081bdece0c66aa900935e5bff9ed8f3eb70eb4ec
    https://github.com/scummvm/scummvm/commit/081bdece0c66aa900935e5bff9ed8f3eb70eb4ec
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-29T17:37:47-07:00

Commit Message:
DREAMWEB: More reversing of DynObject struct

Changed paths:
    engines/dreamweb/backdrop.cpp
    engines/dreamweb/structs.h
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index cfa4d57..4ffd589 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -305,14 +305,14 @@ void DreamGenContext::showallex() {
 	data.word(kDataad) = kExframedata;
 	data.word(kFramesad) = kExframes;
 	data.byte(kCurrentex) = 0;
-	si = kExdata + 2;
-	for (size_t i = 0; i < 100; ++i, ++data.byte(kCurrentex), si +=16) {
-		es = data.word(kExtras);
-		if (es.byte(si) == 0xff)
+	DynObject *objects = (DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject));
+	for (size_t i = 0; i < 100; ++i, ++data.byte(kCurrentex)) {
+		DynObject *object = objects + i;
+		if (object->b2[0] == 0xff)
 			continue;
-		if (es.byte(si-2) != data.byte(kReallocation))
+		if (object->currentLocation != data.byte(kReallocation))
 			continue;
-		if (getmapad((const uint8 *)es.ptr(si, 5)) == 0)
+		if (getmapad(object->b2) == 0)
 			continue;
 		data.word(kCurrentframe) = 3 * data.byte(kCurrentex);
 		uint8 width, height;
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index 6d3deac..0b99b01 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -119,18 +119,14 @@ struct SetObject {
 };
 
 struct DynObject {
-	uint8 b0;
+	uint8 currentLocation;
 	uint8 index;
-	uint8 b2;
-	uint8 b3;
-	uint8 b4;
-	uint8 b5;
-	uint8 b6;
+	uint8 b2[5];
 	uint8 b7;
 	uint8 b8;
 	uint8 b9;
 	uint8 b10;
-	uint8 location;
+	uint8 initialLocation;
 	uint8 id[4];
 };
 
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 33f7a41..3c4c228 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1177,8 +1177,8 @@ void DreamGenContext::dochange(uint8 index, uint8 value, uint8 type) {
 		getsetad(index)->b58[0] = value;
 	} else if (type == 1) { //freeobject
 		DynObject *freeObject = getfreead(index);
-		if (freeObject->b2 == 0xff)
-			freeObject->b2 = value;
+		if (freeObject->b2[0] == 0xff)
+			freeObject->b2[0] = value;
 	} else { //path
 		bx = kPathdata + (type - 100) * 144 + index * 8;
 		es = data.word(kReels);
@@ -1190,10 +1190,10 @@ void DreamGenContext::deletetaken() {
 	const DynObject *extraObjects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, 0);
 	DynObject *freeObjects = (DynObject *)segRef(data.word(kFreedat)).ptr(0, 0);
 	for(size_t i = 0; i < kNumexobjects; ++i) {
-		uint8 location = extraObjects[i].location;
+		uint8 location = extraObjects[i].initialLocation;
 		if (location == data.byte(kReallocation)) {
 			uint8 index = extraObjects[i].index;
-			freeObjects[index].b2 = 254;
+			freeObjects[index].b2[0] = 254;
 		}
 	}
 }


Commit: 7624083cdcb80c044bd34391a4d536e12bb2320d
    https://github.com/scummvm/scummvm/commit/7624083cdcb80c044bd34391a4d536e12bb2320d
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-29T17:37:48-07:00

Commit Message:
DREAMWEB: 'getexpos' 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 85a1b4b..b76edfe 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -165,6 +165,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'waitframes',
 	'drawflags',
 	'addtopeoplelist',
+	'getexpos',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 5b1e30f..d2a9651 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -6026,24 +6026,6 @@ moretext:
 		goto moretext;
 }
 
-void DreamGenContext::getexpos() {
-	STACK_CHECK;
-	es = data.word(kExtras);
-	al = 0;
-	di = (0+2080+30000);
-tryanotherex:
-	_cmp(es.byte(di+2), 255);
-	if (flags.z())
-		goto foundnewex;
-	_add(di, 16);
-	_inc(al);
-	_cmp(al, (114));
-	if (!flags.z())
-		goto tryanotherex;
-foundnewex:
-	data.byte(kExpos) = al;
-}
-
 void DreamGenContext::purgealocation() {
 	STACK_CHECK;
 	push(ax);
@@ -17981,7 +17963,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_pickupconts: pickupconts(); break;
 		case addr_transfercontoex: transfercontoex(); break;
 		case addr_transfertext: transfertext(); break;
-		case addr_getexpos: getexpos(); break;
 		case addr_purgealocation: purgealocation(); break;
 		case addr_emergencypurge: emergencypurge(); break;
 		case addr_purgeanitem: purgeanitem(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index cc777f4..f80c2eb 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -455,7 +455,6 @@ public:
 	static const uint16 addr_purgeanitem = 0xc414;
 	static const uint16 addr_emergencypurge = 0xc410;
 	static const uint16 addr_purgealocation = 0xc40c;
-	static const uint16 addr_getexpos = 0xc408;
 	static const uint16 addr_transfertext = 0xc404;
 	static const uint16 addr_transfercontoex = 0xc400;
 	static const uint16 addr_pickupconts = 0xc3fc;
@@ -1336,7 +1335,7 @@ public:
 	//void clearwork();
 	void loadtraveltext();
 	//void worktoscreen();
-	void getexpos();
+	//void getexpos();
 	void fadedos();
 	//void fillspace();
 	void selectlocation();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 3c4c228..1ffe329 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1198,6 +1198,17 @@ void DreamGenContext::deletetaken() {
 	}
 }
 
+void DreamGenContext::getexpos() {
+	const DynObject *objects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject));
+	for (size_t i = 0; i < kNumexobjects; ++i) {
+		if (objects[i].b2[0] == 0xff) {
+			data.byte(kExpos) = i;
+			return;
+		}
+	}
+	data.byte(kExpos) = kNumexobjects;
+}
+
 void DreamGenContext::placesetobject() {
 	placesetobject(al);
 }
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 0be9c79..c5a1742 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -197,4 +197,6 @@
 	void drawflags();
 	void addtopeoplelist();
 	void addtopeoplelist(ReelRoutine *routine);
+	void getexpos();
+
 


Commit: 5bfe1f22d59471c50e0a6e65fb2dbf79e67fdf89
    https://github.com/scummvm/scummvm/commit/5bfe1f22d59471c50e0a6e65fb2dbf79e67fdf89
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-29T17:45:53-07:00

Commit Message:
DREAMWEB: 'paneltomap' 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 b76edfe..bc138cf 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -166,6 +166,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'drawflags',
 	'addtopeoplelist',
 	'getexpos',
+	'paneltomap',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index d2a9651..6ebb617 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2657,19 +2657,6 @@ nought:
 		goto palloop;
 }
 
-void DreamGenContext::paneltomap() {
-	STACK_CHECK;
-	di = data.word(kMapxstart);
-	_add(di, data.word(kMapadx));
-	bx = data.word(kMapystart);
-	_add(bx, data.word(kMapady));
-	ds = data.word(kMapstore);
-	si = 0;
-	cl = data.byte(kMapxsize);
-	ch = data.byte(kMapysize);
-	multiget();
-}
-
 void DreamGenContext::maptopanel() {
 	STACK_CHECK;
 	di = data.word(kMapxstart);
@@ -17849,7 +17836,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_showpcx: showpcx(); break;
 		case addr_loadpalfromiff: loadpalfromiff(); break;
 		case addr_setmode: setmode(); break;
-		case addr_paneltomap: paneltomap(); break;
 		case addr_maptopanel: maptopanel(); break;
 		case addr_dumpmap: dumpmap(); break;
 		case addr_pixelcheckset: pixelcheckset(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f80c2eb..8cf0462 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -568,7 +568,6 @@ public:
 	static const uint16 addr_pixelcheckset = 0xc1f8;
 	static const uint16 addr_dumpmap = 0xc1f4;
 	static const uint16 addr_maptopanel = 0xc1f0;
-	static const uint16 addr_paneltomap = 0xc1ec;
 	static const uint16 addr_setmode = 0xc1dc;
 	static const uint16 addr_loadpalfromiff = 0xc1d8;
 	static const uint16 addr_showpcx = 0xc1cc;
@@ -1457,7 +1456,7 @@ public:
 	void runtap();
 	//void domix();
 	void priesttext();
-	void paneltomap();
+	//void paneltomap();
 	//void obname();
 	void getridoftemp3();
 	void getridoftemp2();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index c5a1742..58bda83 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -198,5 +198,5 @@
 	void addtopeoplelist();
 	void addtopeoplelist(ReelRoutine *routine);
 	void getexpos();
-
+	void paneltomap();
 
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 3c92640..00fb171 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -411,5 +411,9 @@ void DreamGenContext::zoom() {
 	data.byte(kDidzoom) = 1;
 }
 
+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));
+}
+
 } /*namespace dreamgen */
 






More information about the Scummvm-git-logs mailing list