[Scummvm-cvs-logs] scummvm master -> 36b8a60eda5db6a9b3597a00ac9184eb608b9ae9

wjp wjp at usecode.org
Sun Dec 11 10:16:51 CET 2011


This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
364b30425a DREAMWEB: Make use of member vars of class Engine
51b724fa43 DREAMWEB: Remove DreamGenContext::closeFile, stop using kHandle
dfeb31e187 DREAMWEB: Add DreamWebEngine::getSavegameFilename
3d753794e6 DREAMWEB: Move savefile creation into DreamGenContext::savePosition
6b226d5943 DREAMWEB: Do savefile reading directly in loadPosition() / scanForNames()
36b8a60eda DREAMWEB: Properly fix workoutFrames regression


Commit: 364b30425a6527ea5f7c834f6de4111fe55c2dc3
    https://github.com/scummvm/scummvm/commit/364b30425a6527ea5f7c834f6de4111fe55c2dc3
Author: Max Horn (max at quendi.de)
Date: 2011-12-11T01:01:28-08:00

Commit Message:
DREAMWEB: Make use of member vars of class Engine

Changed paths:
    engines/dreamweb/dreamweb.cpp



diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index e15f315..f455643 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -108,8 +108,7 @@ void DreamWebEngine::quit() {
 }
 
 void DreamWebEngine::processEvents() {
-	Common::EventManager *event_manager = _system->getEventManager();
-	if (event_manager->shouldQuit()) {
+	if (_eventMan->shouldQuit()) {
 		quit();
 		return;
 	}
@@ -117,7 +116,7 @@ void DreamWebEngine::processEvents() {
 	soundHandler();
 	Common::Event event;
 	int softKey, hardKey;
-	while (event_manager->pollEvent(event)) {
+	while (_eventMan->pollEvent(event)) {
 		switch(event.type) {
 		case Common::EVENT_RTL:
 			quit();
@@ -213,11 +212,11 @@ Common::Error DreamWebEngine::run() {
 
 	ConfMan.registerDefault("dreamweb_originalsaveload", "true");
 
-	getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync");
+	_timer->installTimerProc(vSyncInterrupt, 1000000 / 70, this, "dreamwebVSync");
 	_context.__start();
 	_base.data.byte(DreamGen::kQuitrequested) = 0;
 
-	getTimerManager()->removeTimerProc(vSyncInterrupt);
+	_timer->removeTimerProc(vSyncInterrupt);
 
 	return Common::kNoError;
 }
@@ -225,8 +224,8 @@ Common::Error DreamWebEngine::run() {
 void DreamWebEngine::setSpeed(uint speed) {
 	debug(0, "setting speed %u", speed);
 	_speed = speed;
-	getTimerManager()->removeTimerProc(vSyncInterrupt);
-	getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70 / speed, this, "dreamwebVSync");
+	_timer->removeTimerProc(vSyncInterrupt);
+	_timer->installTimerProc(vSyncInterrupt, 1000000 / 70 / speed, this, "dreamwebVSync");
 }
 
 void DreamWebEngine::openFile(const Common::String &name) {
@@ -234,7 +233,7 @@ void DreamWebEngine::openFile(const Common::String &name) {
 	closeFile();
 	if (_file.open(name))
 		return;
-	_inSaveFile = _system->getSavefileManager()->openForLoading(name);
+	_inSaveFile = _saveFileMan->openForLoading(name);
 	if (_inSaveFile)
 		return;
 	error("cannot open file %s", name.c_str());
@@ -268,13 +267,13 @@ void DreamWebEngine::closeFile() {
 void DreamWebEngine::openSaveFileForWriting(const Common::String &name) {
 	processEvents();
 	delete _outSaveFile;
-	_outSaveFile = _system->getSavefileManager()->openForSaving(name);
+	_outSaveFile = _saveFileMan->openForSaving(name);
 }
 
 bool DreamWebEngine::openSaveFileForReading(const Common::String &name) {
 	processEvents();
 	delete _inSaveFile;
-	_inSaveFile = _system->getSavefileManager()->openForLoading(name);
+	_inSaveFile = _saveFileMan->openForLoading(name);
 	return _inSaveFile != 0;
 }
 
@@ -306,8 +305,7 @@ void DreamWebEngine::keyPressed(uint16 ascii) {
 
 void DreamWebEngine::mouseCall(uint16 *x, uint16 *y, uint16 *state) {
 	processEvents();
-	Common::EventManager *eventMan = _system->getEventManager();
-	Common::Point pos = eventMan->getMousePos();
+	Common::Point pos = _eventMan->getMousePos();
 	if (pos.x > 298)
 		pos.x = 298;
 	if (pos.x < 15)
@@ -319,7 +317,7 @@ void DreamWebEngine::mouseCall(uint16 *x, uint16 *y, uint16 *state) {
 	*x = pos.x;
 	*y = pos.y;
 
-	unsigned newState = eventMan->getButtonState();
+	unsigned newState = _eventMan->getButtonState();
 	*state = (newState == _oldMouseState? 0 : newState);
 	_oldMouseState = newState;
 }


Commit: 51b724fa43678d33cdbbe8336ae4b0960519c160
    https://github.com/scummvm/scummvm/commit/51b724fa43678d33cdbbe8336ae4b0960519c160
Author: Max Horn (max at quendi.de)
Date: 2011-12-11T01:01:28-08:00

Commit Message:
DREAMWEB: Remove DreamGenContext::closeFile, stop using kHandle

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 0cae9ed..e1d94d6 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -146,6 +146,7 @@ p = parser(skip_binary_data = [
 	'diarygraphic',
 	'diarytext',
 	'title7graphics',
+	'handle',
 	# 'basicsample', # This can't be removed due to tasm-recover limitations
 	'endtextname',
 	'gungraphic',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 77c21ac..c135861 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -1172,7 +1172,7 @@ void DreamGenContext::monkSpeaking() {
 	STACK_CHECK;
 	data.byte(kRoomssample) = 35;
 	loadRoomsSample();
-	dx = 1003;
+	dx = 1001;
 	loadIntoTemp();
 	clearWork();
 	showMonk();
@@ -3220,14 +3220,14 @@ void DreamGenContext::getDestInfo() {
 	push(ax);
 	dx = data;
 	es = dx;
-	si = 1355;
+	si = 1353;
 	_add(si, ax);
 	cl = es.byte(si);
 	ax = pop();
 	push(cx);
 	dx = data;
 	es = dx;
-	si = 1371;
+	si = 1369;
 	_add(si, ax);
 	ax = pop();
 }
@@ -3279,7 +3279,7 @@ clearedlocations:
 	bx = ax;
 	dx = data;
 	es = dx;
-	_add(bx, 1355);
+	_add(bx, 1353);
 	es.byte(bx) = 0;
 }
 
@@ -3315,7 +3315,7 @@ void DreamGenContext::execCommand() {
 	es = cs;
 	bx = offset_comlist;
 	ds = cs;
-	si = 1389;
+	si = 1387;
 	al = ds.byte(si);
 	_cmp(al, 0);
 	if (!flags.z())
@@ -3408,7 +3408,7 @@ dirroot:
 	si = offset_rootdir;
 	_inc(si);
 	es = cs;
-	di = 1212;
+	di = 1210;
 	_inc(di);
 	cx = 12;
 	_movsb(cx, true);
@@ -3510,7 +3510,7 @@ notyetassigned:
 	push(bx);
 	_add(bx, 2);
 	ds = cs;
-	si = 1389;
+	si = 1387;
 checkpass:
 	_lodsw();
 	ah = es.byte(bx);
@@ -3581,7 +3581,7 @@ void DreamGenContext::read() {
 	return;
 okcom:
 	es = cs;
-	di = 1212;
+	di = 1210;
 	ax = data.word(kTextfile1);
 	data.word(kMonsource) = ax;
 	ds = ax;
@@ -3711,7 +3711,7 @@ keyok2:
 	ds = cs;
 	si = offset_operand1+1;
 	es = cs;
-	di = 1212+1;
+	di = 1210+1;
 	cx = 12;
 	_movsb(cx, true);
 	monitorLogo();
@@ -3838,7 +3838,7 @@ void DreamGenContext::parser() {
 	al = '=';
 	_stosb();
 	ds = cs;
-	si = 1389;
+	si = 1387;
 notspace1:
 	_lodsw();
 	_cmp(al, 32);
@@ -5564,7 +5564,7 @@ void DreamGenContext::getNamePos() {
 	_mul(cx);
 	dx = data;
 	es = dx;
-	bx = 1523;
+	bx = 1521;
 	_add(bx, ax);
 	al = data.byte(kCursorpos);
 	ah = 0;
@@ -5660,7 +5660,7 @@ void DreamGenContext::showNames() {
 	STACK_CHECK;
 	dx = data;
 	es = dx;
-	si = 1523+1;
+	si = 1521+1;
 	di = (60)+21;
 	bx = (52)+10;
 	cl = 0;
@@ -5984,7 +5984,7 @@ notalley:
 void DreamGenContext::clearBuffers() {
 	STACK_CHECK;
 	es = data.word(kBuffers);
-	cx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+977-520+68-0)/2;
+	cx = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+975-518+68-0)/2;
 	ax = 0;
 	di = 0;
 	_stosw(cx, true);
@@ -5996,11 +5996,11 @@ void DreamGenContext::clearBuffers() {
 	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)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64));
 	ds = cs;
-	si = 520;
-	cx = (977-520);
+	si = 518;
+	cx = (975-518);
 	_movsb(cx, true);
 	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)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+977-520);
+	di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+975-518);
 	ds = cs;
 	si = 0;
 	cx = (68-0);
@@ -6018,11 +6018,11 @@ void DreamGenContext::clearChanges() {
 	ds = data.word(kBuffers);
 	si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64));
 	es = cs;
-	di = 520;
-	cx = (977-520);
+	di = 518;
+	cx = (975-518);
 	_movsb(cx, true);
 	ds = data.word(kBuffers);
-	si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+977-520);
+	si = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+975-518);
 	es = cs;
 	di = 0;
 	cx = (68-0);
@@ -6036,7 +6036,7 @@ void DreamGenContext::clearChanges() {
 	di = 0;
 	_stosw(cx, true);
 	es = cs;
-	di = 1355;
+	di = 1353;
 	al = 1;
 	_stosb(2);
 	al = 0;
@@ -6271,137 +6271,137 @@ void DreamGenContext::__start() {
 		//0x0130: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0140: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
 		//0x0150: .... .... .... ....
-		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 
 		//0x0160: .... .... .... ....
-		0x00, 0x05, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0170: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0180: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 
 		//0x0190: .... .... .... ....
 		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 		//0x01a0: .... .... .... ....
 		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 		//0x01b0: .... .... .... ....
-		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x01c0: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x01d0: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x01e0: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x01f0: .... .... .... ....
-		0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 
-		//0x0200: .... .... .,.. ....
-		0x01, 0x37, 0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 
-		//0x0210: .7.. .2.. ...J ....
-		0x18, 0x21, 0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 
-		//0x0220: .!.K .... .,.. ....
-		0x01, 0x2c, 0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 
-		//0x0230: .,.` .... .,.v ....
-		0x01, 0x2c, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 
-		//0x0240: .,.. .... ...5 ....
-		0x05, 0x16, 0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 
-		//0x0250: ...( .... ...2 ....
-		0x02, 0x0b, 0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 
+		0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x14, 0x00, 0x02, 0x00, 0x01, 0x01, 0x37, 
+		//0x0200: .... ..., .... ...7
+		0x00, 0x00, 0x00, 0x32, 0x14, 0x00, 0x18, 0x16, 0x00, 0x4a, 0x00, 0x01, 0x00, 0x00, 0x18, 0x21, 
+		//0x0210: ...2 .... .J.. ...!
+		0x0a, 0x4b, 0x00, 0x01, 0x00, 0x01, 0x01, 0x2c, 0x00, 0x1b, 0x00, 0x02, 0x00, 0x02, 0x01, 0x2c, 
+		//0x0220: .K.. ..., .... ...,
+		0x00, 0x60, 0x00, 0x03, 0x00, 0x04, 0x01, 0x2c, 0x00, 0x76, 0x00, 0x02, 0x00, 0x05, 0x01, 0x2c, 
+		//0x0230: .`.. ..., .v.. ...,
+		0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x05, 0x16, 0x14, 0x35, 0x00, 0x03, 0x00, 0x00, 0x05, 0x16, 
+		//0x0240: .... .... .5.. ....
+		0x14, 0x28, 0x00, 0x01, 0x00, 0x02, 0x05, 0x16, 0x14, 0x32, 0x00, 0x01, 0x00, 0x03, 0x02, 0x0b, 
+		//0x0250: .(.. .... .2.. ....
+		0x0a, 0xc0, 0x00, 0x01, 0x00, 0x00, 0x02, 0x0b, 0x0a, 0xb6, 0x00, 0x02, 0x00, 0x01, 0x08, 0x0b, 
 		//0x0260: .... .... .... ....
-		0x08, 0x0b, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 
-		//0x0270: .... .... ..2. ....
-		0x1c, 0x0b, 0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 
-		//0x0280: .... .... ..2+ ....
-		0x17, 0x0b, 0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 
-		//0x0290: ..(. .... ..(z ....
-		0x17, 0x16, 0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 
-		//0x02a0: ..(i .... ..(Q ....
-		0x17, 0x0b, 0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 
-		//0x02b0: ..(. .... ..(. ....
-		0x04, 0x16, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 
-		//0x02c0: .... .... -... ....
-		0x2d, 0x16, 0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 
-		//0x02d0: -..' .... -... ....
-		0x08, 0x16, 0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 
-		//0x02e0: ..(  .... ...@ ....
-		0x16, 0x16, 0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 
-		//0x02f0: ...R .... .... ....
-		0x14, 0x00, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 
-		//0x0300: .... .... .!(. ....
-		0x1d, 0x0b, 0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 
+		0x0a, 0x00, 0x00, 0x02, 0x00, 0x01, 0x17, 0x00, 0x32, 0x00, 0x00, 0x03, 0x00, 0x00, 0x1c, 0x0b, 
+		//0x0270: .... .... 2... ....
+		0x14, 0xfa, 0x00, 0x04, 0x00, 0x00, 0x17, 0x00, 0x32, 0x2b, 0x00, 0x02, 0x00, 0x08, 0x17, 0x0b, 
+		//0x0280: .... .... 2+.. ....
+		0x28, 0x82, 0x00, 0x02, 0x00, 0x01, 0x17, 0x16, 0x28, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x17, 0x16, 
+		//0x0290: (... .... (z.. ....
+		0x28, 0x69, 0x00, 0x02, 0x00, 0x03, 0x17, 0x16, 0x28, 0x51, 0x00, 0x02, 0x00, 0x04, 0x17, 0x0b, 
+		//0x02a0: (i.. .... (Q.. ....
+		0x28, 0x87, 0x00, 0x02, 0x00, 0x05, 0x17, 0x16, 0x28, 0x91, 0x00, 0x02, 0x00, 0x06, 0x04, 0x16, 
+		//0x02b0: (... .... (... ....
+		0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x14, 0x2d, 0x16, 
+		//0x02c0: .... ..-. .... ..-.
+		0x1e, 0x27, 0x00, 0x02, 0x00, 0x00, 0x2d, 0x16, 0x1e, 0x19, 0x00, 0x02, 0x00, 0x00, 0x08, 0x16, 
+		//0x02d0: .'.. ..-. .... ....
+		0x28, 0x20, 0x00, 0x02, 0x00, 0x00, 0x07, 0x0b, 0x14, 0x40, 0x00, 0x02, 0x00, 0x00, 0x16, 0x16, 
+		//0x02e0: ( .. .... . at .. ....
+		0x14, 0x52, 0x00, 0x02, 0x00, 0x00, 0x1b, 0x0b, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x14, 0x00, 
+		//0x02f0: .R.. .... .... ....
+		0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x21, 0x28, 0x15, 0x00, 0x01, 0x00, 0x00, 0x1d, 0x0b, 
+		//0x0300: .... ...! (... ....
+		0x0a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x19, 0x00, 
 		//0x0310: .... .... .... ....
-		0x19, 0x00, 0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 
-		//0x0320: ..2. .... 2..y ....
-		0x32, 0x16, 0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 
-		//0x0330: 2... .... 4... ....
-		0x34, 0x16, 0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 
-		//0x0340: 4... .... 2.(h .7..
-		0x35, 0x21, 0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 
-		//0x0350: 5!.c .... 2.(. ....
-		0x32, 0x16, 0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 
-		//0x0360: 2... .... 4..9 ....
-		0x34, 0x16, 0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 
-		//0x0370: 4... .... 6..H ....
-		0x37, 0x2c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 
-		//0x0380: 7,.. .... .... ....
-		0x0e, 0x16, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 
-		//0x0390: .... .... ..., ....
-		0x0a, 0x16, 0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 
+		0x32, 0x04, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x1e, 0x79, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 
+		//0x0320: 2... ..2. .y.. ..2.
+		0x1e, 0x00, 0x00, 0x14, 0x00, 0x00, 0x34, 0x16, 0x1e, 0xc0, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 
+		//0x0330: .... ..4. .... ..4.
+		0x1e, 0xe9, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x68, 0x00, 0x37, 0x00, 0x00, 0x35, 0x21, 
+		//0x0340: .... ..2. (h.7 ..5!
+		0x00, 0x63, 0x00, 0x02, 0x00, 0x00, 0x32, 0x16, 0x28, 0x00, 0x00, 0x03, 0x00, 0x00, 0x32, 0x16, 
+		//0x0350: .c.. ..2. (... ..2.
+		0x1e, 0xa2, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 0x1e, 0x39, 0x00, 0x02, 0x00, 0x00, 0x34, 0x16, 
+		//0x0360: .... ..4. .9.. ..4.
+		0x1e, 0x00, 0x00, 0x02, 0x00, 0x00, 0x36, 0x00, 0x00, 0x48, 0x00, 0x03, 0x00, 0x00, 0x37, 0x2c, 
+		//0x0370: .... ..6. .H.. ..7,
+		0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x16, 
+		//0x0380: .... .... .... ....
+		0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x0e, 0x16, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x0a, 0x16, 
+		//0x0390: .... .... .,.. ....
+		0x1e, 0xae, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x16, 0x14, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x0b, 
 		//0x03a0: .... .... .... ....
-		0x0b, 0x0b, 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 
-		//0x03b0: .... .2.. .... .2..
-		0x0b, 0x16, 0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 
-		//0x03c0: .... .2.. .!(. .2..
-		0xff, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, 0x39, 0x00, 0x44, 0x52, 
-		//0x03d0: .DRE AMWE B.V9 9.DR
-		0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 
-		//0x03e0: EAMW EB.V OL.D REAM
-		0x57, 0x45, 0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x00, 0x01, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 
-		//0x03f0: WEB. G15. ..EX IT  
-		0x20, 0x20, 0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 
-		//0x0400:      HELP        LI
-		0x53, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 
-		//0x0410: ST        READ     
-		0x20, 0x20, 0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 
-		//0x0420:   LO GON       KEYS
-		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 
-		//0x0430:        .. PUBL IC  
-		0x20, 0x20, 0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 
-		//0x0440:      PUBL IC      .
-		0x00, 0x00, 0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 
-		//0x0450: ..BL ACKD RAGO N RY
-		0x41, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 
-		//0x0460: AN         ... HEND
-		0x52, 0x49, 0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 
-		//0x0470: RIX       LOUI S   
-		0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 
-		//0x0480:    . ..SE PTIM US  
-		0x20, 0x20, 0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 
-		//0x0490:   BE CKET T     ...
-		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 
-		//0x04a0:                 ."R
-		0x4f, 0x4f, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 
-		//0x04b0: OOT          . "   
-		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 
-		//0x04c0:            .00 00.0
-		0x30, 0x00, 0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 
-		//0x04d0: 0... ..$S PEEC HR24
-		0x43, 0x30, 0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 
-		//0x04e0: C000 5.RA W.OB JECT
-		0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
-		//0x04f0:  NAM E ON E        
+		0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x0b, 0x1e, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0b, 0x16, 
+		//0x03b0: ...2 .... ...2 ....
+		0x14, 0x00, 0x00, 0x32, 0x14, 0x00, 0x0e, 0x21, 0x28, 0x00, 0x00, 0x32, 0x14, 0x00, 0xff, 0x44, 
+		//0x03c0: ...2 ...! (..2 ...D
+		0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x39, 0x39, 0x00, 0x44, 0x52, 0x45, 0x41, 
+		//0x03d0: REAM WEB. V99. DREA
+		0x4d, 0x57, 0x45, 0x42, 0x2e, 0x56, 0x4f, 0x4c, 0x00, 0x44, 0x52, 0x45, 0x41, 0x4d, 0x57, 0x45, 
+		//0x03e0: MWEB .VOL .DRE AMWE
+		0x42, 0x2e, 0x47, 0x31, 0x35, 0x00, 0x00, 0x01, 0x45, 0x58, 0x49, 0x54, 0x20, 0x20, 0x20, 0x20, 
+		//0x03f0: B.G1 5... EXIT     
+		0x20, 0x20, 0x48, 0x45, 0x4c, 0x50, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x53, 0x54, 
+		//0x0400:   HE LP        LIST
+		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x41, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
+		//0x0410:        RE AD       
+		0x4c, 0x4f, 0x47, 0x4f, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4b, 0x45, 0x59, 0x53, 0x20, 0x20, 
+		//0x0420: LOGO N      KE YS  
+		0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 
+		//0x0430:      ..PU BLIC     
+		0x20, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 
+		//0x0440:   PU BLIC       ...
+		0x42, 0x4c, 0x41, 0x43, 0x4b, 0x44, 0x52, 0x41, 0x47, 0x4f, 0x4e, 0x20, 0x52, 0x59, 0x41, 0x4e, 
+		//0x0450: BLAC KDRA GON  RYAN
+		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x48, 0x45, 0x4e, 0x44, 0x52, 0x49, 
+		//0x0460:         . ..HE NDRI
+		0x58, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x4f, 0x55, 0x49, 0x53, 0x20, 0x20, 0x20, 0x20, 0x20, 
+		//0x0470: X      LO UIS      
+		0x20, 0x00, 0x00, 0x00, 0x53, 0x45, 0x50, 0x54, 0x49, 0x4d, 0x55, 0x53, 0x20, 0x20, 0x20, 0x20, 
+		//0x0480:  ... SEPT IMUS     
+		0x42, 0x45, 0x43, 0x4b, 0x45, 0x54, 0x54, 0x20, 0x20, 0x20, 0x20, 0x00, 0xff, 0xff, 0x20, 0x20, 
+		//0x0490: BECK ETT     . ..  
+		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x52, 0x4f, 0x4f, 
+		//0x04a0:              . "ROO
+		0x54, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 
+		//0x04b0: T          ."      
+		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x30, 0x30, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 
+		//0x04c0:         . 0000 .00.
+		0x0d, 0x0a, 0x0d, 0x0a, 0x24, 0x53, 0x50, 0x45, 0x45, 0x43, 0x48, 0x52, 0x32, 0x34, 0x43, 0x30, 
+		//0x04d0: .... $SPE ECHR 24C0
+		0x30, 0x30, 0x35, 0x2e, 0x52, 0x41, 0x57, 0x00, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x20, 0x4e, 
+		//0x04e0: 005. RAW. OBJE CT N
+		0x41, 0x4d, 0x45, 0x20, 0x4f, 0x4e, 0x45, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
+		//0x04f0: AME  ONE           
 		0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
 		//0x0500:                    
-		0x20, 0x20, 0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
-		//0x0510:   .. .... .... ....
-		0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 
-		//0x0520: .... .... ...D :...
+		0x00, 0x10, 0x12, 0x12, 0x11, 0x10, 0x10, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		//0x0510: .... .... .... ....
+		0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x44, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		//0x0520: .... .... .D:. ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0530: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 
 		//0x0540: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a, 
 		//0x0550: .... .... .... ....
-		0x01, 0x0a, 0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+		0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0560: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x0570: .... .... .... ....
@@ -6417,23 +6417,23 @@ void DreamGenContext::__start() {
 		//0x05c0: .... .... .... ....
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 		//0x05d0: .... .... .... ....
-		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 
 		//0x05e0: .... .... .... ....
-		0xff, 0xff, 0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0xff, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x05f0: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x0600: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x0610: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x0620: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x0630: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x0640: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 
+		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
 		//0x0650: .... .... .... ....
-		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, };
+		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, };
 	ds.assign(src, src + sizeof(src));
 	dreamweb(); 
 }
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 853d8b4..9d83762 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -32,15 +32,15 @@
 
 namespace DreamGen {
 
-static const uint16 offset_commandline = 0x04ea;
-static const uint16 offset_keys = 0x0436;
-static const uint16 offset_speechfile = 0x04dd;
-static const uint16 offset_rootdir = 0x04ae;
-static const uint16 offset_money1poke = 0x04ca;
-static const uint16 offset_openchangesize = 0x03f8;
-static const uint16 offset_comlist = 0x03fa;
-static const uint16 offset_money2poke = 0x04cf;
-static const uint16 offset_operand1 = 0x04a0;
+static const uint16 offset_commandline = 0x04e8;
+static const uint16 offset_money2poke = 0x04cd;
+static const uint16 offset_speechfile = 0x04db;
+static const uint16 offset_rootdir = 0x04ac;
+static const uint16 offset_keys = 0x0434;
+static const uint16 offset_money1poke = 0x04c8;
+static const uint16 offset_comlist = 0x03f8;
+static const uint16 offset_openchangesize = 0x03f6;
+static const uint16 offset_operand1 = 0x049e;
 static const uint16 kStartvars = 0;
 static const uint16 kProgresspoints = 1;
 static const uint16 kWatchon = 2;
@@ -292,139 +292,138 @@ static const uint16 kTimedoffset = 324;
 static const uint16 kTimedy = 326;
 static const uint16 kTimedx = 327;
 static const uint16 kNeedtodumptimed = 328;
-static const uint16 kHandle = 329;
-static const uint16 kLoadingorsave = 331;
-static const uint16 kCurrentslot = 332;
-static const uint16 kCursorpos = 333;
-static const uint16 kColourpos = 334;
-static const uint16 kFadedirection = 335;
-static const uint16 kNumtofade = 336;
-static const uint16 kFadecount = 337;
-static const uint16 kAddtogreen = 338;
-static const uint16 kAddtored = 339;
-static const uint16 kAddtoblue = 340;
-static const uint16 kLastsoundreel = 341;
-static const uint16 kSoundbuffer = 343;
-static const uint16 kSoundbufferad = 345;
-static const uint16 kSoundbufferpage = 347;
-static const uint16 kSoundtimes = 348;
-static const uint16 kNeedsoundbuff = 349;
-static const uint16 kOldint9seg = 350;
-static const uint16 kOldint9add = 352;
-static const uint16 kOldint8seg = 354;
-static const uint16 kOldint8add = 356;
-static const uint16 kOldsoundintseg = 358;
-static const uint16 kOldsoundintadd = 360;
-static const uint16 kSoundbaseadd = 362;
-static const uint16 kDsp_status = 364;
-static const uint16 kDsp_write = 366;
-static const uint16 kDmaaddress = 368;
-static const uint16 kSoundint = 369;
-static const uint16 kSounddmachannel = 370;
-static const uint16 kSampleplaying = 371;
-static const uint16 kTestresult = 372;
-static const uint16 kCurrentirq = 373;
-static const uint16 kSpeechloaded = 374;
-static const uint16 kSpeechlength = 375;
-static const uint16 kVolume = 377;
-static const uint16 kVolumeto = 378;
-static const uint16 kVolumedirection = 379;
-static const uint16 kVolumecount = 380;
-static const uint16 kPlayblock = 381;
-static const uint16 kWongame = 382;
-static const uint16 kLasthardkey = 383;
-static const uint16 kBufferin = 384;
-static const uint16 kBufferout = 386;
-static const uint16 kExtras = 388;
-static const uint16 kWorkspace = 390;
-static const uint16 kMapstore = 392;
-static const uint16 kCharset1 = 394;
-static const uint16 kBuffers = 396;
-static const uint16 kMainsprites = 398;
-static const uint16 kBackdrop = 400;
-static const uint16 kMapdata = 402;
-static const uint16 kSounddata = 404;
-static const uint16 kSounddata2 = 406;
-static const uint16 kRecordspace = 408;
-static const uint16 kFreedat = 410;
-static const uint16 kSetdat = 412;
-static const uint16 kReel1 = 414;
-static const uint16 kReel2 = 416;
-static const uint16 kReel3 = 418;
-static const uint16 kRoomdesc = 420;
-static const uint16 kFreedesc = 422;
-static const uint16 kSetdesc = 424;
-static const uint16 kBlockdesc = 426;
-static const uint16 kSetframes = 428;
-static const uint16 kFreeframes = 430;
-static const uint16 kPeople = 432;
-static const uint16 kReels = 434;
-static const uint16 kCommandtext = 436;
-static const uint16 kPuzzletext = 438;
-static const uint16 kTraveltext = 440;
-static const uint16 kTempgraphics = 442;
-static const uint16 kTempgraphics2 = 444;
-static const uint16 kTempgraphics3 = 446;
-static const uint16 kTempsprites = 448;
-static const uint16 kTextfile1 = 450;
-static const uint16 kTextfile2 = 452;
-static const uint16 kTextfile3 = 454;
-static const uint16 kBlinkframe = 456;
-static const uint16 kBlinkcount = 457;
-static const uint16 kReasseschanges = 458;
-static const uint16 kPointerspath = 459;
-static const uint16 kManspath = 460;
-static const uint16 kPointerfirstpath = 461;
-static const uint16 kFinaldest = 462;
-static const uint16 kDestination = 463;
-static const uint16 kLinestartx = 464;
-static const uint16 kLinestarty = 466;
-static const uint16 kLineendx = 468;
-static const uint16 kLineendy = 470;
-static const uint16 kIncrement1 = 472;
-static const uint16 kIncrement2 = 474;
-static const uint16 kLineroutine = 476;
-static const uint16 kLinepointer = 477;
-static const uint16 kLinedirection = 478;
-static const uint16 kLinelength = 479;
-static const uint16 kLiftsoundcount = 480;
-static const uint16 kEmmhandle = 481;
-static const uint16 kEmmpageframe = 483;
-static const uint16 kEmmhardwarepage = 485;
-static const uint16 kCh0emmpage = 486;
-static const uint16 kCh0offset = 488;
-static const uint16 kCh0blockstocopy = 490;
-static const uint16 kCh0playing = 492;
-static const uint16 kCh0repeat = 493;
-static const uint16 kCh0oldemmpage = 494;
-static const uint16 kCh0oldoffset = 496;
-static const uint16 kCh0oldblockstocopy = 498;
-static const uint16 kCh1playing = 500;
-static const uint16 kCh1emmpage = 501;
-static const uint16 kCh1offset = 503;
-static const uint16 kCh1blockstocopy = 505;
-static const uint16 kCh1blocksplayed = 507;
-static const uint16 kSoundbufferwrite = 509;
-static const uint16 kSoundemmpage = 511;
-static const uint16 kSpeechemmpage = 513;
-static const uint16 kCurrentsample = 515;
-static const uint16 kRoomssample = 516;
-static const uint16 kGameerror = 517;
-static const uint16 kHowmuchalloc = 518;
-static const uint16 kReelroutines = 520;
-static const uint16 kBasicsample = 977;
-static const uint16 kVolumetabname = 990;
-static const uint16 kMonkface = 1003;
-static const uint16 kCurrentfile = 1212;
-static const uint16 kRoomscango = 1355;
-static const uint16 kRoompics = 1371;
-static const uint16 kOplist = 1386;
-static const uint16 kInputline = 1389;
-static const uint16 kPresslist = 1517;
-static const uint16 kSavenames = 1523;
-static const uint16 kQuitrequested = 1642;
-static const uint16 kSubtitles = 1643;
-static const uint16 kForeignrelease = 1644;
+static const uint16 kLoadingorsave = 329;
+static const uint16 kCurrentslot = 330;
+static const uint16 kCursorpos = 331;
+static const uint16 kColourpos = 332;
+static const uint16 kFadedirection = 333;
+static const uint16 kNumtofade = 334;
+static const uint16 kFadecount = 335;
+static const uint16 kAddtogreen = 336;
+static const uint16 kAddtored = 337;
+static const uint16 kAddtoblue = 338;
+static const uint16 kLastsoundreel = 339;
+static const uint16 kSoundbuffer = 341;
+static const uint16 kSoundbufferad = 343;
+static const uint16 kSoundbufferpage = 345;
+static const uint16 kSoundtimes = 346;
+static const uint16 kNeedsoundbuff = 347;
+static const uint16 kOldint9seg = 348;
+static const uint16 kOldint9add = 350;
+static const uint16 kOldint8seg = 352;
+static const uint16 kOldint8add = 354;
+static const uint16 kOldsoundintseg = 356;
+static const uint16 kOldsoundintadd = 358;
+static const uint16 kSoundbaseadd = 360;
+static const uint16 kDsp_status = 362;
+static const uint16 kDsp_write = 364;
+static const uint16 kDmaaddress = 366;
+static const uint16 kSoundint = 367;
+static const uint16 kSounddmachannel = 368;
+static const uint16 kSampleplaying = 369;
+static const uint16 kTestresult = 370;
+static const uint16 kCurrentirq = 371;
+static const uint16 kSpeechloaded = 372;
+static const uint16 kSpeechlength = 373;
+static const uint16 kVolume = 375;
+static const uint16 kVolumeto = 376;
+static const uint16 kVolumedirection = 377;
+static const uint16 kVolumecount = 378;
+static const uint16 kPlayblock = 379;
+static const uint16 kWongame = 380;
+static const uint16 kLasthardkey = 381;
+static const uint16 kBufferin = 382;
+static const uint16 kBufferout = 384;
+static const uint16 kExtras = 386;
+static const uint16 kWorkspace = 388;
+static const uint16 kMapstore = 390;
+static const uint16 kCharset1 = 392;
+static const uint16 kBuffers = 394;
+static const uint16 kMainsprites = 396;
+static const uint16 kBackdrop = 398;
+static const uint16 kMapdata = 400;
+static const uint16 kSounddata = 402;
+static const uint16 kSounddata2 = 404;
+static const uint16 kRecordspace = 406;
+static const uint16 kFreedat = 408;
+static const uint16 kSetdat = 410;
+static const uint16 kReel1 = 412;
+static const uint16 kReel2 = 414;
+static const uint16 kReel3 = 416;
+static const uint16 kRoomdesc = 418;
+static const uint16 kFreedesc = 420;
+static const uint16 kSetdesc = 422;
+static const uint16 kBlockdesc = 424;
+static const uint16 kSetframes = 426;
+static const uint16 kFreeframes = 428;
+static const uint16 kPeople = 430;
+static const uint16 kReels = 432;
+static const uint16 kCommandtext = 434;
+static const uint16 kPuzzletext = 436;
+static const uint16 kTraveltext = 438;
+static const uint16 kTempgraphics = 440;
+static const uint16 kTempgraphics2 = 442;
+static const uint16 kTempgraphics3 = 444;
+static const uint16 kTempsprites = 446;
+static const uint16 kTextfile1 = 448;
+static const uint16 kTextfile2 = 450;
+static const uint16 kTextfile3 = 452;
+static const uint16 kBlinkframe = 454;
+static const uint16 kBlinkcount = 455;
+static const uint16 kReasseschanges = 456;
+static const uint16 kPointerspath = 457;
+static const uint16 kManspath = 458;
+static const uint16 kPointerfirstpath = 459;
+static const uint16 kFinaldest = 460;
+static const uint16 kDestination = 461;
+static const uint16 kLinestartx = 462;
+static const uint16 kLinestarty = 464;
+static const uint16 kLineendx = 466;
+static const uint16 kLineendy = 468;
+static const uint16 kIncrement1 = 470;
+static const uint16 kIncrement2 = 472;
+static const uint16 kLineroutine = 474;
+static const uint16 kLinepointer = 475;
+static const uint16 kLinedirection = 476;
+static const uint16 kLinelength = 477;
+static const uint16 kLiftsoundcount = 478;
+static const uint16 kEmmhandle = 479;
+static const uint16 kEmmpageframe = 481;
+static const uint16 kEmmhardwarepage = 483;
+static const uint16 kCh0emmpage = 484;
+static const uint16 kCh0offset = 486;
+static const uint16 kCh0blockstocopy = 488;
+static const uint16 kCh0playing = 490;
+static const uint16 kCh0repeat = 491;
+static const uint16 kCh0oldemmpage = 492;
+static const uint16 kCh0oldoffset = 494;
+static const uint16 kCh0oldblockstocopy = 496;
+static const uint16 kCh1playing = 498;
+static const uint16 kCh1emmpage = 499;
+static const uint16 kCh1offset = 501;
+static const uint16 kCh1blockstocopy = 503;
+static const uint16 kCh1blocksplayed = 505;
+static const uint16 kSoundbufferwrite = 507;
+static const uint16 kSoundemmpage = 509;
+static const uint16 kSpeechemmpage = 511;
+static const uint16 kCurrentsample = 513;
+static const uint16 kRoomssample = 514;
+static const uint16 kGameerror = 515;
+static const uint16 kHowmuchalloc = 516;
+static const uint16 kReelroutines = 518;
+static const uint16 kBasicsample = 975;
+static const uint16 kVolumetabname = 988;
+static const uint16 kMonkface = 1001;
+static const uint16 kCurrentfile = 1210;
+static const uint16 kRoomscango = 1353;
+static const uint16 kRoompics = 1369;
+static const uint16 kOplist = 1384;
+static const uint16 kInputline = 1387;
+static const uint16 kPresslist = 1515;
+static const uint16 kSavenames = 1521;
+static const uint16 kQuitrequested = 1640;
+static const uint16 kSubtitles = 1641;
+static const uint16 kForeignrelease = 1642;
 static const uint16 kBlocktextdat = (0);
 static const uint16 kPersonframes = (0);
 static const uint16 kDebuglevel1 = (0);
@@ -463,8 +462,8 @@ static const uint16 kListofchanges = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768
 static const uint16 kUndertimedtext = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
 static const uint16 kRainlist = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30));
 static const uint16 kInitialreelrouts = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64));
-static const uint16 kInitialvars = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+977-520);
-static const uint16 kLengthofbuffer = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+977-520+68-0);
+static const uint16 kInitialvars = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+975-518);
+static const uint16 kLengthofbuffer = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*30)+(6*64)+975-518+68-0);
 static const uint16 kReellist = (0+(36*144));
 static const uint16 kIntext = (0+(38*2));
 static const uint16 kLengthofmap = (0+(66*60));
@@ -516,7 +515,7 @@ static const uint16 kZoomx = (8);
 static const uint16 kInventx = (80);
 static const uint16 kMenux = (80+40);
 static const uint16 kHeaderlen = (96);
-static const uint16 kLenofreelrouts = (977-520);
+static const uint16 kLenofreelrouts = (975-518);
 
 
 class DreamGenContext : public DreamBase, public Context {
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 1c0e635..1ddf54e 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -340,7 +340,7 @@ void DreamGenContext::savePosition(unsigned int slot, const uint8 *descbuf) {
 	engine->writeToSaveFile(data.ptr(kRoomscango, 16), 16);
 
 	engine->writeToSaveFile(data.ptr(kReelroutines, len[5]), len[5]);
-	closeFile();
+	engine->closeFile();
 }
 
 void DreamGenContext::loadPosition(unsigned int slot) {
@@ -379,7 +379,7 @@ void DreamGenContext::loadPosition(unsigned int slot) {
 
 	engine->readFromSaveFile(data.ptr(kReelroutines, len[5]), len[5]);
 
-	closeFile();
+	engine->closeFile();
 }
 
 // Count number of save files, and load their descriptions into kSavenames
@@ -398,14 +398,14 @@ unsigned int DreamGenContext::scanForNames() {
 
 		if (header.len(0) != 17) {
 			::warning("Error loading save: description buffer isn't 17 bytes");
-			closeFile();
+			engine->closeFile();
 			continue;
 		}
 
 		// NB: Only possible if slot < 7
 		engine->readFromSaveFile(data.ptr(kSavenames + 17*slot, 17), 17);
 
-		closeFile();
+		engine->closeFile();
 	}
 
 	al = (uint8)count;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index a4cd72d..1d4a5a0 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -745,14 +745,14 @@ uint8 *DreamBase::textUnder() {
 uint16 DreamGenContext::standardLoad(const char *fileName, uint16 *outSizeInBytes) {
 	FileHeader header;
 
-	engine->openFile(fileName);
-	engine->readFromFile((uint8 *)&header, sizeof(FileHeader));
+	Common::File file;
+	file.open(fileName);
+	file.read((uint8 *)&header, sizeof(FileHeader));
 	uint16 sizeInBytes = header.len(0);
 	if (outSizeInBytes)
 		*outSizeInBytes = sizeInBytes;
 	uint16 result = allocateMem((sizeInBytes + 15) / 16);
-	engine->readFromFile(getSegment(result).ptr(0, 0), sizeInBytes);
-	engine->closeFile();
+	file.read(getSegment(result).ptr(0, 0), sizeInBytes);
 	return result;
 }
 
@@ -819,11 +819,6 @@ void DreamGenContext::quickQuit2() {
 	engine->quit();
 }
 
-void DreamGenContext::closeFile() {
-	engine->closeFile();
-	data.byte(kHandle) = 0;
-}
-
 void DreamGenContext::openForSave(unsigned int slot) {
 	//Common::String filename = ConfMan.getActiveDomainName() + Common::String::format(".d%02d", savegameId);
 	Common::String filename = Common::String::format("DREAMWEB.D%02d", slot);
@@ -2341,8 +2336,6 @@ void DreamGenContext::getRidOfAll() {
 // if skipDat, skip clearing and loading Setdat and Freedat
 void DreamGenContext::loadRoomData(const Room &room, bool skipDat) {
 	engine->openFile(room.name);
-	data.word(kHandle) = 1; //only one handle
-	flags._c = false;
 
 	FileHeader header;
 	engine->readFromFile((uint8 *)&header, sizeof(FileHeader));
@@ -2378,7 +2371,7 @@ void DreamGenContext::loadRoomData(const Room &room, bool skipDat) {
 		engine->skipBytes(len[13]);
 	data.word(kFreedesc) = allocateAndLoad(len[14]);
 
-	closeFile();
+	engine->closeFile();
 }
 
 void DreamGenContext::restoreAll() {
@@ -2394,8 +2387,6 @@ void DreamGenContext::restoreReels() {
 	const Room &room = g_roomData[data.byte(kReallocation)];
 
 	engine->openFile(room.name);
-	data.word(kHandle) = 1; //only one handle
-	flags._c = false;
 
 	FileHeader header;
 	engine->readFromFile((uint8 *)&header, sizeof(FileHeader));
@@ -2413,7 +2404,7 @@ void DreamGenContext::restoreReels() {
 	data.word(kReel2) = allocateAndLoad(len[5]);
 	data.word(kReel3) = allocateAndLoad(len[6]);
 
-	closeFile();
+	engine->closeFile();
 }
 
 void DreamGenContext::loadFolder() {
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6a453eb..58d0ce0 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -532,7 +532,6 @@
 	void selectLocation();
 	void showGroup();
 	void loadSpeech();
-	void closeFile();
 	void getTime();
 	void set16ColPalette();
 	void examineInventory();
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 2a69124..12feb56 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -442,9 +442,10 @@ bool DreamGenContext::pixelCheckSet(const ObjPos *pos, uint8 x, uint8 y) {
 }
 
 void DreamBase::loadPalFromIFF() {
-	engine->openFile("DREAMWEB.PAL");
-	engine->readFromFile(mapStore(), 2000);
-	engine->closeFile();
+	Common::File palFile;
+	palFile.open("DREAMWEB.PAL");
+	palFile.read(mapStore(), 2000);
+	palFile.close();
 
 	const uint8 *src = mapStore() + 0x30;
 	uint8 *dst = mainPalette();


Commit: dfeb31e187118978a665482fb1b147a62f65c35f
    https://github.com/scummvm/scummvm/commit/dfeb31e187118978a665482fb1b147a62f65c35f
Author: Max Horn (max at quendi.de)
Date: 2011-12-11T01:01:28-08:00

Commit Message:
DREAMWEB: Add DreamWebEngine::getSavegameFilename

Changed paths:
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/saveload.cpp
    engines/dreamweb/stubs.cpp



diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index f455643..2e2d993 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -264,6 +264,15 @@ void DreamWebEngine::closeFile() {
 	_outSaveFile = 0;
 }
 
+Common::String DreamWebEngine::getSavegameFilename(int slot) const {
+	// TODO: Are saves from all versions of Dreamweb compatible with each other?
+	// Then we can can consider keeping the filenames as DREAMWEB.Dnn.
+	// Otherwise, this must be changed to be target dependent.
+	//Common::String filename = _targetName + Common::String::format(".d%02d", savegameId);
+	Common::String filename = Common::String::format("DREAMWEB.D%02d", slot);
+	return filename;
+}
+
 void DreamWebEngine::openSaveFileForWriting(const Common::String &name) {
 	processEvents();
 	delete _outSaveFile;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 1d16a18..28ca021 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -104,6 +104,8 @@ public:
 	void getPalette(uint8 *data, uint start, uint count);
 	void setPalette(const uint8 *data, uint start, uint count);
 
+	Common::String getSavegameFilename(int slot) const;
+
 	void openSaveFileForWriting(const Common::String &name);
 	uint writeToSaveFile(const uint8 *data, uint size);
 
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 1ddf54e..ad95f31 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -31,6 +31,18 @@ namespace DreamGen {
 // Temporary storage for loading the room from a savegame
 Room g_madeUpRoomDat;
 
+void DreamGenContext::openForSave(unsigned int slot) {
+	Common::String filename = engine->getSavegameFilename(slot);
+	debug(1, "openForSave(%s)", filename.c_str());
+	engine->openSaveFileForWriting(filename);
+}
+
+bool DreamGenContext::openForLoad(unsigned int slot) {
+	Common::String filename = engine->getSavegameFilename(slot);
+	debug(1, "openForLoad(%s)", filename.c_str());
+	return engine->openSaveFileForReading(filename);
+}
+
 
 void DreamGenContext::loadGame() {
 	if (data.byte(kCommandtype) != 246) {
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 1d4a5a0..388118a 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -819,20 +819,6 @@ void DreamGenContext::quickQuit2() {
 	engine->quit();
 }
 
-void DreamGenContext::openForSave(unsigned int slot) {
-	//Common::String filename = ConfMan.getActiveDomainName() + Common::String::format(".d%02d", savegameId);
-	Common::String filename = Common::String::format("DREAMWEB.D%02d", slot);
-	debug(1, "openForSave(%s)", filename.c_str());
-	engine->openSaveFileForWriting(filename);
-}
-
-bool DreamGenContext::openForLoad(unsigned int slot) {
-	//Common::String filename = ConfMan.getActiveDomainName() + Common::String::format(".d%02d", savegameId);
-	Common::String filename = Common::String::format("DREAMWEB.D%02d", slot);
-	debug(1, "openForLoad(%s)", filename.c_str());
-	return engine->openSaveFileForReading(filename);
-}
-
 void DreamBase::readMouse() {
 	data.word(kOldbutton) = data.word(kMousebutton);
 	uint16 state = readMouseState();


Commit: 3d753794e6c266e7ee7bd1858a6175d34707e140
    https://github.com/scummvm/scummvm/commit/3d753794e6c266e7ee7bd1858a6175d34707e140
Author: Max Horn (max at quendi.de)
Date: 2011-12-11T01:01:28-08:00

Commit Message:
DREAMWEB: Move savefile creation into DreamGenContext::savePosition

Also, make sure the save file is properly finalized before being closed.

Changed paths:
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/saveload.cpp



diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 2e2d993..12fea56 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -51,7 +51,6 @@ DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gam
 	_console = 0;
 	DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag");
 	DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function");
-	_outSaveFile = 0;
 	_inSaveFile = 0;
 	_speed = 1;
 	_turbo = false;
@@ -260,8 +259,6 @@ void DreamWebEngine::closeFile() {
 		_file.close();
 	delete _inSaveFile;
 	_inSaveFile = 0;
-	delete _outSaveFile;
-	_outSaveFile = 0;
 }
 
 Common::String DreamWebEngine::getSavegameFilename(int slot) const {
@@ -273,12 +270,6 @@ Common::String DreamWebEngine::getSavegameFilename(int slot) const {
 	return filename;
 }
 
-void DreamWebEngine::openSaveFileForWriting(const Common::String &name) {
-	processEvents();
-	delete _outSaveFile;
-	_outSaveFile = _saveFileMan->openForSaving(name);
-}
-
 bool DreamWebEngine::openSaveFileForReading(const Common::String &name) {
 	processEvents();
 	delete _inSaveFile;
@@ -286,13 +277,6 @@ bool DreamWebEngine::openSaveFileForReading(const Common::String &name) {
 	return _inSaveFile != 0;
 }
 
-uint DreamWebEngine::writeToSaveFile(const uint8 *data, uint size) {
-	processEvents();
-	if (!_outSaveFile)
-		error("save file was not opened for writing");
-	return _outSaveFile->write(data, size);
-}
-
 uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) {
 	processEvents();
 	if (!_inSaveFile)
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 28ca021..f296f05 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -106,9 +106,6 @@ public:
 
 	Common::String getSavegameFilename(int slot) const;
 
-	void openSaveFileForWriting(const Common::String &name);
-	uint writeToSaveFile(const uint8 *data, uint size);
-
 	bool openSaveFileForReading(const Common::String &name);
 	uint readFromSaveFile(uint8 *data, uint size);
 
@@ -151,7 +148,6 @@ private:
 	Common::RandomSource			_rnd;
 
 	Common::File _file;
-	Common::OutSaveFile *_outSaveFile;
 	Common::InSaveFile *_inSaveFile;
 
 	uint _speed;
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index ad95f31..95dc353 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -31,12 +31,6 @@ namespace DreamGen {
 // Temporary storage for loading the room from a savegame
 Room g_madeUpRoomDat;
 
-void DreamGenContext::openForSave(unsigned int slot) {
-	Common::String filename = engine->getSavegameFilename(slot);
-	debug(1, "openForSave(%s)", filename.c_str());
-	engine->openSaveFileForWriting(filename);
-}
-
 bool DreamGenContext::openForLoad(unsigned int slot) {
 	Common::String filename = engine->getSavegameFilename(slot);
 	debug(1, "openForLoad(%s)", filename.c_str());
@@ -323,7 +317,14 @@ void DreamGenContext::savePosition(unsigned int slot, const uint8 *descbuf) {
 	madeUpRoom.facing = data.byte(kFacing);
 	madeUpRoom.b27 = 255;
 
-	openForSave(slot);
+
+	engine->processEvents();	// TODO: Is this necessary?
+
+	Common::String filename = engine->getSavegameFilename(slot);
+	debug(1, "openForSave(%s)", filename.c_str());
+	Common::OutSaveFile *outSaveFile = engine->getSaveFileManager()->openForSaving(filename);
+	if (!outSaveFile)	// TODO: Do proper error handling!
+		error("save could not be opened for writing");
 
 	// Initialize new header
 	FileHeader header;
@@ -341,18 +342,25 @@ void DreamGenContext::savePosition(unsigned int slot, const uint8 *descbuf) {
 	for (int i = 0; i < 6; ++i)
 		header.setLen(i, len[i]);
 
-	engine->writeToSaveFile((const uint8 *)&header, sizeof(FileHeader));
-	engine->writeToSaveFile(descbuf, len[0]);
-	engine->writeToSaveFile(data.ptr(kStartvars, len[1]), len[1]);
-	engine->writeToSaveFile(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]);
-	engine->writeToSaveFile(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
+	outSaveFile->write((const uint8 *)&header, sizeof(FileHeader));
+	outSaveFile->write(descbuf, len[0]);
+	outSaveFile->write(data.ptr(kStartvars, len[1]), len[1]);
+	outSaveFile->write(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]);
+	outSaveFile->write(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
 
 	// len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango'
-	engine->writeToSaveFile((const uint8 *)&madeUpRoom, sizeof(Room));
-	engine->writeToSaveFile(data.ptr(kRoomscango, 16), 16);
+	outSaveFile->write((const uint8 *)&madeUpRoom, sizeof(Room));
+	outSaveFile->write(data.ptr(kRoomscango, 16), 16);
 
-	engine->writeToSaveFile(data.ptr(kReelroutines, len[5]), len[5]);
-	engine->closeFile();
+	outSaveFile->write(data.ptr(kReelroutines, len[5]), len[5]);
+
+	outSaveFile->finalize();
+	if (outSaveFile->err()) {
+		// TODO: Do proper error handling
+		warning("an error occurred while writing the savegame");
+	}
+
+	delete outSaveFile;
 }
 
 void DreamGenContext::loadPosition(unsigned int slot) {


Commit: 6b226d5943b61e700a8ec7a3099c99f654f13b89
    https://github.com/scummvm/scummvm/commit/6b226d5943b61e700a8ec7a3099c99f654f13b89
Author: Max Horn (max at quendi.de)
Date: 2011-12-11T01:02:50-08:00

Commit Message:
DREAMWEB: Do savefile reading directly in loadPosition() / scanForNames()

Changed paths:
    engines/dreamweb/dreamweb.cpp
    engines/dreamweb/dreamweb.h
    engines/dreamweb/saveload.cpp
    engines/dreamweb/stubs.h



diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 12fea56..b4fc1b7 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -232,6 +232,9 @@ void DreamWebEngine::openFile(const Common::String &name) {
 	closeFile();
 	if (_file.open(name))
 		return;
+	// File not found? See if there is a save state with this name
+	// FIXME: Is this really needed? If yes, document why; if not,
+	// remove all traces of _inSaveFile.
 	_inSaveFile = _saveFileMan->openForLoading(name);
 	if (_inSaveFile)
 		return;
@@ -270,20 +273,6 @@ Common::String DreamWebEngine::getSavegameFilename(int slot) const {
 	return filename;
 }
 
-bool DreamWebEngine::openSaveFileForReading(const Common::String &name) {
-	processEvents();
-	delete _inSaveFile;
-	_inSaveFile = _saveFileMan->openForLoading(name);
-	return _inSaveFile != 0;
-}
-
-uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) {
-	processEvents();
-	if (!_inSaveFile)
-		error("save file was not opened for reading");
-	return _inSaveFile->read(data, size);
-}
-
 void DreamWebEngine::keyPressed(uint16 ascii) {
 	debug(2, "key pressed = %04x", ascii);
 	uint16 in = (_base.data.word(DreamGen::kBufferin) + 1) & 0x0f;
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index f296f05..7ff0005 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -106,9 +106,6 @@ public:
 
 	Common::String getSavegameFilename(int slot) const;
 
-	bool openSaveFileForReading(const Common::String &name);
-	uint readFromSaveFile(uint8 *data, uint size);
-
 	void setShakePos(int pos) { _system->setShakePos(pos); }
 	void printUnderMonitor();
 
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 95dc353..40b6451 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -31,13 +31,6 @@ namespace DreamGen {
 // Temporary storage for loading the room from a savegame
 Room g_madeUpRoomDat;
 
-bool DreamGenContext::openForLoad(unsigned int slot) {
-	Common::String filename = engine->getSavegameFilename(slot);
-	debug(1, "openForLoad(%s)", filename.c_str());
-	return engine->openSaveFileForReading(filename);
-}
-
-
 void DreamGenContext::loadGame() {
 	if (data.byte(kCommandtype) != 246) {
 		data.byte(kCommandtype) = 246;
@@ -321,7 +314,7 @@ void DreamGenContext::savePosition(unsigned int slot, const uint8 *descbuf) {
 	engine->processEvents();	// TODO: Is this necessary?
 
 	Common::String filename = engine->getSavegameFilename(slot);
-	debug(1, "openForSave(%s)", filename.c_str());
+	debug(1, "savePosition: slot %d filename %s", slot, filename.c_str());
 	Common::OutSaveFile *outSaveFile = engine->getSaveFileManager()->openForSaving(filename);
 	if (!outSaveFile)	// TODO: Do proper error handling!
 		error("save could not be opened for writing");
@@ -367,11 +360,15 @@ void DreamGenContext::loadPosition(unsigned int slot) {
 	data.word(kTimecount) = 0;
 	clearChanges();
 
-	openForLoad(slot);
+	Common::String filename = engine->getSavegameFilename(slot);
+	debug(1, "loadPosition: slot %d filename %s", slot, filename.c_str());
+	Common::InSaveFile *inSaveFile = engine->getSaveFileManager()->openForLoading(filename);
+	if (!inSaveFile)	// TODO: Do proper error handling!
+		error("save could not be opened for reading");
 
 	FileHeader header;
 
-	engine->readFromSaveFile((uint8 *)&header, sizeof(FileHeader));
+	inSaveFile->read((uint8 *)&header, sizeof(FileHeader));
 
 	// read segment lengths from savegame file header
 	int len[6];
@@ -381,25 +378,25 @@ void DreamGenContext::loadPosition(unsigned int slot) {
 		::error("Error loading save: description buffer isn't 17 bytes");
 
 	if (slot < 7) {
-		engine->readFromSaveFile(data.ptr(kSavenames + 17*slot, len[0]), len[0]);
+		inSaveFile->read(data.ptr(kSavenames + 17*slot, len[0]), len[0]);
 	} else {
 		// The savenames buffer only has room for 7 descriptions
 		uint8 namebuf[17];
-		engine->readFromSaveFile(namebuf, 17);
+		inSaveFile->read(namebuf, 17);
 	}
-	engine->readFromSaveFile(data.ptr(kStartvars, len[1]), len[1]);
-	engine->readFromSaveFile(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]);
-	engine->readFromSaveFile(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
+	inSaveFile->read(data.ptr(kStartvars, len[1]), len[1]);
+	inSaveFile->read(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]);
+	inSaveFile->read(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
 
 	// len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango'
 	// Note: the values read into g_madeUpRoomDat are only used in actualLoad,
 	// which is (almost) immediately called after this function
-	engine->readFromSaveFile((uint8 *)&g_madeUpRoomDat, sizeof(Room));
-	engine->readFromSaveFile(data.ptr(kRoomscango, 16), 16);
+	inSaveFile->read((uint8 *)&g_madeUpRoomDat, sizeof(Room));
+	inSaveFile->read(data.ptr(kRoomscango, 16), 16);
 
-	engine->readFromSaveFile(data.ptr(kReelroutines, len[5]), len[5]);
+	inSaveFile->read(data.ptr(kReelroutines, len[5]), len[5]);
 
-	engine->closeFile();
+	delete inSaveFile;
 }
 
 // Count number of save files, and load their descriptions into kSavenames
@@ -408,24 +405,28 @@ unsigned int DreamGenContext::scanForNames() {
 
 	FileHeader header;
 
+	// TODO: Change this to use SaveFileManager::listSavefiles()
 	for (unsigned int slot = 0; slot < 7; ++slot) {
-
-		if (!openForLoad(slot)) continue;
+		// Try opening savegame with the given slot id
+		Common::String filename = engine->getSavegameFilename(slot);
+		Common::InSaveFile *inSaveFile = engine->getSaveFileManager()->openForLoading(filename);
+		if (!inSaveFile)
+			continue;
 
 		++count;
 
-		engine->readFromSaveFile((uint8 *)&header, sizeof(FileHeader));
+		inSaveFile->read((uint8 *)&header, sizeof(FileHeader));
 
 		if (header.len(0) != 17) {
 			::warning("Error loading save: description buffer isn't 17 bytes");
-			engine->closeFile();
+			delete inSaveFile;
 			continue;
 		}
 
 		// NB: Only possible if slot < 7
-		engine->readFromSaveFile(data.ptr(kSavenames + 17*slot, 17), 17);
+		inSaveFile->read(data.ptr(kSavenames + 17*slot, 17), 17);
 
-		engine->closeFile();
+		delete inSaveFile;
 	}
 
 	al = (uint8)count;
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 58d0ce0..5d99e23 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -306,8 +306,6 @@
 	void actualLoad();
 	void loadPosition(unsigned int slot);
 	void savePosition(unsigned int slot, const uint8 *descbuf);
-	void openForSave(unsigned int slot);
-	bool openForLoad(unsigned int slot);
 	uint16 allocateAndLoad(unsigned int size);
 	void clearAndLoad(uint8 *buf, uint8 c, unsigned int size, unsigned int maxSize);
 	void clearAndLoad(uint16 seg, uint8 c, unsigned int size, unsigned int maxSize);


Commit: 36b8a60eda5db6a9b3597a00ac9184eb608b9ae9
    https://github.com/scummvm/scummvm/commit/36b8a60eda5db6a9b3597a00ac9184eb608b9ae9
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-11T01:14:06-08:00

Commit Message:
DREAMWEB: Properly fix workoutFrames regression

Changed paths:
    engines/dreamweb/pathfind.cpp



diff --git a/engines/dreamweb/pathfind.cpp b/engines/dreamweb/pathfind.cpp
index bd7412f..f6591d4 100644
--- a/engines/dreamweb/pathfind.cpp
+++ b/engines/dreamweb/pathfind.cpp
@@ -278,17 +278,17 @@ void DreamBase::bresenhams() {
 
 void DreamBase::workoutFrames() {
 	byte tmp;
-	uint16 diffx, diffy;
+	int diffx, diffy;
 
 	// We have to use signed arithmetic here because these values can
 	// be slightly negative when walking off-screen
-	int lineStartX = data.word(kLinestartx);
-	int lineStartY = data.word(kLinestarty);
-	int lineEndX = data.word(kLineendx);
-	int lineEndY = data.word(kLineendy);
+	int lineStartX = (int16)data.word(kLinestartx);
+	int lineStartY = (int16)data.word(kLinestarty);
+	int lineEndX = (int16)data.word(kLineendx);
+	int lineEndY = (int16)data.word(kLineendy);
 
 
-	diffx = ABS(lineStartX -lineEndX);
+	diffx = ABS(lineStartX - lineEndX);
 	diffy = ABS(lineStartY - lineEndY);
 
 	if (diffx < diffy) {






More information about the Scummvm-git-logs mailing list