aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/access.cpp61
-rw-r--r--engines/access/access.h94
-rw-r--r--engines/access/configure.engine3
-rw-r--r--engines/access/debugger.cpp33
-rw-r--r--engines/access/debugger.h45
-rw-r--r--engines/access/detection.cpp146
-rw-r--r--engines/access/detection_tables.h47
-rw-r--r--engines/access/module.mk14
8 files changed, 443 insertions, 0 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
new file mode 100644
index 0000000000..f3615e10da
--- /dev/null
+++ b/engines/access/access.cpp
@@ -0,0 +1,61 @@
+/* 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/scummsys.h"
+#include "common/config-manager.h"
+#include "common/debug-channels.h"
+#include "common/events.h"
+#include "engines/util.h"
+#include "access/access.h"
+
+namespace Access {
+
+AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc) :
+ _gameDescription(gameDesc), Engine(syst), _randomSource("Access") {
+ _debugger = nullptr;
+}
+
+AccessEngine::~AccessEngine() {
+ delete _debugger;
+}
+
+void AccessEngine::initialize() {
+ // Set up debug channels
+ DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level");
+ DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
+ DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
+
+ _debugger = new Debugger(this);
+}
+
+Common::Error AccessEngine::run() {
+ initGraphics(320, 200, false);
+ initialize();
+
+ return Common::kNoError;
+}
+
+int AccessEngine::getRandomNumber(int maxNumber) {
+ return _randomSource.getRandomNumber(maxNumber);
+}
+
+} // End of namespace Access
diff --git a/engines/access/access.h b/engines/access/access.h
new file mode 100644
index 0000000000..f46cf0094c
--- /dev/null
+++ b/engines/access/access.h
@@ -0,0 +1,94 @@
+/* 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 ACCESS_ACCESS_H
+#define ACCESS_ACCESS_H
+
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/error.h"
+#include "common/random.h"
+#include "common/util.h"
+#include "engines/engine.h"
+#include "graphics/surface.h"
+#include "access/debugger.h"
+
+/**
+ * This is the namespace of the Access engine.
+ *
+ * Status of this engine: In Development
+ *
+ * Games using this engine:
+ * - Amazon: Guardians of Eden
+ */
+namespace Access {
+
+#define DEBUG_BASIC 1
+#define DEBUG_INTERMEDIATE 2
+#define DEBUG_DETAILED 3
+
+enum AccessDebugChannels {
+ kDebugPath = 1 << 0,
+ kDebugScripts = 1 << 1,
+ kDebugGraphics = 1 << 2
+};
+
+enum {
+ GType_Amazon = 0,
+ GType_MeanStreets = 1
+};
+
+struct AccessGameDescription;
+
+
+class AccessEngine : public Engine {
+private:
+ const AccessGameDescription *_gameDescription;
+ Common::RandomSource _randomSource;
+
+ /**
+ * Handles basic initialisation
+ */
+ void initialize();
+protected:
+ // Engine APIs
+ virtual Common::Error run();
+ virtual bool hasFeature(EngineFeature f) const;
+public:
+ Debugger *_debugger;
+public:
+ AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc);
+ virtual ~AccessEngine();
+
+ uint32 getFeatures() const;
+ Common::Language getLanguage() const;
+ Common::Platform getPlatform() const;
+ uint16 getVersion() const;
+ uint32 getGameID() const;
+ uint32 getGameFeatures() const;
+
+ int getRandomNumber(int maxNumber);
+};
+
+} // End of namespace Access
+
+#endif /* ACCESS_ACCESS_H */
diff --git a/engines/access/configure.engine b/engines/access/configure.engine
new file mode 100644
index 0000000000..b1defce946
--- /dev/null
+++ b/engines/access/configure.engine
@@ -0,0 +1,3 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine access "Access" no
diff --git a/engines/access/debugger.cpp b/engines/access/debugger.cpp
new file mode 100644
index 0000000000..e92e3402ac
--- /dev/null
+++ b/engines/access/debugger.cpp
@@ -0,0 +1,33 @@
+/* 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/file.h"
+#include "access/access.h"
+#include "access/debugger.h"
+
+namespace Access {
+
+Debugger::Debugger(AccessEngine *vm) : GUI::Debugger(), _vm(vm) {
+ registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
+}
+
+} // End of namespace Access
diff --git a/engines/access/debugger.h b/engines/access/debugger.h
new file mode 100644
index 0000000000..dcf49c4ecd
--- /dev/null
+++ b/engines/access/debugger.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 ACCESS_DEBUGGER_H
+#define ACCESS_DEBUGGER_H
+
+#include "common/scummsys.h"
+#include "gui/debugger.h"
+
+namespace Access {
+
+class AccessEngine;
+
+class Debugger : public GUI::Debugger {
+private:
+ AccessEngine *_vm;
+protected:
+public:
+public:
+ Debugger(AccessEngine *vm);
+ virtual ~Debugger() {}
+};
+
+} // End of namespace Access
+
+#endif /* ACCESS_DEBUGGER_H */
diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp
new file mode 100644
index 0000000000..aca594d60d
--- /dev/null
+++ b/engines/access/detection.cpp
@@ -0,0 +1,146 @@
+/* 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 "access/access.h"
+
+#include "base/plugins.h"
+#include "common/savefile.h"
+#include "common/str-array.h"
+#include "common/memstream.h"
+#include "engines/advancedDetector.h"
+#include "common/system.h"
+#include "graphics/colormasks.h"
+#include "graphics/surface.h"
+
+#define MAX_SAVES 99
+
+namespace Access {
+
+struct AccessGameDescription {
+ ADGameDescription desc;
+
+ int gameID;
+ uint32 features;
+};
+
+uint32 AccessEngine::getGameID() const {
+ return _gameDescription->gameID;
+}
+
+uint32 AccessEngine::getGameFeatures() const {
+ return _gameDescription->features;
+}
+
+uint32 AccessEngine::getFeatures() const {
+ return _gameDescription->desc.flags;
+}
+
+Common::Language AccessEngine::getLanguage() const {
+ return _gameDescription->desc.language;
+}
+
+Common::Platform AccessEngine::getPlatform() const {
+ return _gameDescription->desc.platform;
+}
+
+} // End of namespace Access
+
+static const PlainGameDescriptor AccessGames[] = {
+ {"Access", "Access"},
+ {"amazon", "Amazon: Guardians of Eden"},
+ {0, 0}
+};
+
+#include "access/detection_tables.h"
+
+class AccessMetaEngine : public AdvancedMetaEngine {
+public:
+ AccessMetaEngine() : AdvancedMetaEngine(Access::gameDescriptions, sizeof(Access::AccessGameDescription), AccessGames) {
+ _maxScanDepth = 3;
+ }
+
+ virtual const char *getName() const {
+ return "Access Engine";
+ }
+
+ virtual const char *getOriginalCopyright() const {
+ return "Access (c)";
+ }
+
+ virtual bool hasFeature(MetaEngineFeature f) const;
+ virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+ virtual SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const;
+ virtual void removeSaveState(const char *target, int slot) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+};
+
+bool AccessMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsLoadingDuringStartup) ||
+ (f == kSupportsDeleteSave) ||
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportThumbnail);
+}
+
+bool Access::AccessEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL) ||
+ (f == kSupportsLoadingDuringRuntime) ||
+ (f == kSupportsSavingDuringRuntime);
+}
+
+bool AccessMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+ const Access::AccessGameDescription *gd = (const Access::AccessGameDescription *)desc;
+ if (gd) {
+ *engine = new Access::AccessEngine(syst, gd);
+ }
+ return gd != 0;
+}
+
+SaveStateList AccessMetaEngine::listSaves(const char *target) const {
+ SaveStateList saveList;
+
+ return saveList;
+}
+
+int AccessMetaEngine::getMaximumSaveSlot() const {
+ return MAX_SAVES;
+}
+
+void AccessMetaEngine::removeSaveState(const char *target, int slot) const {
+ Common::String filename = Common::String::format("%s.%03d", target, slot);
+ g_system->getSavefileManager()->removeSavefile(filename);
+}
+
+SaveStateDescriptor AccessMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ return SaveStateDescriptor();
+}
+
+
+#if PLUGIN_ENABLED_DYNAMIC(ACCESS)
+ REGISTER_PLUGIN_DYNAMIC(ACCESS, PLUGIN_TYPE_ENGINE, AccessMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(ACCESS, PLUGIN_TYPE_ENGINE, AccessMetaEngine);
+#endif
diff --git a/engines/access/detection_tables.h b/engines/access/detection_tables.h
new file mode 100644
index 0000000000..9100e52e30
--- /dev/null
+++ b/engines/access/detection_tables.h
@@ -0,0 +1,47 @@
+/* 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.
+ *
+ */
+
+namespace Access {
+
+static const AccessGameDescription gameDescriptions[] = {
+ {
+ // Amazon Guadians of Eden
+ {
+ "amazon",
+ 0,
+ {
+ {"amazon", 0, "00000000000000000000000000000000", 1},
+ AD_LISTEND
+ },
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NONE)
+ },
+ GType_Amazon,
+ 0
+ },
+
+ { AD_TABLE_END_MARKER, 0, 0 }
+};
+
+} // End of namespace Access
diff --git a/engines/access/module.mk b/engines/access/module.mk
new file mode 100644
index 0000000000..c61ab50fae
--- /dev/null
+++ b/engines/access/module.mk
@@ -0,0 +1,14 @@
+MODULE := engines/access
+
+MODULE_OBJS := \
+ access.o \
+ debugger.o \
+ detection.o
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_ACCESS), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk