1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

Savestates: Add some logging for sys_overlay

This commit is contained in:
Eladash 2024-01-20 20:19:15 +02:00 committed by Elad.Ash
parent 81ba791ee7
commit 4cd60aca22

View File

@ -72,8 +72,11 @@ fs::file make_file_view(fs::file&& file, u64 offset, u64 size);
std::shared_ptr<void> lv2_overlay::load(utils::serial& ar)
{
const std::string path = vfs::get(ar.pop<std::string>());
const s64 offset = ar;
const std::string vpath = ar.pop<std::string>();
const std::string path = vfs::get(vpath);
const s64 offset = ar.pop<s64>();
sys_overlay.success("lv2_overlay::load(): vpath='%s', path='%s', offset=0x%x", vpath, path, offset);
std::shared_ptr<lv2_overlay> ovlm;
@ -84,11 +87,19 @@ std::shared_ptr<void> lv2_overlay::load(utils::serial& ar)
u128 klic = g_fxo->get<loaded_npdrm_keys>().last_key();
file = make_file_view(std::move(file), offset, umax);
ovlm = ppu_load_overlay(ppu_exec_object{ decrypt_self(std::move(file), reinterpret_cast<u8*>(&klic)) }, false, path, 0, &ar).first;
ensure(ovlm);
if (!ovlm)
{
fmt::throw_exception("lv2_overlay::load(): ppu_load_overlay() failed. (vpath='%s', offset=0x%x)", vpath, offset);
}
}
else if (!g_cfg.savestate.state_inspection_mode.get())
{
fmt::throw_exception("lv2_overlay::load(): Failed to find file. (vpath='%s', offset=0x%x)", vpath, offset);
}
else
{
ensure(g_cfg.savestate.state_inspection_mode.get());
sys_overlay.error("lv2_overlay::load(): Failed to find file. (vpath='%s', offset=0x%x)", vpath, offset);
}
return ovlm;
@ -97,7 +108,11 @@ std::shared_ptr<void> lv2_overlay::load(utils::serial& ar)
void lv2_overlay::save(utils::serial& ar)
{
USING_SERIALIZATION_VERSION(lv2_prx_overlay);
ar(vfs::retrieve(path), offset);
const std::string vpath = vfs::retrieve(path);
(vpath.empty() ? sys_overlay.error : sys_overlay.success)("lv2_overlay::save(): vpath='%s', offset=0x%x", vpath, offset);
ar(vpath, offset);
}
error_code sys_overlay_load_module(vm::ptr<u32> ovlmid, vm::cptr<char> path, u64 flags, vm::ptr<u32> entry)