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_;
};

View File

@@ -54,10 +54,11 @@ public:
shared_ptr<ExportResolver> export_resolver();
shared_ptr<fs::FileSystem> filesystem();
int LaunchModule(const xechar_t* path);
int LaunchXexFile(const xechar_t* path);
int LaunchDiscImage(const xechar_t* path);
private:
xechar_t command_line_[2048];
xechar_t command_line_[XE_MAX_PATH];
xe_pal_ref pal_;
xe_memory_ref memory_;

View File

@@ -34,6 +34,7 @@ typedef uint32_t X_STATUS;
#define X_STATUS_ACCESS_VIOLATION ((uint32_t)0xC0000005L)
#define X_STATUS_INVALID_HANDLE ((uint32_t)0xC0000008L)
#define X_STATUS_INVALID_PARAMETER ((uint32_t)0xC000000DL)
#define X_STATUS_NO_SUCH_FILE ((uint32_t)0xC000000FL)
#define X_STATUS_NO_MEMORY ((uint32_t)0xC0000017L)
#define X_STATUS_ALREADY_COMMITTED ((uint32_t)0xC0000021L)
#define X_STATUS_ACCESS_DENIED ((uint32_t)0xC0000022L)