[Scummvm-git-logs] scummvm master -> 177206cc2efba4a2991f29f67a2d4f68d2bcc899

waltervn walter at vanniftrik-it.nl
Sun Aug 28 18:38:04 CEST 2016


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

Summary:
9dc3c78827 ADL: Load hires4 messages
90d2dd3b40 ADL: Load hires4 global pictures
70cd57892a ADL: Fix item description in debug output
177206cc2e ADL: Load hires4 commands and item pictures


Commit: 9dc3c78827995e214db9b94d19727f893d2f40ec
    https://github.com/scummvm/scummvm/commit/9dc3c78827995e214db9b94d19727f893d2f40ec
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-28T18:20:14+02:00

Commit Message:
ADL: Load hires4 messages

Changed paths:
    engines/adl/adl_v2.cpp
    engines/adl/adl_v2.h
    engines/adl/hires0.cpp
    engines/adl/hires2.cpp
    engines/adl/hires4.cpp
    engines/adl/hires4.h
    engines/adl/hires6.cpp



diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index 307bf98..c251433 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -414,6 +414,11 @@ void AdlEngine_v2::loadRooms(Common::SeekableReadStream &stream, byte count) {
 		error("Error loading rooms");
 }
 
+void AdlEngine_v2::loadMessages(Common::SeekableReadStream &stream, byte count) {
+	for (uint i = 0; i < count; ++i)
+		_messages.push_back(readDataBlockPtr(stream));
+}
+
 int AdlEngine_v2::o2_isFirstTime(ScriptEnv &e) {
 	OP_DEBUG_0("\t&& IS_FIRST_TIME()");
 
diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index 5430085..c2dd7f8 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -55,6 +55,7 @@ protected:
 	virtual void adjustDataBlockPtr(byte &track, byte &sector, byte &offset, byte &size) const { }
 	void loadItems(Common::SeekableReadStream &stream);
 	void loadRooms(Common::SeekableReadStream &stream, byte count);
+	void loadMessages(Common::SeekableReadStream &stream, byte count);
 
 	void checkTextOverflow(char c);
 
diff --git a/engines/adl/hires0.cpp b/engines/adl/hires0.cpp
index e6ff0bd..34a1b26 100644
--- a/engines/adl/hires0.cpp
+++ b/engines/adl/hires0.cpp
@@ -37,12 +37,10 @@ void HiRes0Engine::init() {
 
 	_disk->setSectorLimit(13);
 
-	StreamPtr stream(_disk->createReadStream(0x1f, 0x2, 0x00, 2));
-
 	// TODO: all these strings/offsets/etc are the same as hires2
 
-	for (uint i = 0; i < IDI_HR0_NUM_MESSAGES; ++i)
-		_messages.push_back(readDataBlockPtr(*stream));
+	StreamPtr stream(_disk->createReadStream(0x1f, 0x2, 0x00, 2));
+	loadMessages(*stream, IDI_HR0_NUM_MESSAGES);
 
 	// Read parser messages
 	stream.reset(_disk->createReadStream(0x1a, 0x1));
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index b662142..e9ca86f 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -63,9 +63,7 @@ void HiRes2Engine::init() {
 	_disk->setSectorLimit(13);
 
 	StreamPtr stream(_disk->createReadStream(0x1f, 0x2, 0x00, 4));
-
-	for (uint i = 0; i < IDI_HR2_NUM_MESSAGES; ++i)
-		_messages.push_back(readDataBlockPtr(*stream));
+	loadMessages(*stream, IDI_HR2_NUM_MESSAGES);
 
 	// Read parser messages
 	stream.reset(_disk->createReadStream(0x1a, 0x1));
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
index 312cce6..41bbd95 100644
--- a/engines/adl/hires4.cpp
+++ b/engines/adl/hires4.cpp
@@ -45,7 +45,24 @@ void HiRes4Engine::init() {
 	if (!_boot->open(getDiskImageName(0)))
 		error("Failed to open disk image '%s'", getDiskImageName(0));
 
-	StreamPtr stream(createReadStream(_boot, 0x06, 0xd, 0x12, 2));
+	_disk = new DiskImage();
+	if (!_disk->open(getDiskImageName(1)))
+		error("Failed to open disk image '%s'", getDiskImageName(1));
+
+	loadCommonData();
+
+	StreamPtr stream(createReadStream(_boot, 0x06, 0x2));
+	_strings.verbError = readStringAt(*stream, 0x4f);
+	_strings.nounError = readStringAt(*stream, 0x83);
+	_strings.enterCommand = readStringAt(*stream, 0xa6);
+
+	_messageIds.cantGoThere = IDI_HR4_MSG_CANT_GO_THERE;
+	_messageIds.dontUnderstand = IDI_HR4_MSG_DONT_UNDERSTAND;
+	_messageIds.itemDoesntMove = IDI_HR4_MSG_ITEM_DOESNT_MOVE;
+	_messageIds.itemNotHere = IDI_HR4_MSG_ITEM_NOT_HERE;
+	_messageIds.thanksForPlaying = IDI_HR4_MSG_THANKS_FOR_PLAYING;
+
+	stream.reset(createReadStream(_boot, 0x06, 0xd, 0x12, 2));
 	loadItemDescriptions(*stream, IDI_HR4_NUM_ITEM_DESCS);
 
 	stream.reset(createReadStream(_boot, 0x05, 0x4, 0x00, 3));
@@ -55,6 +72,22 @@ void HiRes4Engine::init() {
 	loadWords(*stream, _nouns, _priNouns);
 }
 
+Common::String HiRes4Engine::formatVerbError(const Common::String &verb) const {
+	Common::String err = _strings.verbError;
+	for (uint i = 0; i < verb.size(); ++i)
+		err.setChar(verb[i], i + 8);
+	return err;
+}
+
+Common::String HiRes4Engine::formatNounError(const Common::String &verb, const Common::String &noun) const {
+	Common::String err = _strings.nounError;
+	for (uint i = 0; i < verb.size(); ++i)
+		err.setChar(verb[i], i + 8);
+	for (uint i = 0; i < noun.size(); ++i)
+		err.setChar(noun[i], i + 19);
+	return err;
+}
+
 void HiRes4Engine::goToSideC() {
 	delete _disk;
 
@@ -63,19 +96,24 @@ void HiRes4Engine::goToSideC() {
 		error("Failed to open disk image '%s'", getDiskImageName(2));
 
 	// As room.data is bound to the DiskImage, we need to rebind them here
-	StreamPtr stream(createReadStream(_boot, 0x03, 0x1, 0x0e, 17));
+	StreamPtr stream(createReadStream(_boot, 0x03, 0x1, 0x0e, 9));
 	for (uint i = 0; i < IDI_HR4_NUM_ROOMS; ++i) {
 		stream->skip(7);
 		_state.rooms[i].data = readDataBlockPtr(*stream);
 		stream->skip(3);
 	}
+
+	// Rebind data that is on both side B and C
+	loadCommonData();
 }
 
-void HiRes4Engine::initGameState() {
-	_disk = new DiskImage();
-	if (!_disk->open(getDiskImageName(1)))
-		error("Failed to open disk image '%s'", getDiskImageName(1));
+void HiRes4Engine::loadCommonData() {
+	_messages.clear();
+	StreamPtr stream(createReadStream(_boot, 0x0a, 0x4, 0x00, 3));
+	loadMessages(*stream, IDI_HR4_NUM_MESSAGES);
+}
 
+void HiRes4Engine::initGameState() {
 	_state.vars.resize(IDI_HR4_NUM_VARS);
 
 	StreamPtr stream(createReadStream(_boot, 0x03, 0x1, 0x0e, 9));
diff --git a/engines/adl/hires4.h b/engines/adl/hires4.h
index b522657..1d21e0c 100644
--- a/engines/adl/hires4.h
+++ b/engines/adl/hires4.h
@@ -30,9 +30,17 @@
 namespace Adl {
 
 #define IDI_HR4_NUM_ROOMS 164
+#define IDI_HR4_NUM_MESSAGES 255
 #define IDI_HR4_NUM_VARS 40
 #define IDI_HR4_NUM_ITEM_DESCS 44
 
+// Messages used outside of scripts
+#define IDI_HR4_MSG_CANT_GO_THERE      110
+#define IDI_HR4_MSG_DONT_UNDERSTAND    112
+#define IDI_HR4_MSG_ITEM_DOESNT_MOVE   114
+#define IDI_HR4_MSG_ITEM_NOT_HERE      115
+#define IDI_HR4_MSG_THANKS_FOR_PLAYING 113
+
 class HiRes4Engine : public AdlEngine_v3 {
 public:
 	~HiRes4Engine();
@@ -43,8 +51,11 @@ protected:
 	// AdlEngine
 	void init();
 	void initGameState();
+	Common::String formatVerbError(const Common::String &verb) const;
+	Common::String formatNounError(const Common::String &verb, const Common::String &noun) const;
 
 	Common::SeekableReadStream *createReadStream(DiskImage *disk, byte track, byte sector, byte offset = 0, byte size = 0) const;
+	void loadCommonData();
 	void goToSideC();
 	virtual const char *getDiskImageName(byte index) const = 0;
 
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp
index 553729d..756ead9 100644
--- a/engines/adl/hires6.cpp
+++ b/engines/adl/hires6.cpp
@@ -213,8 +213,7 @@ void HiRes6Engine::loadDisk(byte disk) {
 			// Messages
 			_messages.clear();
 			uint count = size / 4;
-			for (uint i = 0; i < count; ++i)
-				_messages.push_back(readDataBlockPtr(*stream));
+			loadMessages(*stream, count);
 			break;
 		}
 		case 0x4a80: {


Commit: 90d2dd3b4085a4864889e5eb2d005199c6769819
    https://github.com/scummvm/scummvm/commit/90d2dd3b4085a4864889e5eb2d005199c6769819
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-28T18:20:14+02:00

Commit Message:
ADL: Load hires4 global pictures

Changed paths:
    engines/adl/adl_v2.cpp
    engines/adl/adl_v2.h
    engines/adl/hires0.cpp
    engines/adl/hires2.cpp
    engines/adl/hires4.cpp
    engines/adl/hires6.cpp



diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index c251433..ae4c2d8 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -419,6 +419,16 @@ void AdlEngine_v2::loadMessages(Common::SeekableReadStream &stream, byte count)
 		_messages.push_back(readDataBlockPtr(stream));
 }
 
+void AdlEngine_v2::loadPictures(Common::SeekableReadStream &stream) {
+	byte picNr;
+	while ((picNr = stream.readByte()) != 0xff) {
+		if (stream.eos() || stream.err())
+			error("Error reading global pic list");
+
+		_pictures[picNr] = readDataBlockPtr(stream);
+	}
+}
+
 int AdlEngine_v2::o2_isFirstTime(ScriptEnv &e) {
 	OP_DEBUG_0("\t&& IS_FIRST_TIME()");
 
diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index c2dd7f8..4136afb 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -56,6 +56,7 @@ protected:
 	void loadItems(Common::SeekableReadStream &stream);
 	void loadRooms(Common::SeekableReadStream &stream, byte count);
 	void loadMessages(Common::SeekableReadStream &stream, byte count);
+	void loadPictures(Common::SeekableReadStream &stream);
 
 	void checkTextOverflow(char c);
 
diff --git a/engines/adl/hires0.cpp b/engines/adl/hires0.cpp
index 34a1b26..1c18123 100644
--- a/engines/adl/hires0.cpp
+++ b/engines/adl/hires0.cpp
@@ -73,13 +73,7 @@ void HiRes0Engine::init() {
 
 	// Load global picture data
 	stream.reset(_disk->createReadStream(0x19, 0xa, 0x80, 0));
-	byte picNr;
-	while ((picNr = stream->readByte()) != 0xff) {
-		if (stream->eos() || stream->err())
-			error("Error reading global pic list");
-
-		_pictures[picNr] = readDataBlockPtr(*stream);
-	}
+	loadPictures(*stream);
 
 	// Load item picture data
 	stream.reset(_disk->createReadStream(0x1e, 0x9, 0x05));
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index e9ca86f..69e7e74 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -96,13 +96,7 @@ void HiRes2Engine::init() {
 
 	// Load global picture data
 	stream.reset(_disk->createReadStream(0x19, 0xa, 0x80, 0));
-	byte picNr;
-	while ((picNr = stream->readByte()) != 0xff) {
-		if (stream->eos() || stream->err())
-			error("Error reading global pic list");
-
-		_pictures[picNr] = readDataBlockPtr(*stream);
-	}
+	loadPictures(*stream);
 
 	// Load item picture data
 	stream.reset(_disk->createReadStream(0x1e, 0x9, 0x05));
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
index 41bbd95..7d20457 100644
--- a/engines/adl/hires4.cpp
+++ b/engines/adl/hires4.cpp
@@ -96,6 +96,10 @@ void HiRes4Engine::goToSideC() {
 		error("Failed to open disk image '%s'", getDiskImageName(2));
 
 	// As room.data is bound to the DiskImage, we need to rebind them here
+	// We cannot simply reload the rooms as that would reset their state
+
+	// FIXME: Remove DataBlockPtr-DiskImage coupling?
+
 	StreamPtr stream(createReadStream(_boot, 0x03, 0x1, 0x0e, 9));
 	for (uint i = 0; i < IDI_HR4_NUM_ROOMS; ++i) {
 		stream->skip(7);
@@ -111,6 +115,10 @@ void HiRes4Engine::loadCommonData() {
 	_messages.clear();
 	StreamPtr stream(createReadStream(_boot, 0x0a, 0x4, 0x00, 3));
 	loadMessages(*stream, IDI_HR4_NUM_MESSAGES);
+
+	_pictures.clear();
+	stream.reset(createReadStream(_boot, 0x05, 0xe, 0x80));
+	loadPictures(*stream);
 }
 
 void HiRes4Engine::initGameState() {
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp
index 756ead9..c2843ea 100644
--- a/engines/adl/hires6.cpp
+++ b/engines/adl/hires6.cpp
@@ -219,12 +219,7 @@ void HiRes6Engine::loadDisk(byte disk) {
 		case 0x4a80: {
 			// Global pics
 			_pictures.clear();
-			byte picNr;
-			while ((picNr = stream->readByte()) != 0xff) {
-				if (stream->eos() || stream->err())
-					error("Error reading global pic list");
-				_pictures[picNr] = readDataBlockPtr(*stream);
-			}
+			loadPictures(*stream);
 			break;
 		}
 		case 0x4000:


Commit: 70cd57892abebba705c41ad995632dcd6fafd32c
    https://github.com/scummvm/scummvm/commit/70cd57892abebba705c41ad995632dcd6fafd32c
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-28T18:20:14+02:00

Commit Message:
ADL: Fix item description in debug output

Changed paths:
    engines/adl/adl.cpp



diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index 1959560..8135d40 100644
--- a/engines/adl/adl.cpp
+++ b/engines/adl/adl.cpp
@@ -1263,16 +1263,17 @@ Common::String AdlEngine::toAscii(const Common::String &str) {
 }
 
 Common::String AdlEngine::itemStr(uint i) const {
-	byte desc = getItem(i).description;
-	byte noun = getItem(i).noun;
+	const Item &item(getItem(i));
+
 	Common::String name = Common::String::format("%d", i);
-	if (noun > 0) {
+	if (item.noun > 0) {
 		name += "/";
-		name += _priNouns[noun - 1];
+		name += _priNouns[item.noun - 1];
 	}
-	if (desc > 0) {
+	Common::String desc = getItemDescription(item);
+	if (!desc.empty()) {
 		name += "/";
-		name += toAscii(loadMessage(desc));
+		name += toAscii(desc);
 	}
 	return name;
 }


Commit: 177206cc2efba4a2991f29f67a2d4f68d2bcc899
    https://github.com/scummvm/scummvm/commit/177206cc2efba4a2991f29f67a2d4f68d2bcc899
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-28T18:20:14+02:00

Commit Message:
ADL: Load hires4 commands and item pictures

Changed paths:
    engines/adl/adl_v2.cpp
    engines/adl/adl_v2.h
    engines/adl/disk.cpp
    engines/adl/hires0.cpp
    engines/adl/hires2.cpp
    engines/adl/hires4.cpp
    engines/adl/hires4.h
    engines/adl/hires6.cpp



diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index ae4c2d8..4522591 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -429,6 +429,13 @@ void AdlEngine_v2::loadPictures(Common::SeekableReadStream &stream) {
 	}
 }
 
+void AdlEngine_v2::loadItemPictures(Common::SeekableReadStream &stream, byte count) {
+	for (uint i = 0; i < count; ++i) {
+		stream.readByte(); // number
+		_itemPics.push_back(readDataBlockPtr(stream));
+	}
+}
+
 int AdlEngine_v2::o2_isFirstTime(ScriptEnv &e) {
 	OP_DEBUG_0("\t&& IS_FIRST_TIME()");
 
diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index 4136afb..85c7544 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -57,6 +57,7 @@ protected:
 	void loadRooms(Common::SeekableReadStream &stream, byte count);
 	void loadMessages(Common::SeekableReadStream &stream, byte count);
 	void loadPictures(Common::SeekableReadStream &stream);
+	void loadItemPictures(Common::SeekableReadStream &stream, byte count);
 
 	void checkTextOverflow(char c);
 
diff --git a/engines/adl/disk.cpp b/engines/adl/disk.cpp
index 6a5cf0b..d429556 100644
--- a/engines/adl/disk.cpp
+++ b/engines/adl/disk.cpp
@@ -265,7 +265,7 @@ Common::SeekableReadStream *DiskImage::createReadStream(uint track, uint sector,
 			bytesRemInTrack = bytesToRead - dataOffset;
 
 		if (_stream->read(data + dataOffset, bytesRemInTrack) < bytesRemInTrack)
-			error("Error reading disk image");
+			error("Error reading disk image at track %d; sector %d", track, sector);
 
 		++track;
 
diff --git a/engines/adl/hires0.cpp b/engines/adl/hires0.cpp
index 1c18123..d5f7ab5 100644
--- a/engines/adl/hires0.cpp
+++ b/engines/adl/hires0.cpp
@@ -77,10 +77,7 @@ void HiRes0Engine::init() {
 
 	// Load item picture data
 	stream.reset(_disk->createReadStream(0x1e, 0x9, 0x05));
-	for (uint i = 0; i < IDI_HR0_NUM_ITEM_PICS; ++i) {
-		stream->readByte(); // number
-		_itemPics.push_back(readDataBlockPtr(*stream));
-	}
+	loadItemPictures(*stream, IDI_HR0_NUM_ITEM_PICS);
 
 	// Load commands from executable
 	stream.reset(_disk->createReadStream(0x1d, 0x7, 0x00, 2));
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index 69e7e74..25a3bba 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -100,10 +100,7 @@ void HiRes2Engine::init() {
 
 	// Load item picture data
 	stream.reset(_disk->createReadStream(0x1e, 0x9, 0x05));
-	for (uint i = 0; i < IDI_HR2_NUM_ITEM_PICS; ++i) {
-		stream->readByte(); // number
-		_itemPics.push_back(readDataBlockPtr(*stream));
-	}
+	loadItemPictures(*stream, IDI_HR2_NUM_ITEM_PICS);
 
 	// Load commands from executable
 	stream.reset(_disk->createReadStream(0x1d, 0x7, 0x00, 4));
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
index 7d20457..ae04a66 100644
--- a/engines/adl/hires4.cpp
+++ b/engines/adl/hires4.cpp
@@ -45,9 +45,7 @@ void HiRes4Engine::init() {
 	if (!_boot->open(getDiskImageName(0)))
 		error("Failed to open disk image '%s'", getDiskImageName(0));
 
-	_disk = new DiskImage();
-	if (!_disk->open(getDiskImageName(1)))
-		error("Failed to open disk image '%s'", getDiskImageName(1));
+	insertDisk(1);
 
 	loadCommonData();
 
@@ -65,6 +63,12 @@ void HiRes4Engine::init() {
 	stream.reset(createReadStream(_boot, 0x06, 0xd, 0x12, 2));
 	loadItemDescriptions(*stream, IDI_HR4_NUM_ITEM_DESCS);
 
+	stream.reset(createReadStream(_boot, 0x08, 0xe, 0xa5, 5));
+	readCommands(*stream, _roomCommands);
+
+	stream.reset(createReadStream(_boot, 0x0a, 0x9, 0x00, 3));
+	readCommands(*stream, _globalCommands);
+
 	stream.reset(createReadStream(_boot, 0x05, 0x4, 0x00, 3));
 	loadWords(*stream, _verbs, _priVerbs);
 
@@ -72,6 +76,31 @@ void HiRes4Engine::init() {
 	loadWords(*stream, _nouns, _priNouns);
 }
 
+void HiRes4Engine::loadRoom(byte roomNr) {
+	if (roomNr >= 59 && roomNr < 113) {
+		insertDisk(2);
+		rebindDisk();
+	} else {
+		insertDisk(1);
+		rebindDisk();
+	}
+
+	if (roomNr == 121) {
+		// Room 121 is not present in the Atari version. This causes
+		// problems when we're dumping scripts with the debugger, so
+		// we intercept this room load here.
+		// FIXME: Find out if the Apple II version does have this room
+		// FIXME: Implement more generic handling of invalid rooms?
+		debug("Warning: attempt to load non-existent room 121");
+		_roomData.description.clear();
+		_roomData.pictures.clear();
+		_roomData.commands.clear();
+		return;
+	}
+
+	AdlEngine_v3::loadRoom(roomNr);
+}
+
 Common::String HiRes4Engine::formatVerbError(const Common::String &verb) const {
 	Common::String err = _strings.verbError;
 	for (uint i = 0; i < verb.size(); ++i)
@@ -88,13 +117,20 @@ Common::String HiRes4Engine::formatNounError(const Common::String &verb, const C
 	return err;
 }
 
-void HiRes4Engine::goToSideC() {
+void HiRes4Engine::insertDisk(byte diskNr) {
+	if (_curDisk == diskNr)
+		return;
+
+	_curDisk = diskNr;
+
 	delete _disk;
 
 	_disk = new DiskImage();
-	if (!_disk->open(getDiskImageName(2)))
-		error("Failed to open disk image '%s'", getDiskImageName(2));
+	if (!_disk->open(getDiskImageName(diskNr)))
+		error("Failed to open disk image '%s'", getDiskImageName(diskNr));
+}
 
+void HiRes4Engine::rebindDisk() {
 	// As room.data is bound to the DiskImage, we need to rebind them here
 	// We cannot simply reload the rooms as that would reset their state
 
@@ -119,6 +155,10 @@ void HiRes4Engine::loadCommonData() {
 	_pictures.clear();
 	stream.reset(createReadStream(_boot, 0x05, 0xe, 0x80));
 	loadPictures(*stream);
+
+	_itemPics.clear();
+	stream.reset(createReadStream(_boot, 0x09, 0xe, 0x05));
+	loadItemPictures(*stream, IDI_HR4_NUM_ITEM_PICS);
 }
 
 void HiRes4Engine::initGameState() {
diff --git a/engines/adl/hires4.h b/engines/adl/hires4.h
index 1d21e0c..fd682cb 100644
--- a/engines/adl/hires4.h
+++ b/engines/adl/hires4.h
@@ -32,6 +32,7 @@ namespace Adl {
 #define IDI_HR4_NUM_ROOMS 164
 #define IDI_HR4_NUM_MESSAGES 255
 #define IDI_HR4_NUM_VARS 40
+#define IDI_HR4_NUM_ITEM_PICS 41
 #define IDI_HR4_NUM_ITEM_DESCS 44
 
 // Messages used outside of scripts
@@ -46,20 +47,26 @@ public:
 	~HiRes4Engine();
 
 protected:
-	HiRes4Engine(OSystem *syst, const AdlGameDescription *gd) : AdlEngine_v3(syst, gd) { }
+	HiRes4Engine(OSystem *syst, const AdlGameDescription *gd) :
+			AdlEngine_v3(syst, gd),
+			_boot(nullptr),
+			_curDisk(0) { }
 
 	// AdlEngine
 	void init();
 	void initGameState();
+	void loadRoom(byte roomNr);
 	Common::String formatVerbError(const Common::String &verb) const;
 	Common::String formatNounError(const Common::String &verb, const Common::String &noun) const;
 
 	Common::SeekableReadStream *createReadStream(DiskImage *disk, byte track, byte sector, byte offset = 0, byte size = 0) const;
 	void loadCommonData();
-	void goToSideC();
+	void insertDisk(byte diskNr);
+	void rebindDisk();
 	virtual const char *getDiskImageName(byte index) const = 0;
 
 	DiskImage *_boot;
+	byte _curDisk;
 };
 
 class HiRes4Engine_Atari : public HiRes4Engine {
diff --git a/engines/adl/hires6.cpp b/engines/adl/hires6.cpp
index c2843ea..314d817 100644
--- a/engines/adl/hires6.cpp
+++ b/engines/adl/hires6.cpp
@@ -186,10 +186,7 @@ void HiRes6Engine::loadDisk(byte disk) {
 	// Load item picture data (indexed on boot disk)
 	StreamPtr stream(_boot->createReadStream(0xb, 0xd, 0x08));
 	_itemPics.clear();
-	for (uint i = 0; i < IDI_HR6_NUM_ITEM_PICS; ++i) {
-		stream->readByte();
-		_itemPics.push_back(readDataBlockPtr(*stream));
-	}
+	loadItemPictures(*stream, IDI_HR6_NUM_ITEM_PICS);
 
 	_curDisk = disk;
 





More information about the Scummvm-git-logs mailing list