mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 12:15:32 -06:00
118 lines
3.8 KiB
C++
118 lines
3.8 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Generated By moduleGenerator
|
|
#include <common/singleton.h>
|
|
#include <input/mouse.h>
|
|
#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_INFO(Lib_Mouse, "called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceMouseMbusInit() {
|
|
LOG_ERROR(Lib_Mouse, "(STUBBED) called");
|
|
return ORBIS_OK;
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceMouseOpen(s32 userId, s32 type, s32 index, OrbisMouseOpenParam* pParam) {
|
|
LOG_INFO(Lib_Mouse, "(DUMMY) called");
|
|
return 2; // dummy
|
|
}
|
|
|
|
int PS4_SYSV_ABI sceMouseRead(s32 handle, OrbisMouseData* pData, s32 num) {
|
|
bool connected = false;
|
|
Input::MouseState states[64];
|
|
auto* mouse = Common::Singleton<Input::GameMouse>::Instance();
|
|
int ret_num = mouse->ReadStates(states, num, &connected);
|
|
|
|
if (!connected) {
|
|
ret_num = 1;
|
|
}
|
|
|
|
for (int i = 0; i < ret_num; i++) {
|
|
pData[i].buttons = states[i].buttonsState;
|
|
pData[i].connected = true;
|
|
pData[i].timestamp = states[i].time;
|
|
pData[i].xAxis = 0;
|
|
pData[i].yAxis = 0;
|
|
pData[i].wheel = 0;
|
|
pData[i].tilt = 0;
|
|
}
|
|
return ret_num;
|
|
}
|
|
|
|
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
|