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:
Ben Vanik
2013-01-12 23:25:41 -08:00
parent 986d63e412
commit bcd575f9b0
66 changed files with 6859 additions and 304 deletions

31
src/core/ref.cc Normal file
View 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. *
******************************************************************************
*/
#include <xenia/core/ref.h>
void xe_ref_init(xe_ref_t* ref) {
ref->count = 1;
}
void xe_ref_retain(xe_ref_t* ref) {
xe_atomic_inc_32(&ref->count);
}
void xe_ref_release(xe_ref_t* ref, xe_ref_dealloc_t dealloc) {
if (!ref) {
return;
}
if (!xe_atomic_dec_32(&ref->count)) {
if (dealloc) {
dealloc(ref);
}
xe_free(ref);
}
}