[Scummvm-git-logs] scummvm master -> 444fe0e64df11b26ba6d281c00ad365750550079

waltervn walter at vanniftrik-it.nl
Fri Aug 26 22:02:13 CEST 2016


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

Summary:
7dcf38c205 ADL: Remove outdated comment
1ca15d76d3 ADL: Rename ADL_v3 to ADL_v4
92cea7ab35 ADL: Add ADL_v3 class for hires4
c1671b5d32 ADL: Add skeleton for hires4
444fe0e64d ADL: Implement inventory listing for v3 and v4


Commit: 7dcf38c2050daf51caa545e5b094b0668adb23d9
    https://github.com/scummvm/scummvm/commit/7dcf38c2050daf51caa545e5b094b0668adb23d9
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-26T22:00:37+02:00

Commit Message:
ADL: Remove outdated comment

Changed paths:
    engines/adl/adl_v2.h
    engines/adl/adl_v3.h



diff --git a/engines/adl/adl_v2.h b/engines/adl/adl_v2.h
index 4a473e9..327b36e 100644
--- a/engines/adl/adl_v2.h
+++ b/engines/adl/adl_v2.h
@@ -25,9 +25,6 @@
 
 #include "adl/adl.h"
 
-// Note: this version of ADL redraws only when necessary, but
-// this is not currently implemented.
-
 namespace Common {
 class RandomSource;
 }
diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h
index 61dd585..9e9a8dc 100644
--- a/engines/adl/adl_v3.h
+++ b/engines/adl/adl_v3.h
@@ -25,9 +25,6 @@
 
 #include "adl/adl_v2.h"
 
-// Note: this version of ADL redraws only when necessary, but
-// this is not currently implemented.
-
 namespace Common {
 class RandomSource;
 }


Commit: 1ca15d76d37a89e7a943ac93daa01f358601cf6e
    https://github.com/scummvm/scummvm/commit/1ca15d76d37a89e7a943ac93daa01f358601cf6e
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-26T22:00:37+02:00

Commit Message:
ADL: Rename ADL_v3 to ADL_v4

Changed paths:
  A engines/adl/adl_v4.cpp
  A engines/adl/adl_v4.h
  R engines/adl/adl_v3.cpp
  R engines/adl/adl_v3.h
    engines/adl/hires6.h
    engines/adl/module.mk



diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp
deleted file mode 100644
index 005478c..0000000
--- a/engines/adl/adl_v3.cpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/random.h"
-#include "common/error.h"
-
-#include "adl/adl_v3.h"
-#include "adl/display.h"
-#include "adl/graphics.h"
-
-namespace Adl {
-
-AdlEngine_v3::AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd) :
-		AdlEngine_v2(syst, gd),
-		_curDisk(0) {
-}
-
-Common::String AdlEngine_v3::loadMessage(uint idx) const {
-	Common::String str = AdlEngine_v2::loadMessage(idx);
-
-	for (uint i = 0; i < str.size(); ++i) {
-		const char *xorStr = "AVISDURGAN";
-		str.setChar(str[i] ^ xorStr[i % strlen(xorStr)], i);
-	}
-
-	return str;
-}
-
-Common::String AdlEngine_v3::getItemDescription(const Item &item) const {
-	return _itemDesc[item.id - 1];
-}
-
-void AdlEngine_v3::applyDiskOffset(byte &track, byte &sector) const {
-	sector += _diskOffsets[_curDisk].sector;
-	if (sector >= 16) {
-		sector -= 16;
-		++track;
-	}
-
-	track += _diskOffsets[_curDisk].track;
-}
-
-DataBlockPtr AdlEngine_v3::readDataBlockPtr(Common::ReadStream &f) const {
-	byte track = f.readByte();
-	byte sector = f.readByte();
-	byte offset = f.readByte();
-	byte size = f.readByte();
-
-	if (f.eos() || f.err())
-		error("Error reading DataBlockPtr");
-
-	if (track == 0 && sector == 0 && offset == 0 && size == 0)
-		return DataBlockPtr();
-
-	applyDiskOffset(track, sector);
-
-	return _disk->getDataBlock(track, sector, offset, size);
-}
-
-typedef Common::Functor1Mem<ScriptEnv &, int, AdlEngine_v3> OpcodeV3;
-#define SetOpcodeTable(x) table = &x;
-#define Opcode(x) table->push_back(new OpcodeV3(this, &AdlEngine_v3::x))
-#define OpcodeUnImpl() table->push_back(new OpcodeV3(this, 0))
-
-void AdlEngine_v3::setupOpcodeTables() {
-	Common::Array<const Opcode *> *table = 0;
-
-	SetOpcodeTable(_condOpcodes);
-	// 0x00
-	OpcodeUnImpl();
-	Opcode(o2_isFirstTime);
-	Opcode(o2_isRandomGT);
-	Opcode(o3_isItemInRoom);
-	// 0x04
-	Opcode(o3_isNounNotInRoom);
-	Opcode(o1_isMovesGT);
-	Opcode(o1_isVarEQ);
-	Opcode(o2_isCarryingSomething);
-	// 0x08
-	Opcode(o3_isVarGT);
-	Opcode(o1_isCurPicEQ);
-	Opcode(o3_skipOneCommand);
-
-	SetOpcodeTable(_actOpcodes);
-	// 0x00
-	OpcodeUnImpl();
-	Opcode(o1_varAdd);
-	Opcode(o1_varSub);
-	Opcode(o1_varSet);
-	// 0x04
-	Opcode(o1_listInv);
-	Opcode(o3_moveItem);
-	Opcode(o1_setRoom);
-	Opcode(o2_setCurPic);
-	// 0x08
-	Opcode(o2_setPic);
-	Opcode(o1_printMsg);
-	Opcode(o3_dummy);
-	Opcode(o3_setTextMode);
-	// 0x0c
-	Opcode(o2_moveAllItems);
-	Opcode(o1_quit);
-	Opcode(o3_dummy);
-	Opcode(o2_save);
-	// 0x10
-	Opcode(o2_restore);
-	Opcode(o1_restart);
-	Opcode(o3_setDisk);
-	Opcode(o3_dummy);
-	// 0x14
-	Opcode(o1_resetPic);
-	Opcode(o1_goDirection<IDI_DIR_NORTH>);
-	Opcode(o1_goDirection<IDI_DIR_SOUTH>);
-	Opcode(o1_goDirection<IDI_DIR_EAST>);
-	// 0x18
-	Opcode(o1_goDirection<IDI_DIR_WEST>);
-	Opcode(o1_goDirection<IDI_DIR_UP>);
-	Opcode(o1_goDirection<IDI_DIR_DOWN>);
-	Opcode(o1_takeItem);
-	// 0x1c
-	Opcode(o1_dropItem);
-	Opcode(o1_setRoomPic);
-	Opcode(o3_sound);
-	OpcodeUnImpl();
-	// 0x20
-	Opcode(o2_initDisk);
-}
-
-int AdlEngine_v3::o3_isVarGT(ScriptEnv &e) {
-	OP_DEBUG_2("\t&& VARS[%d] > %d", e.arg(1), e.arg(2));
-
-	if (getVar(e.arg(1)) > e.arg(2))
-		return 2;
-
-	return -1;
-}
-
-int AdlEngine_v3::o3_skipOneCommand(ScriptEnv &e) {
-	OP_DEBUG_0("\t&& SKIP_ONE_COMMAND()");
-
-	_skipOneCommand = true;
-	setVar(2, 0);
-
-	return -1;
-}
-
-// FIXME: Rename "isLineArt" and look at code duplication
-int AdlEngine_v3::o3_isItemInRoom(ScriptEnv &e) {
-	OP_DEBUG_2("\t&& GET_ITEM_ROOM(%s) == %s", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
-
-	const Item &item = getItem(e.arg(1));
-
-	if (e.arg(2) != IDI_ANY && item.isLineArt != _curDisk)
-		return -1;
-
-	if (item.room == roomArg(e.arg(2)))
-		return 2;
-
-	return -1;
-}
-
-int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) {
-	OP_DEBUG_1("\t&& NO_SUCH_ITEMS_IN_ROOM(%s)", itemRoomStr(e.arg(1)).c_str());
-
-	Common::List<Item>::const_iterator item;
-
-	setVar(24, 0);
-
-	for (item = _state.items.begin(); item != _state.items.end(); ++item)
-		if (item->noun == e.getNoun()) {
-			setVar(24, 1);
-
-			if (item->room == roomArg(e.arg(1)))
-				return -1;
-		}
-
-	return 1;
-}
-
-int AdlEngine_v3::o3_moveItem(ScriptEnv &e) {
-	OP_DEBUG_2("\tSET_ITEM_ROOM(%s, %s)", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
-
-	byte room = roomArg(e.arg(2));
-
-	Item &item = getItem(e.arg(1));
-
-	if (item.room == _roomOnScreen)
-		_picOnScreen = 0;
-
-	// Set items that move from inventory to a room to state "dropped"
-	if (item.room == IDI_ANY && room != IDI_VOID_ROOM)
-		item.state = IDI_ITEM_DROPPED;
-
-	item.room = room;
-	item.isLineArt = _curDisk;
-	return 2;
-}
-
-int AdlEngine_v3::o3_dummy(ScriptEnv &e) {
-	OP_DEBUG_0("\tDUMMY()");
-
-	return 0;
-}
-
-int AdlEngine_v3::o3_setTextMode(ScriptEnv &e) {
-	OP_DEBUG_1("\tSET_TEXT_MODE(%d)", e.arg(1));
-
-	// TODO
-	// 1: 4-line mode
-	// 2: 24-line mode
-
-	switch (e.arg(1)) {
-	case 3:
-		// We re-use the restarting flag here, to simulate a long jump
-		_isRestarting = true;
-		return -1;
-	}
-
-	return 1;
-}
-
-int AdlEngine_v3::o3_setDisk(ScriptEnv &e) {
-	OP_DEBUG_2("\tSET_DISK(%d, %d)", e.arg(1), e.arg(2));
-
-	// TODO
-	// Arg 1: disk
-	// Arg 2: room
-
-	return 2;
-}
-
-int AdlEngine_v3::o3_sound(ScriptEnv &e) {
-	OP_DEBUG_0("\tSOUND()");
-
-	// TODO
-
-	return 0;
-}
-
-} // End of namespace Adl
diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h
deleted file mode 100644
index 9e9a8dc..0000000
--- a/engines/adl/adl_v3.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ADL_ADL_V3_H
-#define ADL_ADL_V3_H
-
-#include "adl/adl_v2.h"
-
-namespace Common {
-class RandomSource;
-}
-
-struct DiskOffset {
-	byte track;
-	byte sector;
-};
-
-namespace Adl {
-
-class AdlEngine_v3 : public AdlEngine_v2 {
-public:
-	virtual ~AdlEngine_v3() { }
-
-protected:
-	AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd);
-
-	// AdlEngine
-	virtual void setupOpcodeTables();
-	virtual Common::String loadMessage(uint idx) const;
-	Common::String getItemDescription(const Item &item) const;
-
-	// AdlEngine_v2
-	virtual DataBlockPtr readDataBlockPtr(Common::ReadStream &f) const;
-
-	void applyDiskOffset(byte &track, byte &sector) const;
-
-	int o3_isVarGT(ScriptEnv &e);
-	int o3_isItemInRoom(ScriptEnv &e);
-	int o3_isNounNotInRoom(ScriptEnv &e);
-	int o3_skipOneCommand(ScriptEnv &e);
-	int o3_moveItem(ScriptEnv &e);
-	int o3_dummy(ScriptEnv &e);
-	int o3_setTextMode(ScriptEnv &e);
-	int o3_setDisk(ScriptEnv &e);
-	int o3_sound(ScriptEnv &e);
-
-	Common::Array<Common::String> _itemDesc;
-	byte _curDisk;
-	Common::Array<DiskOffset> _diskOffsets;
-};
-
-} // End of namespace Adl
-
-#endif
diff --git a/engines/adl/adl_v4.cpp b/engines/adl/adl_v4.cpp
new file mode 100644
index 0000000..42f576e
--- /dev/null
+++ b/engines/adl/adl_v4.cpp
@@ -0,0 +1,259 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/random.h"
+#include "common/error.h"
+
+#include "adl/adl_v4.h"
+#include "adl/display.h"
+#include "adl/graphics.h"
+
+namespace Adl {
+
+AdlEngine_v4::AdlEngine_v4(OSystem *syst, const AdlGameDescription *gd) :
+		AdlEngine_v2(syst, gd),
+		_curDisk(0) {
+}
+
+Common::String AdlEngine_v4::loadMessage(uint idx) const {
+	Common::String str = AdlEngine_v2::loadMessage(idx);
+
+	for (uint i = 0; i < str.size(); ++i) {
+		const char *xorStr = "AVISDURGAN";
+		str.setChar(str[i] ^ xorStr[i % strlen(xorStr)], i);
+	}
+
+	return str;
+}
+
+Common::String AdlEngine_v4::getItemDescription(const Item &item) const {
+	return _itemDesc[item.id - 1];
+}
+
+void AdlEngine_v4::applyDiskOffset(byte &track, byte &sector) const {
+	sector += _diskOffsets[_curDisk].sector;
+	if (sector >= 16) {
+		sector -= 16;
+		++track;
+	}
+
+	track += _diskOffsets[_curDisk].track;
+}
+
+DataBlockPtr AdlEngine_v4::readDataBlockPtr(Common::ReadStream &f) const {
+	byte track = f.readByte();
+	byte sector = f.readByte();
+	byte offset = f.readByte();
+	byte size = f.readByte();
+
+	if (f.eos() || f.err())
+		error("Error reading DataBlockPtr");
+
+	if (track == 0 && sector == 0 && offset == 0 && size == 0)
+		return DataBlockPtr();
+
+	applyDiskOffset(track, sector);
+
+	return _disk->getDataBlock(track, sector, offset, size);
+}
+
+typedef Common::Functor1Mem<ScriptEnv &, int, AdlEngine_v4> OpcodeV4;
+#define SetOpcodeTable(x) table = &x;
+#define Opcode(x) table->push_back(new OpcodeV4(this, &AdlEngine_v4::x))
+#define OpcodeUnImpl() table->push_back(new OpcodeV4(this, 0))
+
+void AdlEngine_v4::setupOpcodeTables() {
+	Common::Array<const Opcode *> *table = 0;
+
+	SetOpcodeTable(_condOpcodes);
+	// 0x00
+	OpcodeUnImpl();
+	Opcode(o2_isFirstTime);
+	Opcode(o2_isRandomGT);
+	Opcode(o4_isItemInRoom);
+	// 0x04
+	Opcode(o4_isNounNotInRoom);
+	Opcode(o1_isMovesGT);
+	Opcode(o1_isVarEQ);
+	Opcode(o2_isCarryingSomething);
+	// 0x08
+	Opcode(o4_isVarGT);
+	Opcode(o1_isCurPicEQ);
+	Opcode(o4_skipOneCommand);
+
+	SetOpcodeTable(_actOpcodes);
+	// 0x00
+	OpcodeUnImpl();
+	Opcode(o1_varAdd);
+	Opcode(o1_varSub);
+	Opcode(o1_varSet);
+	// 0x04
+	Opcode(o1_listInv);
+	Opcode(o4_moveItem);
+	Opcode(o1_setRoom);
+	Opcode(o2_setCurPic);
+	// 0x08
+	Opcode(o2_setPic);
+	Opcode(o1_printMsg);
+	Opcode(o4_dummy);
+	Opcode(o4_setTextMode);
+	// 0x0c
+	Opcode(o2_moveAllItems);
+	Opcode(o1_quit);
+	Opcode(o4_dummy);
+	Opcode(o2_save);
+	// 0x10
+	Opcode(o2_restore);
+	Opcode(o1_restart);
+	Opcode(o4_setDisk);
+	Opcode(o4_dummy);
+	// 0x14
+	Opcode(o1_resetPic);
+	Opcode(o1_goDirection<IDI_DIR_NORTH>);
+	Opcode(o1_goDirection<IDI_DIR_SOUTH>);
+	Opcode(o1_goDirection<IDI_DIR_EAST>);
+	// 0x18
+	Opcode(o1_goDirection<IDI_DIR_WEST>);
+	Opcode(o1_goDirection<IDI_DIR_UP>);
+	Opcode(o1_goDirection<IDI_DIR_DOWN>);
+	Opcode(o1_takeItem);
+	// 0x1c
+	Opcode(o1_dropItem);
+	Opcode(o1_setRoomPic);
+	Opcode(o4_sound);
+	OpcodeUnImpl();
+	// 0x20
+	Opcode(o2_initDisk);
+}
+
+int AdlEngine_v4::o4_isVarGT(ScriptEnv &e) {
+	OP_DEBUG_2("\t&& VARS[%d] > %d", e.arg(1), e.arg(2));
+
+	if (getVar(e.arg(1)) > e.arg(2))
+		return 2;
+
+	return -1;
+}
+
+int AdlEngine_v4::o4_skipOneCommand(ScriptEnv &e) {
+	OP_DEBUG_0("\t&& SKIP_ONE_COMMAND()");
+
+	_skipOneCommand = true;
+	setVar(2, 0);
+
+	return -1;
+}
+
+// FIXME: Rename "isLineArt" and look at code duplication
+int AdlEngine_v4::o4_isItemInRoom(ScriptEnv &e) {
+	OP_DEBUG_2("\t&& GET_ITEM_ROOM(%s) == %s", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
+
+	const Item &item = getItem(e.arg(1));
+
+	if (e.arg(2) != IDI_ANY && item.isLineArt != _curDisk)
+		return -1;
+
+	if (item.room == roomArg(e.arg(2)))
+		return 2;
+
+	return -1;
+}
+
+int AdlEngine_v4::o4_isNounNotInRoom(ScriptEnv &e) {
+	OP_DEBUG_1("\t&& NO_SUCH_ITEMS_IN_ROOM(%s)", itemRoomStr(e.arg(1)).c_str());
+
+	Common::List<Item>::const_iterator item;
+
+	setVar(24, 0);
+
+	for (item = _state.items.begin(); item != _state.items.end(); ++item)
+		if (item->noun == e.getNoun()) {
+			setVar(24, 1);
+
+			if (item->room == roomArg(e.arg(1)))
+				return -1;
+		}
+
+	return 1;
+}
+
+int AdlEngine_v4::o4_moveItem(ScriptEnv &e) {
+	OP_DEBUG_2("\tSET_ITEM_ROOM(%s, %s)", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
+
+	byte room = roomArg(e.arg(2));
+
+	Item &item = getItem(e.arg(1));
+
+	if (item.room == _roomOnScreen)
+		_picOnScreen = 0;
+
+	// Set items that move from inventory to a room to state "dropped"
+	if (item.room == IDI_ANY && room != IDI_VOID_ROOM)
+		item.state = IDI_ITEM_DROPPED;
+
+	item.room = room;
+	item.isLineArt = _curDisk;
+	return 2;
+}
+
+int AdlEngine_v4::o4_dummy(ScriptEnv &e) {
+	OP_DEBUG_0("\tDUMMY()");
+
+	return 0;
+}
+
+int AdlEngine_v4::o4_setTextMode(ScriptEnv &e) {
+	OP_DEBUG_1("\tSET_TEXT_MODE(%d)", e.arg(1));
+
+	// TODO
+	// 1: 4-line mode
+	// 2: 24-line mode
+
+	switch (e.arg(1)) {
+	case 3:
+		// We re-use the restarting flag here, to simulate a long jump
+		_isRestarting = true;
+		return -1;
+	}
+
+	return 1;
+}
+
+int AdlEngine_v4::o4_setDisk(ScriptEnv &e) {
+	OP_DEBUG_2("\tSET_DISK(%d, %d)", e.arg(1), e.arg(2));
+
+	// TODO
+	// Arg 1: disk
+	// Arg 2: room
+
+	return 2;
+}
+
+int AdlEngine_v4::o4_sound(ScriptEnv &e) {
+	OP_DEBUG_0("\tSOUND()");
+
+	// TODO
+
+	return 0;
+}
+
+} // End of namespace Adl
diff --git a/engines/adl/adl_v4.h b/engines/adl/adl_v4.h
new file mode 100644
index 0000000..e5c7ba3
--- /dev/null
+++ b/engines/adl/adl_v4.h
@@ -0,0 +1,73 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ADL_ADL_V4_H
+#define ADL_ADL_V4_H
+
+#include "adl/adl_v2.h"
+
+namespace Common {
+class RandomSource;
+}
+
+struct DiskOffset {
+	byte track;
+	byte sector;
+};
+
+namespace Adl {
+
+class AdlEngine_v4 : public AdlEngine_v2 {
+public:
+	virtual ~AdlEngine_v4() { }
+
+protected:
+	AdlEngine_v4(OSystem *syst, const AdlGameDescription *gd);
+
+	// AdlEngine
+	virtual void setupOpcodeTables();
+	virtual Common::String loadMessage(uint idx) const;
+	Common::String getItemDescription(const Item &item) const;
+
+	// AdlEngine_v2
+	virtual DataBlockPtr readDataBlockPtr(Common::ReadStream &f) const;
+
+	void applyDiskOffset(byte &track, byte &sector) const;
+
+	int o4_isVarGT(ScriptEnv &e);
+	int o4_isItemInRoom(ScriptEnv &e);
+	int o4_isNounNotInRoom(ScriptEnv &e);
+	int o4_skipOneCommand(ScriptEnv &e);
+	int o4_moveItem(ScriptEnv &e);
+	int o4_dummy(ScriptEnv &e);
+	int o4_setTextMode(ScriptEnv &e);
+	int o4_setDisk(ScriptEnv &e);
+	int o4_sound(ScriptEnv &e);
+
+	Common::Array<Common::String> _itemDesc;
+	byte _curDisk;
+	Common::Array<DiskOffset> _diskOffsets;
+};
+
+} // End of namespace Adl
+
+#endif
diff --git a/engines/adl/hires6.h b/engines/adl/hires6.h
index 0f604d8..5ff0391 100644
--- a/engines/adl/hires6.h
+++ b/engines/adl/hires6.h
@@ -25,7 +25,7 @@
 
 #include "common/str.h"
 
-#include "adl/adl_v3.h"
+#include "adl/adl_v4.h"
 #include "adl/disk.h"
 
 namespace Common {
@@ -56,10 +56,10 @@ struct DiskDataDesc {
 	byte volume;
 };
 
-class HiRes6Engine : public AdlEngine_v3 {
+class HiRes6Engine : public AdlEngine_v4 {
 public:
 	HiRes6Engine(OSystem *syst, const AdlGameDescription *gd) :
-			AdlEngine_v3(syst, gd),
+			AdlEngine_v4(syst, gd),
 			_boot(nullptr),
 			_currVerb(0),
 			_currNoun(0) {
diff --git a/engines/adl/module.mk b/engines/adl/module.mk
index d17c856..98e1de5 100644
--- a/engines/adl/module.mk
+++ b/engines/adl/module.mk
@@ -3,7 +3,7 @@ MODULE := engines/adl
 MODULE_OBJS := \
 	adl.o \
 	adl_v2.o \
-	adl_v3.o \
+	adl_v4.o \
 	console.o \
 	detection.o \
 	disk.o \


Commit: 92cea7ab35978cae759dc5e9714ff5024919e6a1
    https://github.com/scummvm/scummvm/commit/92cea7ab35978cae759dc5e9714ff5024919e6a1
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-26T22:00:37+02:00

Commit Message:
ADL: Add ADL_v3 class for hires4

Changed paths:
  A engines/adl/adl_v3.cpp
  A engines/adl/adl_v3.h
    engines/adl/adl_v4.cpp
    engines/adl/adl_v4.h
    engines/adl/module.mk



diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp
new file mode 100644
index 0000000..2e54195
--- /dev/null
+++ b/engines/adl/adl_v3.cpp
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "adl/adl_v3.h"
+
+namespace Adl {
+
+AdlEngine_v3::AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd) :
+		AdlEngine_v2(syst, gd) {
+}
+
+typedef Common::Functor1Mem<ScriptEnv &, int, AdlEngine_v3> OpcodeV3;
+
+void AdlEngine_v3::setupOpcodeTables() {
+	AdlEngine_v2::setupOpcodeTables();
+	delete _condOpcodes[0x04];
+	_condOpcodes[0x04] = new OpcodeV3(this, &AdlEngine_v3::o3_isNounNotInRoom);
+}
+
+int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) {
+	OP_DEBUG_1("\t&& NO_SUCH_ITEMS_IN_ROOM(%s)", itemRoomStr(e.arg(1)).c_str());
+
+	Common::List<Item>::const_iterator item;
+
+	bool isAnItem = false;
+
+	for (item = _state.items.begin(); item != _state.items.end(); ++item) {
+		if (item->noun == e.getNoun()) {
+			isAnItem = true;
+
+			if (item->room == roomArg(e.arg(1)))
+				return -1;
+		}
+	}
+
+	return (isAnItem ? 1 : -1);
+}
+
+} // End of namespace Adl
diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h
new file mode 100644
index 0000000..097fa65
--- /dev/null
+++ b/engines/adl/adl_v3.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ADL_ADL_V3_H
+#define ADL_ADL_V3_H
+
+#include "adl/adl_v2.h"
+
+namespace Adl {
+
+class AdlEngine_v3 : public AdlEngine_v2 {
+public:
+	virtual ~AdlEngine_v3() { }
+
+protected:
+	AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd);
+
+	// AdlEngine
+	virtual void setupOpcodeTables();
+
+	int o3_isNounNotInRoom(ScriptEnv &e);
+};
+
+} // End of namespace Adl
+
+#endif
diff --git a/engines/adl/adl_v4.cpp b/engines/adl/adl_v4.cpp
index 42f576e..598f0f0 100644
--- a/engines/adl/adl_v4.cpp
+++ b/engines/adl/adl_v4.cpp
@@ -30,7 +30,7 @@
 namespace Adl {
 
 AdlEngine_v4::AdlEngine_v4(OSystem *syst, const AdlGameDescription *gd) :
-		AdlEngine_v2(syst, gd),
+		AdlEngine_v3(syst, gd),
 		_curDisk(0) {
 }
 
diff --git a/engines/adl/adl_v4.h b/engines/adl/adl_v4.h
index e5c7ba3..3a4836b 100644
--- a/engines/adl/adl_v4.h
+++ b/engines/adl/adl_v4.h
@@ -23,7 +23,7 @@
 #ifndef ADL_ADL_V4_H
 #define ADL_ADL_V4_H
 
-#include "adl/adl_v2.h"
+#include "adl/adl_v3.h"
 
 namespace Common {
 class RandomSource;
@@ -36,7 +36,7 @@ struct DiskOffset {
 
 namespace Adl {
 
-class AdlEngine_v4 : public AdlEngine_v2 {
+class AdlEngine_v4 : public AdlEngine_v3 {
 public:
 	virtual ~AdlEngine_v4() { }
 
diff --git a/engines/adl/module.mk b/engines/adl/module.mk
index 98e1de5..b8f6cb3 100644
--- a/engines/adl/module.mk
+++ b/engines/adl/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/adl
 MODULE_OBJS := \
 	adl.o \
 	adl_v2.o \
+	adl_v3.o \
 	adl_v4.o \
 	console.o \
 	detection.o \


Commit: c1671b5d320fe4c58b883bb8bb4774288f1a1259
    https://github.com/scummvm/scummvm/commit/c1671b5d320fe4c58b883bb8bb4774288f1a1259
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-26T22:00:37+02:00

Commit Message:
ADL: Add skeleton for hires4

Changed paths:
  A engines/adl/hires4.cpp
  A engines/adl/hires4.h
    engines/adl/detection.cpp
    engines/adl/detection.h
    engines/adl/module.mk



diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index 200e0b5..be9165b 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -76,6 +76,7 @@ static const PlainGameDescriptor adlGames[] = {
 	{ "hires0", "Hi-Res Adventure #0: Mission Asteroid" },
 	{ "hires1", "Hi-Res Adventure #1: Mystery House" },
 	{ "hires2", "Hi-Res Adventure #2: Wizard and the Princess" },
+	{ "hires4", "Hi-Res Adventure #4: Ulysses and the Golden Fleece" },
 	{ "hires6", "Hi-Res Adventure #6: The Dark Crystal" },
 	{ 0, 0 }
 };
@@ -139,6 +140,21 @@ static const AdlGameDescription gameDescriptions[] = {
 		},
 		GAME_TYPE_HIRES0
 	},
+	{ // Hi-Res Adventure #4: Ulysses and the Golden Fleece - Atari 8-bit - Re-release
+		{
+			"hires4", 0,
+			{
+				{ "ULYS1A.XFD", 0, "26365d2b06509fd21e7a7919e33f7199", 92160 },
+				// FIXME: Add sides 1B and 2C
+				AD_LISTEND
+			},
+			Common::EN_ANY,
+			Common::kPlatformAtariST, // FIXME
+			ADGF_UNSTABLE,
+			GUIO2(GAMEOPTION_COLOR_DEFAULT_ON, GAMEOPTION_SCANLINES)
+		},
+		GAME_TYPE_HIRES4
+	},
 	{ // Hi-Res Adventure #6: The Dark Crystal - Apple II - Roberta Williams Anthology
 		{
 			"hires6", 0,
@@ -297,6 +313,7 @@ void AdlMetaEngine::removeSaveState(const char *target, int slot) const {
 Engine *HiRes1Engine_create(OSystem *syst, const AdlGameDescription *gd);
 Engine *HiRes2Engine_create(OSystem *syst, const AdlGameDescription *gd);
 Engine *HiRes0Engine_create(OSystem *syst, const AdlGameDescription *gd);
+Engine *HiRes4Engine_create(OSystem *syst, const AdlGameDescription *gd);
 Engine *HiRes6Engine_create(OSystem *syst, const AdlGameDescription *gd);
 
 bool AdlMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
@@ -315,6 +332,9 @@ bool AdlMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameD
 	case GAME_TYPE_HIRES0:
 		*engine = HiRes0Engine_create(syst, adlGd);
 		break;
+	case GAME_TYPE_HIRES4:
+		*engine = HiRes4Engine_create(syst, adlGd);
+		break;
 	case GAME_TYPE_HIRES6:
 		*engine = HiRes6Engine_create(syst, adlGd);
 		break;
diff --git a/engines/adl/detection.h b/engines/adl/detection.h
index 533466c..b4dc3c4 100644
--- a/engines/adl/detection.h
+++ b/engines/adl/detection.h
@@ -35,6 +35,7 @@ enum GameType {
 	GAME_TYPE_HIRES0,
 	GAME_TYPE_HIRES1,
 	GAME_TYPE_HIRES2,
+	GAME_TYPE_HIRES4,
 	GAME_TYPE_HIRES6
 };
 
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
new file mode 100644
index 0000000..22fd9c2
--- /dev/null
+++ b/engines/adl/hires4.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/system.h"
+#include "common/debug.h"
+#include "common/error.h"
+#include "common/file.h"
+#include "common/stream.h"
+
+#include "adl/hires4.h"
+#include "adl/display.h"
+#include "adl/graphics.h"
+#include "adl/disk.h"
+
+namespace Adl {
+
+void HiRes4Engine::runIntro() const {
+}
+
+void HiRes4Engine::init() {
+	_graphics = new Graphics_v2(*_display);
+}
+
+void HiRes4Engine::initGameState() {
+}
+
+Engine *HiRes4Engine_create(OSystem *syst, const AdlGameDescription *gd) {
+	return new HiRes4Engine(syst, gd);
+}
+
+} // End of namespace Adl
diff --git a/engines/adl/hires4.h b/engines/adl/hires4.h
new file mode 100644
index 0000000..f1c429c
--- /dev/null
+++ b/engines/adl/hires4.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ADL_HIRES4_H
+#define ADL_HIRES4_H
+
+#include "common/str.h"
+
+#include "adl/adl_v3.h"
+
+namespace Adl {
+
+class HiRes4Engine : public AdlEngine_v3 {
+public:
+	HiRes4Engine(OSystem *syst, const AdlGameDescription *gd) : AdlEngine_v3(syst, gd) { }
+
+private:
+	// AdlEngine
+	void runIntro() const;
+	void init();
+	void initGameState();
+};
+
+} // End of namespace Adl
+
+#endif
diff --git a/engines/adl/module.mk b/engines/adl/module.mk
index b8f6cb3..d1de2a6 100644
--- a/engines/adl/module.mk
+++ b/engines/adl/module.mk
@@ -15,6 +15,7 @@ MODULE_OBJS := \
 	hires0.o \
 	hires1.o \
 	hires2.o \
+	hires4.o \
 	hires6.o \
 	speaker.o
 


Commit: 444fe0e64df11b26ba6d281c00ad365750550079
    https://github.com/scummvm/scummvm/commit/444fe0e64df11b26ba6d281c00ad365750550079
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-08-26T22:00:37+02:00

Commit Message:
ADL: Implement inventory listing for v3 and v4

Changed paths:
    engines/adl/adl_v3.cpp
    engines/adl/adl_v3.h
    engines/adl/adl_v4.cpp
    engines/adl/adl_v4.h



diff --git a/engines/adl/adl_v3.cpp b/engines/adl/adl_v3.cpp
index 2e54195..6b93acd 100644
--- a/engines/adl/adl_v3.cpp
+++ b/engines/adl/adl_v3.cpp
@@ -28,12 +28,18 @@ AdlEngine_v3::AdlEngine_v3(OSystem *syst, const AdlGameDescription *gd) :
 		AdlEngine_v2(syst, gd) {
 }
 
+Common::String AdlEngine_v3::getItemDescription(const Item &item) const {
+	return _itemDesc[item.description - 1];
+}
+
 typedef Common::Functor1Mem<ScriptEnv &, int, AdlEngine_v3> OpcodeV3;
 
 void AdlEngine_v3::setupOpcodeTables() {
 	AdlEngine_v2::setupOpcodeTables();
 	delete _condOpcodes[0x04];
 	_condOpcodes[0x04] = new OpcodeV3(this, &AdlEngine_v3::o3_isNounNotInRoom);
+	delete _actOpcodes[0x04];
+	_actOpcodes[0x04] = new OpcodeV3(this, &AdlEngine_v3::o3_listInv);
 }
 
 int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) {
@@ -55,4 +61,16 @@ int AdlEngine_v3::o3_isNounNotInRoom(ScriptEnv &e) {
 	return (isAnItem ? 1 : -1);
 }
 
+int AdlEngine_v3::o3_listInv(ScriptEnv &e) {
+	OP_DEBUG_0("\tLIST_INVENTORY()");
+
+	Common::List<Item>::const_iterator item;
+
+	for (item = _state.items.begin(); item != _state.items.end(); ++item)
+		if (item->room == IDI_ANY)
+			printString(_itemDesc[item->description - 1]);
+
+	return 0;
+}
+
 } // End of namespace Adl
diff --git a/engines/adl/adl_v3.h b/engines/adl/adl_v3.h
index 097fa65..759b17c 100644
--- a/engines/adl/adl_v3.h
+++ b/engines/adl/adl_v3.h
@@ -36,8 +36,12 @@ protected:
 
 	// AdlEngine
 	virtual void setupOpcodeTables();
+	Common::String getItemDescription(const Item &item) const;
 
 	int o3_isNounNotInRoom(ScriptEnv &e);
+	int o3_listInv(ScriptEnv &e);
+
+	Common::Array<Common::String> _itemDesc;
 };
 
 } // End of namespace Adl
diff --git a/engines/adl/adl_v4.cpp b/engines/adl/adl_v4.cpp
index 598f0f0..602ee25 100644
--- a/engines/adl/adl_v4.cpp
+++ b/engines/adl/adl_v4.cpp
@@ -107,7 +107,7 @@ void AdlEngine_v4::setupOpcodeTables() {
 	Opcode(o1_varSub);
 	Opcode(o1_varSet);
 	// 0x04
-	Opcode(o1_listInv);
+	Opcode(o4_listInv);
 	Opcode(o4_moveItem);
 	Opcode(o1_setRoom);
 	Opcode(o2_setCurPic);
@@ -196,6 +196,18 @@ int AdlEngine_v4::o4_isNounNotInRoom(ScriptEnv &e) {
 	return 1;
 }
 
+int AdlEngine_v4::o4_listInv(ScriptEnv &e) {
+	OP_DEBUG_0("\tLIST_INVENTORY()");
+
+	Common::List<Item>::const_iterator item;
+
+	for (item = _state.items.begin(); item != _state.items.end(); ++item)
+		if (item->room == IDI_ANY)
+			printString(_itemDesc[item->id - 1]);
+
+	return 0;
+}
+
 int AdlEngine_v4::o4_moveItem(ScriptEnv &e) {
 	OP_DEBUG_2("\tSET_ITEM_ROOM(%s, %s)", itemStr(e.arg(1)).c_str(), itemRoomStr(e.arg(2)).c_str());
 
diff --git a/engines/adl/adl_v4.h b/engines/adl/adl_v4.h
index 3a4836b..dc9a275 100644
--- a/engines/adl/adl_v4.h
+++ b/engines/adl/adl_v4.h
@@ -57,13 +57,13 @@ protected:
 	int o4_isItemInRoom(ScriptEnv &e);
 	int o4_isNounNotInRoom(ScriptEnv &e);
 	int o4_skipOneCommand(ScriptEnv &e);
+	int o4_listInv(ScriptEnv &e);
 	int o4_moveItem(ScriptEnv &e);
 	int o4_dummy(ScriptEnv &e);
 	int o4_setTextMode(ScriptEnv &e);
 	int o4_setDisk(ScriptEnv &e);
 	int o4_sound(ScriptEnv &e);
 
-	Common::Array<Common::String> _itemDesc;
 	byte _curDisk;
 	Common::Array<DiskOffset> _diskOffsets;
 };





More information about the Scummvm-git-logs mailing list