xenia-canary/src/xenia/cpu/xex_module.h

61 lines
1.5 KiB
C
Raw Normal View History

/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_CPU_XEX_MODULE_H_
#define XENIA_CPU_XEX_MODULE_H_
2014-07-14 04:15:37 +00:00
#include <string>
2015-03-24 15:25:58 +00:00
#include "xenia/cpu/module.h"
2015-02-01 06:49:47 +00:00
#include "xenia/kernel/util/xex2.h"
namespace xe {
// KernelState forward decl.
namespace kernel { class KernelState; }
namespace cpu {
2015-03-24 15:25:58 +00:00
class Runtime;
2015-03-24 15:25:58 +00:00
class XexModule : public xe::cpu::Module {
public:
XexModule(Processor* processor, kernel::KernelState* state);
virtual ~XexModule();
2013-12-25 01:25:29 +00:00
xe_xex2_ref xex() const { return xex_; }
2015-05-06 00:21:08 +00:00
bool Load(const std::string& name, const std::string& path, xe_xex2_ref xex);
2014-07-14 04:15:37 +00:00
const std::string& name() const override { return name_; }
bool ContainsAddress(uint32_t address) override;
private:
2015-05-06 00:21:08 +00:00
bool SetupImports(xe_xex2_ref xex);
bool SetupLibraryImports(const xe_xex2_import_library_t* library);
bool FindSaveRest();
private:
2015-05-04 05:28:25 +00:00
Processor* processor_;
kernel::KernelState* kernel_state_;
std::string name_;
std::string path_;
xe_xex2_ref xex_;
uint32_t base_address_;
uint32_t low_address_;
uint32_t high_address_;
};
} // namespace cpu
} // namespace xe
#endif // XENIA_CPU_XEX_MODULE_H_