Switching kernel files to the new style.

This commit is contained in:
Ben Vanik
2013-05-26 21:37:47 -07:00
parent fbe800aacd
commit 6e8828f843
20 changed files with 155 additions and 56 deletions

View File

@@ -6,6 +6,7 @@
'xam_module.cc',
'xam_module.h',
'xam_ordinals.h',
'xam_private.h',
'xam_state.cc',
'xam_state.h',
'xam_table.inc',

View File

@@ -10,8 +10,8 @@
#include <xenia/kernel/modules/xam/xam_info.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xbox.h>
#include <xenia/kernel/modules/xam/xam_module.h>
#include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/xam/xam_state.h>
using namespace xe;

View File

@@ -10,8 +10,10 @@
#ifndef XENIA_KERNEL_MODULES_XAM_INFO_H_
#define XENIA_KERNEL_MODULES_XAM_INFO_H_
#include <xenia/kernel/modules/xam/xam_state.h>
#include <xenia/kernel/modules/xam/xam_ordinals.h>
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xbox.h>
namespace xe {
@@ -19,7 +21,6 @@ namespace kernel {
namespace xam {
void RegisterInfoExports(ExportResolver* export_resolver, XamState* state);
} // namespace xam

View File

@@ -10,7 +10,8 @@
#include <xenia/kernel/modules/xam/xam_module.h>
#include <xenia/kernel/export.h>
#include <xenia/kernel/modules/xam/xam_info.h>
#include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/xam/xam_state.h>
using namespace xe;
@@ -18,6 +19,9 @@ using namespace xe::kernel;
using namespace xe::kernel::xam;
XamState* xe::kernel::xam::shared_xam_state_ = NULL;
XamModule::XamModule(Runtime* runtime) :
KernelModule(runtime) {
// Build the export table used for resolution.
@@ -32,9 +36,15 @@ XamModule::XamModule(Runtime* runtime) :
// Setup the xam state instance.
xam_state = auto_ptr<XamState>(new XamState(memory_, export_resolver_));
// Setup the shared global state object.
XEASSERTNULL(shared_xam_state_);
shared_xam_state_ = xam_state.get();
// Register all exported functions.
RegisterInfoExports(export_resolver_.get(), xam_state.get());
}
XamModule::~XamModule() {
// Clear the shared XAM state.
shared_xam_state_ = NULL;
}

View File

@@ -17,6 +17,9 @@
#include <xenia/kernel/kernel_module.h>
#include <xenia/kernel/modules/xam/xam_ordinals.h>
// All of the exported functions:
#include <xenia/kernel/modules/xam/xam_info.h>
namespace xe {
namespace kernel {

View File

@@ -0,0 +1,41 @@
/**
******************************************************************************
* 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_KERNEL_MODULES_XAM_PRIVATE_H_
#define XENIA_KERNEL_MODULES_XAM_PRIVATE_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/modules/xam/xam_ordinals.h>
namespace xe {
namespace kernel {
namespace xam {
class XamState;
// This is a global object initialized with the XamModule.
// It references the current xam state object that all xam methods should
// be using to stash their variables.
extern XamState* shared_xam_state_;
// Registration functions, one per file.
void RegisterInfoExports(ExportResolver* export_resolver, XamState* state);
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_MODULES_XAM_PRIVATE_H_