Massive refactoring of all code + audio skeleton.

This should make it easier to find files and (in the future) split things
up into separate libraries.
It also changes around emulator initialization to make it a little more
difficult to do things out of order and a little more sensible as to when
real init work happens.
Also adding a skeleton audio system/driver and reworking CPU register
access to be more extensible.
This commit is contained in:
Ben Vanik
2013-10-23 20:42:24 -07:00
parent c996a4bbaf
commit b7ffd46319
182 changed files with 3919 additions and 3286 deletions

67
src/xenia/memory.h Normal file
View File

@@ -0,0 +1,67 @@
/**
******************************************************************************
* 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_CORE_MEMORY_H_
#define XENIA_CORE_MEMORY_H_
#include <xenia/common.h>
#include <xenia/core/ref.h>
typedef struct {
int reserved;
} xe_memory_options_t;
struct xe_memory;
typedef struct xe_memory* xe_memory_ref;
xe_memory_ref xe_memory_create(xe_memory_options_t options);
xe_memory_ref xe_memory_retain(xe_memory_ref memory);
void xe_memory_release(xe_memory_ref memory);
uint8_t *xe_memory_addr(xe_memory_ref memory, size_t guest_addr = 0);
void xe_memory_copy(xe_memory_ref memory,
uint32_t dest, uint32_t src, uint32_t size);
uint32_t xe_memory_search_aligned(xe_memory_ref memory, size_t start,
size_t end, const uint32_t *values,
const size_t value_count);
// These methods slice off memory from the virtual address space, unless
// base_address is specified in which case they place into an address in
// memory.
enum {
XE_MEMORY_FLAG_64KB_PAGES = (1 << 1),
XE_MEMORY_FLAG_PHYSICAL = (1 << 2),
XE_MEMORY_FLAG_ZERO = (1 << 3),
};
enum {
XE_MEMORY_ACCESS_READ = (1 << 1),
XE_MEMORY_ACCESS_WRITE = (1 << 2)
};
void xe_memory_heap_dump(xe_memory_ref memory);
uint32_t xe_memory_heap_alloc(xe_memory_ref memory, uint32_t base_address,
uint32_t size, uint32_t flags,
uint32_t alignment = 0x20);
int xe_memory_heap_free(xe_memory_ref memory, uint32_t addr, uint32_t size);
bool xe_memory_is_valid(xe_memory_ref memory, uint32_t address);
int xe_memory_protect(xe_memory_ref memory, uint32_t address, uint32_t size,
uint32_t access);
uint32_t xe_memory_query_protect(xe_memory_ref memory, uint32_t address);
#endif // XENIA_CORE_MEMORY_H_