mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-20 15:40:23 +00:00
Add one missing line, fix savestate restart
This commit is contained in:
parent
ee3e36672c
commit
23fdcbfeb8
@ -662,16 +662,7 @@ game_boot_result Emulator::BootGame(const std::string& path, const std::string&
|
|||||||
m_config_mode = config_mode;
|
m_config_mode = config_mode;
|
||||||
m_config_path = config_path;
|
m_config_path = config_path;
|
||||||
|
|
||||||
if (fs::file save{path, fs::isfile + fs::read}; save && save.size() >= 8 && save.read<u64>() == "RPCS3SAV"_u64)
|
if (direct || fs::is_file(path))
|
||||||
{
|
|
||||||
m_ar = std::make_shared<utils::serial>();
|
|
||||||
m_ar->set_reading_state();
|
|
||||||
save.seek(0);
|
|
||||||
save.read(m_ar->data, save.size());
|
|
||||||
m_ar->data.shrink_to_fit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (direct || m_ar || fs::is_file(path))
|
|
||||||
{
|
{
|
||||||
m_path = path;
|
m_path = path;
|
||||||
|
|
||||||
@ -749,6 +740,8 @@ void Emulator::SetForceBoot(bool force_boot)
|
|||||||
|
|
||||||
game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool is_disc_patch)
|
game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool is_disc_patch)
|
||||||
{
|
{
|
||||||
|
m_ar.reset();
|
||||||
|
|
||||||
if (m_config_mode == cfg_mode::continuous)
|
if (m_config_mode == cfg_mode::continuous)
|
||||||
{
|
{
|
||||||
// The program is being booted from another running program
|
// The program is being booted from another running program
|
||||||
@ -769,6 +762,15 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (fs::file save{m_path, fs::isfile + fs::read}; save && save.size() >= 8 && save.read<u64>() == "RPCS3SAV"_u64)
|
||||||
|
{
|
||||||
|
m_ar = std::make_shared<utils::serial>();
|
||||||
|
m_ar->set_reading_state();
|
||||||
|
save.seek(0);
|
||||||
|
save.read(m_ar->data, save.size());
|
||||||
|
m_ar->data.shrink_to_fit();
|
||||||
|
}
|
||||||
|
|
||||||
m_boot_source_type = CELL_GAME_GAMETYPE_SYS;
|
m_boot_source_type = CELL_GAME_GAMETYPE_SYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2529,6 +2531,7 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
|
|||||||
if (!file.file || (file.file.write(ar.data), !file.commit()))
|
if (!file.file || (file.file.write(ar.data), !file.commit()))
|
||||||
{
|
{
|
||||||
sys_log.error("Failed to write savestate to file! (path='%s', %s)", path, fs::g_tls_error);
|
sys_log.error("Failed to write savestate to file! (path='%s', %s)", path, fs::g_tls_error);
|
||||||
|
savestate = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2559,13 +2562,6 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
|
|||||||
}
|
}
|
||||||
|
|
||||||
ar.set_reading_state();
|
ar.set_reading_state();
|
||||||
|
|
||||||
if (!g_cfg.savestate.suspend_emu)
|
|
||||||
{
|
|
||||||
to_ar.reset();
|
|
||||||
Restart();
|
|
||||||
return to_ar;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Boot arg cleanup (preserved in the case restarting)
|
// Boot arg cleanup (preserved in the case restarting)
|
||||||
@ -2581,6 +2577,13 @@ std::shared_ptr<utils::serial> Emulator::Kill(bool allow_autoexit, bool savestat
|
|||||||
m_ar.reset();
|
m_ar.reset();
|
||||||
read_used_savestate_versions();
|
read_used_savestate_versions();
|
||||||
|
|
||||||
|
if (savestate && !g_cfg.savestate.suspend_emu)
|
||||||
|
{
|
||||||
|
to_ar.reset();
|
||||||
|
BootGame(m_path);
|
||||||
|
return to_ar;
|
||||||
|
}
|
||||||
|
|
||||||
// Always Enable display sleep, not only if it was prevented.
|
// Always Enable display sleep, not only if it was prevented.
|
||||||
enable_display_sleep();
|
enable_display_sleep();
|
||||||
|
|
||||||
|
@ -284,6 +284,7 @@
|
|||||||
<addaction name="actionopen_rsx_capture"/>
|
<addaction name="actionopen_rsx_capture"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionCreate_RSX_Capture"/>
|
<addaction name="actionCreate_RSX_Capture"/>
|
||||||
|
<addaction name="actionCreate_Savestate"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuView">
|
<widget class="QMenu" name="menuView">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user