[Scummvm-cvs-logs] scummvm master -> 1f531c6f7fc90d78a4d14cda377e5aed7c7f4eb0

tramboi bertrand_augereau at yahoo.fr
Wed Aug 31 22:06: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:
1f531c6f7f DREAMWEB: 'obicons' ported to C++


Commit: 1f531c6f7fc90d78a4d14cda377e5aed7c7f4eb0
    https://github.com/scummvm/scummvm/commit/1f531c6f7fc90d78a4d14cda377e5aed7c7f4eb0
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-31T15:02:05-07:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 658ff74..29d24a5 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -173,6 +173,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'obpicture',
 	'delthisone',
 	'transferinv',
+	'obicons',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index b239842..58c4619 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4338,28 +4338,6 @@ void DreamGenContext::openob() {
 	cs.word(bx) = ax;
 }
 
-void DreamGenContext::obicons() {
-	STACK_CHECK;
-	al = data.byte(kCommand);
-	getanyad();
-	_cmp(al, 255);
-	if (flags.z())
-		goto cantopenit;
-	ds = data.word(kIcons2);
-	di = 210;
-	bx = 1;
-	al = 4;
-	ah = 0;
-	showframe();
-cantopenit:
-	ds = data.word(kIcons2);
-	di = 260;
-	bx = 1;
-	al = 1;
-	ah = 0;
-	showframe();
-}
-
 void DreamGenContext::examicon() {
 	STACK_CHECK;
 	ds = data.word(kIcons2);
@@ -17718,7 +17696,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_openinv: openinv(); break;
 		case addr_showryanpage: showryanpage(); break;
 		case addr_openob: openob(); break;
-		case addr_obicons: obicons(); break;
 		case addr_examicon: examicon(); break;
 		case addr_describeob: describeob(); break;
 		case addr_additionaltext: additionaltext(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 2eb0b93..04bef16 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -495,7 +495,6 @@ public:
 	static const uint16 addr_additionaltext = 0xc368;
 	static const uint16 addr_describeob = 0xc364;
 	static const uint16 addr_examicon = 0xc35c;
-	static const uint16 addr_obicons = 0xc358;
 	static const uint16 addr_openob = 0xc354;
 	static const uint16 addr_showryanpage = 0xc350;
 	static const uint16 addr_openinv = 0xc34c;
@@ -1292,6 +1291,7 @@ public:
 	//void multidump();
 	void channel0only();
 	void worktoscreenm();
+	//void obicons();
 	void removeemm();
 	//void frameoutbh();
 	void getobtextstart();
@@ -1634,7 +1634,7 @@ public:
 	//void readabyte();
 	//void showframe();
 	void random();
-	void obicons();
+	void mainman();
 	void mansatstill();
 	void channel1only();
 	void checkbasemem();
@@ -2019,7 +2019,6 @@ public:
 	void accesslightoff();
 	void usehole();
 	void useobject();
-	void mainman();
 	void volumeadjust();
 	//void checkiffree();
 };
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index 9f7c231..9b8d823 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -77,8 +77,6 @@ struct SetObject {
 	uint8 b3;
 	uint8 b4;
 	uint8 priority;
-	uint16 w4() const { return READ_LE_UINT16(&b4); }
-	void setW4(uint16 v) { WRITE_LE_UINT16(&b4, v); }
 	uint8 b6;
 	uint8 delay;
 	uint8 type;
@@ -126,9 +124,6 @@ struct DynObject {
 	uint8 mapad[5];
 	uint8 b7;
 	uint8 b8;
-	uint16 w7() const { return READ_LE_UINT16(&b7); }
-	void setW7(uint16 v) { WRITE_LE_UINT16(&b7, v); }
-
 	uint8 b9;
 	uint8 b10;
 	uint8 initialLocation;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 88e590f..e400a5b 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1188,18 +1188,21 @@ DynObject *DreamGenContext::geteitheradCPP() {
 		return getfreead(data.byte(kItemframe));
 }
 
-void *DreamGenContext::getanyad(uint16 *value) {
+void *DreamGenContext::getanyad(uint8 *value1, uint8 *value2) {
 	if (data.byte(kObjecttype) == 4) {
 		DynObject *exObject = getexad(data.byte(kCommand));
-		*value = exObject->w7();
+		*value1 = exObject->b7;
+		*value2 = exObject->b8;
 		return exObject;
 	} else if (data.byte(kObjecttype) == 2) {
 		DynObject *freeObject = getfreead(data.byte(kCommand));
-		*value = freeObject->w7();
+		*value1 = freeObject->b7;
+		*value2 = freeObject->b8;
 		return freeObject;
 	} else {
 		SetObject *setObject = getsetad(data.byte(kCommand));
-		*value = setObject->w4(); // Suspicious : conflicts with priority being a byte?
+		*value1 = setObject->b4;
+		*value2 = setObject->priority;
 		return setObject;
 	}
 }
@@ -1695,6 +1698,16 @@ void DreamGenContext::obpicture() {
 	showframe(frames, 160, 68, frame, 0x80);
 }
 
+void DreamGenContext::obicons() {
+	uint8 value1, value2;
+	getanyad(&value1, &value2);
+	if (value1 == 0xff) {
+		showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 260, 1, 1, 0);
+	} else {
+		showframe((Frame *)segRef(data.word(kIcons2)).ptr(0, 0), 210, 1, 4, 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 ac68da8..7bba6a9 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -162,7 +162,7 @@
 	DynObject *getexad(uint8 index);
 	DynObject *geteitheradCPP();
 	SetObject *getsetad(uint8 index);
-	void *getanyad(uint16 *value);
+	void *getanyad(uint8 *value1, uint8 *value2);
 	void setallchanges();
 	void dochange();
 	void dochange(uint8 index, uint8 value, uint8 type);
@@ -206,4 +206,5 @@
 	void dumpmap();
 	void obpicture();
 	void transferinv();
+	void obicons();
 






More information about the Scummvm-git-logs mailing list