diff options
| -rw-r--r-- | src/core/file_sys/bis_factory.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/file_sys/bis_factory.cpp b/src/core/file_sys/bis_factory.cpp index 8935a62c3..a412dbd9c 100644 --- a/src/core/file_sys/bis_factory.cpp +++ b/src/core/file_sys/bis_factory.cpp | |||
| @@ -12,6 +12,10 @@ | |||
| 12 | 12 | ||
| 13 | namespace FileSys { | 13 | namespace FileSys { |
| 14 | 14 | ||
| 15 | constexpr u64 NAND_USER_SIZE = 0x680000000; // 26624 MiB | ||
| 16 | constexpr u64 NAND_SYSTEM_SIZE = 0xA0000000; // 2560 MiB | ||
| 17 | constexpr u64 NAND_TOTAL_SIZE = 0x747C00000; // 29820 MiB | ||
| 18 | |||
| 15 | BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_, VirtualDir dump_root_) | 19 | BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_, VirtualDir dump_root_) |
| 16 | : nand_root(std::move(nand_root_)), load_root(std::move(load_root_)), | 20 | : nand_root(std::move(nand_root_)), load_root(std::move(load_root_)), |
| 17 | dump_root(std::move(dump_root_)), | 21 | dump_root(std::move(dump_root_)), |
| @@ -110,30 +114,27 @@ VirtualDir BISFactory::GetImageDirectory() const { | |||
| 110 | 114 | ||
| 111 | u64 BISFactory::GetSystemNANDFreeSpace() const { | 115 | u64 BISFactory::GetSystemNANDFreeSpace() const { |
| 112 | const auto sys_dir = GetOrCreateDirectoryRelative(nand_root, "/system"); | 116 | const auto sys_dir = GetOrCreateDirectoryRelative(nand_root, "/system"); |
| 113 | if (sys_dir == nullptr) | 117 | if (sys_dir == nullptr) { |
| 114 | return 0; | 118 | return GetSystemNANDTotalSpace(); |
| 119 | } | ||
| 115 | 120 | ||
| 116 | return GetSystemNANDTotalSpace() - sys_dir->GetSize(); | 121 | return GetSystemNANDTotalSpace() - sys_dir->GetSize(); |
| 117 | } | 122 | } |
| 118 | 123 | ||
| 119 | u64 BISFactory::GetSystemNANDTotalSpace() const { | 124 | u64 BISFactory::GetSystemNANDTotalSpace() const { |
| 120 | return static_cast<u64>(Settings::values.nand_system_size); | 125 | return NAND_SYSTEM_SIZE; |
| 121 | } | 126 | } |
| 122 | 127 | ||
| 123 | u64 BISFactory::GetUserNANDFreeSpace() const { | 128 | u64 BISFactory::GetUserNANDFreeSpace() const { |
| 124 | const auto usr_dir = GetOrCreateDirectoryRelative(nand_root, "/user"); | 129 | return GetUserNANDTotalSpace(); |
| 125 | if (usr_dir == nullptr) | ||
| 126 | return 0; | ||
| 127 | |||
| 128 | return GetUserNANDTotalSpace() - usr_dir->GetSize(); | ||
| 129 | } | 130 | } |
| 130 | 131 | ||
| 131 | u64 BISFactory::GetUserNANDTotalSpace() const { | 132 | u64 BISFactory::GetUserNANDTotalSpace() const { |
| 132 | return static_cast<u64>(Settings::values.nand_user_size); | 133 | return NAND_USER_SIZE; |
| 133 | } | 134 | } |
| 134 | 135 | ||
| 135 | u64 BISFactory::GetFullNANDTotalSpace() const { | 136 | u64 BISFactory::GetFullNANDTotalSpace() const { |
| 136 | return static_cast<u64>(Settings::values.nand_total_size); | 137 | return NAND_TOTAL_SIZE; |
| 137 | } | 138 | } |
| 138 | 139 | ||
| 139 | VirtualDir BISFactory::GetBCATDirectory(u64 title_id) const { | 140 | VirtualDir BISFactory::GetBCATDirectory(u64 title_id) const { |