From da06cb4f069e094d33794832b2fde28c12e12d4e Mon Sep 17 00:00:00 2001 From: gibbed Date: Sun, 27 May 2018 19:34:38 -0500 Subject: [PATCH] [Kernel] Fix return of XamUserGetDeviceContext. --- src/xenia/kernel/xam/xam_input.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/xenia/kernel/xam/xam_input.cc b/src/xenia/kernel/xam/xam_input.cc index f0bf0fc5b..2815bef91 100644 --- a/src/xenia/kernel/xam/xam_input.cc +++ b/src/xenia/kernel/xam/xam_input.cc @@ -28,15 +28,13 @@ using xe::hid::X_INPUT_VIBRATION; constexpr uint32_t XINPUT_FLAG_GAMEPAD = 0x01; constexpr uint32_t XINPUT_FLAG_ANY_USER = 1 << 30; -dword_result_t XamResetInactivity(dword_t unk) { - // Result ignored. - return 0; +void XamResetInactivity() { + // Do we need to do anything? } DECLARE_XAM_EXPORT(XamResetInactivity, ExportTag::kInput | ExportTag::kStub); -dword_result_t XamEnableInactivityProcessing(dword_t zero, dword_t unk) { - // Expects 0. - return 0; +dword_result_t XamEnableInactivityProcessing(dword_t unk, dword_t enable) { + return X_ERROR_SUCCESS; } DECLARE_XAM_EXPORT(XamEnableInactivityProcessing, ExportTag::kInput | ExportTag::kStub); @@ -186,16 +184,16 @@ dword_result_t XamInputGetKeystrokeEx(lpdword_t user_index_ptr, dword_t flags, DECLARE_XAM_EXPORT(XamInputGetKeystrokeEx, ExportTag::kInput | ExportTag::kImplemented); -dword_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk, - lpdword_t out_ptr) { +X_HRESULT_result_t XamUserGetDeviceContext(dword_t user_index, dword_t unk, + lpdword_t out_ptr) { // Games check the result - usually with some masking. // If this function fails they assume zero, so let's fail AND // set zero just to be safe. *out_ptr = 0; if (!user_index || (user_index & 0xFF) == 0xFF) { - return 0; + return X_E_SUCCESS; } else { - return -1; + return X_E_DEVICE_NOT_CONNECTED; } } DECLARE_XAM_EXPORT(XamUserGetDeviceContext,