aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Puccinelli2010-08-07 00:40:15 +0000
committerTony Puccinelli2010-08-07 00:40:15 +0000
commit6982aed8a43be6a33802be95c9fde557885b7a5b (patch)
tree5fe7161875e2e7ff6658c6179f9f9c03ef8adf90
parent646587f79a4249e25e47af74d36c72602f00dd0f (diff)
downloadscummvm-rg350-6982aed8a43be6a33802be95c9fde557885b7a5b.tar.gz
scummvm-rg350-6982aed8a43be6a33802be95c9fde557885b7a5b.tar.bz2
scummvm-rg350-6982aed8a43be6a33802be95c9fde557885b7a5b.zip
made MIPSDLObject and PS2 plugin provider that uses it
svn-id: r51818
-rw-r--r--backends/module.mk1
-rw-r--r--backends/platform/ps2/Makefile.ps24
-rw-r--r--backends/platform/ps2/systemps2.cpp4
-rw-r--r--backends/plugins/arm-loader.cpp6
-rw-r--r--backends/plugins/ds/ds-provider.cpp6
-rw-r--r--backends/plugins/mips-loader.cpp (renamed from backends/plugins/mips-relocs.cpp)9
6 files changed, 14 insertions, 16 deletions
diff --git a/backends/module.mk b/backends/module.mk
index bcfcb53a3e..d164cd3782 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -37,6 +37,7 @@ MODULE_OBJS := \
plugins/sdl/sdl-provider.o \
plugins/win32/win32-provider.o \
plugins/psp/psp-provider.o \
+ plugins/ps2/ps2-provider.o \
plugins/gp2xwiz/gp2xwiz-provider.o \
saves/savefile.o \
saves/default/default-saves.o \
diff --git a/backends/platform/ps2/Makefile.ps2 b/backends/platform/ps2/Makefile.ps2
index e5617f40bd..8c59ee8c17 100644
--- a/backends/platform/ps2/Makefile.ps2
+++ b/backends/platform/ps2/Makefile.ps2
@@ -77,7 +77,7 @@ DEPDIR = .deps
TARGET = elf/scummvm.elf
-DEFINES += -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -DDISABLE_SAVEGAME_SORTING -D_EE -D__PLAYSTATION2__ -DELF_LOADER_TARGET -G2 -O2 -Wall -Wno-multichar -fno-rtti -fno-exceptions -DNO_ADAPTOR -DNEW_PLUGIN_DESIGN_FIRST_REFINEMENT
+DEFINES += -DUSE_VORBIS -DUSE_TREMOR -DUSE_MAD -DUSE_ZLIB -DFORCE_RTL -DDISABLE_SAVEGAME_SORTING -D_EE -D__PLAYSTATION2__ -DELF_LOADER_TARGET -G2 -O2 -Wall -Wno-multichar -fno-rtti -fno-exceptions -DNO_ADAPTOR#-DNEW_PLUGIN_DESIGN_FIRST_REFINEMENT
INCLUDES = $(addprefix -I$(PS2_EXTRA),$(PS2_EXTRA_INCS))
INCLUDES += -I $(PS2SDK)/ee/include -I $(PS2SDK)/common/include -I ./common -I . -I $(srcdir) -I $(srcdir)/engines
@@ -112,7 +112,7 @@ OBJS := $(srcdir)/backends/platform/ps2/DmaPipe.o \
$(srcdir)/backends/platform/ps2/ps2mutex.o \
$(srcdir)/backends/platform/ps2/ps2time.o \
$(srcdir)/backends/plugins/elf-loader.o \
- $(srcdir)/backends/plugins/mips-relocs.o \
+ $(srcdir)/backends/plugins/mips-loader.o \
$(srcdir)/backends/plugins/shorts-segment-manager.o \
$(srcdir)/backends/platform/ps2/ps2debug.o
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index bd8179976b..357404c5c4 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -59,7 +59,7 @@
#include "backends/platform/ps2/ps2debug.h"
#include "backends/fs/ps2/ps2-fs-factory.h"
-#include "backends/plugins/elf-provider.h"
+#include "backends/plugins/ps2/ps2-provider.h"
#include "backends/saves/default/default-saves.h"
#include "common/config-manager.h"
@@ -132,7 +132,7 @@ extern "C" int main(int argc, char *argv[]) {
g_system = g_systemPs2 = new OSystem_PS2(argv[0]);
#ifdef DYNAMIC_MODULES
- PluginManager::instance().addPluginProvider(new ELFPluginProvider());
+ PluginManager::instance().addPluginProvider(new PS2PluginProvider());
#endif
g_systemPs2->init();
diff --git a/backends/plugins/arm-loader.cpp b/backends/plugins/arm-loader.cpp
index 61d7c73236..cb19af78b6 100644
--- a/backends/plugins/arm-loader.cpp
+++ b/backends/plugins/arm-loader.cpp
@@ -23,7 +23,7 @@
*
*/
-#if defined(DYNAMIC_MODULES) && defined(ARM)
+#if defined(DYNAMIC_MODULES)
#include "backends/fs/ds/ds-fs.h"
#include "elf-loader.h"
@@ -146,7 +146,7 @@ bool ARMDLObject::relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *e
Elf32_Shdr *curShdr = &(shdr[i]);
if ((curShdr->sh_type == SHT_REL || curShdr->sh_type == SHT_RELA) && // Check for a relocation section
- curShdr->sh_entsize == sizeof(Elf32_Rel) && // Check for proper relocation size
+ curShdr->sh_entsize == sizeof(Elf32_Rel) && // Check for proper relocation size
(int)curShdr->sh_link == _symtab_sect && // Check that the sh_link connects to our symbol table
curShdr->sh_info < ehdr->e_shnum && // Check that the relocated section exists
(shdr[curShdr->sh_info].sh_flags & SHF_ALLOC)) { // Check if relocated section resides in memory
@@ -166,4 +166,4 @@ bool ARMDLObject::relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *e
return true;
}
-#endif /* defined(DYNAMIC_MODULES) && defined(ARM) */
+#endif /* defined(DYNAMIC_MODULES) */
diff --git a/backends/plugins/ds/ds-provider.cpp b/backends/plugins/ds/ds-provider.cpp
index c83f198b5e..66e063f151 100644
--- a/backends/plugins/ds/ds-provider.cpp
+++ b/backends/plugins/ds/ds-provider.cpp
@@ -25,17 +25,11 @@
#if defined(DYNAMIC_MODULES) && defined(__DS__)
-/*#include "base/plugins.h"
-#include "backends/plugins/dynamic-plugin.h"
-#include "common/fs.h"
-
-#include "backends/plugins/elf-loader.h"*/
#include "backends/plugins/arm-loader.h"
#include "backends/plugins/elf-provider.h"
#include "backends/plugins/ds/ds-provider.h"
-
class DSPlugin : public ELFPlugin {
public:
DSPlugin(const Common::String &filename) {
diff --git a/backends/plugins/mips-relocs.cpp b/backends/plugins/mips-loader.cpp
index fe8fa7c1a0..708456d475 100644
--- a/backends/plugins/mips-relocs.cpp
+++ b/backends/plugins/mips-loader.cpp
@@ -23,7 +23,9 @@
*
*/
-#include "elf-loader.h"
+#if defined(DYNAMIC_MODULES)
+
+#include "mips-loader.h"
#define __DEBUG_PLUGINS__
@@ -44,7 +46,7 @@
* @param relSegment Base address of relocated segment in memory (memory offset)
*
*/
-bool DLObject::relocate(Common::SeekableReadStream* DLFile, unsigned long offset, unsigned long size, void *relSegment) {
+bool MIPSDLObject::relocate(Common::SeekableReadStream* DLFile, unsigned long offset, unsigned long size, void *relSegment) {
Elf32_Rel *rel = NULL; // relocation entry
// Allocate memory for relocation table
@@ -228,7 +230,7 @@ bool DLObject::relocate(Common::SeekableReadStream* DLFile, unsigned long offset
return true;
}
-bool DLObject::relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) {
+bool MIPSDLObject::relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) {
// Loop over sections, finding relocation sections
for (int i = 0; i < ehdr->e_shnum; i++) {
@@ -257,3 +259,4 @@ bool DLObject::relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr
return true;
}
+#endif /* defined(DYNAMIC_MODULES) */