System: add vsh.self when scanning vsh/module

This commit is contained in:
Megamouse 2021-07-27 04:09:20 +02:00
parent 03a46a499e
commit 22e51e1615

View file

@ -728,9 +728,23 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
g_fxo->init<named_thread>("SPRX Loader"sv, [this] g_fxo->init<named_thread>("SPRX Loader"sv, [this]
{ {
std::string path;
std::vector<std::string> dir_queue; std::vector<std::string> dir_queue;
dir_queue.emplace_back(m_path + '/'); dir_queue.emplace_back(m_path + '/');
if (m_title_id.empty())
{
// Check if we are trying to scan vsh/module
const std::string vsh_path = g_cfg.vfs.get_dev_flash() + "vsh/module";
if (IsPathInsideDir(m_path, vsh_path))
{
// Memorize path to vsh.self
path = vsh_path + "/vsh.self";
}
}
else
{
// Find game update to use EBOOT.BIN from it, also add its directory to scan // Find game update to use EBOOT.BIN from it, also add its directory to scan
if (m_cat == "DG") if (m_cat == "DG")
{ {
@ -743,14 +757,18 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
} }
} }
// Memorize path to EBOOT.BIN
path = m_path + "/USRDIR/EBOOT.BIN";
// Try to add all related directories // Try to add all related directories
const std::set<std::string> dirs = GetGameDirs(); const std::set<std::string> dirs = GetGameDirs();
dir_queue.insert(std::end(dir_queue), std::begin(dirs), std::end(dirs)); dir_queue.insert(std::end(dir_queue), std::begin(dirs), std::end(dirs));
}
if (std::string path = m_path + "/USRDIR/EBOOT.BIN"; fs::is_file(path)) if (fs::is_file(path))
{ {
// Compile EBOOT.BIN first // Compile binary first
ppu_log.notice("Trying to load EBOOT.BIN: %s", path); ppu_log.notice("Trying to load binary: %s", path);
fs::file src{path}; fs::file src{path};
@ -772,7 +790,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
} }
else else
{ {
sys_log.error("Failed to load EBOOT.BIN '%s' (%s)", path, obj.get_error()); sys_log.error("Failed to load binary '%s' (%s)", path, obj.get_error());
} }
} }
else else