[Scummvm-cvs-logs] scummvm master -> d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1

bluegr md5 at scummvm.org
Mon Dec 26 12:59:45 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:
d7335d69e3 DREAMWEB: Move the roomsCanGo array out of the data blob


Commit: d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1
    https://github.com/scummvm/scummvm/commit/d7335d69e351e910f33dbcc3b80a9a5d52bfd4e1
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-26T03:59:20-08:00

Commit Message:
DREAMWEB: Move the roomsCanGo array out of the data blob

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index e7c7cf2..1f39fcf 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -51,6 +51,7 @@ p = parser(skip_binary_data = [
 	'commandline',
 	'openchangesize',
 	'roompics',
+	'roomscango',
 	# keypad.asm
 	'keypadlist',
 	'symbollist',
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index cbcfa1e..5ac720b 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -98,6 +98,7 @@ protected:
 	uint8 _underTimedText[kUnderTimedTextBufSize];
 	Common::List<Rain> _rainList;
 	uint8 _initialVars[kLengthOfVars]; // TODO: This shouldn't be necessary
+	uint8 _roomsCanGo[16];
 
 public:
 	DreamBase(DreamWeb::DreamWebEngine *en);
@@ -177,6 +178,7 @@ public:
 	void showArrows();
 	uint8 getLocation(uint8 index);
 	void setLocation(uint8 index);
+	void clearLocation(uint8 index);
 	void resetLocation(uint8 index);
 	void readCityPic();
 	void readDestIcon();
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 66885d7..2d58aea 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -608,7 +608,7 @@ void DreamGenContext::parser() {
 	al = '=';
 	_stosb();
 	ds = cs;
-	si = 556;
+	si = 540;
 notspace1:
 	_lodsw();
 	_cmp(al, 32);
@@ -704,7 +704,7 @@ void DreamGenContext::__start() {
 		//0x01f0: .... .... .D:. ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0200: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0210: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0220: .... .... .... ....
@@ -720,10 +720,8 @@ void DreamGenContext::__start() {
 		//0x0270: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0280: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
-		//0x0290: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
-		//0x02a0: .... .... .... ....
+		//0x0290: .... .... .... ....
 		0xff, 0xff, 0x00, 0x00, 0x00, };
 	ds.assign(src, src + sizeof(src));
 	dreamweb(); 
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 3d98f29..3da65cf 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -345,13 +345,12 @@ static const uint16 kCurrentsample = 419;
 static const uint16 kRoomssample = 420;
 static const uint16 kBasicsample = 421;
 static const uint16 kCurrentfile = 462;
-static const uint16 kRoomscango = 537;
-static const uint16 kOplist = 553;
-static const uint16 kInputline = 556;
-static const uint16 kPresslist = 684;
-static const uint16 kQuitrequested = 690;
-static const uint16 kSubtitles = 691;
-static const uint16 kForeignrelease = 692;
+static const uint16 kOplist = 537;
+static const uint16 kInputline = 540;
+static const uint16 kPresslist = 668;
+static const uint16 kQuitrequested = 674;
+static const uint16 kSubtitles = 675;
+static const uint16 kForeignrelease = 676;
 static const uint16 kBlocktextdat = (0);
 static const uint16 kPersonframes = (0);
 static const uint16 kDebuglevel1 = (0);
diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp
index 03824aa..efcffef 100644
--- a/engines/dreamweb/newplace.cpp
+++ b/engines/dreamweb/newplace.cpp
@@ -177,7 +177,7 @@ void DreamBase::nextDest() {
 		data.byte(kDestpos)++;
 		if (data.byte(kDestpos) == 15)
 			data.byte(kDestpos) = 0;	// last destination
-	} while (!data.byte(kRoomscango + data.byte(kDestpos)));
+	} while (!getLocation(data.byte(kDestpos)));
 
 	data.byte(kNewtextline) = 1;
 	delTextLine();
@@ -206,7 +206,7 @@ void DreamBase::lastDest() {
 		data.byte(kDestpos)--;
 		if (data.byte(kDestpos) == 0xFF)
 			data.byte(kDestpos) = 15;	// first destination
-	} while (!data.byte(kRoomscango + data.byte(kDestpos)));
+	} while (!getLocation(data.byte(kDestpos)));
 
 	data.byte(kNewtextline) = 1;
 	delTextLine();
@@ -235,11 +235,15 @@ void DreamBase::destSelect() {
 }
 
 uint8 DreamBase::getLocation(uint8 index) {
-	return data.byte(kRoomscango + index);
+	return _roomsCanGo[index];
 }
 
 void DreamBase::setLocation(uint8 index) {
-	data.byte(kRoomscango + index) = 1;
+	_roomsCanGo[index] = 1;
+}
+
+void DreamBase::clearLocation(uint8 index) {
+	_roomsCanGo[index] = 0;
 }
 
 void DreamBase::resetLocation(uint8 index) {
@@ -264,7 +268,7 @@ void DreamBase::resetLocation(uint8 index) {
 		purgeALocation(29);
 	}
 
-	data.byte(kRoomscango + index) = 0;
+	clearLocation(index);
 }
 
 void DreamBase::readDestIcon() {
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 2076a34..4fa8cf3 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -483,7 +483,7 @@ void DreamBase::savePosition(unsigned int slot, const char *descbuf) {
 
 	// len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango'
 	outSaveFile->write((const uint8 *)&madeUpRoom, sizeof(Room));
-	outSaveFile->write(data.ptr(kRoomscango, 16), 16);
+	outSaveFile->write(_roomsCanGo, 16);
 
 	// TODO: Convert more to serializer?
 	Common::Serializer s(0, outSaveFile);
@@ -551,7 +551,7 @@ void DreamBase::loadPosition(unsigned int slot) {
 	// Note: the values read into g_madeUpRoomDat are only used in actualLoad,
 	// which is (almost) immediately called after this function
 	inSaveFile->read((uint8 *)&g_madeUpRoomDat, sizeof(Room));
-	inSaveFile->read(data.ptr(kRoomscango, 16), 16);
+	inSaveFile->read(_roomsCanGo, 16);
 
 	// TODO: Use serializer for more
 	Common::Serializer s(inSaveFile, 0);
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 413bd27..827fb2e 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -3618,7 +3618,7 @@ void DreamBase::clearChanges() {
 
 	const uint8 initialRoomsCanGo[] = { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
-	memcpy(data.ptr(kRoomscango, 16), initialRoomsCanGo, 16);
+	memcpy(_roomsCanGo, initialRoomsCanGo, 16);
 }
 
 void DreamBase::showDiaryKeys() {






More information about the Scummvm-git-logs mailing list