aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-10-15 21:47:27 -0700
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit9c536cb6bff1744b39b20a9d29c9e33315025e2d (patch)
treedc34dc1398f7576425d9a13faa6861570f9e724c
parentc4d4d48d67953687b1d21eb1f7e01fb4a508958b (diff)
downloadscummvm-rg350-9c536cb6bff1744b39b20a9d29c9e33315025e2d.tar.gz
scummvm-rg350-9c536cb6bff1744b39b20a9d29c9e33315025e2d.tar.bz2
scummvm-rg350-9c536cb6bff1744b39b20a9d29c9e33315025e2d.zip
GLK: Add stub classes for sub-engine components
-rw-r--r--engines/gargoyle/events.cpp31
-rw-r--r--engines/gargoyle/events.h40
-rw-r--r--engines/gargoyle/gargoyle.cpp5
-rw-r--r--engines/gargoyle/gargoyle.h10
-rw-r--r--engines/gargoyle/glk.cpp28
-rw-r--r--engines/gargoyle/glk.h45
-rw-r--r--engines/gargoyle/interpreter.cpp28
-rw-r--r--engines/gargoyle/interpreter.h45
-rw-r--r--engines/gargoyle/module.mk6
-rw-r--r--engines/gargoyle/scott/scott.cpp30
-rw-r--r--engines/gargoyle/scott/scott.h98
11 files changed, 362 insertions, 4 deletions
diff --git a/engines/gargoyle/events.cpp b/engines/gargoyle/events.cpp
new file mode 100644
index 0000000000..93021efb4a
--- /dev/null
+++ b/engines/gargoyle/events.cpp
@@ -0,0 +1,31 @@
+/* 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 "gargoyle/events.h"
+
+namespace Gargoyle {
+
+void Events::pollEvents() {
+ // TODO
+}
+
+} // End of namespace Gargoyle
diff --git a/engines/gargoyle/events.h b/engines/gargoyle/events.h
new file mode 100644
index 0000000000..ac66d0e3c9
--- /dev/null
+++ b/engines/gargoyle/events.h
@@ -0,0 +1,40 @@
+/* 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 GARGOYLE_EVENTS_H
+#define GARGOYLE_EVENTS_H
+
+#include "common/events.h"
+
+namespace Gargoyle {
+
+class Events {
+public:
+ /**
+ * Checks for new events
+ */
+ void pollEvents();
+};
+
+} // End of namespace Gargoyle
+
+#endif
diff --git a/engines/gargoyle/gargoyle.cpp b/engines/gargoyle/gargoyle.cpp
index 79cbaf24fd..e55e4c57fb 100644
--- a/engines/gargoyle/gargoyle.cpp
+++ b/engines/gargoyle/gargoyle.cpp
@@ -31,8 +31,9 @@
namespace Gargoyle {
-GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc)
- : _gameDescription(gameDesc), Engine(syst) {
+GargoyleEngine::GargoyleEngine(OSystem *syst, const GargoyleGameDescription *gameDesc) :
+ _gameDescription(gameDesc), Engine(syst), _glk(&_screen),
+ _scott(_glk) {
}
GargoyleEngine::~GargoyleEngine() {
diff --git a/engines/gargoyle/gargoyle.h b/engines/gargoyle/gargoyle.h
index 79016ea2ae..5e014b5b83 100644
--- a/engines/gargoyle/gargoyle.h
+++ b/engines/gargoyle/gargoyle.h
@@ -28,6 +28,10 @@
#include "common/serializer.h"
#include "engines/advancedDetector.h"
#include "engines/engine.h"
+#include "graphics/screen.h"
+#include "gargoyle/events.h"
+#include "gargoyle/glk.h"
+#include "gargoyle/scott/scott.h"
namespace Gargoyle {
@@ -57,9 +61,13 @@ private:
* Handles basic initialization
*/
void initialize();
-protected:
+private:
const GargoyleGameDescription *_gameDescription;
int _loadSaveSlot;
+ Graphics::Screen _screen;
+ Events _events;
+ Glk _glk;
+ Scott::Scott _scott;
// Engine APIs
virtual Common::Error run();
diff --git a/engines/gargoyle/glk.cpp b/engines/gargoyle/glk.cpp
new file mode 100644
index 0000000000..82447b5c3c
--- /dev/null
+++ b/engines/gargoyle/glk.cpp
@@ -0,0 +1,28 @@
+/* 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 "gargoyle/glk.h"
+
+namespace Gargoyle {
+
+
+} // End of namespace Gargoyle
diff --git a/engines/gargoyle/glk.h b/engines/gargoyle/glk.h
new file mode 100644
index 0000000000..86c2353bbd
--- /dev/null
+++ b/engines/gargoyle/glk.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 GARGOYLE_GLK_H
+#define GARGOYLE_GLK_H
+
+#include "graphics/managed_surface.h"
+
+namespace Gargoyle {
+
+/**
+ * Implements the GLK interface
+ */
+class Glk {
+private:
+ Graphics::ManagedSurface *_surface;
+public:
+ /**
+ * Constructor
+ */
+ Glk(Graphics::ManagedSurface *surface) : _surface(surface) {}
+};
+
+} // End of namespace Gargoyle
+
+#endif
diff --git a/engines/gargoyle/interpreter.cpp b/engines/gargoyle/interpreter.cpp
new file mode 100644
index 0000000000..10cefd7cc6
--- /dev/null
+++ b/engines/gargoyle/interpreter.cpp
@@ -0,0 +1,28 @@
+/* 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 "gargoyle/interpreter.h"
+
+namespace Gargoyle {
+
+
+} // End of namespace Gargoyle
diff --git a/engines/gargoyle/interpreter.h b/engines/gargoyle/interpreter.h
new file mode 100644
index 0000000000..002b46ce2e
--- /dev/null
+++ b/engines/gargoyle/interpreter.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 GARGOYLE_INTERPRETER_H
+#define GARGOYLE_INTERPRETER_H
+
+#include "gargoyle/glk.h"
+
+namespace Gargoyle {
+
+/**
+ * Base class for specific interpreters
+ */
+class Interpreter {
+protected:
+ Glk &_glk;
+public:
+ /**
+ * Constructor
+ */
+ Interpreter(Glk &glk) : _glk(glk) {}
+};
+
+} // End of namespace Gargoyle
+
+#endif
diff --git a/engines/gargoyle/module.mk b/engines/gargoyle/module.mk
index 81b1389185..937b814453 100644
--- a/engines/gargoyle/module.mk
+++ b/engines/gargoyle/module.mk
@@ -2,7 +2,11 @@ MODULE := engines/gargoyle
MODULE_OBJS := \
detection.o \
- gargoyle.o
+ events.o \
+ gargoyle.o \
+ glk.o \
+ interpreter.o \
+ scott/scott.o
# This module can be built as a plugin
ifeq ($(ENABLE_GARGOYLE), DYNAMIC_PLUGIN)
diff --git a/engines/gargoyle/scott/scott.cpp b/engines/gargoyle/scott/scott.cpp
new file mode 100644
index 0000000000..b5e537caad
--- /dev/null
+++ b/engines/gargoyle/scott/scott.cpp
@@ -0,0 +1,30 @@
+/* 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 "gargoyle/scott/scott.h"
+
+namespace Gargoyle {
+namespace Scott {
+
+
+} // End of namespace Scott
+} // End of namespace Gargoyle
diff --git a/engines/gargoyle/scott/scott.h b/engines/gargoyle/scott/scott.h
new file mode 100644
index 0000000000..a5d734f40d
--- /dev/null
+++ b/engines/gargoyle/scott/scott.h
@@ -0,0 +1,98 @@
+/* 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 GARGOYLE_SCOTT
+#define GARGOYLE_SCOTT
+
+/*
+ * Controlling block
+ */
+
+#include "common/scummsys.h"
+#include "gargoyle/interpreter.h"
+
+namespace Gargoyle {
+namespace Scott {
+
+#define LIGHT_SOURCE 9 // Always 9 how odd
+#define CARRIED 255 // Carried
+#define DESTROYED 0 // Destroyed
+#define DARKBIT 15
+#define LIGHTOUTBIT 16 // Light gone out
+
+#define YOUARE 1 // You are not I am
+#define SCOTTLIGHT 2 // Authentic Scott Adams light messages
+#define DEBUGGING 4 // Info from database load
+#define TRS80_STYLE 8 // Display in style used on TRS-80
+#define PREHISTORIC_LAMP 16 // Destroy the lamp (very old databases)
+
+struct Header {
+ int Unknown;
+ int NumItems;
+ int NumActions;
+ int NumWords; // Smaller of verb/noun is padded to same size
+ int NumRooms;
+ int MaxCarry;
+ int PlayerRoom;
+ int Treasures;
+ int WordLength;
+ int LightTime;
+ int NumMessages;
+ int TreasureRoom;
+};
+
+struct Action {
+ uint Vocab;
+ uint Condition[5];
+ uint action[2];
+};
+
+struct Room {
+ char *Text;
+ short Exits[6];
+};
+
+struct Item {
+ char *Text; // PORTABILITY WARNING: THESE TWO MUST BE 8 BIT VALUES.
+ byte Location;
+ byte InitialLoc;
+ char *AutoGet;
+};
+
+struct Tail {
+ int Version;
+ int AdventureNumber;
+ int Unknown;
+};
+
+class Scott : public Interpreter {
+public:
+ /**
+ * Constructor
+ */
+ Scott(Glk &glk) : Interpreter(glk) {}
+};
+
+} // End of namespace Scott
+} // End of namespace Gargoyle
+
+#endif