diff options
| author | 2019-04-10 12:10:38 -0400 | |
|---|---|---|
| committer | 2019-09-21 16:43:10 -0400 | |
| commit | b71bda45ae26695665bba45e7a3f84ae5a13d2b3 (patch) | |
| tree | cede44f2d6f30a8a7b1beeb38375621e07698a20 /src | |
| parent | bis_factory: Add accessor for NAND Image Directory (diff) | |
| download | yuzu-b71bda45ae26695665bba45e7a3f84ae5a13d2b3.tar.gz yuzu-b71bda45ae26695665bba45e7a3f84ae5a13d2b3.tar.xz yuzu-b71bda45ae26695665bba45e7a3f84ae5a13d2b3.zip | |
bis_factory: Add accessors for BIS placeholder caches
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/bis_factory.cpp | 14 | ||||
| -rw-r--r-- | src/core/file_sys/bis_factory.h | 7 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/core/file_sys/bis_factory.cpp b/src/core/file_sys/bis_factory.cpp index b8967853f..cbeb2f73a 100644 --- a/src/core/file_sys/bis_factory.cpp +++ b/src/core/file_sys/bis_factory.cpp | |||
| @@ -14,7 +14,11 @@ BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_, VirtualDir | |||
| 14 | sysnand_cache(std::make_unique<RegisteredCache>( | 14 | sysnand_cache(std::make_unique<RegisteredCache>( |
| 15 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/registered"))), | 15 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/registered"))), |
| 16 | usrnand_cache(std::make_unique<RegisteredCache>( | 16 | usrnand_cache(std::make_unique<RegisteredCache>( |
| 17 | GetOrCreateDirectoryRelative(nand_root, "/user/Contents/registered"))) {} | 17 | GetOrCreateDirectoryRelative(nand_root, "/user/Contents/registered"))), |
| 18 | sysnand_placeholder(std::make_unique<PlaceholderCache>( | ||
| 19 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/placehld"))), | ||
| 20 | usrnand_placeholder(std::make_unique<PlaceholderCache>( | ||
| 21 | GetOrCreateDirectoryRelative(nand_root, "/user/Contents/placehld"))) {} | ||
| 18 | 22 | ||
| 19 | BISFactory::~BISFactory() = default; | 23 | BISFactory::~BISFactory() = default; |
| 20 | 24 | ||
| @@ -34,6 +38,14 @@ RegisteredCache* BISFactory::GetUserNANDContents() const { | |||
| 34 | return usrnand_cache.get(); | 38 | return usrnand_cache.get(); |
| 35 | } | 39 | } |
| 36 | 40 | ||
| 41 | PlaceholderCache* BISFactory::GetSystemNANDPlaceholder() const { | ||
| 42 | return sysnand_placeholder.get(); | ||
| 43 | } | ||
| 44 | |||
| 45 | PlaceholderCache* BISFactory::GetUserNANDPlaceholder() const { | ||
| 46 | return usrnand_placeholder.get(); | ||
| 47 | } | ||
| 48 | |||
| 37 | VirtualDir BISFactory::GetModificationLoadRoot(u64 title_id) const { | 49 | VirtualDir BISFactory::GetModificationLoadRoot(u64 title_id) const { |
| 38 | // LayeredFS doesn't work on updates and title id-less homebrew | 50 | // LayeredFS doesn't work on updates and title id-less homebrew |
| 39 | if (title_id == 0 || (title_id & 0x800) > 0) | 51 | if (title_id == 0 || (title_id & 0x800) > 0) |
diff --git a/src/core/file_sys/bis_factory.h b/src/core/file_sys/bis_factory.h index 38dcd28dc..6229cd5a9 100644 --- a/src/core/file_sys/bis_factory.h +++ b/src/core/file_sys/bis_factory.h | |||
| @@ -28,6 +28,7 @@ enum class BisPartitionId : u32 { | |||
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | class RegisteredCache; | 30 | class RegisteredCache; |
| 31 | class PlaceholderCache; | ||
| 31 | 32 | ||
| 32 | /// File system interface to the Built-In Storage | 33 | /// File system interface to the Built-In Storage |
| 33 | /// This is currently missing accessors to BIS partitions, but seemed like a good place for the NAND | 34 | /// This is currently missing accessors to BIS partitions, but seemed like a good place for the NAND |
| @@ -43,6 +44,9 @@ public: | |||
| 43 | RegisteredCache* GetSystemNANDContents() const; | 44 | RegisteredCache* GetSystemNANDContents() const; |
| 44 | RegisteredCache* GetUserNANDContents() const; | 45 | RegisteredCache* GetUserNANDContents() const; |
| 45 | 46 | ||
| 47 | PlaceholderCache* GetSystemNANDPlaceholder() const; | ||
| 48 | PlaceholderCache* GetUserNANDPlaceholder() const; | ||
| 49 | |||
| 46 | VirtualDir GetModificationLoadRoot(u64 title_id) const; | 50 | VirtualDir GetModificationLoadRoot(u64 title_id) const; |
| 47 | VirtualDir GetModificationDumpRoot(u64 title_id) const; | 51 | VirtualDir GetModificationDumpRoot(u64 title_id) const; |
| 48 | 52 | ||
| @@ -58,6 +62,9 @@ private: | |||
| 58 | 62 | ||
| 59 | std::unique_ptr<RegisteredCache> sysnand_cache; | 63 | std::unique_ptr<RegisteredCache> sysnand_cache; |
| 60 | std::unique_ptr<RegisteredCache> usrnand_cache; | 64 | std::unique_ptr<RegisteredCache> usrnand_cache; |
| 65 | |||
| 66 | std::unique_ptr<PlaceholderCache> sysnand_placeholder; | ||
| 67 | std::unique_ptr<PlaceholderCache> usrnand_placeholder; | ||
| 61 | }; | 68 | }; |
| 62 | 69 | ||
| 63 | } // namespace FileSys | 70 | } // namespace FileSys |