Stubs for more XAM functions.

This commit is contained in:
Ben Vanik 2013-10-23 00:05:50 -07:00
parent 60ef171ff2
commit c996a4bbaf
9 changed files with 272 additions and 0 deletions

View File

@ -1,8 +1,12 @@
# Copyright 2013 Ben Vanik. All Rights Reserved. # Copyright 2013 Ben Vanik. All Rights Reserved.
{ {
'sources': [ 'sources': [
'xam_content.cc',
'xam_content.h',
'xam_info.cc', 'xam_info.cc',
'xam_info.h', 'xam_info.h',
'xam_input.cc',
'xam_input.h',
'xam_module.cc', 'xam_module.cc',
'xam_module.h', 'xam_module.h',
'xam_net.cc', 'xam_net.cc',
@ -12,6 +16,8 @@
'xam_state.cc', 'xam_state.cc',
'xam_state.h', 'xam_state.h',
'xam_table.inc', 'xam_table.inc',
'xam_user.cc',
'xam_user.h',
'xam_video.cc', 'xam_video.cc',
'xam_video.h', 'xam_video.h',
], ],

View File

@ -0,0 +1,49 @@
/**
******************************************************************************
* 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/modules/xam/xam_content.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/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(
xe_ppc_state_t* 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

@ -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_KERNEL_MODULES_XAM_CONTENT_H_
#define XENIA_KERNEL_MODULES_XAM_CONTENT_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_MODULES_XAM_CONTENT_H_

View File

@ -0,0 +1,49 @@
/**
******************************************************************************
* 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/modules/xam/xam_input.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/xam/xam_state.h>
using namespace xe;
using namespace xe::kernel;
using namespace xe::kernel::xam;
namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XamInputGetState_shim(
xe_ppc_state_t* 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);
SHIM_SET_RETURN(X_STATUS_NOT_IMPLEMENTED);
}
} // namespace xam
} // namespace kernel
} // namespace xe
void xe::kernel::xam::RegisterInputExports(
ExportResolver* export_resolver, XamState* state) {
SHIM_SET_MAPPING("xam.xex", XamInputGetState, state);
}

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. *
******************************************************************************
*/
#ifndef XENIA_KERNEL_MODULES_XAM_INPUT_H_
#define XENIA_KERNEL_MODULES_XAM_INPUT_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_MODULES_XAM_INPUT_H_

View File

@ -41,8 +41,11 @@ XamModule::XamModule(Runtime* runtime) :
shared_xam_state_ = xam_state.get(); shared_xam_state_ = xam_state.get();
// Register all exported functions. // Register all exported functions.
RegisterContentExports(export_resolver_.get(), xam_state.get());
RegisterInfoExports(export_resolver_.get(), xam_state.get()); RegisterInfoExports(export_resolver_.get(), xam_state.get());
RegisterInputExports(export_resolver_.get(), xam_state.get());
RegisterNetExports(export_resolver_.get(), xam_state.get()); RegisterNetExports(export_resolver_.get(), xam_state.get());
RegisterUserExports(export_resolver_.get(), xam_state.get());
RegisterVideoExports(export_resolver_.get(), xam_state.get()); RegisterVideoExports(export_resolver_.get(), xam_state.get());
} }

View File

@ -30,8 +30,11 @@ extern XamState* shared_xam_state_;
// Registration functions, one per file. // Registration functions, one per file.
void RegisterContentExports(ExportResolver* export_resolver, XamState* state);
void RegisterInfoExports(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 RegisterNetExports(ExportResolver* export_resolver, XamState* state);
void RegisterUserExports(ExportResolver* export_resolver, XamState* state);
void RegisterVideoExports(ExportResolver* export_resolver, XamState* state); void RegisterVideoExports(ExportResolver* export_resolver, XamState* state);

View File

@ -0,0 +1,69 @@
/**
******************************************************************************
* 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/modules/xam/xam_user.h>
#include <xenia/kernel/shim_utils.h>
#include <xenia/kernel/modules/xam/xam_private.h>
#include <xenia/kernel/modules/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(
xe_ppc_state_t* 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(
xe_ppc_state_t* 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

@ -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_KERNEL_MODULES_XAM_USER_H_
#define XENIA_KERNEL_MODULES_XAM_USER_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/kernel/xbox.h>
namespace xe {
namespace kernel {
namespace xam {
} // namespace xam
} // namespace kernel
} // namespace xe
#endif // XENIA_KERNEL_MODULES_XAM_USER_H_