Massive dump of xenia-info required code.
This is a working xenia-info for xex files (no gdfs files yet).
This commit is contained in:
37
include/xenia/core/file.h
Normal file
37
include/xenia/core/file.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_FILE_H_
|
||||
#define XENIA_CORE_FILE_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core/pal.h>
|
||||
#include <xenia/core/ref.h>
|
||||
|
||||
|
||||
struct xe_file;
|
||||
typedef struct xe_file* xe_file_ref;
|
||||
|
||||
|
||||
typedef enum {
|
||||
kXEFileModeRead = (1 << 0),
|
||||
kXEFileModeWrite = (1 << 1),
|
||||
} xe_file_mode;
|
||||
|
||||
|
||||
xe_file_ref xe_file_open(xe_pal_ref pal, const xe_file_mode mode,
|
||||
const xechar_t *path);
|
||||
xe_file_ref xe_file_retain(xe_file_ref file);
|
||||
void xe_file_release(xe_file_ref file);
|
||||
size_t xe_file_get_length(xe_file_ref file);
|
||||
size_t xe_file_read(xe_file_ref file, const size_t offset,
|
||||
uint8_t *buffer, const size_t buffer_size);
|
||||
|
||||
|
||||
#endif // XENIA_CORE_FILE_H_
|
||||
35
include/xenia/core/memory.h
Normal file
35
include/xenia/core/memory.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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/pal.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_pal_ref pal, xe_memory_options_t options);
|
||||
xe_memory_ref xe_memory_retain(xe_memory_ref memory);
|
||||
void xe_memory_release(xe_memory_ref memory);
|
||||
|
||||
size_t xe_memory_get_length(xe_memory_ref memory);
|
||||
void *xe_memory_addr(xe_memory_ref memory, uint32_t guest_addr);
|
||||
|
||||
|
||||
#endif // XENIA_CORE_MEMORY_H_
|
||||
32
include/xenia/core/mmap.h
Normal file
32
include/xenia/core/mmap.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_MMAP_H_
|
||||
#define XENIA_CORE_MMAP_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core/file.h>
|
||||
#include <xenia/core/pal.h>
|
||||
#include <xenia/core/ref.h>
|
||||
|
||||
|
||||
struct xe_mmap;
|
||||
typedef struct xe_mmap* xe_mmap_ref;
|
||||
|
||||
|
||||
xe_mmap_ref xe_mmap_open(xe_pal_ref pal, const xe_file_mode mode,
|
||||
const xechar_t *path,
|
||||
const size_t offset, const size_t length);
|
||||
xe_mmap_ref xe_mmap_retain(xe_mmap_ref mmap);
|
||||
void xe_mmap_release(xe_mmap_ref mmap);
|
||||
void *xe_mmap_get_addr(xe_mmap_ref mmap);
|
||||
size_t xe_mmap_get_length(xe_mmap_ref mmap);
|
||||
|
||||
|
||||
#endif // XENIA_CORE_MMAP_H_
|
||||
31
include/xenia/core/pal.h
Normal file
31
include/xenia/core/pal.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_PAL_H_
|
||||
#define XENIA_CORE_PAL_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
#include <xenia/core/ref.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
int reserved;
|
||||
} xe_pal_options_t;
|
||||
|
||||
|
||||
struct xe_pal;
|
||||
typedef struct xe_pal* xe_pal_ref;
|
||||
|
||||
|
||||
xe_pal_ref xe_pal_create(xe_pal_options_t options);
|
||||
xe_pal_ref xe_pal_retain(xe_pal_ref pal);
|
||||
void xe_pal_release(xe_pal_ref pal);
|
||||
|
||||
|
||||
#endif // XENIA_CORE_PAL_H_
|
||||
29
include/xenia/core/ref.h
Normal file
29
include/xenia/core/ref.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_REF_H_
|
||||
#define XENIA_CORE_REF_H_
|
||||
|
||||
#include <xenia/common.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
volatile int32_t count;
|
||||
} xe_ref_t;
|
||||
typedef xe_ref_t* xe_ref;
|
||||
|
||||
typedef void (*xe_ref_dealloc_t)(xe_ref);
|
||||
|
||||
|
||||
void xe_ref_init(xe_ref ref);
|
||||
void xe_ref_retain(xe_ref ref);
|
||||
void xe_ref_release(xe_ref ref, xe_ref_dealloc_t dealloc);
|
||||
|
||||
|
||||
#endif // XENIA_CORE_REF_H_
|
||||
Reference in New Issue
Block a user