summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Morph2020-07-09 12:29:12 -0400
committerGravatar Morph2020-07-10 00:37:39 -0400
commit0373ead96e45a590ded0949a801a2783ef1097bf (patch)
treeafa552c15d285f0911662d657df170c3d5d8ca90 /src
parentsettings: Remove storage size options (diff)
downloadyuzu-0373ead96e45a590ded0949a801a2783ef1097bf.tar.gz
yuzu-0373ead96e45a590ded0949a801a2783ef1097bf.tar.xz
yuzu-0373ead96e45a590ded0949a801a2783ef1097bf.zip
bis_factory: Use hardware default NAND partition sizes
Sets the total space of user and system partitions to their hardware defaults. Furthermore, return the total space as free space for the user partition to prevent it from reaching zero. Some games like Bioshock 2 check for the available free space prior to save creation, and we should not be limited by arbitrary limits.
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/bis_factory.cpp21
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
13namespace FileSys { 13namespace FileSys {
14 14
15constexpr u64 NAND_USER_SIZE = 0x680000000; // 26624 MiB
16constexpr u64 NAND_SYSTEM_SIZE = 0xA0000000; // 2560 MiB
17constexpr u64 NAND_TOTAL_SIZE = 0x747C00000; // 29820 MiB
18
15BISFactory::BISFactory(VirtualDir nand_root_, VirtualDir load_root_, VirtualDir dump_root_) 19BISFactory::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
111u64 BISFactory::GetSystemNANDFreeSpace() const { 115u64 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
119u64 BISFactory::GetSystemNANDTotalSpace() const { 124u64 BISFactory::GetSystemNANDTotalSpace() const {
120 return static_cast<u64>(Settings::values.nand_system_size); 125 return NAND_SYSTEM_SIZE;
121} 126}
122 127
123u64 BISFactory::GetUserNANDFreeSpace() const { 128u64 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
131u64 BISFactory::GetUserNANDTotalSpace() const { 132u64 BISFactory::GetUserNANDTotalSpace() const {
132 return static_cast<u64>(Settings::values.nand_user_size); 133 return NAND_USER_SIZE;
133} 134}
134 135
135u64 BISFactory::GetFullNANDTotalSpace() const { 136u64 BISFactory::GetFullNANDTotalSpace() const {
136 return static_cast<u64>(Settings::values.nand_total_size); 137 return NAND_TOTAL_SIZE;
137} 138}
138 139
139VirtualDir BISFactory::GetBCATDirectory(u64 title_id) const { 140VirtualDir BISFactory::GetBCATDirectory(u64 title_id) const {