Shuffle some code around.

This commit is contained in:
Dr. Chat
2015-06-29 00:48:24 -05:00
parent e44ac54eed
commit fe87c08424
5 changed files with 162 additions and 37 deletions

View File

@@ -14,6 +14,7 @@
#include "xenia/cpu/module.h"
#include "xenia/kernel/util/xex2.h"
#include "xenia/kernel/util/xex2_info.h"
namespace xe {
@@ -32,7 +33,17 @@ class XexModule : public xe::cpu::Module {
virtual ~XexModule();
xe_xex2_ref xex() const { return xex_; }
const xex2_header* xex_header() const { return xex_header_; }
// Gets an optional header. Returns NULL if not found.
// Special case: if key & 0xFF == 0x00, this function will return the value,
// not a pointer!
static bool GetOptHeader(const xex2_header* header, xe_xex2_header_keys key,
void** out_ptr);
bool ApplyPatch(XexModule* module);
bool Load(const std::string& name, const std::string& path,
const void* xex_addr, size_t xex_length);
bool Load(const std::string& name, const std::string& path, xe_xex2_ref xex);
const std::string& name() const override { return name_; }
@@ -50,6 +61,7 @@ class XexModule : public xe::cpu::Module {
std::string name_;
std::string path_;
xe_xex2_ref xex_;
xex2_header* xex_header_;
uint32_t base_address_;
uint32_t low_address_;