mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-24 00:40:06 +00:00
PPU Precompilation Fixup
This commit is contained in:
parent
343ba8733b
commit
ee869a49f4
@ -532,6 +532,11 @@ namespace ppu_patterns
|
|||||||
|
|
||||||
bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::basic_string<u32>& applied, std::function<bool()> check_aborted)
|
bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::basic_string<u32>& applied, std::function<bool()> check_aborted)
|
||||||
{
|
{
|
||||||
|
if (segs.empty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Assume first segment is executable
|
// Assume first segment is executable
|
||||||
const u32 start = segs[0].addr;
|
const u32 start = segs[0].addr;
|
||||||
|
|
||||||
|
@ -1658,7 +1658,7 @@ std::shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, bool virtual_lo
|
|||||||
|
|
||||||
void ppu_unload_prx(const lv2_prx& prx)
|
void ppu_unload_prx(const lv2_prx& prx)
|
||||||
{
|
{
|
||||||
if (prx.segs[0].ptr != vm::base(prx.segs[0].addr))
|
if (prx.segs.empty() || prx.segs[0].ptr != vm::base(prx.segs[0].addr))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3199,7 +3199,7 @@ extern fs::file make_file_view(fs::file&& _file, u64 offset)
|
|||||||
|
|
||||||
extern void ppu_finalize(const ppu_module& info)
|
extern void ppu_finalize(const ppu_module& info)
|
||||||
{
|
{
|
||||||
if (!info.cache.empty())
|
if (info.name.empty())
|
||||||
{
|
{
|
||||||
// Don't remove main module from memory
|
// Don't remove main module from memory
|
||||||
return;
|
return;
|
||||||
@ -3573,7 +3573,7 @@ extern void ppu_precompile(std::vector<std::string>& dir_queue, std::vector<ppu_
|
|||||||
|
|
||||||
if (std::memcpy(main_module.sha1, _main.sha1, sizeof(_main.sha1)) == 0)
|
if (std::memcpy(main_module.sha1, _main.sha1, sizeof(_main.sha1)) == 0)
|
||||||
{
|
{
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_main.analyse(0, _main.elf_entry, _main.seg0_code_end, _main.applied_pathes, [](){ return Emu.IsStopped(); }))
|
if (!_main.analyse(0, _main.elf_entry, _main.seg0_code_end, _main.applied_pathes, [](){ return Emu.IsStopped(); }))
|
||||||
@ -3584,6 +3584,8 @@ extern void ppu_precompile(std::vector<std::string>& dir_queue, std::vector<ppu_
|
|||||||
obj.clear(), src.close(); // Clear decrypted file and elf object memory
|
obj.clear(), src.close(); // Clear decrypted file and elf object memory
|
||||||
|
|
||||||
ppu_initialize(_main);
|
ppu_initialize(_main);
|
||||||
|
|
||||||
|
_main.name = ' '; // Make ppu_finalize work
|
||||||
ppu_finalize(_main);
|
ppu_finalize(_main);
|
||||||
_main = {};
|
_main = {};
|
||||||
break;
|
break;
|
||||||
@ -3600,6 +3602,7 @@ extern void ppu_precompile(std::vector<std::string>& dir_queue, std::vector<ppu_
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_fxo->get<main_ppu_module>() = std::move(main_module);
|
g_fxo->get<main_ppu_module>() = std::move(main_module);
|
||||||
|
Emu.ConfigurePPUCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
exec_worker();
|
exec_worker();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user