Implement SPU recompiler cache

Shared between ASMJIT/LLVM recompilers, compiled at startup
This commit is contained in:
Nekotekina 2018-05-05 00:01:27 +03:00
parent f5ee6fb113
commit fe4c3c4d84
7 changed files with 282 additions and 59 deletions

View file

@ -9,6 +9,7 @@
#include "PPUInterpreter.h"
#include "PPUAnalyser.h"
#include "PPUModule.h"
#include "SPURecompiler.h"
#include "lv2/sys_sync.h"
#include "lv2/sys_prx.h"
#include "Utilities/GDBDebugServer.h"
@ -1086,6 +1087,22 @@ extern void ppu_initialize()
return;
}
// New PPU cache location
_main->cache = fmt::format("%sdata/%s/ppu-%s-%s/", fs::get_config_dir(), Emu.GetTitleID(), fmt::base57(_main->sha1), Emu.GetBoot().substr(Emu.GetBoot().find_last_of('/') + 1));
if (!fs::create_path(_main->cache))
{
fmt::throw_exception("Failed to create cache directory: %s (%s)", _main->cache, fs::g_tls_error);
}
// Initialize SPU cache
spu_cache::initialize();
if (Emu.IsStopped())
{
return;
}
// Initialize main module
ppu_initialize(*_main);