diff --git a/src/core/file_sys/fs.cpp b/src/core/file_sys/fs.cpp index c24304430..b237ab7d9 100644 --- a/src/core/file_sys/fs.cpp +++ b/src/core/file_sys/fs.cpp @@ -139,7 +139,7 @@ std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_rea return std::optional(current_path); }; - if (!force_base_path) { + if (!force_base_path && !ignore_game_patches) { if (const auto path = search(patch_path)) { return *path; } diff --git a/src/emulator.cpp b/src/emulator.cpp index 9e97155d5..c35fd4e46 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "common/config.h" #include "common/debug.h" @@ -63,7 +64,8 @@ Emulator::~Emulator() { Config::saveMainWindow(config_dir / "config.toml"); } -void Emulator::Run(std::filesystem::path file, const std::vector args, bool ignore_game_patch) { +void Emulator::Run(std::filesystem::path file, const std::vector args, + bool ignore_game_patch) { if (std::filesystem::is_directory(file)) { file /= "eboot.bin"; } @@ -75,7 +77,7 @@ void Emulator::Run(std::filesystem::path file, const std::vector ar game_folder_name.ends_with("-UPDATE") || game_folder_name.ends_with("-patch")) { // If an executable was launched from a separate update directory, // use the base game directory as the game folder. - const auto base_name = game_folder_name.substr(0, game_folder_name.size() - 7); + const std::string base_name = game_folder_name.substr(0, game_folder_name.rfind('-')); const auto base_path = game_folder.parent_path() / base_name; if (std::filesystem::is_directory(base_path)) { game_folder = base_path; @@ -84,7 +86,7 @@ void Emulator::Run(std::filesystem::path file, const std::vector ar // Applications expect to be run from /app0 so mount the file's parent path as app0. auto* mnt = Common::Singleton::Instance(); - mnt->ignore_game_patches = ignore_game_patch; + Core::FileSys::MntPoints::ignore_game_patches = ignore_game_patch; mnt->Mount(game_folder, "/app0", true); // Certain games may use /hostapp as well such as CUSA001100 diff --git a/src/emulator.h b/src/emulator.h index e904d9f1d..4351fde98 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -25,7 +25,8 @@ public: Emulator(); ~Emulator(); - void Run(std::filesystem::path file, const std::vector args = {}, bool use_game_patch=false); + void Run(std::filesystem::path file, const std::vector args = {}, + bool ignore_game_patch = false); void UpdatePlayTime(const std::string& serial); private: diff --git a/src/qt_gui/main.cpp b/src/qt_gui/main.cpp index b634981a0..f2203ee93 100644 --- a/src/qt_gui/main.cpp +++ b/src/qt_gui/main.cpp @@ -42,21 +42,22 @@ int main(int argc, char* argv[]) { std::unordered_map> arg_map = { {"-h", [&](int&) { - std::cout << "Usage: shadps4 [options]\n" - "Options:\n" - " No arguments: Opens the GUI.\n" - " -g, --game Specify or " - " to launch\n" - " -- ... Parameters passed to the game ELF. " - "Needs to be at the end of the line, and everything after \"--\" is a " - "game argument.\n" - " -p, --patch Apply specified patch file\n" - " -i, --ignore-game-patch Disable automatic loading of game patch\n" - " -s, --show-gui Show the GUI\n" - " -f, --fullscreen Specify window initial fullscreen " - "state. Does not overwrite the config file.\n" - " --add-game-folder Adds a new game folder to the config.\n" - " -h, --help Display this help message\n"; + std::cout + << "Usage: shadps4 [options]\n" + "Options:\n" + " No arguments: Opens the GUI.\n" + " -g, --game Specify or " + " to launch\n" + " -- ... Parameters passed to the game ELF. " + "Needs to be at the end of the line, and everything after \"--\" is a " + "game argument.\n" + " -p, --patch Apply specified patch file\n" + " -i, --ignore-game-patch Disable automatic loading of game patch\n" + " -s, --show-gui Show the GUI\n" + " -f, --fullscreen Specify window initial fullscreen " + "state. Does not overwrite the config file.\n" + " --add-game-folder Adds a new game folder to the config.\n" + " -h, --help Display this help message\n"; exit(0); }}, {"--help", [&](int& i) { arg_map["-h"](i); }}, // Redirect --help to -h