mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12:00
Fix mounting bdvd when elf in subdirectory
Causes MGS4 to boot further
This commit is contained in:
parent
0fba38f691
commit
901f503a3a
1 changed files with 8 additions and 15 deletions
|
@ -226,8 +226,8 @@ void Emulator::Load()
|
||||||
// Mount all devices
|
// Mount all devices
|
||||||
const std::string emu_dir_ = g_cfg_vfs_emulator_dir;
|
const std::string emu_dir_ = g_cfg_vfs_emulator_dir;
|
||||||
const std::string emu_dir = emu_dir_.empty() ? fs::get_config_dir() : emu_dir_;
|
const std::string emu_dir = emu_dir_.empty() ? fs::get_config_dir() : emu_dir_;
|
||||||
const std::string bdvd_dir = g_cfg_vfs_dev_bdvd;
|
|
||||||
const std::string home_dir = g_cfg_vfs_app_home;
|
const std::string home_dir = g_cfg_vfs_app_home;
|
||||||
|
std::string bdvd_dir = g_cfg_vfs_dev_bdvd;
|
||||||
|
|
||||||
vfs::mount("dev_hdd0", fmt::replace_all(g_cfg_vfs_dev_hdd0, "$(EmulatorDir)", emu_dir));
|
vfs::mount("dev_hdd0", fmt::replace_all(g_cfg_vfs_dev_hdd0, "$(EmulatorDir)", emu_dir));
|
||||||
vfs::mount("dev_hdd1", fmt::replace_all(g_cfg_vfs_dev_hdd1, "$(EmulatorDir)", emu_dir));
|
vfs::mount("dev_hdd1", fmt::replace_all(g_cfg_vfs_dev_hdd1, "$(EmulatorDir)", emu_dir));
|
||||||
|
@ -237,25 +237,18 @@ void Emulator::Load()
|
||||||
vfs::mount("app_home", home_dir.empty() ? elf_dir + '/' : fmt::replace_all(home_dir, "$(EmulatorDir)", emu_dir));
|
vfs::mount("app_home", home_dir.empty() ? elf_dir + '/' : fmt::replace_all(home_dir, "$(EmulatorDir)", emu_dir));
|
||||||
|
|
||||||
// Mount /dev_bdvd/ if necessary
|
// Mount /dev_bdvd/ if necessary
|
||||||
if (bdvd_dir.empty() && fs::is_file(elf_dir + "/../../PS3_DISC.SFB"))
|
if (bdvd_dir.empty())
|
||||||
{
|
{
|
||||||
const auto dir_list = fmt::split(elf_dir, { "/", "\\" });
|
size_t pos = elf_dir.rfind("PS3_GAME");
|
||||||
|
std::string temp = elf_dir.substr(0, pos);
|
||||||
// Check latest two directories
|
if ((pos != std::string::npos) && fs::is_file(temp + "/PS3_DISC.SFB")) {
|
||||||
if (dir_list.size() >= 2 && dir_list.back() == "USRDIR" && *(dir_list.end() - 2) == "PS3_GAME")
|
bdvd_dir = temp;
|
||||||
{
|
|
||||||
vfs::mount("dev_bdvd", elf_dir.substr(0, elf_dir.length() - 15));
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
vfs::mount("dev_bdvd", elf_dir + "/../../");
|
|
||||||
}
|
}
|
||||||
|
if (!bdvd_dir.empty() && fs::is_dir(bdvd_dir))
|
||||||
LOG_NOTICE(LOADER, "Disc: %s", vfs::get("/dev_bdvd"));
|
|
||||||
}
|
|
||||||
else if (bdvd_dir.size())
|
|
||||||
{
|
{
|
||||||
vfs::mount("dev_bdvd", fmt::replace_all(bdvd_dir, "$(EmulatorDir)", emu_dir));
|
vfs::mount("dev_bdvd", fmt::replace_all(bdvd_dir, "$(EmulatorDir)", emu_dir));
|
||||||
|
LOG_NOTICE(LOADER, "Disc: %s", vfs::get("/dev_bdvd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mount /host_root/ if necessary
|
// Mount /host_root/ if necessary
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue