[Scummvm-cvs-logs] scummvm master -> 3971a0dbf51b52df0762e43cc90b214978484c1e

tramboi bertrand_augereau at yahoo.fr
Mon Aug 15 23:30:04 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:
9d8e5c0df4 DREAMWEB: 'updatepeople' ported to C++
3971a0dbf5 DREAMWEB: 'madmantext' ported to C++


Commit: 9d8e5c0df49a6a6d52f71c31f3ab0b406ad84ede
    https://github.com/scummvm/scummvm/commit/9d8e5c0df49a6a6d52f71c31f3ab0b406ad84ede
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-15T15:50:12-07:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 9bc5ff7..cc678b7 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -111,6 +111,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'copyname',
 	'commandwithob',
 	'showpanel',
+	'updatepeople',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8b8b622..8c3719b 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2651,43 +2651,6 @@ void DreamGenContext::widedoor() {
 	dodoor();
 }
 
-void DreamGenContext::updatepeople() {
-	STACK_CHECK;
-	es = data.word(kBuffers);
-	di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5));
-	data.word(kListpos) = di;
-	cx = 12*5;
-	al = 255;
-	_stosb(cx, true);
-	_inc(data.word(kMaintimer));
-	es = cs;
-	bx = 534;
-	di = 991;
-updateloop:
-	al = es.byte(bx);
-	_cmp(al, 255);
-	if (flags.z())
-		return /* (endupdate) */;
-	_cmp(al, data.byte(kReallocation));
-	if (!flags.z())
-		goto notinthisroom;
-	cx = es.word(bx+1);
-	_cmp(cl, data.byte(kMapx));
-	if (!flags.z())
-		goto notinthisroom;
-	_cmp(ch, data.byte(kMapy));
-	if (!flags.z())
-		goto notinthisroom;
-	push(di);
-	ax = cs.word(di);
-	__dispatch_call(ax);
-	di = pop();
-notinthisroom:
-	_add(bx, 8);
-	_add(di, 2);
-	goto updateloop;
-}
-
 void DreamGenContext::reelsonscreen() {
 	STACK_CHECK;
 	reconstruct();
@@ -19234,7 +19197,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_constant: constant(); break;
 		case addr_doorway: doorway(); break;
 		case addr_widedoor: widedoor(); break;
-		case addr_updatepeople: updatepeople(); break;
 		case addr_reelsonscreen: reelsonscreen(); break;
 		case addr_soundonreels: soundonreels(); break;
 		case addr_reconstruct: reconstruct(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 16b23db..851c87d 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -625,7 +625,6 @@ public:
 	static const uint16 addr_reconstruct = 0xc1ac;
 	static const uint16 addr_soundonreels = 0xc1a8;
 	static const uint16 addr_reelsonscreen = 0xc1a0;
-	static const uint16 addr_updatepeople = 0xc198;
 	static const uint16 addr_widedoor = 0xc18c;
 	static const uint16 addr_doorway = 0xc188;
 	static const uint16 addr_constant = 0xc184;
@@ -1416,7 +1415,7 @@ public:
 	void eden();
 	void showdiary();
 	void purgealocation();
-	void updatepeople();
+	//void updatepeople();
 	void slabdoorf();
 	void addtopeoplelist();
 	void hangoncurs();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 9735ad0..59ca0cb 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -619,5 +619,150 @@ void DreamGenContext::showrain() {
 	}
 }
 
+void DreamGenContext::updatepeople() {
+	data.word(kListpos) = kPeoplelist;
+	memset(segRef(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People));
+	++data.word(kMaintimer);
+	es = cs;
+	bx = kReelroutines;
+	const ReelRoutine *reelRoutine = (const ReelRoutine *)cs.ptr(bx, 0);
+	const uint16 *callbacks = (const uint16 *)cs.ptr(kReelcalls, 0);
+	while (true) {
+		uint8 realLocation = reelRoutine->reallocation;
+		if (realLocation == 255)
+			return;
+		if ((realLocation == data.byte(kReallocation)) &&
+		    (reelRoutine->mapX == data.byte(kMapx)) &&
+		    (reelRoutine->mapY == data.byte(kMapy))) {
+			uint16 callback = READ_LE_UINT16(callbacks);
+			//dw	gamer,sparkydrip,eden,edeninbath,sparky,smokebloke
+			if (callback == addr_gamer)
+				gamer();
+			else if (callback == addr_sparkydrip)
+				sparkydrip();
+			else if (callback == addr_eden)
+				eden();
+			else if (callback == addr_edeninbath)
+				edeninbath();
+			else if (callback == addr_sparky)
+				sparky();
+			else if (callback == addr_smokebloke)
+				smokebloke();
+			//dw	manasleep,drunk,receptionist,malefan,femalefan
+			else if (callback == addr_manasleep)
+				manasleep();
+			else if (callback == addr_drunk)
+				drunk();
+			else if (callback == addr_receptionist)
+				receptionist();
+			else if (callback == addr_malefan)
+				malefan();
+			else if (callback == addr_femalefan)
+				femalefan();
+			//dw	louis,louischair,soldier1,bossman,interviewer
+			else if (callback == addr_louis)
+				louis();
+			else if (callback == addr_louischair)
+				louischair();
+			else if (callback == addr_soldier1)
+				soldier1();
+			else if (callback == addr_bossman)
+				bossman();
+			else if (callback == addr_interviewer)
+				interviewer();
+			//dw	heavy,manasleep2,mansatstill,drinker,bartender
+			else if (callback == addr_heavy)
+				heavy();
+			else if (callback == addr_manasleep2)
+				manasleep2();
+			else if (callback == addr_mansatstill)
+				mansatstill();
+			else if (callback == addr_drinker)
+				drinker();
+			else if (callback == addr_bartender)
+				bartender();
+			//dw	othersmoker,tattooman,attendant,keeper,candles1
+			else if (callback == addr_othersmoker)
+				othersmoker();
+			else if (callback == addr_tattooman)
+				tattooman();
+			else if (callback == addr_attendant)
+				attendant();
+			else if (callback == addr_keeper)
+				keeper();
+			else if (callback == addr_candles1)
+				candles1();
+			//dw	smallcandle,security,copper,poolguard,rockstar
+			else if (callback == addr_smallcandle)
+				smallcandle();
+			else if (callback == addr_security)
+				security();
+			else if (callback == addr_copper)
+				copper();
+			else if (callback == addr_poolguard)
+				poolguard();
+			else if (callback == addr_rockstar)
+				rockstar();
+			//dw	businessman,train,aide,mugger,helicopter
+			else if (callback == addr_businessman)
+				businessman();
+			else if (callback == addr_train)
+				train();
+			else if (callback == addr_aide)
+				aide();
+			else if (callback == addr_mugger)
+				mugger();
+			else if (callback == addr_helicopter)
+				helicopter();
+			//dw	intromagic1,intromusic,intromagic2,candles2,gates
+			else if (callback == addr_intromagic1)
+				intromagic1();
+			else if (callback == addr_intromusic)
+				intromusic();
+			else if (callback == addr_intromagic2)
+				intromagic2();
+			else if (callback == addr_candles2)
+				candles2();
+			else if (callback == addr_gates)
+				gates();
+			//dw	intromagic3,intromonks1,candles,intromonks2
+			else if (callback == addr_intromagic3)
+				intromagic3();
+			else if (callback == addr_intromonks1)
+				intromonks1();
+			else if (callback == addr_candles)
+				candles();
+			else if (callback == addr_intromonks2)
+				intromonks2();
+			//dw	handclap,monkandryan,endgameseq,priest,madman
+			else if (callback == addr_handclap)
+				handclap();
+			else if (callback == addr_monkandryan)
+				monkandryan();
+			else if (callback == addr_endgameseq)
+				endgameseq();
+			else if (callback == addr_priest)
+				priest();
+			else if (callback == addr_madman)
+				madman();
+			//dw	madmanstelly,alleybarksound,foghornsound
+			else if (callback == addr_madmanstelly)
+				madmanstelly();
+			else if (callback == addr_alleybarksound)
+				alleybarksound();
+			else if (callback == addr_foghornsound)
+				foghornsound();
+			//dw	carparkdrip,carparkdrip,carparkdrip,carparkdrip
+			else if (callback == addr_carparkdrip)
+				carparkdrip();
+			else
+				assert(false); // Oops I forgot something in the dispatch table
+		}
+		bx += 8;
+		++reelRoutine;
+		++callbacks;
+	}
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index 775466a..685e4cf 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -96,6 +96,17 @@ struct Reel {
 	uint8 b4;
 };
 
+struct ReelRoutine {
+	uint8 reallocation;
+	uint8 mapX;
+	uint8 mapY;
+	uint8 b3;
+	uint8 b4;
+	uint8 b5;
+	uint8 b6;
+	uint8 b7;
+};
+
 struct People {
 	uint8 b0;
 	uint8 b1;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 1f14faf..94580b3 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -127,5 +127,5 @@
 	void commandwithob();
 	void commandwithob(uint8 command, uint8 type, uint8 index);
 	void showpanel();
-
+	void updatepeople();
 


Commit: 3971a0dbf51b52df0762e43cc90b214978484c1e
    https://github.com/scummvm/scummvm/commit/3971a0dbf51b52df0762e43cc90b214978484c1e
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-08-15T16:25:59-07:00

Commit Message:
DREAMWEB: 'madmantext' ported to C++
There is a debatable hack to accomodate the two different builds of the game, cd or not.

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index cc678b7..e05e58c 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -112,6 +112,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'commandwithob',
 	'showpanel',
 	'updatepeople',
+	'madmantext',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8c3719b..9306acd 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1772,25 +1772,6 @@ ryansded:
 	showgamereel();
 }
 
-void DreamGenContext::madmantext() {
-	STACK_CHECK;
-	_cmp(data.byte(kSpeechcount), 63);
-	if (!flags.c())
-		return /* (nomadtext) */;
-	_cmp(data.byte(kCh1playing), 255);
-	if (!flags.z())
-		return /* (nomadtext) */;
-	al = data.byte(kSpeechcount);
-	_inc(data.byte(kSpeechcount));
-	_add(al, 47);
-	bl = 72;
-	bh = 80;
-	cx = 90;
-	dx = 1;
-	ah = 82;
-	setuptimedtemp();
-}
-
 void DreamGenContext::madmode() {
 	STACK_CHECK;
 	data.word(kWatchingtime) = 2;
@@ -19166,7 +19147,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_priest: priest(); break;
 		case addr_madmanstelly: madmanstelly(); break;
 		case addr_madman: madman(); break;
-		case addr_madmantext: madmantext(); break;
 		case addr_madmode: madmode(); break;
 		case addr_priesttext: priesttext(); break;
 		case addr_textforend: textforend(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 851c87d..be3c122 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -655,7 +655,6 @@ public:
 	static const uint16 addr_textforend = 0xc0ec;
 	static const uint16 addr_priesttext = 0xc0e8;
 	static const uint16 addr_madmode = 0xc0e4;
-	static const uint16 addr_madmantext = 0xc0e0;
 	static const uint16 addr_madman = 0xc0dc;
 	static const uint16 addr_madmanstelly = 0xc0d8;
 	static const uint16 addr_priest = 0xc0d4;
@@ -1802,7 +1801,7 @@ public:
 	void dmaend();
 	//void quickquit2();
 	void twodigitnum();
-	void madmantext();
+	//void madmantext();
 	void dumpcurrent();
 	void textforend();
 	void showdiarykeys();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 59ca0cb..da9d8c9 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -764,5 +764,29 @@ void DreamGenContext::updatepeople() {
 	}
 }
 
+void DreamGenContext::madmantext() {
+	// 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
+	// we managed to load the speech.
+	if (data.byte(kSpeechloaded)) {
+		if (data.byte(kSpeechcount) >= 63)
+			return;
+		_cmp(data.byte(kCh1playing), 255);
+		if (!flags.z())
+			return /* (nomadtext) */;
+		al = data.byte(kSpeechcount);
+		++data.byte(kSpeechcount);
+	} else {
+		if (data.byte(kCombatcount) >= 61)
+			return;
+		al = data.byte(kCombatcount);
+		_and(al, 3);
+		if (!flags.z())
+			return /* (nomadtext) */;
+		al = data.byte(kCombatcount) / 4;
+	}
+	setuptimedtemp(47 + al, 82, 72, 80, 90, 1);
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 94580b3..5b8839f 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -128,4 +128,6 @@
 	void commandwithob(uint8 command, uint8 type, uint8 index);
 	void showpanel();
 	void updatepeople();
+	void madmantext();
+
 






More information about the Scummvm-git-logs mailing list