fix in GetHostDirectory , added scePadGetHandle

This commit is contained in:
georgemoralis 2024-06-01 17:40:21 +03:00
parent b6ffedba85
commit a69dfda538
2 changed files with 11 additions and 9 deletions

View File

@ -27,16 +27,15 @@ void MntPoints::UnmountAll() {
std::string MntPoints::GetHostDirectory(const std::string& guest_directory) {
std::scoped_lock lock{m_mutex};
for (auto& pair : m_mnt_pairs) {
if (pair.guest_path.starts_with(guest_directory)) {
return pair.host_path + guest_directory;
}
}
// hack for relative path , get app0 and assuming it goes from there
for (auto& pair : m_mnt_pairs) {
if (pair.guest_path.starts_with("/app0")) {
// horrible code but it works :D
int find = guest_directory.find(pair.guest_path);
if (find == 0) {
std::string npath =
guest_directory.substr(pair.guest_path.size(), guest_directory.size() - 1);
std::replace(pair.host_path.begin(), pair.host_path.end(), '\\', '/');
return pair.host_path + guest_directory;
return pair.host_path + npath;
}
}
return "";

View File

@ -113,12 +113,15 @@ s32 PS4_SYSV_ABI scePadSetMotionSensorState(s32 handle, bool enable) {
return SCE_OK;
}
int PS4_SYSV_ABI scePadGetHandle(s32 userId, int32_t type, int32_t index) {
return 1;
}
void padSymbolsRegister(Core::Loader::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);
LIB_FUNCTION("q1cHNfGycLI", "libScePad", 1, "libScePad", 1, 1, scePadRead);
LIB_FUNCTION("u1GRHp+oWoY", "libScePad", 1, "libScePad", 1, 1, scePadGetHandle);
LIB_FUNCTION("gjP9-KQzoUk", "libScePad", 1, "libScePad", 1, 1, scePadGetControllerInformation);
LIB_FUNCTION("clVvL4ZDntw", "libScePad", 1, "libScePad", 1, 1, scePadSetMotionSensorState);
}