mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 11:36:22 +00:00
made MIPSDLObject and PS2 plugin provider that uses it
svn-id: r51818
This commit is contained in:
parent
646587f79a
commit
6982aed8a4
@ -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 \
|
||||
|
@ -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
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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) */
|
||||
|
@ -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) {
|
||||
|
@ -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) */
|
Loading…
x
Reference in New Issue
Block a user