aboutsummaryrefslogtreecommitdiff
path: root/backends/plugins/ps2
diff options
context:
space:
mode:
authorTony Puccinelli2010-08-07 21:47:50 +0000
committerTony Puccinelli2010-08-07 21:47:50 +0000
commit68b986545a7ce24e3c0d2a8635d538941b67729f (patch)
treefe7bdb69f40c885935411a313c5e2ab198a649a1 /backends/plugins/ps2
parent59b2b46fe8eaf292602ea6e1011ce35ed598e742 (diff)
downloadscummvm-rg350-68b986545a7ce24e3c0d2a8635d538941b67729f.tar.gz
scummvm-rg350-68b986545a7ce24e3c0d2a8635d538941b67729f.tar.bz2
scummvm-rg350-68b986545a7ce24e3c0d2a8635d538941b67729f.zip
added necessary files I forgot to commit yesterday (whoops...) for mips and arm loaders
svn-id: r51843
Diffstat (limited to 'backends/plugins/ps2')
-rw-r--r--backends/plugins/ps2/ps2-provider.cpp76
-rw-r--r--backends/plugins/ps2/ps2-provider.h31
2 files changed, 107 insertions, 0 deletions
diff --git a/backends/plugins/ps2/ps2-provider.cpp b/backends/plugins/ps2/ps2-provider.cpp
new file mode 100644
index 0000000000..7305c27c74
--- /dev/null
+++ b/backends/plugins/ps2/ps2-provider.cpp
@@ -0,0 +1,76 @@
+/* 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$
+ *
+ */
+
+#if defined(DYNAMIC_MODULES) && defined(__PLAYSTATION2__)
+
+#include "backends/plugins/mips-loader.h"
+#include "backends/plugins/elf-provider.h"
+#include "backends/plugins/ps2/ps2-provider.h"
+
+
+class PS2Plugin : public ELFPlugin {
+public:
+ PS2Plugin(const Common::String &filename) {
+ _dlHandle = 0;
+ _filename = filename;
+ }
+
+ ~PS2Plugin() {
+ if (_dlHandle)
+ unloadPlugin();
+ }
+
+ bool loadPlugin();
+};
+
+bool PS2Plugin::loadPlugin() {
+ assert(!_dlHandle);
+ DLObject *obj = new MIPSDLObject();
+ if (obj->open(_filename.c_str())) {
+ _dlHandle = obj;
+ } else {
+ delete obj;
+ _dlHandle = NULL;
+ }
+
+ if (!_dlHandle) {
+ warning("Failed loading plugin '%s'", _filename.c_str());
+ return false;
+ }
+
+ bool ret = DynamicPlugin::loadPlugin();
+
+ if (ret && _dlHandle) {
+ _dlHandle->discard_symtab();
+ }
+
+ return ret;
+};
+
+Plugin* PS2PluginProvider::createPlugin(const Common::FSNode &node) const {
+ return new PS2Plugin(node.getPath());
+}
+
+#endif // defined(DYNAMIC_MODULES) && defined(ELF_LOADER_TARGET)
diff --git a/backends/plugins/ps2/ps2-provider.h b/backends/plugins/ps2/ps2-provider.h
new file mode 100644
index 0000000000..28a2321c29
--- /dev/null
+++ b/backends/plugins/ps2/ps2-provider.h
@@ -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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "backends/plugins/elf-provider.h"
+
+class PS2PluginProvider : public ELFPluginProvider {
+ Plugin* createPlugin(const Common::FSNode &node) const;
+};
+