diff --git a/rpcs3/Emu/Cell/lv2/sys_overlay.cpp b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp index 6f7ef23a4a65..3648862a48d5 100644 --- a/rpcs3/Emu/Cell/lv2/sys_overlay.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_overlay.cpp @@ -95,7 +95,7 @@ std::function lv2_overlay::load(utils::serial& ar) { u128 klic = g_fxo->get().last_key(); file = make_file_view(std::move(file), offset, umax); - ovlm = ppu_load_overlay(ppu_exec_object{ decrypt_self(std::move(file), reinterpret_cast(&klic)) }, false, path, 0, &ar).first; + ovlm = ppu_load_overlay(ppu_exec_object{ decrypt_self(std::move(file), reinterpret_cast(&klic)) }, false, path, offset, &ar).first; if (!ovlm) { diff --git a/rpcs3/Emu/Cell/lv2/sys_prx.cpp b/rpcs3/Emu/Cell/lv2/sys_prx.cpp index 564943db1168..f9efd58fa73a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_prx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_prx.cpp @@ -347,7 +347,7 @@ std::function lv2_prx::load(utils::serial& ar) { u128 klic = g_fxo->get().last_key(); file = make_file_view(std::move(file), offset, umax); - prx = ppu_load_prx(ppu_prx_object{decrypt_self(std::move(file), reinterpret_cast(&klic))}, false, path, 0, &ar); + prx = ppu_load_prx(ppu_prx_object{decrypt_self(std::move(file), reinterpret_cast(&klic))}, false, path, offset, &ar); prx->m_loaded_flags = std::move(loaded_flags); prx->m_external_loaded_flags = std::move(external_flags); @@ -390,7 +390,9 @@ void lv2_prx::save(utils::serial& ar) { USING_SERIALIZATION_VERSION(lv2_prx_overlay); - ar(vfs::retrieve(path), offset, state); + const std::string vpath = vfs::retrieve(path); + + ar(vpath, offset, state); // Save segments count ar.serialize_vle(segs.size()); @@ -401,10 +403,18 @@ void lv2_prx::save(utils::serial& ar) ar(m_external_loaded_flags); } + std::string segments; + for (const ppu_segment& seg : segs) { - if (seg.type == 0x1u && seg.size) ar(seg.addr); + if (seg.type == 0x1u && seg.size) + { + fmt::append(segments, " 0x%x", seg.addr); + ar(seg.addr); + } } + + (vpath.empty() ? sys_prx.error : sys_prx.success)("lv2_prx::save(): vpath='%s', offset=0x%x, state=%x, segments:%s", vpath, offset, +state, segments); } error_code sys_prx_get_ppu_guid(ppu_thread& ppu) diff --git a/rpcs3/Emu/VFS.cpp b/rpcs3/Emu/VFS.cpp index 0133fe583fdf..46a417ee6ee3 100644 --- a/rpcs3/Emu/VFS.cpp +++ b/rpcs3/Emu/VFS.cpp @@ -399,7 +399,7 @@ std::string vfs::retrieve(std::string_view path, const vfs_directory* node, std: std::vector mount_path_empty; - const std::string rpath = Emu.GetCallbacks().resolve_path(path); + const std::string rpath = Emu.GetCallbacks().resolve_path_may_not_exist(path); if (!rpath.empty()) { diff --git a/rpcs3/main_application.cpp b/rpcs3/main_application.cpp index 9d9ab53faa7e..9719bde28d6e 100644 --- a/rpcs3/main_application.cpp +++ b/rpcs3/main_application.cpp @@ -399,7 +399,22 @@ EmuCallbacks main_application::CreateCallbacks() const QString result = QDir(fi.canonicalFilePath()).filePath(tail); +#ifdef _WIN32 + std::string result_with_drive = QDir::cleanPath(result).toStdString(); + + if (!tail.isEmpty() && sv.starts_with("/") && !sv.starts_with("//")) + { + // Erase absolute path for non-existant path + if (result_with_drive.size() > 1 && result_with_drive[1] == ':') + { + result_with_drive.erase(result_with_drive.begin(), result_with_drive.begin() + 2); + } + } + + return result_with_drive; +#else return QDir::cleanPath(result).toStdString(); +#endif }; callbacks.get_font_dirs = []()