mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-22 04:24:44 +00:00
SaveData: fix icon overriding
This commit is contained in:
parent
e68774d449
commit
bb32b30a58
3 changed files with 7 additions and 2 deletions
|
@ -157,7 +157,11 @@ void SaveInstance::SetupAndMount(bool read_only, bool copy_icon, bool ignore_cor
|
|||
if (copy_icon) {
|
||||
const auto& src_icon = g_mnt->GetHostPath("/app0/sce_sys/save_data.png");
|
||||
if (fs::exists(src_icon)) {
|
||||
fs::copy_file(src_icon, GetIconPath());
|
||||
auto output_icon = GetIconPath();
|
||||
if (fs::exists(output_icon)) {
|
||||
fs::remove(output_icon);
|
||||
}
|
||||
fs::copy_file(src_icon, output_icon);
|
||||
}
|
||||
}
|
||||
exists = true;
|
||||
|
|
|
@ -207,7 +207,7 @@ void SetIcon(void* buf, size_t buf_size) {
|
|||
} else {
|
||||
g_icon_memory.resize(buf_size);
|
||||
std::memcpy(g_icon_memory.data(), buf, buf_size);
|
||||
IOFile file(g_icon_path, Common::FS::FileAccessMode::Append);
|
||||
IOFile file(g_icon_path, Common::FS::FileAccessMode::Write);
|
||||
file.Seek(0);
|
||||
file.WriteRaw<u8>(g_icon_memory.data(), buf_size);
|
||||
file.Close();
|
||||
|
|
|
@ -1573,6 +1573,7 @@ Error PS4_SYSV_ABI sceSaveDataSetupSaveDataMemory2(const OrbisSaveDataMemorySetu
|
|||
SaveMemory::SetIcon(nullptr, 0);
|
||||
}
|
||||
}
|
||||
SaveMemory::TriggerSaveWithoutEvent();
|
||||
if (g_fw_ver >= ElfInfo::FW_45 && result != nullptr) {
|
||||
result->existedMemorySize = existed_size;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue