[Scummvm-cvs-logs] scummvm master -> 24c355e04fe7fb536bbfd72bdb998b4dbf265148

tramboi bertrand_augereau at yahoo.fr
Thu Dec 1 18:35:21 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:
24c355e04f DREAMWEB: Ported 'sparky' to C++


Commit: 24c355e04fe7fb536bbfd72bdb998b4dbf265148
    https://github.com/scummvm/scummvm/commit/24c355e04fe7fb536bbfd72bdb998b4dbf265148
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-12-01T09:33:05-08:00

Commit Message:
DREAMWEB: Ported 'sparky' 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 e36c3df..b0cd1e9 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -340,6 +340,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'barwoman',
 	'gamer',
 	'eden',
+	'sparky',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index cfdfcd4..f0d471e 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1742,44 +1742,6 @@ nocopper:
 	addtopeoplelist();
 }
 
-void DreamGenContext::sparky() {
-	STACK_CHECK;
-	_cmp(data.word(kCard1money), 0);
-	if (flags.z())
-		goto animsparky;
-	es.byte(bx+7) = 3;
-	goto animsparky;
-animsparky:
-	checkspeed();
-	if (!flags.z())
-		goto finishsparky;
-	_cmp(es.word(bx+3), 34);
-	if (!flags.z())
-		goto notsparky1;
-	randomnumber();
-	_cmp(al, 30);
-	if (flags.c())
-		goto dosparky;
-	es.word(bx+3) = 27;
-	goto finishsparky;
-notsparky1:
-	_cmp(es.word(bx+3), 48);
-	if (!flags.z())
-		goto dosparky;
-	es.word(bx+3) = 27;
-	goto finishsparky;
-dosparky:
-	_inc(es.word(bx+3));
-finishsparky:
-	showgamereel();
-	addtopeoplelist();
-	al = es.byte(bx+7);
-	_and(al, 128);
-	if (flags.z())
-		return /* (nottalkedsparky) */;
-	data.byte(kTalkedtosparky) = 1;
-}
-
 void DreamGenContext::train() {
 	STACK_CHECK;
 	return;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d6d2a16..78c4e5c 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -429,7 +429,6 @@ public:
 	static const uint16 addr_checkforexit = 0xc148;
 	static const uint16 addr_mainman = 0xc138;
 	static const uint16 addr_train = 0xc104;
-	static const uint16 addr_sparky = 0xc100;
 	static const uint16 addr_copper = 0xc0fc;
 	static const uint16 addr_advisor = 0xc0f8;
 	static const uint16 addr_drunk = 0xc0f4;
@@ -1309,7 +1308,6 @@ public:
 	void showmonk();
 	void diarykeyn();
 	void set16colpalette();
-	void sparky();
 	void interviewer();
 	void purgeanitem();
 	void madman();
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index a9f5bf1..76f1dd3 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -570,7 +570,7 @@ void DreamGenContext::showrain() {
 static void (DreamGenContext::*reelCallbacks[57])() = {
 	NULL, NULL,
 	NULL, &DreamGenContext::edeninbath,
-	&DreamGenContext::sparky, &DreamGenContext::smokebloke,
+	NULL, &DreamGenContext::smokebloke,
 	&DreamGenContext::manasleep, &DreamGenContext::drunk,
 	&DreamGenContext::receptionist, &DreamGenContext::malefan,
 	&DreamGenContext::femalefan, &DreamGenContext::louis,
@@ -602,7 +602,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = {
 static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = {
 	&DreamGenContext::gamer, &DreamGenContext::sparkydrip,
 	&DreamGenContext::eden, /*&DreamGenContext::edeninbath*/NULL,
-	/*&DreamGenContext::sparky*/NULL, /*&DreamGenContext::smokebloke*/NULL,
+	&DreamGenContext::sparky, /*&DreamGenContext::smokebloke*/NULL,
 	/*&DreamGenContext::manasleep*/NULL, /*&DreamGenContext::drunk*/NULL,
 	/*&DreamGenContext::receptionist*/NULL, /*&DreamGenContext::malefan*/NULL,
 	/*&DreamGenContext::femalefan*/NULL, /*&DreamGenContext::louis*/NULL,
@@ -1107,5 +1107,27 @@ void DreamGenContext::eden(ReelRoutine &routine) {
 	addtopeoplelist(&routine);
 }
 
+void DreamGenContext::sparky(ReelRoutine &routine) {
+	if (data.word(kCard1money))
+		routine.b7 = 3;
+	if (checkspeed(&routine)) {
+		if (routine.reelPointer() != 34) {
+			if (engine->randomNumber() < 30)
+				routine.incReelPointer();
+			else
+				routine.setReelPointer(27);
+		} else {
+			if (routine.reelPointer() != 48)
+				routine.incReelPointer();
+			else
+				routine.setReelPointer(27);
+		}
+	}
+	showgamereel(&routine);
+	addtopeoplelist(&routine);
+	if (routine.b7 & 128)
+		data.byte(kTalkedtosparky) = 1;
+}
+
 } /*namespace dreamgen */
 
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index db863ac..62f4be6 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -167,6 +167,7 @@ struct ReelRoutine {
 	uint8 b4;
 	uint16 reelPointer() const { return READ_LE_UINT16(&b3); }
 	void setReelPointer(uint16 v) { WRITE_LE_UINT16(&b3, v); }
+	void incReelPointer() { setReelPointer(reelPointer() + 1); }
 	uint8 period;
 	uint8 counter;
 	uint8 b7;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 68349db..974b61d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -381,4 +381,5 @@
 	void othersmoker(ReelRoutine &routine);
 	void gamer(ReelRoutine &routine);
 	void eden(ReelRoutine &routine);
+	void sparky(ReelRoutine &routine);
 






More information about the Scummvm-git-logs mailing list