[Scummvm-cvs-logs] scummvm master -> 30b2c37e53852fba8ee73f692492f489b4d86e5a

bluegr md5 at scummvm.org
Mon Dec 12 19:03:38 CET 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:
30b2c37e53 DREAMWEB: Convert 'setuptimeduse', 'entrytexts' to C++ and move priestText() to DreamBase


Commit: 30b2c37e53852fba8ee73f692492f489b4d86e5a
    https://github.com/scummvm/scummvm/commit/30b2c37e53852fba8ee73f692492f489b4d86e5a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-12T10:02:34-08:00

Commit Message:
DREAMWEB: Convert 'setuptimeduse', 'entrytexts' to C++ and move priestText() to DreamBase

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 7c89ab4..c182ca5 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -357,6 +357,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'endpaltostart',
 	'entercode',
 	'entersymbol',
+	'entrytexts',
 	'eraseoldobs',
 	'error',
 	'errormessage1',
@@ -673,6 +674,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'setupemm',
 	'setuppit',
 	'setuptimedtemp',
+	'setuptimeduse',
 	'setwalk',
 	'showallex',
 	'showallfree',
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 3d5c9ce..7ef6a92 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -115,6 +115,7 @@ public:
 	const Frame *getReelFrameAX(uint16 frame);
 	void soundOnReels(uint16 reelPointer);
 	void rollEndCredits();
+	void priestText(ReelRoutine &routine);
 
 	// from stubs.cpp
 	void crosshair();
@@ -154,6 +155,7 @@ public:
 	// from use.cpp
 	void placeFreeObject(uint8 index);
 	void removeFreeObject(uint8 index);
+	void setupTimedUse(uint16 offset, uint16 countToTimed, uint16 timeCount, byte x, byte y);
 
 	// from vgafades.cpp
 	uint8 *mainPalette();
@@ -209,6 +211,7 @@ public:
 	void createPanel();
 	void createPanel2();
 	void showPanel();
+	void entryTexts();
 };
 
 
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 6d3da6d..76fbf92 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4531,28 +4531,6 @@ void DreamGenContext::removeFreeObject() {
 	es = pop();
 }
 
-void DreamGenContext::setupTimedUse() {
-	STACK_CHECK;
-	_cmp(data.word(kTimecount), 0);
-	if (!flags.z())
-		return /* (cantsetup) */;
-	data.byte(kTimedy) = bh;
-	data.byte(kTimedx) = bl;
-	data.word(kCounttotimed) = cx;
-	_add(dx, cx);
-	data.word(kTimecount) = dx;
-	bl = al;
-	bh = 0;
-	_add(bx, bx);
-	es = data.word(kPuzzletext);
-	cx = (66*2);
-	ax = es.word(bx);
-	_add(ax, cx);
-	bx = ax;
-	data.word(kTimedseg) = es;
-	data.word(kTimedoffset) = bx;
-}
-
 void DreamGenContext::useGun() {
 	STACK_CHECK;
 	_cmp(data.byte(kObjecttype), 4);
@@ -5051,85 +5029,6 @@ nomatchslot:
 		goto slotloop;
 }
 
-void DreamGenContext::entryTexts() {
-	STACK_CHECK;
-	_cmp(data.byte(kLocation), 21);
-	if (!flags.z())
-		goto notloc15;
-	al = 28;
-	cx = 60;
-	dx = 11;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-	return;
-notloc15:
-	_cmp(data.byte(kLocation), 30);
-	if (!flags.z())
-		goto notloc43;
-	al = 27;
-	cx = 60;
-	dx = 11;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-	return;
-notloc43:
-	_cmp(data.byte(kLocation), 23);
-	if (!flags.z())
-		goto notloc23;
-	al = 29;
-	cx = 60;
-	dx = 11;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-	return;
-notloc23:
-	_cmp(data.byte(kLocation), 31);
-	if (!flags.z())
-		goto notloc44;
-	al = 30;
-	cx = 60;
-	dx = 11;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-	return;
-notloc44:
-	_cmp(data.byte(kLocation), 20);
-	if (!flags.z())
-		goto notsarters2;
-	al = 31;
-	cx = 60;
-	dx = 11;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-	return;
-notsarters2:
-	_cmp(data.byte(kLocation), 24);
-	if (!flags.z())
-		goto notedenlob;
-	al = 32;
-	cx = 60;
-	dx = 3;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-	return;
-notedenlob:
-	_cmp(data.byte(kLocation), 34);
-	if (!flags.z())
-		return /* (noteden2) */;
-	al = 33;
-	cx = 60;
-	dx = 3;
-	bl = 68;
-	bh = 64;
-	setupTimedUse();
-}
-
 void DreamGenContext::entryAnims() {
 	STACK_CHECK;
 	data.word(kReeltowatch) = -1;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index ae9bf3b..c0c7407 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -491,7 +491,6 @@ public:
 	void useOpenBox();
 	void clearBuffers();
 	void getObTextStart();
-	void entryTexts();
 	void putUnderCentre();
 	void checkObjectSize();
 	void findText1();
@@ -580,7 +579,6 @@ public:
 	void checkInside();
 	void findPathOfPoint();
 	void getDestInfo();
-	void setupTimedUse();
 	void makeCaps();
 	void read();
 	void additionalText();
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 889a430..efb9a02 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -629,25 +629,16 @@ void DreamGenContext::priest(ReelRoutine &routine) {
 
 	if (checkSpeed(routine)) {
 		routine.incReelPointer();
-		push(es);
-		push(bx);
 		priestText(routine);
-		bx = pop();
-		es = pop();
 	}
 }
 
-void DreamGenContext::priestText(ReelRoutine &routine) {
+void DreamBase::priestText(ReelRoutine &routine) {
 	uint16 reel = routine.reelPointer();
 	if (reel < 2 || reel >= 7 || (reel & 1))
 		return; // nopriesttext
 
-	al = ((reel & 0xFF) >> 1) + 50;
-	bl = 72;
-	bh = 80;
-	cx = 54;
-	dx = 1;
-	setupTimedUse();
+	setupTimedUse((reel >> 1) + 50, 54, 1, 72, 80);
 }
 
 void DreamGenContext::monkAndRyan(ReelRoutine &routine) {
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 162152c..e4c9a75 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -4317,4 +4317,50 @@ void DreamGenContext::quitKey() {
 		data.byte(kGetback) = 1;
 }
 
+void DreamGenContext::setupTimedUse() {
+	DreamBase::setupTimedUse(al, cx, dx, bl, bh);
+}
+
+void DreamBase::setupTimedUse(uint16 textIndex, uint16 countToTimed, uint16 timeCount, byte x, byte y) {
+	if (data.word(kTimecount) != 0)
+		return; // can't setup
+
+	data.byte(kTimedy) = y;
+	data.byte(kTimedx) = x;
+	data.word(kCounttotimed) = countToTimed;
+	data.word(kTimecount) = timeCount + countToTimed;
+	data.word(kTimedseg) = data.word(kPuzzletext);
+	data.word(kTimedoffset) = kTextstart + getSegment(data.word(kPuzzletext)).word(textIndex * 2);
+	const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(data.word(kTimedoffset), 0);
+	debug(1, "setupTimedUse: %d => '%s'", textIndex, string);
+}
+
+void DreamBase::entryTexts() {
+	switch (data.byte(kLocation)) {
+	case 21:
+		setupTimedUse(28, 60, 11, 68, 64);
+		break;
+	case 30:
+		setupTimedUse(27, 60, 11, 68, 64);
+		break;
+	case 23:
+		setupTimedUse(29, 60, 11, 68, 64);
+		break;
+	case 31:
+		setupTimedUse(30, 60, 11, 68, 64);
+		break;
+	case 20:
+		setupTimedUse(31, 60, 11, 68, 64);
+		break;
+	case 24:
+		setupTimedUse(32, 60, 3, 68, 64);
+		break;
+	case 34:
+		setupTimedUse(33, 60, 3, 68, 64);
+		break;
+	default:
+		break;
+	}
+}
+
 } // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 4308bd5..661eba3 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -408,7 +408,6 @@
 	void louisChair(ReelRoutine &routine);
 	void bossMan(ReelRoutine &routine);
 	void priest(ReelRoutine &routine);
-	void priestText(ReelRoutine &routine);
 	void monkAndRyan(ReelRoutine &routine);
 	void copper(ReelRoutine &routine);
 	void introMonks1(ReelRoutine &routine);
@@ -568,5 +567,6 @@
 	void useButtonA();
 	void autoAppear();
 	void quitKey();
+	void setupTimedUse();
 
 #endif






More information about the Scummvm-git-logs mailing list