aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2010-12-01 14:46:59 +0000
committerMatthew Hoops2010-12-01 14:46:59 +0000
commit26f27d9983b93a6c8389605f0d59271b1d0f597f (patch)
tree1a0cb5a99cfba14302716dba6b5fafdf1123c6ee /engines
parent768d3dd6f75cba577e03367d4dbed65ac051b21f (diff)
downloadscummvm-rg350-26f27d9983b93a6c8389605f0d59271b1d0f597f.tar.gz
scummvm-rg350-26f27d9983b93a6c8389605f0d59271b1d0f597f.tar.bz2
scummvm-rg350-26f27d9983b93a6c8389605f0d59271b1d0f597f.zip
MOHAWK: Split d'ni opcodes into their own class
svn-id: r54699
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/module.mk1
-rw-r--r--engines/mohawk/myst.cpp4
-rw-r--r--engines/mohawk/myst_stacks/dni.cpp114
-rw-r--r--engines/mohawk/myst_stacks/dni.h63
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp44
5 files changed, 182 insertions, 44 deletions
diff --git a/engines/mohawk/module.mk b/engines/mohawk/module.mk
index 6ef0ab814e..7ca71c99ad 100644
--- a/engines/mohawk/module.mk
+++ b/engines/mohawk/module.mk
@@ -25,6 +25,7 @@ MODULE_OBJS = \
video.o \
myst_stacks/channelwood.o \
myst_stacks/credits.o \
+ myst_stacks/dni.o \
myst_stacks/mechanical.o \
myst_stacks/myst.o \
myst_stacks/selenitic.o \
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index b7ce6dd2e3..27f248e819 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -41,6 +41,7 @@
// The stacks
#include "mohawk/myst_stacks/channelwood.h"
#include "mohawk/myst_stacks/credits.h"
+#include "mohawk/myst_stacks/dni.h"
#include "mohawk/myst_stacks/mechanical.h"
#include "mohawk/myst_stacks/myst.h"
#include "mohawk/myst_stacks/selenitic.h"
@@ -385,6 +386,9 @@ void MohawkEngine_Myst::changeToStack(uint16 stack) {
case kCreditsStack:
_scriptParser = new MystScriptParser_Credits(this);
break;
+ case kDniStack:
+ _scriptParser = new MystScriptParser_Dni(this);
+ break;
case kMechanicalStack:
_scriptParser = new MystScriptParser_Mechanical(this);
break;
diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp
new file mode 100644
index 0000000000..5c93841b67
--- /dev/null
+++ b/engines/mohawk/myst_stacks/dni.cpp
@@ -0,0 +1,114 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "mohawk/myst.h"
+#include "mohawk/graphics.h"
+#include "mohawk/myst_areas.h"
+#include "mohawk/sound.h"
+#include "mohawk/video.h"
+#include "mohawk/myst_stacks/dni.h"
+
+#include "gui/message.h"
+
+namespace Mohawk {
+
+MystScriptParser_Dni::MystScriptParser_Dni(MohawkEngine_Myst *vm) : MystScriptParser(vm) {
+ setupOpcodes();
+}
+
+MystScriptParser_Dni::~MystScriptParser_Dni() {
+}
+
+#define OPCODE(op, x) _opcodes.push_back(new MystOpcode(op, (OpcodeProcMyst) &MystScriptParser_Dni::x, #x))
+
+void MystScriptParser_Dni::setupOpcodes() {
+ // "Stack-Specific" Opcodes
+ OPCODE(100, opcode_100);
+ OPCODE(101, opcode_101);
+
+ // "Init" Opcodes
+ OPCODE(200, opcode_200);
+
+ // "Exit" Opcodes
+ OPCODE(300, opcode_300);
+}
+
+#undef OPCODE
+
+void MystScriptParser_Dni::disablePersistentScripts() {
+}
+
+void MystScriptParser_Dni::runPersistentScripts() {
+}
+
+void MystScriptParser_Dni::opcode_100(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ // Used in Card 5022 (Rocks)
+ varUnusedCheck(op, var);
+
+ if (argc == 0) {
+ debugC(kDebugScript, "Opcode %d: Unknown Function", op);
+
+ // TODO: Fill in Logic.
+ } else
+ unknown(op, var, argc, argv);
+}
+
+void MystScriptParser_Dni::opcode_101(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ // Used in Card 5014 (Atrus)
+ // Hotspot Resource Used to hand Page to Atrus...
+ varUnusedCheck(op, var);
+ // TODO: Fill in Logic.
+}
+
+void MystScriptParser_Dni::opcode_200(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ varUnusedCheck(op, var);
+ // Used on Card 5014
+
+ // TODO: Logic for Atrus Reactions and Movies
+ if (false) {
+ // Var 0 used for Atrus Gone (from across room) 0 = Present, 1 = Not Present
+ // Var 1 used for Myst Book Status 0 = Not Usuable
+ // 1 = Openable, but not linkable (Atrus Gone?)
+ // 2 = Linkable
+ // Var 2 used for Music Type 0 to 2..
+ // Var 106 used for Atrus Static Image State 0 = Initial State
+ // 1 = Holding Out Hand for Page
+ // 2 = Gone, Book Open
+ // 3 = Back #1
+ // 4 = Back #2
+ _vm->_video->playMovie(_vm->wrapMovieFilename("atr1nopg", kDniStack), 215, 77);
+ _vm->_video->playMovie(_vm->wrapMovieFilename("atr1page", kDniStack), 215, 77);
+ _vm->_video->playMovie(_vm->wrapMovieFilename("atrus2", kDniStack), 215, 77);
+ _vm->_video->playMovie(_vm->wrapMovieFilename("atrwrite", kDniStack), 215, 77);
+ }
+}
+
+void MystScriptParser_Dni::opcode_300(uint16 op, uint16 var, uint16 argc, uint16 *argv) {
+ // Used in Card 5014 (Atrus Writing)
+ varUnusedCheck(op, var);
+ // TODO: Fill in Logic.
+}
+
+} // End of namespace Mohawk
diff --git a/engines/mohawk/myst_stacks/dni.h b/engines/mohawk/myst_stacks/dni.h
new file mode 100644
index 0000000000..56f8591d41
--- /dev/null
+++ b/engines/mohawk/myst_stacks/dni.h
@@ -0,0 +1,63 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef MYST_SCRIPTS_DNI_H
+#define MYST_SCRIPTS_DNI_H
+
+#include "common/scummsys.h"
+#include "common/util.h"
+#include "mohawk/myst_scripts.h"
+
+namespace Mohawk {
+
+#define DECLARE_OPCODE(x) void x(uint16 op, uint16 var, uint16 argc, uint16 *argv)
+
+class MohawkEngine_Myst;
+struct MystScriptEntry;
+
+class MystScriptParser_Dni : public MystScriptParser {
+public:
+ MystScriptParser_Dni(MohawkEngine_Myst *vm);
+ ~MystScriptParser_Dni();
+
+ void disablePersistentScripts();
+ void runPersistentScripts();
+
+private:
+ void setupOpcodes();
+
+ DECLARE_OPCODE(opcode_100);
+ DECLARE_OPCODE(opcode_101);
+
+ DECLARE_OPCODE(opcode_200);
+
+ DECLARE_OPCODE(opcode_300);
+};
+
+} // End of namespace Mohawk
+
+#undef DECLARE_OPCODE
+
+#endif
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 0209510390..a072e560c4 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -224,17 +224,6 @@ void MystScriptParser_Myst::opcode_100(uint16 op, uint16 var, uint16 argc, uint1
// TODO: No soundIdLinkDst for Opcode 100 link? Check Original.
}
break;
- case kDniStack:
- // Used in Card 5022 (Rocks)
- varUnusedCheck(op, var);
-
- if (argc == 0) {
- debugC(kDebugScript, "Opcode %d: Unknown Function", op);
-
- // TODO: Fill in Logic.
- } else
- unknown(op, var, argc, argv);
- break;
case kMakingOfStack:
_vm->_system->quit();
break;
@@ -263,12 +252,6 @@ void MystScriptParser_Myst::opcode_101(uint16 op, uint16 var, uint16 argc, uint1
} else
unknown(op, var, argc, argv);
break;
- case kDniStack:
- // Used in Card 5014 (Atrus)
- // Hotspot Resource Used to hand Page to Atrus...
- varUnusedCheck(op, var);
- // TODO: Fill in Logic.
- break;
case kDemoStack:
varUnusedCheck(op, var);
@@ -1160,28 +1143,6 @@ void MystScriptParser_Myst::opcode_200(uint16 op, uint16 var, uint16 argc, uint1
} else
unknown(op, var, argc, argv);
break;
- case kDniStack:
- varUnusedCheck(op, var);
- // Used on Card 5014
-
- // TODO: Logic for Atrus Reactions and Movies
- if (false) {
- // Var 0 used for Atrus Gone (from across room) 0 = Present, 1 = Not Present
- // Var 1 used for Myst Book Status 0 = Not Usuable
- // 1 = Openable, but not linkable (Atrus Gone?)
- // 2 = Linkable
- // Var 2 used for Music Type 0 to 2..
- // Var 106 used for Atrus Static Image State 0 = Initial State
- // 1 = Holding Out Hand for Page
- // 2 = Gone, Book Open
- // 3 = Back #1
- // 4 = Back #2
- _vm->_video->playMovie(_vm->wrapMovieFilename("atr1nopg", kDniStack), 215, 77);
- _vm->_video->playMovie(_vm->wrapMovieFilename("atr1page", kDniStack), 215, 77);
- _vm->_video->playMovie(_vm->wrapMovieFilename("atrus2", kDniStack), 215, 77);
- _vm->_video->playMovie(_vm->wrapMovieFilename("atrwrite", kDniStack), 215, 77);
- }
- break;
case kDemoSlidesStack:
// Used on Cards...
if (argc == 1) {
@@ -1995,11 +1956,6 @@ void MystScriptParser_Myst::opcode_300(uint16 op, uint16 var, uint16 argc, uint1
debugC(kDebugScript, "Var: %d", var);
// TODO: Fill in Logic
break;
- case kDniStack:
- // Used in Card 5014 (Atrus Writing)
- varUnusedCheck(op, var);
- // TODO: Fill in Logic.
- break;
case kDemoStack:
// Used on Card 2000
varUnusedCheck(op, var);