From 1361fda8849c7ab548e05eb1871af4a6fffe65a1 Mon Sep 17 00:00:00 2001 From: wszechpolak Date: Sat, 16 Aug 2014 22:47:08 +0200 Subject: [PATCH 1/3] Fix XamWriteGamerTile to make it support both sync/async requests --- src/xenia/kernel/xam_user.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/xenia/kernel/xam_user.cc b/src/xenia/kernel/xam_user.cc index 15bf258df..4524d743a 100644 --- a/src/xenia/kernel/xam_user.cc +++ b/src/xenia/kernel/xam_user.cc @@ -283,13 +283,19 @@ SHIM_CALL XamWriteGamerTile_shim( uint32_t arg2 = SHIM_GET_ARG_32(2); uint32_t arg3 = SHIM_GET_ARG_32(3); uint32_t arg4 = SHIM_GET_ARG_32(4); - uint32_t arg5 = SHIM_GET_ARG_32(5); + uint32_t overlapped_ptr = SHIM_GET_ARG_32(5); XELOGD( "XamWriteGamerTile(%.8X, %.8X, %.8X, %.8X, %.8X, %.8X)", - arg0, arg1, arg2, arg3, arg4, arg5); + arg0, arg1, arg2, arg3, arg4, overlapped_ptr); - SHIM_SET_RETURN_32(0x3E5); + if (overlapped_ptr) { + state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_SUCCESS); + SHIM_SET_RETURN_32(X_ERROR_IO_PENDING); + } + else { + SHIM_SET_RETURN_32(X_ERROR_SUCCESS); + } } From b449e9f5cc0dd53a1eeb05e5c4637556c8cbec90 Mon Sep 17 00:00:00 2001 From: wszechpolak Date: Sat, 16 Aug 2014 22:49:13 +0200 Subject: [PATCH 2/3] Add X_ERROR_FUNCTION_FAILED --- src/xenia/xbox.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xenia/xbox.h b/src/xenia/xbox.h index 633477a9c..52bc8f31e 100644 --- a/src/xenia/xbox.h +++ b/src/xenia/xbox.h @@ -76,6 +76,7 @@ typedef uint32_t X_RESULT; #define X_ERROR_NOT_FOUND X_HRESULT_FROM_WIN32(0x00000490L) #define X_ERROR_CANCELLED X_HRESULT_FROM_WIN32(0x000004C7L) #define X_ERROR_NO_SUCH_USER X_HRESULT_FROM_WIN32(0x00000525L) +#define X_ERROR_FUNCTION_FAILED X_HRESULT_FROM_WIN32(0x0000065BL) #define X_ERROR_EMPTY X_HRESULT_FROM_WIN32(0x000010D2L) // MEM_*, used by NtAllocateVirtualMemory From 1f8cfb6fce8c2214e25cfb5b874b153294001f82 Mon Sep 17 00:00:00 2001 From: wszechpolak Date: Sat, 16 Aug 2014 22:49:50 +0200 Subject: [PATCH 3/3] Clean --- src/xenia/kernel/xam_content.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xenia/kernel/xam_content.cc b/src/xenia/kernel/xam_content.cc index bc8a6675f..3abd40fb6 100644 --- a/src/xenia/kernel/xam_content.cc +++ b/src/xenia/kernel/xam_content.cc @@ -76,7 +76,7 @@ SHIM_CALL XamShowDeviceSelectorUI_shim( XELOGD( "XamShowDeviceSelectorUI(%.8X, %.8X, %.8X, %.8X, %.8X, %.8X)", arg0, arg1, arg2, arg3, arg4, arg5); - SHIM_SET_RETURN_32(997); + SHIM_SET_RETURN_32(X_ERROR_IO_PENDING); }