Moving all kernel files around just to fuck with whoever's keeping track ;)

This commit is contained in:
Ben Vanik
2014-01-04 17:12:46 -08:00
parent aad4d7bebf
commit 4d92720109
108 changed files with 449 additions and 677 deletions

View File

@@ -1,26 +0,0 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'xam_content.cc',
'xam_content.h',
'xam_info.cc',
'xam_info.h',
'xam_input.cc',
'xam_input.h',
'xam_module.cc',
'xam_module.h',
'xam_net.cc',
'xam_net.h',
'xam_notify.cc',
'xam_notify.h',
'xam_ordinals.h',
'xam_private.h',
'xam_state.cc',
'xam_state.h',
'xam_table.inc',
'xam_user.cc',
'xam_user.h',
'xam_video.cc',
'xam_video.h',
],
}

View File

@@ -1,49 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_content.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XamContentGetLicenseMask_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t unk0_ptr = SHIM_GET_ARG_32(0);
uint32_t unk1_ptr = SHIM_GET_ARG_32(1);
XELOGD(
"XamContentGetLicenseMask(%.8X, %.8X)",
unk0_ptr,
unk1_ptr);
SHIM_SET_RETURN(X_STATUS_NOT_IMPLEMENTED);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterContentExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XamContentGetLicenseMask, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_CONTENT_H_
#define XENIA_KERNEL_XAM_CONTENT_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_CONTENT_H_

View File

@@ -1,90 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_info.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xex2.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XamGetSystemVersion_shim(
PPCContext* ppc_state, XamState* state) {
XELOGD("XamGetSystemVersion()");
// eh, just picking one. If we go too low we may break new games, but
// this value seems to be used for conditionally loading symbols and if
// we pretend to be old we have less to worry with implementing.
// 0x200A3200
// 0x20096B00
SHIM_SET_RETURN(0);
}
SHIM_CALL XGetAVPack_shim(
PPCContext* ppc_state, XamState* state) {
// DWORD
// Not sure what the values are for this, but 6 is VGA.
// Other likely values are 3/4/8 for HDMI or something.
// Games seem to use this as a PAL check - if the result is not 3/4/6/8
// they explode with errors if not in PAL mode.
SHIM_SET_RETURN(6);
}
SHIM_CALL XGetGameRegion_shim(
PPCContext* ppc_state, XamState* state) {
XELOGD("XGetGameRegion()");
SHIM_SET_RETURN(XEX_REGION_ALL);
}
SHIM_CALL XGetLanguage_shim(
PPCContext* ppc_state, XamState* state) {
XELOGD("XGetLanguage()");
uint32_t desired_language = X_LANGUAGE_ENGLISH;
// Switch the language based on game region.
// TODO(benvanik): pull from xex header.
uint32_t game_region = XEX_REGION_NTSCU;
if (game_region & XEX_REGION_NTSCU) {
desired_language = X_LANGUAGE_ENGLISH;
} else if (game_region & XEX_REGION_NTSCJ) {
desired_language = X_LANGUAGE_JAPANESE;
}
// Add more overrides?
SHIM_SET_RETURN(desired_language);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterInfoExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XamGetSystemVersion, state);
SHIM_SET_MAPPING("xam.xex", XGetAVPack, state);
SHIM_SET_MAPPING("xam.xex", XGetGameRegion, state);
SHIM_SET_MAPPING("xam.xex", XGetLanguage, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_INFO_H_
#define XENIA_KERNEL_XAM_INFO_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_INFO_H_

View File

@@ -1,120 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_input.h>
#include <xenia/emulator.h>
#include <xenia/hid/hid.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
using namespace xe;
using namespace xe::hid;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetcapabilities(v=vs.85).aspx
SHIM_CALL XamInputGetCapabilities_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t user_index = SHIM_GET_ARG_32(0);
uint32_t flags = SHIM_GET_ARG_32(1);
uint32_t caps_ptr = SHIM_GET_ARG_32(2);
XELOGD(
"XamInputGetCapabilities(%d, %.8X, %.8X)",
user_index,
flags,
caps_ptr);
if (!caps_ptr) {
SHIM_SET_RETURN(X_ERROR_BAD_ARGUMENTS);
return;
}
InputSystem* input_system = state->emulator()->input_system();
X_INPUT_CAPABILITIES caps;
X_RESULT result = input_system->GetCapabilities(user_index, flags, caps);
if (XSUCCEEDED(result)) {
caps.Write(SHIM_MEM_BASE, caps_ptr);
}
SHIM_SET_RETURN(result);
}
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetstate(v=vs.85).aspx
SHIM_CALL XamInputGetState_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t user_index = SHIM_GET_ARG_32(0);
uint32_t state_ptr = SHIM_GET_ARG_32(1);
XELOGD(
"XamInputGetState(%d, %.8X)",
user_index,
state_ptr);
if (!state_ptr) {
SHIM_SET_RETURN(X_ERROR_BAD_ARGUMENTS);
return;
}
InputSystem* input_system = state->emulator()->input_system();
X_INPUT_STATE input_state;
X_RESULT result = input_system->GetState(user_index, input_state);
if (XSUCCEEDED(result)) {
input_state.Write(SHIM_MEM_BASE, state_ptr);
}
SHIM_SET_RETURN(result);
}
// http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinputsetstate(v=vs.85).aspx
SHIM_CALL XamInputSetState_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t user_index = SHIM_GET_ARG_32(0);
uint32_t vibration_ptr = SHIM_GET_ARG_32(1);
XELOGD(
"XamInputSetState(%d, %.8X)",
user_index,
vibration_ptr);
if (!vibration_ptr) {
SHIM_SET_RETURN(X_ERROR_BAD_ARGUMENTS);
return;
}
InputSystem* input_system = state->emulator()->input_system();
X_INPUT_VIBRATION vibration(SHIM_MEM_BASE, vibration_ptr);
X_RESULT result = input_system->SetState(user_index, vibration);
SHIM_SET_RETURN(result);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterInputExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XamInputGetCapabilities, state);
SHIM_SET_MAPPING("xam.xex", XamInputGetState, state);
SHIM_SET_MAPPING("xam.xex", XamInputSetState, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_INPUT_H_
#define XENIA_KERNEL_XAM_INPUT_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_INPUT_H_

View File

@@ -1,56 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_module.h>
#include <xenia/export_resolver.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
XamState* xe::kernel::xam::shared_xam_state_ = NULL;
XamModule::XamModule(Emulator* emulator) :
KernelModule(emulator) {
// Build the export table used for resolution.
#include <xenia/kernel/util/export_table_pre.inc>
static KernelExport xam_export_table[] = {
#include <xenia/kernel/xam/xam_table.inc>
};
#include <xenia/kernel/util/export_table_post.inc>
export_resolver_->RegisterTable(
"xam.xex", xam_export_table, XECOUNT(xam_export_table));
// Setup the xam state instance.
xam_state_ = new XamState(emulator);
// Setup the shared global state object.
XEASSERTNULL(shared_xam_state_);
shared_xam_state_ = xam_state_;
// Register all exported functions.
RegisterContentExports(export_resolver_, xam_state_);
RegisterInfoExports(export_resolver_, xam_state_);
RegisterInputExports(export_resolver_, xam_state_);
RegisterNetExports(export_resolver_, xam_state_);
RegisterNotifyExports(export_resolver_, xam_state_);
RegisterUserExports(export_resolver_, xam_state_);
RegisterVideoExports(export_resolver_, xam_state_);
}
XamModule::~XamModule() {
// Clear the shared XAM state.
shared_xam_state_ = NULL;
}

View File

@@ -1,46 +0,0 @@
/**
******************************************************************************
* 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_XAM_H_
#define XENIA_KERNEL_XAM_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/export_resolver.h>
#include <xenia/kernel/kernel_module.h>
#include <xenia/kernel/xam/xam_ordinals.h>
// All of the exported functions:
#include <xenia/kernel/xam/xam_info.h>
namespace xe {
namespace kernel {
namespace xam {
class XamState;
class XamModule : public KernelModule {
public:
XamModule(Emulator* emulator);
virtual ~XamModule();
private:
XamState* xam_state_;
};
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_H_

View File

@@ -1,87 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_net.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL NetDll_XNetStartup_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t one = SHIM_GET_ARG_32(0);
uint32_t params_ptr = SHIM_GET_ARG_32(1);
XELOGD(
"NetDll_XNetStartup(%d, %.8X)",
one,
params_ptr);
SHIM_SET_RETURN(0);
}
SHIM_CALL NetDll_WSAStartup_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t one = SHIM_GET_ARG_32(0);
uint32_t version = SHIM_GET_ARG_16(1);
uint32_t data_ptr = SHIM_GET_ARG_32(2);
XELOGD(
"NetDll_WSAStartup(%d, %.4X, %.8X)",
one,
version,
data_ptr);
if (data_ptr) {
SHIM_SET_MEM_16(data_ptr + 0x000, version);
SHIM_SET_MEM_16(data_ptr + 0x002, 0);
SHIM_SET_MEM_32(data_ptr + 0x004, 0);
SHIM_SET_MEM_32(data_ptr + 0x105, 0);
SHIM_SET_MEM_16(data_ptr + 0x186, 0);
SHIM_SET_MEM_16(data_ptr + 0x188, 0);
SHIM_SET_MEM_32(data_ptr + 0x190, 0);
}
SHIM_SET_RETURN(0);
}
SHIM_CALL NetDll_XNetGetEthernetLinkStatus_shim(
PPCContext* ppc_state, XamState* state) {
// Games seem to call this before *Startup. If we return 0, they don't even
// try.
XELOGD(
"NetDll_XNetGetEthernetLinkStatus()");
SHIM_SET_RETURN(0);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterNetExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", NetDll_XNetStartup, state);
SHIM_SET_MAPPING("xam.xex", NetDll_WSAStartup, state);
SHIM_SET_MAPPING("xam.xex", NetDll_XNetGetEthernetLinkStatus, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_NET_H_
#define XENIA_KERNEL_XAM_NET_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_NET_H_

View File

@@ -1,95 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_notify.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/xboxkrnl/objects/xnotify_listener.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
using namespace xe::kernel::xboxkrnl;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XamNotifyCreateListener_shim(
PPCContext* ppc_state, XamState* state) {
uint64_t mask = SHIM_GET_ARG_64(0);
uint32_t one = SHIM_GET_ARG_32(1);
XELOGD(
"XamNotifyCreateListener(%.8llX, %d)",
mask,
one);
// r4=1 may indicate user process?
//return handle;
SHIM_SET_RETURN(0);
}
// http://ffplay360.googlecode.com/svn/Test/Common/AtgSignIn.cpp
SHIM_CALL XNotifyGetNext_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t handle = SHIM_GET_ARG_32(0);
uint32_t match_id = SHIM_GET_ARG_32(1);
uint32_t id_ptr = SHIM_GET_ARG_32(2);
uint32_t param_ptr = SHIM_GET_ARG_32(3);
XELOGD(
"XNotifyGetNext(%.8X, %.8X, %.8X, %.8X)",
handle,
match_id,
id_ptr,
param_ptr);
// get from handle
XNotifyListener* listener = 0;
bool dequeued = false;
uint32_t id = 0;
uint32_t param = 0;
if (match_id) {
// Asking for a specific notification
id = match_id;
dequeued = listener->DequeueNotification(match_id, &param);
} else {
// Just get next.
dequeued = listener->DequeueNotification(&id, &param);
}
if (dequeued) {
SHIM_SET_MEM_32(id_ptr, id);
SHIM_SET_MEM_32(param_ptr, param);
}
SHIM_SET_RETURN(dequeued ? 1 : 0);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterNotifyExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XamNotifyCreateListener, state);
SHIM_SET_MAPPING("xam.xex", XNotifyGetNext, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_NOTIFY_H_
#define XENIA_KERNEL_XAM_NOTIFY_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_NOTIFY_H_

View File

@@ -1,29 +0,0 @@
/**
******************************************************************************
* 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_XAM_ORDINALS_H_
#define XENIA_KERNEL_XAM_ORDINALS_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/export_resolver.h>
// Build an ordinal enum to make it easy to lookup ordinals.
#include <xenia/kernel/util/ordinal_table_pre.inc>
namespace ordinals {
enum {
#include <xenia/kernel/xam/xam_table.inc>
};
} // namespace ordinals
#include <xenia/kernel/util/ordinal_table_post.inc>
#endif // XENIA_KERNEL_XAM_ORDINALS_H_

View File

@@ -1,47 +0,0 @@
/**
******************************************************************************
* 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_XAM_PRIVATE_H_
#define XENIA_KERNEL_XAM_PRIVATE_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/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 RegisterContentExports(ExportResolver* export_resolver, XamState* state);
void RegisterInfoExports(ExportResolver* export_resolver, XamState* state);
void RegisterInputExports(ExportResolver* export_resolver, XamState* state);
void RegisterNetExports(ExportResolver* export_resolver, XamState* state);
void RegisterNotifyExports(ExportResolver* export_resolver, XamState* state);
void RegisterUserExports(ExportResolver* export_resolver, XamState* state);
void RegisterVideoExports(ExportResolver* export_resolver, XamState* state);
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_PRIVATE_H_

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_state.h>
#include <xenia/emulator.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace {
}
XamState::XamState(Emulator* emulator) :
emulator_(emulator), memory_(emulator->memory()),
export_resolver_(emulator->export_resolver()) {
}
XamState::~XamState() {
}

View File

@@ -1,45 +0,0 @@
/**
******************************************************************************
* 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_XAM_XAM_STATE_H_
#define XENIA_KERNEL_XAM_XAM_STATE_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/export_resolver.h>
#include <xenia/kernel/kernel_module.h>
namespace xe {
namespace kernel {
namespace xam {
class XamState {
public:
XamState(Emulator* emulator);
~XamState();
Emulator* emulator() const { return emulator_; }
Memory* memory() const { return memory_; }
private:
Emulator* emulator_;
Memory* memory_;
ExportResolver* export_resolver_;
};
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_XAM_STATE_H_

File diff suppressed because it is too large Load Diff

View File

@@ -1,69 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_user.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XamUserGetXUID_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t user_index = SHIM_GET_ARG_32(0);
uint32_t xuid_ptr = SHIM_GET_ARG_32(1);
XELOGD(
"XamUserGetXUID(%d, %.8X)",
user_index,
xuid_ptr);
if (xuid_ptr) {
SHIM_SET_MEM_32(xuid_ptr, 0xBABEBABE);
}
SHIM_SET_RETURN(0);
}
SHIM_CALL XamUserGetSigninState_shim(
PPCContext* ppc_state, XamState* state) {
uint32_t user_index = SHIM_GET_ARG_32(0);
XELOGD(
"XamUserGetSigninState(%d)",
user_index);
SHIM_SET_RETURN(0);
}
// XamUserReadProfileSettings
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterUserExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XamUserGetXUID, state);
SHIM_SET_MAPPING("xam.xex", XamUserGetSigninState, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_USER_H_
#define XENIA_KERNEL_XAM_USER_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_USER_H_

View File

@@ -1,44 +0,0 @@
/**
******************************************************************************
* 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/kernel/xam/xam_video.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/xam/xam_private.h>
#include <xenia/kernel/xam/xam_state.h>
#include <xenia/kernel/modules.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XGetVideoMode_shim(
PPCContext* ppc_state, XamState* state) {
xe::kernel::xboxkrnl::X_VIDEO_MODE *video_mode = (xe::kernel::xboxkrnl::X_VIDEO_MODE*)SHIM_MEM_ADDR(SHIM_GET_ARG_32(0));
xeVdQueryVideoMode(video_mode, true);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterVideoExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XGetVideoMode, state);
}

View File

@@ -1,31 +0,0 @@
/**
******************************************************************************
* 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_XAM_VIDEO_H_
#define XENIA_KERNEL_XAM_VIDEO_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_XAM_VIDEO_H_