diff --git a/CMakeLists.txt b/CMakeLists.txt index 94f5d4dce..6fb920b78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -527,6 +527,11 @@ set(PAD_LIB src/core/libraries/pad/pad.cpp src/core/libraries/pad/pad_errors.h ) +set(SYSTEM_GESTURE_LIB + src/core/libraries/system_gesture/SystemGesture.cpp + src/core/libraries/system_gesture/SystemGesture.h +) + set(PNG_LIB src/core/libraries/libpng/pngdec.cpp src/core/libraries/libpng/pngdec.h src/core/libraries/libpng/pngdec_error.h @@ -780,6 +785,7 @@ set(CORE src/core/aerolib/stubs.cpp ${SYSTEM_LIBS} ${HLE_LIBC_INTERNAL_LIB} ${PAD_LIB} + ${SYSTEM_GESTURE_LIB} ${VIDEOOUT_LIB} ${NP_LIBS} ${PNG_LIB} diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 05935fbdc..d711103fc 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -83,6 +83,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) { SUB(Lib, LibcInternal) \ SUB(Lib, Kernel) \ SUB(Lib, Pad) \ + SUB(Lib, SystemGesture) \ SUB(Lib, GnmDriver) \ SUB(Lib, SystemService) \ SUB(Lib, UserService) \ diff --git a/src/common/logging/types.h b/src/common/logging/types.h index 1da84b219..54fe20fd9 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -50,6 +50,7 @@ enum class Class : u8 { Lib_LibcInternal, ///< The LibcInternal implementation. Lib_Kernel, ///< The LibKernel implementation. Lib_Pad, ///< The LibScePad implementation. + Lib_SystemGesture, ///< The LibSceSystemGesture implementation. Lib_GnmDriver, ///< The LibSceGnmDriver implementation. Lib_SystemService, ///< The LibSceSystemService implementation. Lib_UserService, ///< The LibSceUserService implementation. diff --git a/src/core/libraries/libs.cpp b/src/core/libraries/libs.cpp index b2987cd97..3929aee02 100644 --- a/src/core/libraries/libs.cpp +++ b/src/core/libraries/libs.cpp @@ -55,6 +55,7 @@ #include "core/libraries/system/sysmodule.h" #include "core/libraries/system/systemservice.h" #include "core/libraries/system/userservice.h" +#include "core/libraries/system_gesture/SystemGesture.h" #include "core/libraries/ulobjmgr/ulobjmgr.h" #include "core/libraries/usbd/usbd.h" #include "core/libraries/videodec/videodec.h" @@ -103,6 +104,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) { Libraries::Random::RegisterLib(sym); Libraries::Usbd::RegisterLib(sym); Libraries::Pad::RegisterLib(sym); + Libraries::SystemGesture::RegisterLib(sym); Libraries::Ajm::RegisterLib(sym); Libraries::ErrorDialog::RegisterLib(sym); Libraries::ImeDialog::RegisterLib(sym); diff --git a/src/core/libraries/system_gesture/SystemGesture.cpp b/src/core/libraries/system_gesture/SystemGesture.cpp new file mode 100644 index 000000000..5a69a75cc --- /dev/null +++ b/src/core/libraries/system_gesture/SystemGesture.cpp @@ -0,0 +1,174 @@ +// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "SystemGesture.h" +#include "common/config.h" +#include "common/logging/log.h" +#include "common/singleton.h" +#include "core/libraries/libs.h" +#include "core/libraries/pad/pad.h" +#include "core/libraries/pad/pad_errors.h" +#include "input/controller.h" + +namespace Libraries::SystemGesture { + +using Input::GameController; + +int PS4_SYSV_ABI sceSystemGestureAppendTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureClose() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureCreateTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureFinalizePrimitiveTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEventByIndex() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEventByPrimitiveID() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEvents() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEventsCount() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetTouchEventByEventID() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetTouchEventByIndex() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetTouchEvents() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetTouchEventsCount() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureGetTouchRecognizerInformation() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureInitializePrimitiveTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureOpen() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureRemoveTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureResetPrimitiveTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureResetTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureUpdateAllTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureUpdatePrimitiveTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureUpdateTouchRecognizer() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceSystemGestureUpdateTouchRecognizerRectangle() { + LOG_ERROR(Lib_SystemGesture, "(STUBBED) called"); + return ORBIS_OK; +} + +void RegisterLib(Core::Loader::SymbolsResolver* sym) { + LIB_FUNCTION("1MMK0W-kMgA", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureAppendTouchRecognizer); + LIB_FUNCTION("j4yXIA2jJ68", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureClose); + LIB_FUNCTION("FWF8zkhr854", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureCreateTouchRecognizer); + LIB_FUNCTION("3QYCmMlOlCY", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureFinalizePrimitiveTouchRecognizer); + LIB_FUNCTION("KAeP0+cQPVU", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetPrimitiveTouchEventByIndex); + LIB_FUNCTION("yBaQ0h9m1NM", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetPrimitiveTouchEventByPrimitiveID); + LIB_FUNCTION("L8YmemOeSNY", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetPrimitiveTouchEvents); + LIB_FUNCTION("JhwByySf9FY", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetPrimitiveTouchEventsCount); + LIB_FUNCTION("lpsXm7tzeoc", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetTouchEventByEventID); + LIB_FUNCTION("TSKvgSz5ChU", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetTouchEventByIndex); + LIB_FUNCTION("fLTseA7XiWY", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetTouchEvents); + LIB_FUNCTION("h8uongcBNVs", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetTouchEventsCount); + LIB_FUNCTION("0KrW5eMnrwY", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureGetTouchRecognizerInformation); + LIB_FUNCTION("3pcAvmwKCvM", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureInitializePrimitiveTouchRecognizer); + LIB_FUNCTION("qpo-mEOwje0", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureOpen); + LIB_FUNCTION("ELvBVG-LKT0", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureRemoveTouchRecognizer); + LIB_FUNCTION("o11J529VaAE", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureResetPrimitiveTouchRecognizer); + LIB_FUNCTION("oBuH3zFWYIg", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureResetTouchRecognizer); + LIB_FUNCTION("wPJGwI2RM2I", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureUpdateAllTouchRecognizer); + LIB_FUNCTION("GgFMb22sbbI", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureUpdatePrimitiveTouchRecognizer); + LIB_FUNCTION("j4h82CQWENo", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureUpdateTouchRecognizer); + LIB_FUNCTION("4WOA1eTx3V8", "libSceSystemGesture", 1, "libSceSystemGesture", 1, 1, + sceSystemGestureUpdateTouchRecognizerRectangle); +} + +} // namespace Libraries::SystemGesture diff --git a/src/core/libraries/system_gesture/SystemGesture.h b/src/core/libraries/system_gesture/SystemGesture.h new file mode 100644 index 000000000..8150d08c3 --- /dev/null +++ b/src/core/libraries/system_gesture/SystemGesture.h @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: Copyright 2025 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "common/enum.h" +#include "common/types.h" + +namespace Core::Loader { +class SymbolsResolver; +} + +namespace Libraries::SystemGesture { + +int PS4_SYSV_ABI sceSystemGestureAppendTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureClose(); +int PS4_SYSV_ABI sceSystemGestureCreateTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureFinalizePrimitiveTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEventByIndex(); +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEventByPrimitiveID(); +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEvents(); +int PS4_SYSV_ABI sceSystemGestureGetPrimitiveTouchEventsCount(); +int PS4_SYSV_ABI sceSystemGestureGetTouchEventByEventID(); +int PS4_SYSV_ABI sceSystemGestureGetTouchEventByIndex(); +int PS4_SYSV_ABI sceSystemGestureGetTouchEvents(); +int PS4_SYSV_ABI sceSystemGestureGetTouchEventsCount(); +int PS4_SYSV_ABI sceSystemGestureGetTouchRecognizerInformation(); +int PS4_SYSV_ABI sceSystemGestureInitializePrimitiveTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureOpen(); +int PS4_SYSV_ABI sceSystemGestureRemoveTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureResetPrimitiveTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureResetTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureUpdateAllTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureUpdatePrimitiveTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureUpdateTouchRecognizer(); +int PS4_SYSV_ABI sceSystemGestureUpdateTouchRecognizerRectangle(); + +void RegisterLib(Core::Loader::SymbolsResolver* sym); +} // namespace Libraries::SystemGesture