Wiring up xex loading via the new virtual filesystem.

File resolution is hacked, but works well enough for testing.
This commit is contained in:
Ben Vanik
2013-01-31 16:52:50 -08:00
parent 59189f12ab
commit f78fdba9c3
26 changed files with 392 additions and 60 deletions

View File

@@ -23,13 +23,17 @@ namespace fs {
class Device {
public:
Device(xe_pal_ref pal);
Device(xe_pal_ref pal, const char* path);
virtual ~Device();
xe_pal_ref pal();
const char* path();
virtual Entry* ResolvePath(const char* path) = 0;
protected:
xe_pal_ref pal_;
xe_pal_ref pal_;
char* path_;
};

View File

@@ -45,12 +45,29 @@ private:
};
class MemoryMapping {
public:
MemoryMapping(uint8_t* address, size_t length);
virtual ~MemoryMapping();
uint8_t* address();
size_t length();
private:
uint8_t* address_;
size_t length_;
};
class FileEntry : public Entry {
public:
FileEntry(Device* device, const char* path);
virtual ~FileEntry();
//virtual void Query();
//virtual void Query() = 0;
virtual MemoryMapping* CreateMemoryMapping(
xe_file_mode file_mode, const size_t offset, const size_t length) = 0;
};
@@ -59,7 +76,7 @@ public:
DirectoryEntry(Device* device, const char* path);
virtual ~DirectoryEntry();
//virtual void Query();
//virtual void Query() = 0;
};

View File

@@ -13,6 +13,8 @@
#include <xenia/common.h>
#include <xenia/core.h>
#include <vector>
#include <xenia/kernel/fs/entry.h>
@@ -40,7 +42,9 @@ public:
Entry* ResolvePath(const char* path);
private:
xe_pal_ref pal_;
xe_pal_ref pal_;
std::vector<Device*> devices_;
std::tr1::unordered_map<std::string, std::string> symlinks_;
};