diff options
author | Zach Hilman <zachhilman@gmail.com> | 2019-04-16 20:28:20 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-09-21 22:43:10 +0200 |
commit | 721a92775d2da30843fc5e1d9887e55dafa0bc3a (patch) | |
tree | 04913f7daeef3307d7f9dfb3fff26832017fb56b /src/core | |
parent | bis_factory: Add getters for NAND partition sizes (diff) | |
download | yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.tar yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.tar.gz yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.tar.bz2 yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.tar.lz yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.tar.xz yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.tar.zst yuzu-721a92775d2da30843fc5e1d9887e55dafa0bc3a.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/file_sys/sdmc_factory.cpp | 9 | ||||
-rw-r--r-- | src/core/file_sys/sdmc_factory.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp index a5f1dcc5c..743e2e63a 100644 --- a/src/core/file_sys/sdmc_factory.cpp +++ b/src/core/file_sys/sdmc_factory.cpp @@ -6,6 +6,7 @@ #include "core/file_sys/registered_cache.h" #include "core/file_sys/sdmc_factory.h" #include "core/file_sys/xts_archive.h" +#include "core/settings.h" namespace FileSys { @@ -40,4 +41,12 @@ VirtualDir SDMCFactory::GetImageDirectory() const { return GetOrCreateDirectoryRelative(dir, "/Nintendo/Album"); } +u64 SDMCFactory::GetSDMCFreeSpace() const { + return GetSDMCTotalSpace() - dir->GetSize(); +} + +u64 SDMCFactory::GetSDMCTotalSpace() const { + return static_cast<u64>(Settings::values.sdmc_size); +} + } // namespace FileSys diff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.h index abe6cc41c..164fd9435 100644 --- a/src/core/file_sys/sdmc_factory.h +++ b/src/core/file_sys/sdmc_factory.h @@ -28,6 +28,9 @@ public: VirtualDir GetImageDirectory() const; + u64 GetSDMCFreeSpace() const; + u64 GetSDMCTotalSpace() const; + private: VirtualDir dir; |