Command line elf path fix (#2844)

This commit is contained in:
RipleyTom 2017-06-10 21:50:10 +02:00 committed by kd-11
parent 5dd5323ad0
commit 0dd10d1457
1 changed files with 23 additions and 1 deletions

View File

@ -422,7 +422,29 @@ void Emulator::Load()
if (m_elf_path.empty())
{
m_elf_path = "/host_root/" + m_path;
if (!bdvd_dir.empty() && fs::is_dir(bdvd_dir))
{
//Disc games are on /dev_bdvd/
size_t pos = m_path.rfind("PS3_GAME");
m_elf_path = "/dev_bdvd/" + m_path.substr(pos);
}
else if (GetTitleID().substr(0, 2) == "NP")
{
//PSN Games are on /dev_hdd0/
size_t pos = m_path.rfind(GetTitleID());
if (pos == std::string::npos)
{
LOG_ERROR(LOADER, "Title ID isn't present in the path(%s)", m_path);
return;
}
m_elf_path = "/dev_hdd0/game/" + m_path.substr(pos);
}
else
{
//For homebrew
m_elf_path = "/host_root/" + m_path;
}
LOG_NOTICE(LOADER, "Elf path: %s", m_elf_path);
}