ISO: Fix for save states
This commit is contained in:
+19
-1
@@ -1408,6 +1408,10 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
|
||||
m_path = rpcs3::utils::get_hdd1_dir();
|
||||
m_path += std::string_view(argv[0]).substr(9);
|
||||
}
|
||||
else if (is_file_iso(argv[0]))
|
||||
{
|
||||
m_path = argv[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
sys_log.error("Unknown source for path redirection: %s", argv[0]);
|
||||
@@ -1818,6 +1822,10 @@ game_boot_result Emulator::Load(const std::string& title_id, bool is_disc_patch,
|
||||
sys_log.error("Failed to move disc game %s to '%s' (%s)", m_title_id, dst_dir, fs::g_tls_error);
|
||||
return game_boot_result::wrong_disc_location;
|
||||
}
|
||||
else if (launching_from_disc_archive)
|
||||
{
|
||||
bdvd_dir = iso_device::virtual_device_name + "/";
|
||||
}
|
||||
}
|
||||
|
||||
if (bdvd_dir.empty() && disc.empty() && !is_disc_patch)
|
||||
@@ -3583,7 +3591,17 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
|
||||
|
||||
ar(std::array<u8, 32>{}); // Reserved for future use
|
||||
|
||||
if (auto dir = vfs::get("/dev_bdvd/PS3_GAME"); fs::is_dir(dir) && !fs::is_file(fs::get_parent_dir(dir) + "/PS3_DISC.SFB"))
|
||||
// Game mounted from archive
|
||||
if (m_path.starts_with(iso_device::virtual_device_name + "/"))
|
||||
{
|
||||
auto device = fs::get_virtual_device(iso_device::virtual_device_name + "/");
|
||||
ensure(device);
|
||||
|
||||
auto iso_device = dynamic_cast<class iso_device*>(device.get());
|
||||
ar(iso_device->get_loaded_iso());
|
||||
ar(m_title_id);
|
||||
}
|
||||
else if (auto dir = vfs::get("/dev_bdvd/PS3_GAME"); fs::is_dir(dir) && !fs::is_file(fs::get_parent_dir(dir) + "/PS3_DISC.SFB"))
|
||||
{
|
||||
// Fake /dev_bdvd/PS3_GAME detected, use HDD0 for m_path restoration
|
||||
ensure(vfs::unmount("/dev_bdvd/PS3_GAME"));
|
||||
|
||||
Reference in New Issue
Block a user