diff --git a/src/xenia/kernel/sources.gypi b/src/xenia/kernel/sources.gypi index e96dbee36..2a7cb929b 100644 --- a/src/xenia/kernel/sources.gypi +++ b/src/xenia/kernel/sources.gypi @@ -38,6 +38,8 @@ 'xam_user.h', 'xam_video.cc', 'xam_video.h', + 'xam_voice.cc', + 'xam_voice.h', 'xboxkrnl_audio.cc', 'xboxkrnl_audio.h', 'xboxkrnl_debug.cc', diff --git a/src/xenia/kernel/xam_module.cc b/src/xenia/kernel/xam_module.cc index 494863fd3..d8f85547e 100644 --- a/src/xenia/kernel/xam_module.cc +++ b/src/xenia/kernel/xam_module.cc @@ -39,6 +39,7 @@ XamModule::XamModule(Emulator* emulator, KernelState* kernel_state) : RegisterNotifyExports(export_resolver_, kernel_state); RegisterUserExports(export_resolver_, kernel_state); RegisterVideoExports(export_resolver_, kernel_state); + RegisterVoiceExports(export_resolver_, kernel_state); } XamModule::~XamModule() { diff --git a/src/xenia/kernel/xam_private.h b/src/xenia/kernel/xam_private.h index d1cc95ce7..715fc44e6 100644 --- a/src/xenia/kernel/xam_private.h +++ b/src/xenia/kernel/xam_private.h @@ -31,6 +31,7 @@ void RegisterNetExports(ExportResolver* export_resolver, KernelState* state); void RegisterNotifyExports(ExportResolver* export_resolver, KernelState* state); void RegisterUserExports(ExportResolver* export_resolver, KernelState* state); void RegisterVideoExports(ExportResolver* export_resolver, KernelState* state); +void RegisterVoiceExports(ExportResolver* export_resolver, KernelState* state); } // namespace xam } // namespace kernel diff --git a/src/xenia/kernel/xam_voice.cc b/src/xenia/kernel/xam_voice.cc new file mode 100644 index 000000000..068b45f84 --- /dev/null +++ b/src/xenia/kernel/xam_voice.cc @@ -0,0 +1,78 @@ +/** + ****************************************************************************** + * 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 + +#include +#include +#include +#include + + +using namespace xe; +using namespace xe::hid; +using namespace xe::kernel; +using namespace xe::kernel::xam; + + +namespace xe { +namespace kernel { + + +SHIM_CALL XamVoiceCreate_shim( + PPCContext* ppc_state, KernelState* state) { + uint32_t unk1 = SHIM_GET_ARG_32(0); // 0 + uint32_t unk2 = SHIM_GET_ARG_32(1); // 0xF + uint32_t out_voice_ptr = SHIM_GET_ARG_32(2); + + XELOGD( + "XamVoiceCreate(%.8X, %.8X, %.8X)", + unk1, unk2, out_voice_ptr); + + // Null out the ptr. + SHIM_SET_MEM_32(out_voice_ptr, 0); + + SHIM_SET_RETURN_32(X_ERROR_ACCESS_DENIED); +} + + +SHIM_CALL XamVoiceClose_shim( + PPCContext* ppc_state, KernelState* state) { + uint32_t voice_ptr = SHIM_GET_ARG_32(0); + + XELOGD( + "XamVoiceClose(%.8X)", + voice_ptr); + + SHIM_SET_RETURN_32(0); +} + + +SHIM_CALL XamVoiceHeadsetPresent_shim( + PPCContext* ppc_state, KernelState* state) { + uint32_t voice_ptr = SHIM_GET_ARG_32(0); + + XELOGD( + "XamVoiceHeadsetPresent(%.8X)", + voice_ptr); + + SHIM_SET_RETURN_32(0); +} + + +} // namespace kernel +} // namespace xe + + +void xe::kernel::xam::RegisterVoiceExports( + ExportResolver* export_resolver, KernelState* state) { + SHIM_SET_MAPPING("xam.xex", XamVoiceCreate, state); + SHIM_SET_MAPPING("xam.xex", XamVoiceClose, state); + SHIM_SET_MAPPING("xam.xex", XamVoiceHeadsetPresent, state); +} diff --git a/src/xenia/kernel/xam_voice.h b/src/xenia/kernel/xam_voice.h new file mode 100644 index 000000000..2ab9e527e --- /dev/null +++ b/src/xenia/kernel/xam_voice.h @@ -0,0 +1,29 @@ +/** + ****************************************************************************** + * Xenia : Xbox 360 Emulator Research Project * + ****************************************************************************** + * Copyright 2014 Ben Vanik. All rights reserved. * + * Released under the BSD license - see LICENSE in the root for more details. * + ****************************************************************************** + */ + +#ifndef XENIA_KERNEL_XAM_VOICE_H_ +#define XENIA_KERNEL_XAM_VOICE_H_ + +#include +#include + +#include + + +namespace xe { +namespace kernel { + + + + +} // namespace kernel +} // namespace xe + + +#endif // XENIA_KERNEL_XAM_VOICE_H_