[Scummvm-cvs-logs] scummvm master -> 4106ae7d2dcb38895385f5125bd8ff152023565e

bluegr md5 at scummvm.org
Mon Dec 26 16:51:53 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:
4106ae7d2d DREAMWEB: Port 'dircom' to C++, move rootdir out of the data blob and fix a regression in searchForFiles()


Commit: 4106ae7d2dcb38895385f5125bd8ff152023565e
    https://github.com/scummvm/scummvm/commit/4106ae7d2dcb38895385f5125bd8ff152023565e
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-26T07:50:48-08:00

Commit Message:
DREAMWEB: Port 'dircom' to C++, move rootdir out of the data blob and fix a regression in searchForFiles()

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index e531834..0020950 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -61,6 +61,7 @@ p = parser(skip_binary_data = [
 	# monitor.asm
 	'comlist',
 	'keys',
+	'rootdir',
 	# newplace.asm
 	'destlist',
 	# object.asm
@@ -392,6 +393,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'destselect',
 	'diarykeyp',
 	'diarykeyn',
+	'dircom',
 	'disablepath',
 	'disablesoundint',
 	'discops',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 77af051..0004c4f 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -142,39 +142,6 @@ void DreamGenContext::transferConToEx() {
 	ds.byte(si+2) = 255;
 }
 
-void DreamGenContext::dirCom() {
-	STACK_CHECK;
-	cx = 30;
-	randomAccess();
-	parser();
-	_cmp(es.byte(di+1), 0);
-	if (flags.z())
-		goto dirroot;
-	dirFile();
-	return;
-dirroot:
-	data.byte(kLogonum) = 0;
-	ds = cs;
-	si = offset_rootdir;
-	_inc(si);
-	es = cs;
-	di = 436;
-	_inc(di);
-	cx = 12;
-	_movsb(cx, true);
-	monitorLogo();
-	scrollMonitor();
-	al = 9;
-	monMessage();
-	es = data.word(kTextfile1);
-	searchForFiles();
-	es = data.word(kTextfile2);
-	searchForFiles();
-	es = data.word(kTextfile3);
-	searchForFiles();
-	scrollMonitor();
-}
-
 void DreamGenContext::read() {
 	STACK_CHECK;
 	cx = 40;
@@ -187,7 +154,7 @@ void DreamGenContext::read() {
 	return;
 okcom:
 	es = cs;
-	di = 436;
+	di = 422;
 	ax = data.word(kTextfile1);
 	data.word(kMonsource) = ax;
 	ds = ax;
@@ -317,7 +284,7 @@ keyok2:
 	ds = cs;
 	si = offset_operand1+1;
 	es = cs;
-	di = 436+1;
+	di = 422+1;
 	cx = 12;
 	_movsb(cx, true);
 	monitorLogo();
@@ -399,7 +366,7 @@ void DreamGenContext::parser() {
 	al = '=';
 	_stosb();
 	ds = cs;
-	si = 511;
+	si = 497;
 notspace1:
 	_lodsw();
 	_cmp(al, 32);
@@ -481,16 +448,16 @@ void DreamGenContext::__start() {
 		//0x0180: .... .... ...D REAM
 		0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, 0x39, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
 		//0x0190: WEB. V99.          
-		0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 
-		//0x01a0:       ."R OOT      
-		0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-		//0x01b0:    . "             
-		0x20, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 
-		//0x01c0:  ... ..$. .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 
-		//0x01d0: .... .... .... ...D
-		0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-		//0x01e0: :... .... .... ....
+		0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
+		//0x01a0:       ."           
+		0x20, 0x20, 0x20, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 
+		//0x01b0:    . .... $... ....
+		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+		//0x01c0: .... .... .... ....
+		0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		//0x01d0: .D:. .... .... ....
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		//0x01e0: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x01f0: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
@@ -507,9 +474,7 @@ void DreamGenContext::__start() {
 		//0x0250: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0260: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-		//0x0270: .... .... .... ....
-		0x00, 0x00, };
+		0x00, 0x00, 0x00, 0x00, };
 	ds.assign(src, src + sizeof(src));
 	dreamweb(); 
 }
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index d3bb80d..82550fe 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -32,7 +32,6 @@
 
 namespace DreamGen {
 
-static const uint16 offset_rootdir = 0x01a6;
 static const uint16 offset_operand1 = 0x0198;
 static const uint16 kStartvars = 0;
 static const uint16 kProgresspoints = 1;
@@ -321,11 +320,11 @@ static const uint16 kSoundbufferwrite = 391;
 static const uint16 kCurrentsample = 393;
 static const uint16 kRoomssample = 394;
 static const uint16 kBasicsample = 395;
-static const uint16 kCurrentfile = 436;
-static const uint16 kInputline = 511;
-static const uint16 kQuitrequested = 639;
-static const uint16 kSubtitles = 640;
-static const uint16 kForeignrelease = 641;
+static const uint16 kCurrentfile = 422;
+static const uint16 kInputline = 497;
+static const uint16 kQuitrequested = 625;
+static const uint16 kSubtitles = 626;
+static const uint16 kForeignrelease = 627;
 static const uint16 kBlocktextdat = (0);
 static const uint16 kPersonframes = (0);
 static const uint16 kDebuglevel1 = (0);
@@ -427,7 +426,6 @@ public:
 	void __start();
 #include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
 
-	void dirCom();
 	void dirFile();
 	void pickupConts();
 	void transferMap();
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index 81c0f7e..e586999 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -456,6 +456,25 @@ void DreamGenContext::getKeyAndLogo() {
 	}
 }
 
+void DreamGenContext::dirCom() {
+	randomAccess(30);
+	parser();
+	if (es.byte(di + 1)) {
+		dirFile();
+		return;
+	}
+
+	data.byte(kLogonum) = 0;
+	memcpy(data.ptr(kCurrentfile+1, 0), "ROOT        ", 12);
+	monitorLogo();
+	scrollMonitor();
+	monMessage(9);
+	searchForFiles(data.word(kTextfile1));
+	searchForFiles(data.word(kTextfile2));
+	searchForFiles(data.word(kTextfile3));
+	scrollMonitor();
+}
+
 void DreamGenContext::signOn() {
 	parser();
 
@@ -514,17 +533,21 @@ void DreamGenContext::signOn() {
 	}
 }
 
-void DreamGenContext::searchForFiles() {
+void DreamGenContext::searchForFiles(uint16 segment) {
 	uint16 offset = kTextstart;
 	byte curChar;
 
 	while (true) {
-		curChar = es.byte(offset);
+		curChar = getSegment(segment).byte(offset);
 		offset++;
 		if (curChar == '*')
 			return; // "endofdir"
-		if (curChar == 34)
-			monPrint();
+		if (curChar == 34) {
+			uint16 originalOffset = offset;
+			const char *string = (const char *)getSegment(segment).ptr(offset, 0);
+			const char *nextString = monPrint(string);
+			offset = originalOffset + (nextString - string);
+		}
 	}
 }
 
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 9ab025f..14b8acc 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -134,7 +134,8 @@
 	void outOfOpen();
 	void swapWithOpen();
 	void swapWithInv();
-	void searchForFiles();
+	void searchForFiles(uint16 segment);
 	byte transferToEx();
+	void dirCom();
 
 #endif






More information about the Scummvm-git-logs mailing list