From 3c79f3943fdc3c6c4774d42b8495cb3862f05b79 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 9 Nov 2022 21:41:46 +0100 Subject: [PATCH] Minor simplifcation in ppu_finalize --- rpcs3/Emu/Cell/PPUThread.cpp | 40 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 4799f2e81d..1efe0f148a 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -2807,36 +2807,32 @@ extern fs::file make_file_view(fs::file&& _file, u64 offset) extern void ppu_finalize(const ppu_module& info) { - // Get cache path for this executable - std::string cache_path; - if (info.name.empty()) { // Don't remove main module from memory return; } - else + + const std::string dev_flash = vfs::get("/dev_flash/sys/"); + + if (info.path.starts_with(dev_flash) || Emu.GetCat() == "1P") { - // Get PPU cache location - cache_path = fs::get_cache_dir() + "cache/"; - - const std::string dev_flash = vfs::get("/dev_flash/sys/"); - - if (info.path.starts_with(dev_flash) || Emu.GetCat() == "1P") - { - // Don't remove dev_flash prx from memory - return; - } - else if (!Emu.GetTitleID().empty()) - { - cache_path += Emu.GetTitleID(); - cache_path += '/'; - } - - // Add PPU hash and filename - fmt::append(cache_path, "ppu-%s-%s/", fmt::base57(info.sha1), info.path.substr(info.path.find_last_of('/') + 1)); + // Don't remove dev_flash prx from memory + return; } + // Get cache path for this executable + std::string cache_path = fs::get_cache_dir() + "cache/"; + + if (!Emu.GetTitleID().empty()) + { + cache_path += Emu.GetTitleID(); + cache_path += '/'; + } + + // Add PPU hash and filename + fmt::append(cache_path, "ppu-%s-%s/", fmt::base57(info.sha1), info.path.substr(info.path.find_last_of('/') + 1)); + #ifdef LLVM_AVAILABLE g_fxo->get().remove(cache_path + info.name); #endif