From 4d24209eae5e776fe150775771e7cd70579a518e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 1 Aug 2014 16:20:24 -0400 Subject: ACCESS: Add Amazon floppy detection and skeleton for Amazon engine --- engines/access/access.cpp | 6 ++++- engines/access/access.h | 7 ++---- engines/access/amazon/amazon_game.cpp | 35 ++++++++++++++++++++++++++++ engines/access/amazon/amazon_game.h | 43 +++++++++++++++++++++++++++++++++++ engines/access/detection.cpp | 9 +++++++- engines/access/detection_tables.h | 9 ++++++-- engines/access/module.mk | 1 + 7 files changed, 101 insertions(+), 9 deletions(-) create mode 100644 engines/access/amazon/amazon_game.cpp create mode 100644 engines/access/amazon/amazon_game.h diff --git a/engines/access/access.cpp b/engines/access/access.cpp index 23b8fb9f45..e4b4159f9b 100644 --- a/engines/access/access.cpp +++ b/engines/access/access.cpp @@ -51,7 +51,6 @@ void AccessEngine::initialize() { } Common::Error AccessEngine::run() { - initGraphics(320, 200, false); initialize(); return Common::kNoError; @@ -61,4 +60,9 @@ int AccessEngine::getRandomNumber(int maxNumber) { return _randomSource.getRandomNumber(maxNumber); } +void AccessEngine::SETVGA() { + initGraphics(320, 200, false); +} + + } // End of namespace Access diff --git a/engines/access/access.h b/engines/access/access.h index ef9960e007..5c9207db22 100644 --- a/engines/access/access.h +++ b/engines/access/access.h @@ -53,11 +53,6 @@ enum AccessDebugChannels { kDebugGraphics = 1 << 2 }; -enum { - GType_Amazon = 0, - GType_MeanStreets = 1 -}; - struct AccessGameDescription; @@ -75,6 +70,8 @@ private: * Handles basic initialisation */ void initialize(); + + void SETVGA(); protected: // Engine APIs virtual Common::Error run(); diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp new file mode 100644 index 0000000000..2b4196a406 --- /dev/null +++ b/engines/access/amazon/amazon_game.cpp @@ -0,0 +1,35 @@ +/* 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/amazon/amazon_game.h" + +namespace Access { + +namespace Amazon { + +AmazonEngine::AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc) : + AccessEngine(syst, gameDesc) { +} + +} // End of namespace Amazon + +} // End of namespace Access diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h new file mode 100644 index 0000000000..1bccd1cedc --- /dev/null +++ b/engines/access/amazon/amazon_game.h @@ -0,0 +1,43 @@ +/* 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_AMAZON_GAME_H +#define ACCESS_AMAZON_GAME_H + +#include "access/access.h" + +namespace Access { + +namespace Amazon { + +class AmazonEngine : public AccessEngine { +public: + AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc); + + virtual ~AmazonEngine() {} +}; + +} // End of namespace Amazon + +} // End of namespace Access + +#endif /* ACCESS_ACCESS_H */ diff --git a/engines/access/detection.cpp b/engines/access/detection.cpp index aca594d60d..ca04a64b0d 100644 --- a/engines/access/detection.cpp +++ b/engines/access/detection.cpp @@ -22,6 +22,7 @@ */ #include "access/access.h" +#include "access/amazon/amazon_game.h" #include "base/plugins.h" #include "common/savefile.h" @@ -114,7 +115,13 @@ bool Access::AccessEngine::hasFeature(EngineFeature f) const { 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); + switch (gd->gameID) { + case Access::GType_Amazon: + *engine = new Access::Amazon::AmazonEngine(syst, gd); + break; + default: + error("Unknown game"); + } } return gd != 0; } diff --git a/engines/access/detection_tables.h b/engines/access/detection_tables.h index 9100e52e30..90304290f1 100644 --- a/engines/access/detection_tables.h +++ b/engines/access/detection_tables.h @@ -22,14 +22,19 @@ namespace Access { +enum { + GType_Amazon = 1, + GType_MeanStreets = 2 +}; + static const AccessGameDescription gameDescriptions[] = { { - // Amazon Guadians of Eden + // Amazon Guadians of Eden - Floppy English { "amazon", 0, { - {"amazon", 0, "00000000000000000000000000000000", 1}, + { "c00.ap", 0, "dcabf69d5a0d911168cb73511ebaead0", 331481 }, AD_LISTEND }, Common::EN_ANY, diff --git a/engines/access/module.mk b/engines/access/module.mk index 11630335d1..f04e51630e 100644 --- a/engines/access/module.mk +++ b/engines/access/module.mk @@ -6,6 +6,7 @@ MODULE_OBJS := \ detection.o \ events.o \ resources.o \ + amazon\amazon_game.o # This module can be built as a plugin ifeq ($(ENABLE_ACCESS), DYNAMIC_PLUGIN) -- cgit v1.2.3