From c8a6bc6e24d21a9e242bbbd6b86d0c57e83da578 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 11 Mar 2018 00:36:23 +0300 Subject: [PATCH] Relax /dev_bdvd mounting requirements Allow some PSN games with DG category to boot --- rpcs3/Emu/System.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 4117a06280..c27fa1ac45 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -439,8 +439,10 @@ void Emulator::Load(bool add_only) // Detect boot location const std::string hdd0_game = vfs::get("/dev_hdd0/game/"); const std::string hdd0_disc = vfs::get("/dev_hdd0/disc/"); + const std::size_t bdvd_pos = m_cat == "DG" && bdvd_dir.empty() && disc.empty() ? elf_dir.rfind("/PS3_GAME/") + 1 : 0; + const bool from_hdd0_game = m_path.find(hdd0_game) != -1; - if (m_cat == "DG" && m_path.find(hdd0_game) != -1 && disc.empty()) + if (bdvd_pos && from_hdd0_game) { // Booting disc game from wrong location LOG_ERROR(LOADER, "Disc game %s found at invalid location /dev_hdd0/game/", m_title_id); @@ -459,13 +461,10 @@ void Emulator::Load(bool add_only) } // Booting disc game - if (m_cat == "DG" && bdvd_dir.empty() && disc.empty()) + if (bdvd_pos) { // Mount /dev_bdvd/ if necessary - if (auto pos = elf_dir.rfind("/PS3_GAME/") + 1) - { - bdvd_dir = elf_dir.substr(0, pos); - } + bdvd_dir = elf_dir.substr(0, bdvd_pos); } // Booting patch data @@ -514,12 +513,12 @@ void Emulator::Load(bool add_only) { // Don't need /dev_bdvd } - else if (disc.empty()) + else if (disc.empty() && !from_hdd0_game) { LOG_ERROR(LOADER, "Failed to mount disc directory for the disc game %s", m_title_id); return; } - else + else if (!disc.empty()) { bdvd_dir = disc; vfs::mount("dev_bdvd", bdvd_dir);