Skip to content

Commit

Permalink
Fix PPU SELF Precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
elad335 committed Aug 14, 2023
1 parent 0e23b89 commit 933572d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion rpcs3/Emu/Cell/PPUModule.cpp
Expand Up @@ -2243,7 +2243,6 @@ bool ppu_load_exec(const ppu_exec_object& elf, bool virtual_load, const std::str
else
{
g_ps3_process_info = old_process_info;
Emu.ConfigurePPUCache();
}

if (!load_libs.empty())
Expand Down
4 changes: 3 additions & 1 deletion rpcs3/Emu/Cell/PPUThread.cpp
Expand Up @@ -11,6 +11,7 @@
#include "Emu/Memory/vm_locking.h"
#include "Emu/RSX/Core/RSXReservationLock.hpp"
#include "Emu/VFS.h"
#include "Emu/vfs_config.h"
#include "Emu/system_progress.hpp"
#include "Emu/system_utils.hpp"
#include "PPUThread.h"
Expand Down Expand Up @@ -3574,7 +3575,7 @@ extern void ppu_precompile(std::vector<std::string>& dir_queue, std::vector<ppu_
break;
}

if (std::memcpy(main_module.sha1, _main.sha1, sizeof(_main.sha1)) == 0)
if (std::memcmp(main_module.sha1, _main.sha1, sizeof(_main.sha1)) == 0)
{
break;
}
Expand All @@ -3587,6 +3588,7 @@ extern void ppu_precompile(std::vector<std::string>& dir_queue, std::vector<ppu_
obj.clear(), src.close(); // Clear decrypted file and elf object memory

_main.name = ' '; // Make ppu_finalize work
Emu.ConfigurePPUCache(!Emu.IsPathInsideDir(_main.path, g_cfg_vfs.get_dev_flash()));
ppu_initialize(_main);
ppu_finalize(_main);
_main = {};
Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/System.cpp
Expand Up @@ -3243,13 +3243,13 @@ s32 error_code::error_report(s32 result, const logs::message* channel, const cha
return result;
}

void Emulator::ConfigurePPUCache() const
void Emulator::ConfigurePPUCache(bool with_title_id) const
{
auto& _main = g_fxo->get<main_ppu_module>();

_main.cache = rpcs3::utils::get_cache_dir();

if (!m_title_id.empty() && m_cat != "1P")
if (with_title_id && !m_title_id.empty() && m_cat != "1P")
{
_main.cache += GetTitleID();
_main.cache += '/';
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/System.h
Expand Up @@ -353,7 +353,7 @@ class Emulator final

std::string GetFormattedTitle(double fps) const;

void ConfigurePPUCache() const;
void ConfigurePPUCache(bool with_title_id = true) const;

std::set<std::string> GetGameDirs() const;
void AddGamesFromDir(const std::string& path);
Expand Down

0 comments on commit 933572d

Please sign in to comment.