summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/registered_cache.h
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-10 21:06:37 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-12 04:50:48 +0200
commit3b3c919e204a8fc5d2a4e7f372514f257acbe96e (patch)
tree48c45e8b08058a2d54afa940419f66750ce0cdcb /src/core/file_sys/registered_cache.h
parentgame_list: Populate control data from installed NAND (diff)
downloadyuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.tar
yuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.tar.gz
yuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.tar.bz2
yuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.tar.lz
yuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.tar.xz
yuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.tar.zst
yuzu-3b3c919e204a8fc5d2a4e7f372514f257acbe96e.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/registered_cache.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/registered_cache.h b/src/core/file_sys/registered_cache.h
index baaed02dd..f2b07eec8 100644
--- a/src/core/file_sys/registered_cache.h
+++ b/src/core/file_sys/registered_cache.h
@@ -23,6 +23,7 @@ class CNMT;
using NcaID = std::array<u8, 0x10>;
using RegisteredCacheParsingFunction = std::function<VirtualFile(const VirtualFile&, const NcaID&)>;
+using VfsCopyFunction = std::function<bool(VirtualFile, VirtualFile)>;
struct RegisteredCacheEntry {
u64 title_id;
@@ -76,13 +77,14 @@ public:
// Raw copies all the ncas from the xci to the csache. Does some quick checks to make sure there
// is a meta NCA and all of them are accessible.
- bool InstallEntry(std::shared_ptr<XCI> xci);
+ bool InstallEntry(std::shared_ptr<XCI> xci, const VfsCopyFunction& copy = &VfsRawCopy);
// Due to the fact that we must use Meta-type NCAs to determine the existance of files, this
// poses quite a challenge. Instead of creating a new meta NCA for this file, yuzu will create a
// dir inside the NAND called 'yuzu_meta' and store the raw CNMT there.
// TODO(DarkLordZach): Author real meta-type NCAs and install those.
- bool InstallEntry(std::shared_ptr<NCA> nca, TitleType type);
+ bool InstallEntry(std::shared_ptr<NCA> nca, TitleType type,
+ const VfsCopyFunction& copy = &VfsRawCopy);
private:
template <typename T>
@@ -95,7 +97,8 @@ private:
boost::optional<NcaID> GetNcaIDFromMetadata(u64 title_id, ContentRecordType type) const;
VirtualFile GetFileAtID(NcaID id) const;
VirtualFile OpenFileOrDirectoryConcat(const VirtualDir& dir, std::string_view path) const;
- bool RawInstallNCA(std::shared_ptr<NCA> nca, boost::optional<NcaID> override_id = boost::none);
+ bool RawInstallNCA(std::shared_ptr<NCA> nca, const VfsCopyFunction& copy,
+ boost::optional<NcaID> override_id = boost::none);
bool RawInstallYuzuMeta(const CNMT& cnmt);
VirtualDir dir;