scePadGetControllerInformation added , dummy scePadSetMotionSensorState

This commit is contained in:
georgemoralis 2024-04-01 14:45:27 +03:00
parent 92e4c6b798
commit 6066c89607
4 changed files with 49 additions and 4 deletions

View File

@ -6,7 +6,7 @@
#include <array> #include <array>
#include <cstdint> #include <cstdint>
using s08 = std::int8_t; using s8 = std::int8_t;
using s16 = std::int16_t; using s16 = std::int16_t;
using s32 = std::int32_t; using s32 = std::int32_t;
using s64 = std::int64_t; using s64 = std::int64_t;

View File

@ -18,7 +18,7 @@ bool is16KBAligned(u64 n) {
} }
u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize() { u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize() {
LOG_WARNING(Kernel_Vmm, "(STUBBED) called"); LOG_WARNING(Kernel_Vmm, "called");
return SCE_KERNEL_MAIN_DMEM_SIZE; return SCE_KERNEL_MAIN_DMEM_SIZE;
} }

View File

@ -11,13 +11,13 @@
namespace OldLibraries::LibPad { namespace OldLibraries::LibPad {
int PS4_SYSV_ABI scePadInit() { int PS4_SYSV_ABI scePadInit() {
LOG_WARNING(Lib_Pad, "(STUBBED) called"); LOG_WARNING(Lib_Pad, "(DUMMY) called");
return SCE_OK; return SCE_OK;
} }
int PS4_SYSV_ABI scePadOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type, int PS4_SYSV_ABI scePadOpen(Libraries::UserService::OrbisUserServiceUserId user_id, s32 type,
s32 index, const ScePadOpenParam* pParam) { s32 index, const ScePadOpenParam* pParam) {
LOG_INFO(Lib_Pad, "(STUBBED) called user_id = {} type = {} index = {}", user_id, type, index); LOG_INFO(Lib_Pad, "(DUMMY) called user_id = {} type = {} index = {}", user_id, type, index);
return 1; // dummy return 1; // dummy
} }
@ -48,10 +48,32 @@ int PS4_SYSV_ABI scePadReadState(int32_t handle, ScePadData* pData) {
return SCE_OK; return SCE_OK;
} }
s32 PS4_SYSV_ABI scePadGetControllerInformation(s32 handle, OrbisPadInformation* info) {
LOG_INFO(Lib_Pad, "called handle = {}", handle);
info->touchpadDensity = 1;
info->touchResolutionX = 1920;
info->touchResolutionY = 950;
info->stickDeadzoneL = 2;
info->stickDeadzoneR = 2;
info->connectionType = ORBIS_PAD_CONNECTION_TYPE_STANDARD;
info->count = 1;
info->connected = 1;
info->deviceClass = ORBIS_PAD_PORT_TYPE_STANDARD;
return SCE_OK;
}
s32 PS4_SYSV_ABI scePadSetMotionSensorState(s32 handle, bool enable) {
LOG_INFO(Lib_Pad, "(DUMMY) called handle = {} enabled = {}", handle,
(enable ? "true" : "false"));
return SCE_OK;
}
void padSymbolsRegister(Core::Loader::SymbolsResolver* sym) { void padSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("hv1luiJrqQM", "libScePad", 1, "libScePad", 1, 1, scePadInit); LIB_FUNCTION("hv1luiJrqQM", "libScePad", 1, "libScePad", 1, 1, scePadInit);
LIB_FUNCTION("xk0AcarP3V4", "libScePad", 1, "libScePad", 1, 1, scePadOpen); LIB_FUNCTION("xk0AcarP3V4", "libScePad", 1, "libScePad", 1, 1, scePadOpen);
LIB_FUNCTION("YndgXqQVV7c", "libScePad", 1, "libScePad", 1, 1, scePadReadState); LIB_FUNCTION("YndgXqQVV7c", "libScePad", 1, "libScePad", 1, 1, scePadReadState);
LIB_FUNCTION("gjP9-KQzoUk", "libScePad", 1, "libScePad", 1, 1, scePadGetControllerInformation);
LIB_FUNCTION("clVvL4ZDntw", "libScePad", 1, "libScePad", 1, 1, scePadSetMotionSensorState);
} }
} // namespace OldLibraries::LibPad } // namespace OldLibraries::LibPad

View File

@ -12,6 +12,16 @@ class SymbolsResolver;
namespace OldLibraries::LibPad { namespace OldLibraries::LibPad {
#define ORBIS_PAD_PORT_TYPE_STANDARD 0
#define ORBIS_PAD_PORT_TYPE_SPECIAL 2
#define ORBIS_PAD_DEVICE_CLASS_PAD 0
#define ORBIS_PAD_DEVICE_CLASS_GUITAR 1
#define ORBIS_PAD_DEVICE_CLASS_DRUMS 2
#define ORBIS_PAD_CONNECTION_TYPE_STANDARD 0
#define ORBIS_PAD_CONNECTION_TYPE_REMOTE 2
enum ScePadButton : u32 { enum ScePadButton : u32 {
L3 = 0x00000002, L3 = 0x00000002,
R3 = 0x00000004, R3 = 0x00000004,
@ -95,6 +105,19 @@ struct ScePadData {
uint8_t deviceUniqueData[12]; uint8_t deviceUniqueData[12];
}; };
struct OrbisPadInformation {
float touchpadDensity;
u16 touchResolutionX;
u16 touchResolutionY;
u8 stickDeadzoneL;
u8 stickDeadzoneR;
u8 connectionType;
u8 count;
s8 connected;
s8 deviceClass;
u8 unknown[8];
};
int PS4_SYSV_ABI scePadInit(); int PS4_SYSV_ABI scePadInit();
int PS4_SYSV_ABI scePadOpen(Libraries::UserService::OrbisUserServiceUserId userId, s32 type, int PS4_SYSV_ABI scePadOpen(Libraries::UserService::OrbisUserServiceUserId userId, s32 type,
s32 index, const ScePadOpenParam* pParam); s32 index, const ScePadOpenParam* pParam);