diff --git a/src/core/file_sys/fs.cpp b/src/core/file_sys/fs.cpp index 6a99a808..fcb3220f 100644 --- a/src/core/file_sys/fs.cpp +++ b/src/core/file_sys/fs.cpp @@ -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 ""; diff --git a/src/core/libraries/pad/pad.cpp b/src/core/libraries/pad/pad.cpp index e2f73afe..e1f8480c 100644 --- a/src/core/libraries/pad/pad.cpp +++ b/src/core/libraries/pad/pad.cpp @@ -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); }