[Scummvm-cvs-logs] SF.net SVN: scummvm:[51843] scummvm/branches/gsoc2010-plugins/backends/ plugins

toneman1138 at users.sourceforge.net toneman1138 at users.sourceforge.net
Sat Aug 7 23:47:50 CEST 2010


Revision: 51843
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51843&view=rev
Author:   toneman1138
Date:     2010-08-07 21:47:50 +0000 (Sat, 07 Aug 2010)

Log Message:
-----------
added necessary files I forgot to commit yesterday (whoops...) for mips and arm loaders

Added Paths:
-----------
    scummvm/branches/gsoc2010-plugins/backends/plugins/arm-loader.h
    scummvm/branches/gsoc2010-plugins/backends/plugins/mips-loader.h
    scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.cpp
    scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.h

Added: scummvm/branches/gsoc2010-plugins/backends/plugins/arm-loader.h
===================================================================
--- scummvm/branches/gsoc2010-plugins/backends/plugins/arm-loader.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-plugins/backends/plugins/arm-loader.h	2010-08-07 21:47:50 UTC (rev 51843)
@@ -0,0 +1,46 @@
+/* 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/fs/ds/ds-fs.h"
+#include "elf-loader.h"
+#include "dsmain.h"
+
+class ARMDLObject : public DLObject {
+protected:
+    bool relocate(Common::SeekableReadStream* DLFile, unsigned long offset, unsigned long size, void *relSegment);
+    bool relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr);
+
+public:
+    ARMDLObject() {
+    	_segment = NULL;
+    	_symtab = NULL;
+    	_strtab = NULL;
+    	_symbol_cnt = 0;
+    	_symtab_sect = -1;
+    	_dtors_start = NULL;
+    	_dtors_end = NULL;
+    	_segmentSize = 0;
+    }
+};


Property changes on: scummvm/branches/gsoc2010-plugins/backends/plugins/arm-loader.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-plugins/backends/plugins/mips-loader.h
===================================================================
--- scummvm/branches/gsoc2010-plugins/backends/plugins/mips-loader.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-plugins/backends/plugins/mips-loader.h	2010-08-07 21:47:50 UTC (rev 51843)
@@ -0,0 +1,54 @@
+
+/* 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 "elf-loader.h"
+#include "shorts-segment-manager.h"
+
+class MIPSDLObject : public DLObject {
+protected:
+	ShortSegmentManager::Segment *_shortsSegment;			// For assigning shorts ranges
+	unsigned int _gpVal;									// Value of Global Pointer
+
+	bool relocate(Common::SeekableReadStream* DLFile, unsigned long offset, unsigned long size, void *relSegment);
+    bool relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr);
+    void relocateSymbols(Elf32_Addr offset);
+    bool loadSegment(Common::SeekableReadStream* DLFile, Elf32_Phdr *phdr);
+    void unload();
+
+public:
+    MIPSDLObject() {
+    	_segment = NULL;
+    	_symtab = NULL;
+    	_strtab = NULL;
+    	_symbol_cnt = 0;
+    	_symtab_sect = -1;
+    	_dtors_start = NULL;
+    	_dtors_end = NULL;
+    	_segmentSize = 0;
+		_shortsSegment = NULL;
+		_gpVal = 0;
+    }
+};


Property changes on: scummvm/branches/gsoc2010-plugins/backends/plugins/mips-loader.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.cpp
===================================================================
--- scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.cpp	                        (rev 0)
+++ scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.cpp	2010-08-07 21:47:50 UTC (rev 51843)
@@ -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)


Property changes on: scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + URL Id
Added: svn:eol-style
   + native

Added: scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.h
===================================================================
--- scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.h	                        (rev 0)
+++ scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.h	2010-08-07 21:47:50 UTC (rev 51843)
@@ -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;
+};
+


Property changes on: scummvm/branches/gsoc2010-plugins/backends/plugins/ps2/ps2-provider.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + URL Id
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list