From 121328ecedc6bcbe1eb319308f621df8a8b28f09 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Mon, 6 Jan 2025 18:45:53 +0200 Subject: [PATCH] dummy sceMouse module and change sceMouseRead to debug to reduce spam (#2074) --- CMakeLists.txt | 2 + src/common/logging/filter.cpp | 1 + src/common/logging/types.h | 1 + src/core/libraries/libs.cpp | 2 + src/core/libraries/mouse/mouse.cpp | 99 ++++++++++++++++++++++++++++++ src/core/libraries/mouse/mouse.h | 29 +++++++++ 6 files changed, 134 insertions(+) create mode 100644 src/core/libraries/mouse/mouse.cpp create mode 100644 src/core/libraries/mouse/mouse.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 36ebbf58..88682493 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -336,6 +336,8 @@ set(SYSTEM_LIBS src/core/libraries/system/commondialog.cpp src/core/libraries/share_play/shareplay.h src/core/libraries/razor_cpu/razor_cpu.cpp src/core/libraries/razor_cpu/razor_cpu.h + src/core/libraries/mouse/mouse.cpp + src/core/libraries/mouse/mouse.h ) set(VIDEOOUT_LIB src/core/libraries/videoout/buffer.h diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index a2fd2c0a..5ee2dce7 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -126,6 +126,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) { SUB(Lib, Vdec2) \ SUB(Lib, Videodec) \ SUB(Lib, RazorCpu) \ + SUB(Lib, Mouse) \ CLS(Frontend) \ CLS(Render) \ SUB(Render, Vulkan) \ diff --git a/src/common/logging/types.h b/src/common/logging/types.h index 5b496d17..6829e2d1 100644 --- a/src/common/logging/types.h +++ b/src/common/logging/types.h @@ -93,6 +93,7 @@ enum class Class : u8 { Lib_Vdec2, ///< The LibSceVideodec2 implementation. Lib_Videodec, ///< The LibSceVideodec implementation. Lib_RazorCpu, ///< The LibRazorCpu implementation. + Lib_Mouse, ///< The LibSceMouse implementation Frontend, ///< Emulator UI Render, ///< Video Core Render_Vulkan, ///< Vulkan backend diff --git a/src/core/libraries/libs.cpp b/src/core/libraries/libs.cpp index 49cd54a5..69728e52 100644 --- a/src/core/libraries/libs.cpp +++ b/src/core/libraries/libs.cpp @@ -18,6 +18,7 @@ #include "core/libraries/libc_internal/libc_internal.h" #include "core/libraries/libpng/pngdec.h" #include "core/libraries/libs.h" +#include "core/libraries/mouse/mouse.h" #include "core/libraries/move/move.h" #include "core/libraries/network/http.h" #include "core/libraries/network/net.h" @@ -97,6 +98,7 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) { Libraries::Move::RegisterlibSceMove(sym); Libraries::Fiber::RegisterlibSceFiber(sym); Libraries::JpegEnc::RegisterlibSceJpegEnc(sym); + Libraries::Mouse::RegisterlibSceMouse(sym); } } // namespace Libraries diff --git a/src/core/libraries/mouse/mouse.cpp b/src/core/libraries/mouse/mouse.cpp new file mode 100644 index 00000000..dffd2346 --- /dev/null +++ b/src/core/libraries/mouse/mouse.cpp @@ -0,0 +1,99 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +// Generated By moduleGenerator +#include "common/logging/log.h" +#include "core/libraries/error_codes.h" +#include "core/libraries/libs.h" +#include "mouse.h" + +namespace Libraries::Mouse { + +int PS4_SYSV_ABI sceMouseClose() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseConnectPort() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseDebugGetDeviceId() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseDeviceOpen() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseDisconnectDevice() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseDisconnectPort() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseGetDeviceInfo() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseInit() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseMbusInit() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseOpen() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseRead() { + LOG_DEBUG(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseSetHandType() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseSetPointerSpeed() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +int PS4_SYSV_ABI sceMouseSetProcessPrivilege() { + LOG_ERROR(Lib_Mouse, "(STUBBED) called"); + return ORBIS_OK; +} + +void RegisterlibSceMouse(Core::Loader::SymbolsResolver* sym) { + LIB_FUNCTION("cAnT0Rw-IwU", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseClose); + LIB_FUNCTION("Ymyy1HSSJLQ", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseConnectPort); + LIB_FUNCTION("BRXOoXQtb+k", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseDebugGetDeviceId); + LIB_FUNCTION("WiGKINCZWkc", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseDeviceOpen); + LIB_FUNCTION("eDQTFHbgeTU", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseDisconnectDevice); + LIB_FUNCTION("jJP1vYMEPd4", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseDisconnectPort); + LIB_FUNCTION("QA9Qupz3Zjw", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseGetDeviceInfo); + LIB_FUNCTION("Qs0wWulgl7U", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseInit); + LIB_FUNCTION("1FeceR5YhAo", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseMbusInit); + LIB_FUNCTION("RaqxZIf6DvE", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseOpen); + LIB_FUNCTION("x8qnXqh-tiM", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseRead); + LIB_FUNCTION("crkFfp-cmFo", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseSetHandType); + LIB_FUNCTION("ghLUU2Z5Lcg", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseSetPointerSpeed); + LIB_FUNCTION("6aANndpS0Wo", "libSceMouse", 1, "libSceMouse", 1, 1, sceMouseSetProcessPrivilege); +}; + +} // namespace Libraries::Mouse \ No newline at end of file diff --git a/src/core/libraries/mouse/mouse.h b/src/core/libraries/mouse/mouse.h new file mode 100644 index 00000000..8264f62e --- /dev/null +++ b/src/core/libraries/mouse/mouse.h @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once +#include "common/types.h" + +namespace Core::Loader { +class SymbolsResolver; +} + +namespace Libraries::Mouse { + +int PS4_SYSV_ABI sceMouseClose(); +int PS4_SYSV_ABI sceMouseConnectPort(); +int PS4_SYSV_ABI sceMouseDebugGetDeviceId(); +int PS4_SYSV_ABI sceMouseDeviceOpen(); +int PS4_SYSV_ABI sceMouseDisconnectDevice(); +int PS4_SYSV_ABI sceMouseDisconnectPort(); +int PS4_SYSV_ABI sceMouseGetDeviceInfo(); +int PS4_SYSV_ABI sceMouseInit(); +int PS4_SYSV_ABI sceMouseMbusInit(); +int PS4_SYSV_ABI sceMouseOpen(); +int PS4_SYSV_ABI sceMouseRead(); +int PS4_SYSV_ABI sceMouseSetHandType(); +int PS4_SYSV_ABI sceMouseSetPointerSpeed(); +int PS4_SYSV_ABI sceMouseSetProcessPrivilege(); + +void RegisterlibSceMouse(Core::Loader::SymbolsResolver* sym); +} // namespace Libraries::Mouse \ No newline at end of file