[Scummvm-cvs-logs] scummvm master -> 606bde92445682c86ebe875544fb05925e578ed6

tramboi bertrand_augereau at yahoo.fr
Wed Nov 16 18:25:51 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:
606bde9244 DREAMWEB: 'watchcount' ported to C++


Commit: 606bde92445682c86ebe875544fb05925e578ed6
    https://github.com/scummvm/scummvm/commit/606bde92445682c86ebe875544fb05925e578ed6
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-11-16T11:24:53-08:00

Commit Message:
DREAMWEB: 'watchcount' 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 b4c5f35..7aea2fc 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -219,6 +219,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'startpaltoend',
 	'paltoendpal',
 	'fadecalculation',
+	'watchcount',
 	], skip_output = [
 	# These functions are processed but not output
 	'dreamweb',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 4d71850..35f0f63 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -13521,49 +13521,6 @@ void DreamGenContext::checkforshake() {
 	data.byte(kShakecounter) = -1;
 }
 
-void DreamGenContext::watchcount() {
-	STACK_CHECK;
-	_cmp(data.byte(kWatchon), 0);
-	if (flags.z())
-		return /* (nowatchworn) */;
-	_inc(data.byte(kTimercount));
-	_cmp(data.byte(kTimercount), 9);
-	if (flags.z())
-		goto flashdots;
-	_cmp(data.byte(kTimercount), 18);
-	if (flags.z())
-		goto uptime;
-	return;
-flashdots:
-	ax = 91*3+21;
-	di = 268+4;
-	bx = 21;
-	ds = data.word(kCharset1);
-	showframe();
-	goto finishwatch;
-uptime:
-	data.byte(kTimercount) = 0;
-	_add(data.byte(kSecondcount), 1);
-	_cmp(data.byte(kSecondcount), 60);
-	if (!flags.z())
-		goto finishtime;
-	data.byte(kSecondcount) = 0;
-	_inc(data.byte(kMinutecount));
-	_cmp(data.byte(kMinutecount), 60);
-	if (!flags.z())
-		goto finishtime;
-	data.byte(kMinutecount) = 0;
-	_inc(data.byte(kHourcount));
-	_cmp(data.byte(kHourcount), 24);
-	if (!flags.z())
-		goto finishtime;
-	data.byte(kHourcount) = 0;
-finishtime:
-	showtime();
-finishwatch:
-	data.byte(kWatchdump) = 1;
-}
-
 void DreamGenContext::showtime() {
 	STACK_CHECK;
 	_cmp(data.byte(kWatchon), 0);
@@ -16526,7 +16483,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_screenupdate: screenupdate(); break;
 		case addr_watchreel: watchreel(); break;
 		case addr_checkforshake: checkforshake(); break;
-		case addr_watchcount: watchcount(); break;
 		case addr_showtime: showtime(); break;
 		case addr_dumpwatch: dumpwatch(); break;
 		case addr_showbyte: showbyte(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 7bdb934..94299c7 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -114,7 +114,6 @@ public:
 	static const uint16 addr_showbyte = 0xc9b4;
 	static const uint16 addr_dumpwatch = 0xc9b0;
 	static const uint16 addr_showtime = 0xc9ac;
-	static const uint16 addr_watchcount = 0xc9a8;
 	static const uint16 addr_checkforshake = 0xc9a4;
 	static const uint16 addr_watchreel = 0xc9a0;
 	static const uint16 addr_screenupdate = 0xc99c;
@@ -1346,7 +1345,7 @@ public:
 	//void showblink();
 	void mousecall();
 	void train();
-	void watchcount();
+	//void checkiffree();
 	void fadedownmon();
 	void loadcart();
 	//void splitintolines();
@@ -1973,7 +1972,7 @@ public:
 	void usehole();
 	void useobject();
 	void volumeadjust();
-	//void checkiffree();
+	//void watchcount();
 };
 }
 
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index a01949e..338e8da 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1951,6 +1951,31 @@ void DreamGenContext::showwatch() {
 	}
 }
 
+void DreamGenContext::watchcount() {
+	if (data.byte(kWatchon) == 0)
+		return;
+	++data.byte(kTimercount);
+	if (data.byte(kTimercount) == 9) {
+		showframe((Frame *)segRef(data.word(kCharset1)).ptr(0, 0), 268+4, 21, 91*3+21, 0);
+		data.byte(kWatchdump) = 1;
+	} else if (data.byte(kTimercount) == 18) {
+		data.byte(kTimercount) = 0;
+		++data.byte(kSecondcount);
+		if (data.byte(kSecondcount) == 60) {
+			data.byte(kSecondcount) = 0;
+			++data.byte(kMinutecount);
+			if (data.byte(kMinutecount) == 60) {
+				data.byte(kMinutecount) = 0;
+				++data.byte(kHourcount);
+				if (data.byte(kHourcount) == 24)
+					data.byte(kHourcount) = 0;
+			}
+		}
+		showtime();
+		data.byte(kWatchdump) = 1;
+	}
+}
+
 void DreamGenContext::roomname() {
 	printmessage(88, 18, 53, 240, false);
 	uint16 textIndex = data.byte(kRoomnum);
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index a9c8941..3170be9 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -265,4 +265,6 @@
 	void startpaltoend();
 	void paltoendpal();
 	void fadecalculation();
+	void watchcount();
+
 






More information about the Scummvm-git-logs mailing list