Skip to content

Commit

Permalink
Allow BootGame with indirect paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Feb 2, 2021
1 parent 08aaae7 commit 0c7d0de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions rpcs3/Emu/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,24 +669,29 @@ game_boot_result Emulator::BootGame(const std::string& path, const std::string&
if (g_cfg.vfs.limit_cache_size)
LimitCacheSize();

static const char* boot_list[] =
if (!fs::exists(path))
{
"/eboot.bin",
"/EBOOT.BIN",
"/USRDIR/EBOOT.BIN",
"/USRDIR/ISO.BIN.EDAT",
"/PS3_GAME/USRDIR/EBOOT.BIN",
};
return game_boot_result::invalid_file_or_folder;
}

m_path_old = m_path;

if (direct && fs::exists(path))
if (direct || fs::is_file(path))
{
m_path = path;
return Load(title_id, add_only, force_global_config);
}

game_boot_result result = game_boot_result::nothing_to_boot;

static const char* boot_list[] =
{
"/EBOOT.BIN",
"/USRDIR/EBOOT.BIN",
"/USRDIR/ISO.BIN.EDAT",
"/PS3_GAME/USRDIR/EBOOT.BIN",
};

for (std::string elf : boot_list)
{
elf = path + elf;
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ int main(int argc, char** argv)
Emu.argv = std::move(argv);
Emu.SetForceBoot(true);

if (const game_boot_result error = Emu.BootGame(path, "", true); error != game_boot_result::no_errors)
if (const game_boot_result error = Emu.BootGame(path, ""); error != game_boot_result::no_errors)
{
sys_log.error("Booting '%s' with cli argument failed: reason: %s", path, error);

Expand Down

0 comments on commit 0c7d0de

Please sign in to comment.