mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
Move cache dir code to utils
This commit is contained in:
parent
c11c286206
commit
04d6ff274b
4 changed files with 27 additions and 44 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "system_config.h"
|
||||
#include "vfs_config.h"
|
||||
#include "Emu/Io/pad_config.h"
|
||||
#include "Emu/System.h"
|
||||
#include "util/sysinfo.hpp"
|
||||
#include "Utilities/File.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
|
@ -121,6 +122,28 @@ namespace rpcs3::utils
|
|||
return fs::get_cache_dir() + "cache/";
|
||||
}
|
||||
|
||||
std::string get_cache_dir(std::string_view module_path)
|
||||
{
|
||||
std::string cache_dir = get_cache_dir();
|
||||
|
||||
const std::string dev_flash = g_cfg_vfs.get_dev_flash();
|
||||
const bool in_dev_flash = Emu.IsPathInsideDir(module_path, dev_flash);
|
||||
|
||||
if (in_dev_flash && !Emu.IsPathInsideDir(module_path, dev_flash + "sys/external/"))
|
||||
{
|
||||
// Add prefix for vsh
|
||||
cache_dir += "vsh/";
|
||||
}
|
||||
else if (!in_dev_flash && !Emu.GetTitleID().empty() && Emu.GetCat() != "1P")
|
||||
{
|
||||
// Add prefix for anything except dev_flash files, standalone elfs or PS1 classics
|
||||
cache_dir += Emu.GetTitleID();
|
||||
cache_dir += '/';
|
||||
}
|
||||
|
||||
return cache_dir;
|
||||
}
|
||||
|
||||
std::string get_rap_file_path(const std::string_view& rap)
|
||||
{
|
||||
const std::string home_dir = get_hdd0_dir() + "home";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue