From a560121775fbf1f70ebdb4773a7b800ea2f1fe09 Mon Sep 17 00:00:00 2001 From: Eladash Date: Sat, 24 Jun 2023 20:44:21 +0300 Subject: [PATCH] Fix Create PPU Cache --- rpcs3/Emu/Cell/PPUModule.cpp | 4 ++-- rpcs3/Emu/System.cpp | 6 +++--- rpcs3/rpcs3qt/game_list_frame.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index b739b7a0a6..3c5e99cc36 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -1682,7 +1682,7 @@ void ppu_unload_prx(const lv2_prx& prx) } } -bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar) +bool ppu_load_exec(const ppu_exec_object& elf, const std::string& elf_path, utils::serial* ar) { if (elf != elf_error::ok) { @@ -2126,7 +2126,7 @@ bool ppu_load_exec(const ppu_exec_object& elf, utils::serial* ar) // Set path (TODO) _main.name.clear(); - _main.path = vfs::get(Emu.argv[0]); + _main.path = elf_path; _main.elf_entry = static_cast(elf.header.e_entry); _main.seg0_code_end = end; diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 34e8b9348a..9a6810936c 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -70,7 +70,7 @@ std::string g_cfg_defaults; atomic_t g_watchdog_hold_ctr{0}; -extern bool ppu_load_exec(const ppu_exec_object&, utils::serial* = nullptr); +extern bool ppu_load_exec(const ppu_exec_object&, const std::string&, utils::serial* = nullptr); extern void spu_load_exec(const spu_exec_object&); extern void spu_load_rel_exec(const spu_rel_object&); extern void ppu_precompile(std::vector& dir_queue, std::vector* loaded_prx); @@ -1383,7 +1383,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch, const ppu_exec_object obj = src; - if (obj == elf_error::ok && ppu_load_exec(obj)) + if (obj == elf_error::ok && ppu_load_exec(obj, path)) { g_fxo->get().path = path; } @@ -1960,7 +1960,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch, g_fxo->init(); - if (ppu_load_exec(ppu_exec, DeserialManager())) + if (ppu_load_exec(ppu_exec, m_path, DeserialManager())) { } // Overlay (OVL) executable (only load it) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 230fe2be6e..0ed7f4b420 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -1564,7 +1564,7 @@ bool game_list_frame::CreatePPUCache(const std::string& path, const std::string& Emu.GracefulShutdown(false); Emu.SetForceBoot(true); - if (const auto error = Emu.BootGame(path, serial, true); error != game_boot_result::no_errors) + if (const auto error = Emu.BootGame(fs::is_file(path) ? fs::get_parent_dir(path) : path, serial, true); error != game_boot_result::no_errors) { game_list_log.error("Could not create PPU Cache for %s, error: %s", path, error); return false;