From 9f765e1291afe6de2da2f54c810ce6e9714210f1 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Fri, 9 Jan 2015 00:26:47 -0800 Subject: [PATCH] XMsgStartIORequestEx --- src/xenia/kernel/xam_msg.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/xenia/kernel/xam_msg.cc b/src/xenia/kernel/xam_msg.cc index 9647c323a..fca069e67 100644 --- a/src/xenia/kernel/xam_msg.cc +++ b/src/xenia/kernel/xam_msg.cc @@ -53,6 +53,27 @@ SHIM_CALL XMsgStartIORequest_shim(PPCContext* ppc_state, KernelState* state) { SHIM_SET_RETURN_32(result); } +SHIM_CALL XMsgStartIORequestEx_shim(PPCContext* ppc_state, KernelState* state) { + uint32_t app = SHIM_GET_ARG_32(0); + uint32_t message = SHIM_GET_ARG_32(1); + uint32_t overlapped_ptr = SHIM_GET_ARG_32(2); + uint32_t buffer = SHIM_GET_ARG_32(3); + uint32_t buffer_length = SHIM_GET_ARG_32(4); + uint32_t unknown_ptr = SHIM_GET_ARG_32(5); + + XELOGD("XMsgStartIORequestEx(%.8X, %.8X, %.8X, %.8X, %d, %.8X)", app, message, + overlapped_ptr, buffer, buffer_length, unknown_ptr); + + assert_zero(overlapped_ptr); + + auto result = state->app_manager()->DispatchMessageAsync(app, message, buffer, + buffer_length); + if (result == X_ERROR_NOT_FOUND) { + XELOGE("XMsgStartIORequestEx: app %.8X undefined", app); + } + SHIM_SET_RETURN_32(result); +} + SHIM_CALL XMsgCancelIORequest_shim(PPCContext* ppc_state, KernelState* state) { uint32_t overlapped_ptr = SHIM_GET_ARG_32(0); uint32_t wait = SHIM_GET_ARG_32(1); @@ -79,5 +100,6 @@ void xe::kernel::xam::RegisterMsgExports(ExportResolver* export_resolver, KernelState* state) { SHIM_SET_MAPPING("xam.xex", XMsgInProcessCall, state); SHIM_SET_MAPPING("xam.xex", XMsgStartIORequest, state); + SHIM_SET_MAPPING("xam.xex", XMsgStartIORequestEx, state); SHIM_SET_MAPPING("xam.xex", XMsgCancelIORequest, state); }