user service refactoring

This commit is contained in:
georgemoralis 2023-10-31 13:35:52 +02:00
parent bdd756a090
commit 7391f7708a
6 changed files with 25 additions and 22 deletions

View File

@ -31,20 +31,20 @@ set(LIBC_SOURCES src/Emulator/HLE/Libraries/LibC/Libc.cpp
src/Emulator/HLE/Libraries/LibC/libc_cxa.cpp
src/Emulator/HLE/Libraries/LibC/libc_cxa.h
)
set(USERSERVICE_SOURCES src/Emulator/HLE/Libraries/LibUserService/user_service.cpp
src/Emulator/HLE/Libraries/LibUserService/user_service.h
set(USERSERVICE_SOURCES src/core/hle/libraries/libuserservice/user_service.cpp
src/core/hle/libraries/libuserservice/user_service.h
)
set(PAD_SOURCES "src/core/hle/libraries/libpad/pad.cpp"
"src/core/hle/libraries/libpad/pad.h"
set(PAD_SOURCES src/core/hle/libraries/libpad/pad.cpp
src/core/hle/libraries/libpad/pad.h
)
set(SYSTEMSERVICE_SOURCES src/Emulator/HLE/Libraries/LibSystemService/system_service.cpp
src/Emulator/HLE/Libraries/LibSystemService/system_service.h
)
set(FILESYSTEM_SOURCES "src/core/hle/libraries/libkernel/file_system.cpp"
"src/core/hle/libraries/libkernel/file_system.h"
set(FILESYSTEM_SOURCES src/core/hle/libraries/libkernel/file_system.cpp
src/core/hle/libraries/libkernel/file_system.h
)

View File

@ -4,7 +4,7 @@
#include "LibKernel.h"
#include "LibSceGnmDriver.h"
#include <core/PS4/HLE/Graphics/video_out.h>
#include "Emulator/HLE/Libraries/LibUserService/user_service.h"
#include "core/hle/libraries/libuserservice/user_service.h"
#include "core/hle/libraries/libpad/pad.h"
#include <Emulator/HLE/Libraries/LibSystemService/system_service.h>
@ -15,8 +15,8 @@ void Init_HLE_Libs(SymbolsResolver *sym) {
LibKernel::LibKernel_Register(sym);
Graphics::VideoOut::videoOutRegisterLib(sym);
LibSceGnmDriver::LibSceGnmDriver_Register(sym);
Emulator::HLE::Libraries::LibUserService::libUserService_Register(sym);
Core::Libraries::LibPad::libPad_Register(sym);
Core::Libraries::LibUserService::userServiceSymbolsRegister(sym);
Core::Libraries::LibPad::padSymbolsRegister(sym);
Emulator::HLE::Libraries::LibSystemService::libSystemService_Register(sym);
}
} // namespace HLE::Libs

View File

@ -14,7 +14,7 @@ constexpr bool log_file_pad = true; // disable it to disable logging
int PS4_SYSV_ABI scePadInit() { return SCE_OK; }
int PS4_SYSV_ABI scePadOpen(Emulator::HLE::Libraries::LibUserService::SceUserServiceUserId userId, s32 type, s32 index,
int PS4_SYSV_ABI scePadOpen(Core::Libraries::LibUserService::SceUserServiceUserId userId, s32 type, s32 index,
const ScePadOpenParam* pParam) {
LOG_INFO_IF(log_file_pad, "scePadOpen userid = {} type = {} index = {}\n", userId, type, index);
return 1; // dummy
@ -47,7 +47,7 @@ int PS4_SYSV_ABI scePadReadState(int32_t handle, ScePadData* pData) {
return SCE_OK;
}
void libPad_Register(SymbolsResolver* sym) {
void padSymbolsRegister(SymbolsResolver* sym) {
LIB_FUNCTION("hv1luiJrqQM", "libScePad", 1, "libScePad", 1, 1, scePadInit);
LIB_FUNCTION("xk0AcarP3V4", "libScePad", 1, "libScePad", 1, 1, scePadOpen);
LIB_FUNCTION("YndgXqQVV7c", "libScePad", 1, "libScePad", 1, 1, scePadReadState);

View File

@ -1,8 +1,8 @@
#pragma once
#include <Emulator/HLE/Libraries/LibUserService/user_service.h>
#include <types.h>
#include "core/PS4/Loader/SymbolsResolver.h"
#include "core/hle/libraries/libuserservice/user_service.h"
namespace Core::Libraries::LibPad {
@ -90,9 +90,9 @@ struct ScePadData {
};
// hle functions
int PS4_SYSV_ABI scePadInit();
int PS4_SYSV_ABI scePadOpen(Emulator::HLE::Libraries::LibUserService::SceUserServiceUserId userId, s32 type, s32 index,
int PS4_SYSV_ABI scePadOpen(Core::Libraries::LibUserService::SceUserServiceUserId userId, s32 type, s32 index,
const ScePadOpenParam* pParam);
int PS4_SYSV_ABI scePadReadState(int32_t handle, ScePadData* pData);
void libPad_Register(SymbolsResolver* sym);
}; // namespace Emulator::HLE::Libraries::LibPad
void padSymbolsRegister(SymbolsResolver* sym);
}; // namespace Core::Libraries::LibPad

View File

@ -3,15 +3,17 @@
#include <core/PS4/HLE/ErrorCodes.h>
#include <core/PS4/HLE/Libs.h>
namespace Emulator::HLE::Libraries::LibUserService {
#include "Util/log.h"
namespace Core::Libraries::LibUserService {
s32 PS4_SYSV_ABI sceUserServiceInitialize(const SceUserServiceInitializeParams* initParams) {
// dummy
PRINT_DUMMY_FUNCTION_NAME();
return SCE_OK;
}
s32 PS4_SYSV_ABI sceUserServiceGetLoginUserIdList(SceUserServiceLoginUserIdList* userIdList) {
// dummy
PRINT_DUMMY_FUNCTION_NAME();
userIdList->user_id[0] = 1;
userIdList->user_id[1] = -1;
userIdList->user_id[2] = -1;
@ -19,8 +21,9 @@ s32 PS4_SYSV_ABI sceUserServiceGetLoginUserIdList(SceUserServiceLoginUserIdList*
return SCE_OK;
}
void libUserService_Register(SymbolsResolver* sym) {
void userServiceSymbolsRegister(SymbolsResolver* sym) {
LIB_FUNCTION("j3YMu1MVNNo", "libSceUserService", 1, "libSceUserService", 1, 1, sceUserServiceInitialize);
LIB_FUNCTION("fPhymKNvK-A", "libSceUserService", 1, "libSceUserService", 1, 1, sceUserServiceGetLoginUserIdList);
}
}; // namespace Emulator::HLE::Libraries::LibUserService
} // namespace Core::Libraries::LibUserService

View File

@ -1,7 +1,7 @@
#pragma once
#include "core/PS4/Loader/SymbolsResolver.h"
namespace Emulator::HLE::Libraries::LibUserService {
namespace Core::Libraries::LibUserService {
using SceUserServiceUserId = s32;
@ -16,5 +16,5 @@ struct SceUserServiceLoginUserIdList {
s32 PS4_SYSV_ABI sceUserServiceInitialize(const SceUserServiceInitializeParams* initParams);
s32 PS4_SYSV_ABI sceUserServiceGetLoginUserIdList(SceUserServiceLoginUserIdList* userIdList);
void libUserService_Register(SymbolsResolver* sym);
void userServiceSymbolsRegister(SymbolsResolver* sym);
}; // namespace Emulator::HLE::Libraries::LibUserService