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

tramboi bertrand_augereau at yahoo.fr
Mon Aug 22 15:28:09 CEST 2011


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

Summary:
6fc0176aac DREAMWEB: 'checkiffree' ported to C++
b65f54982e DREAMWEB: 'adjustlen' is not needed


Commit: 6fc0176aacacc9eefa215b8a6a1121cd6721f2c8
    https://github.com/scummvm/scummvm/commit/6fc0176aacacc9eefa215b8a6a1121cd6721f2c8
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-22T06:22:44-07:00

Commit Message:
DREAMWEB: 'checkiffree' 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 c380bfa..9cbd4c8 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -106,6 +106,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'deltextline',
 	'doblocks',
 	'checkifperson',
+	'checkiffree',
 	'getreelstart',
 	'findobname',
 	'copyname',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index ceec7d9..de15b77 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -15461,41 +15461,6 @@ notanexid:
 		goto identifyex;
 }
 
-void DreamGenContext::checkiffree() {
-	STACK_CHECK;
-	es = data.word(kBuffers);
-	bx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5);
-	cx = 79;
-identifyfree:
-	_cmp(es.byte(bx+4), 255);
-	if (flags.z())
-		goto notafreeid;
-	_cmp(al, es.byte(bx));
-	if (flags.c())
-		goto notafreeid;
-	_cmp(al, es.byte(bx+2));
-	if (!flags.c())
-		goto notafreeid;
-	_cmp(ah, es.byte(bx+1));
-	if (flags.c())
-		goto notafreeid;
-	_cmp(ah, es.byte(bx+3));
-	if (!flags.c())
-		goto notafreeid;
-	al = es.byte(bx+4);
-	ah = 2;
-	obname();
-	al = 0;
-	_cmp(al, 1);
-	return;
-notafreeid:
-	_sub(bx, 5);
-	_dec(cx);
-	_cmp(cx, -1);
-	if (!flags.z())
-		goto identifyfree;
-}
-
 void DreamGenContext::isitdescribed() {
 	STACK_CHECK;
 	push(ax);
@@ -18659,7 +18624,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_identifyob: identifyob(); break;
 		case addr_checkifset: checkifset(); break;
 		case addr_checkifex: checkifex(); break;
-		case addr_checkiffree: checkiffree(); break;
 		case addr_isitdescribed: isitdescribed(); break;
 		case addr_findpathofpoint: findpathofpoint(); break;
 		case addr_findfirstpath: findfirstpath(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 62aaf70..df6c4cf 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -133,7 +133,6 @@ public:
 	static const uint16 addr_findfirstpath = 0xc9f0;
 	static const uint16 addr_findpathofpoint = 0xc9ec;
 	static const uint16 addr_isitdescribed = 0xc9e8;
-	static const uint16 addr_checkiffree = 0xc9e4;
 	static const uint16 addr_checkifex = 0xc9e0;
 	static const uint16 addr_checkifset = 0xc9dc;
 	static const uint16 addr_identifyob = 0xc9d4;
@@ -2055,7 +2054,7 @@ public:
 	void useobject();
 	void mainman();
 	void volumeadjust();
-	void checkiffree();
+	//void checkiffree();
 };
 }
 
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 1439a24..e77b188 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -955,6 +955,32 @@ bool DreamGenContext::checkifperson(uint8 x, uint8 y) {
 	return false;
 }
 
+void DreamGenContext::checkiffree() {
+	flags._z = not checkiffree(al, ah);
+}
+
+bool DreamGenContext::checkiffree(uint8 x, uint8 y) {
+	const ObjPos *freeList = (const ObjPos *)segRef(data.word(kBuffers)).ptr(kFreelist, 80 * sizeof(ObjPos));
+	for (size_t i = 0; i < 80; ++i) {
+		const ObjPos *objPos = freeList + 79 - i;
+		if (objPos->index == 0xff)
+			continue;
+		if (x < objPos->xMin)
+			continue;
+		if (x >= objPos->xMax)
+			continue;
+		if (y < objPos->yMin)
+			continue;
+		if (y >= objPos->yMax)
+			continue;
+		al = objPos->index;
+		ah = 2;
+		obname();
+		return true;
+	}
+	return false;
+}
+
 const uint8 *DreamGenContext::findobname(uint8 type, uint8 index) {
 	if (type == 5) {
 		uint16 i = 64 * 2 * (index & 127);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 37b7bef..6b0ed59 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -123,6 +123,8 @@
 	void doblocks();
 	void checkifperson();
 	bool checkifperson(uint8 x, uint8 y);
+	void checkiffree();
+	bool checkiffree(uint8 x, uint8 y);
 	const uint8 *findobname(uint8 type, uint8 index);
 	void copyname();
 	void copyname(uint8 type, uint8 index, uint8 *dst);


Commit: b65f54982e14b04378abae0323e0b48ec7686c81
    https://github.com/scummvm/scummvm/commit/b65f54982e14b04378abae0323e0b48ec7686c81
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-22T06:23:11-07:00

Commit Message:
DREAMWEB: 'adjustlen' is not needed

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 9cbd4c8..9ca2d89 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -142,6 +142,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'placesetobject',
 	'removesetobject',
 	'showallfree',
+	'adjustlen',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index de15b77..4ba1324 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -6503,18 +6503,6 @@ blankex:
 	goto exloop;
 }
 
-void DreamGenContext::adjustlen() {
-	STACK_CHECK;
-	ah = al;
-	_add(al, ch);
-	_cmp(al, 100);
-	if (flags.c())
-		return /* (over242) */;
-	al = 224;
-	_sub(al, ch);
-	ch = al;
-}
-
 void DreamGenContext::autolook() {
 	STACK_CHECK;
 	ax = data.word(kMousex);
@@ -18294,7 +18282,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_drawfloor: drawfloor(); break;
 		case addr_drawflags: drawflags(); break;
 		case addr_showallex: showallex(); break;
-		case addr_adjustlen: adjustlen(); break;
 		case addr_autolook: autolook(); break;
 		case addr_look: look(); break;
 		case addr_dolook: dolook(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index df6c4cf..5c4d016 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -464,7 +464,6 @@ public:
 	static const uint16 addr_dolook = 0xc474;
 	static const uint16 addr_look = 0xc470;
 	static const uint16 addr_autolook = 0xc46c;
-	static const uint16 addr_adjustlen = 0xc45c;
 	static const uint16 addr_showallex = 0xc450;
 	static const uint16 addr_drawflags = 0xc43c;
 	static const uint16 addr_drawfloor = 0xc428;
@@ -1350,7 +1349,7 @@ public:
 	void putundercentre();
 	void checkobjectsize();
 	//void commandonly();
-	void adjustlen();
+	void titles();
 	void deallocatemem();
 	void checkforemm();
 	void watchreel();
@@ -1612,7 +1611,7 @@ public:
 	void chewy();
 	void accesslighton();
 	void dosreturn();
-	void titles();
+	//void adjustlen();
 	//void quickquit();
 	void showpointer();
 	void usecooker();






More information about the Scummvm-git-logs mailing list