Atomic SPU LS capture writes

This commit is contained in:
Eladash 2021-02-23 06:29:11 +02:00 committed by Ivan
parent d4af8dd89a
commit 9ccf39b27f
3 changed files with 28 additions and 7 deletions

View file

@ -765,8 +765,12 @@ static void ppu_check_patch_spu_images(const ppu_segment& seg)
if (g_cfg.core.spu_debug)
{
fs::file dump_file(fs::get_cache_dir() + "/spu_progs/" + vfs::escape(name.substr(name.find_last_of('/') + 1)) + '_' + hash.substr(4) + ".elf", fs::rewrite);
obj.save(dump_file);
fs::pending_file temp(fs::get_cache_dir() + "/spu_progs/" + vfs::escape(name.substr(name.find_last_of('/') + 1)) + '_' + hash.substr(4) + ".elf");
if (!temp.file || !(temp.file.write(obj.save()), temp.commit()))
{
ppu_loader.error("Failed to dump SPU program from PPU executable: name='%s', hash=%s", name, hash);
}
}
// Try to patch each segment, will only succeed if the address exists in SPU local storage