Initial Alloy implementation.

This is a regression in functionality and performance, but a much better
foundation for the future of the project (I think). It can run basic
apps under an SSA interpreter but doesn't support some of the features
required to do real 360 apps yet.
This commit is contained in:
Ben Vanik
2013-12-06 22:57:16 -08:00
parent 68b8737a58
commit fdb6a5cfa3
215 changed files with 20167 additions and 16704 deletions

View File

@@ -0,0 +1,69 @@
/**
******************************************************************************
* 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_XENON_MEMORY_H_
#define XENIA_CPU_XENON_MEMORY_H_
#include <alloy/memory.h>
#include <xenia/core.h>
namespace xe {
namespace cpu {
class XenonMemoryHeap;
class XenonMemory : public alloy::Memory {
public:
XenonMemory();
virtual ~XenonMemory();
virtual int Initialize();
virtual uint64_t HeapAlloc(
uint64_t base_address, size_t size, uint32_t flags,
uint32_t alignment = 0x20);
virtual int HeapFree(uint64_t address, size_t size);
virtual int Protect(uint64_t address, size_t size, uint32_t access);
virtual uint32_t QueryProtect(uint64_t address);
private:
int MapViews(uint8_t* mapping_base);
void UnmapViews();
private:
HANDLE mapping_;
uint8_t* mapping_base_;
union {
struct {
uint8_t* v00000000;
uint8_t* v40000000;
uint8_t* v80000000;
uint8_t* vA0000000;
uint8_t* vC0000000;
uint8_t* vE0000000;
};
uint8_t* all_views[6];
} views_;
XenonMemoryHeap* virtual_heap_;
XenonMemoryHeap* physical_heap_;
friend class XenonMemoryHeap;
};
} // namespace cpu
} // namespace xe
#endif // XENIA_CPU_XENON_MEMORY_H_