diff options
| author | 2018-09-19 22:03:36 -0400 | |
|---|---|---|
| committer | 2018-09-21 19:53:33 -0400 | |
| commit | 50a470eab8a409901250d2d3cca5399e9c243f59 (patch) | |
| tree | ee949077f3794f702e2a9f4e0b148b43c8bd79bd /src/core/file_sys | |
| parent | patch_manager: Add LayeredFS mods support (diff) | |
| download | yuzu-50a470eab8a409901250d2d3cca5399e9c243f59.tar.gz yuzu-50a470eab8a409901250d2d3cca5399e9c243f59.tar.xz yuzu-50a470eab8a409901250d2d3cca5399e9c243f59.zip | |
bis_factory: Add mod directory VFS getter
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/bis_factory.cpp | 12 | ||||
| -rw-r--r-- | src/core/file_sys/bis_factory.h | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/core/file_sys/bis_factory.cpp b/src/core/file_sys/bis_factory.cpp index 205492897..012e08e7d 100644 --- a/src/core/file_sys/bis_factory.cpp +++ b/src/core/file_sys/bis_factory.cpp | |||
| @@ -4,11 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | #include "core/file_sys/bis_factory.h" | 5 | #include "core/file_sys/bis_factory.h" |
| 6 | #include "core/file_sys/registered_cache.h" | 6 | #include "core/file_sys/registered_cache.h" |
| 7 | #include "fmt/format.h" | ||
| 7 | 8 | ||
| 8 | namespace FileSys { | 9 | namespace FileSys { |
| 9 | 10 | ||
| 10 | BISFactory::BISFactory(VirtualDir nand_root_) | 11 | BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_) |
| 11 | : nand_root(std::move(nand_root_)), | 12 | : nand_root(std::move(nand_root_)), load_root(std::move(load_root_)), |
| 12 | sysnand_cache(std::make_shared<RegisteredCache>( | 13 | sysnand_cache(std::make_shared<RegisteredCache>( |
| 13 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/registered"))), | 14 | GetOrCreateDirectoryRelative(nand_root, "/system/Contents/registered"))), |
| 14 | usrnand_cache(std::make_shared<RegisteredCache>( | 15 | usrnand_cache(std::make_shared<RegisteredCache>( |
| @@ -24,4 +25,11 @@ std::shared_ptr<RegisteredCache> BISFactory::GetUserNANDContents() const { | |||
| 24 | return usrnand_cache; | 25 | return usrnand_cache; |
| 25 | } | 26 | } |
| 26 | 27 | ||
| 28 | VirtualDir BISFactory::GetModificationLoadRoot(u64 title_id) const { | ||
| 29 | // LayeredFS doesn't work on updates and title id-less homebrew | ||
| 30 | if (title_id == 0 || (title_id & 0x800) > 0) | ||
| 31 | return nullptr; | ||
| 32 | return GetOrCreateDirectoryRelative(load_root, fmt::format("/{:016X}", title_id)); | ||
| 33 | } | ||
| 34 | |||
| 27 | } // namespace FileSys | 35 | } // namespace FileSys |
diff --git a/src/core/file_sys/bis_factory.h b/src/core/file_sys/bis_factory.h index 9523dd864..0d81967cc 100644 --- a/src/core/file_sys/bis_factory.h +++ b/src/core/file_sys/bis_factory.h | |||
| @@ -17,14 +17,17 @@ class RegisteredCache; | |||
| 17 | /// registered caches. | 17 | /// registered caches. |
| 18 | class BISFactory { | 18 | class BISFactory { |
| 19 | public: | 19 | public: |
| 20 | explicit BISFactory(VirtualDir nand_root); | 20 | BISFactory(VirtualDir nand_root, VirtualDir load_root); |
| 21 | ~BISFactory(); | 21 | ~BISFactory(); |
| 22 | 22 | ||
| 23 | std::shared_ptr<RegisteredCache> GetSystemNANDContents() const; | 23 | std::shared_ptr<RegisteredCache> GetSystemNANDContents() const; |
| 24 | std::shared_ptr<RegisteredCache> GetUserNANDContents() const; | 24 | std::shared_ptr<RegisteredCache> GetUserNANDContents() const; |
| 25 | 25 | ||
| 26 | VirtualDir GetModificationLoadRoot(u64 title_id) const; | ||
| 27 | |||
| 26 | private: | 28 | private: |
| 27 | VirtualDir nand_root; | 29 | VirtualDir nand_root; |
| 30 | VirtualDir load_root; | ||
| 28 | 31 | ||
| 29 | std::shared_ptr<RegisteredCache> sysnand_cache; | 32 | std::shared_ptr<RegisteredCache> sysnand_cache; |
| 30 | std::shared_ptr<RegisteredCache> usrnand_cache; | 33 | std::shared_ptr<RegisteredCache> usrnand_cache; |