From f4dffd985b95c37aff5994110ddfce42fb0d0894 Mon Sep 17 00:00:00 2001 From: Functionable <40835042+Functionable@users.noreply.github.com> Date: Wed, 7 Jan 2026 22:51:14 +0000 Subject: [PATCH] ISO: Fix argv[0] being set to a garbage value - Due to GetCallbacks().resolve_path behaviour being reverted in a prior commit, resolved_path will not have the path to the game executable. This causes issues when setting argv[0] to the game executable path and apparently breaks some games which may rely on this value. --- rpcs3/Emu/System.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 4f6a4eb680..bff86636e7 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -2361,8 +2361,9 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch, else if (!bdvd_dir.empty() && fs::is_dir(bdvd_dir)) { // Disc games are on /dev_bdvd/ - const usz pos = resolved_path.rfind(m_game_dir); - argv[0] = "/dev_bdvd/PS3_GAME/" + unescape(resolved_path.substr(pos + m_game_dir.size() + 1)); + std::string disc_path = !launching_from_disc_archive ? resolved_path : m_path; + const usz pos = disc_path.rfind(m_game_dir); + argv[0] = "/dev_bdvd/PS3_GAME/" + unescape(disc_path.substr(pos + m_game_dir.size() + 1)); m_dir = "/dev_bdvd/PS3_GAME/"; } else if (from_dev_flash)