diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index b79e330a..8405a539 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later // Generated By moduleGenerator +#include #include #include "common/logging/log.h" #include "core/libraries/error_codes.h" @@ -85,7 +86,6 @@ int PS4_SYSV_ABI scePadGetCapability() { int PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadControllerInformation* pInfo) { LOG_INFO(Lib_Pad, "called handle = {}", handle); - std::memset(pInfo, 0, sizeof(OrbisPadControllerInformation)); if (handle < 0) { pInfo->touchPadInfo.pixelDensity = 1; pInfo->touchPadInfo.resolution.x = 1920; @@ -251,7 +251,9 @@ int PS4_SYSV_ABI scePadOutputReport() { } int PS4_SYSV_ABI scePadRead(s32 handle, OrbisPadData* pData, s32 num) { - std::memset(pData, 0, sizeof(OrbisPadData)); + if (handle != 1) { + UNREACHABLE_MSG("unknown handle"); + } int connected_count = 0; bool connected = false; Input::State states[64]; @@ -318,11 +320,12 @@ int PS4_SYSV_ABI scePadReadHistory() { int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) { auto* controller = Common::Singleton::Instance(); - + if (handle != 1) { + UNREACHABLE_MSG("unknown handle"); + } int connectedCount = 0; bool isConnected = false; Input::State state; - std::memset(pData, 0, sizeof(OrbisPadData)); controller->ReadState(&state, &isConnected, &connectedCount); pData->buttons = state.buttonsState; pData->leftStick.x = state.axes[static_cast(Input::Axis::LeftX)]; @@ -334,7 +337,7 @@ int PS4_SYSV_ABI scePadReadState(s32 handle, OrbisPadData* pData) { pData->orientation.x = 0; pData->orientation.y = 0; pData->orientation.z = 0; - pData->orientation.w = 0; + pData->orientation.w = 1; pData->acceleration.x = 0.0f; pData->acceleration.y = 0.0f; pData->acceleration.z = 0.0f;