diff --git a/Source/Core/Core/IOS/FS/FileSystem.h b/Source/Core/Core/IOS/FS/FileSystem.h index 581df6fbee..f02d2eb350 100644 --- a/Source/Core/Core/IOS/FS/FileSystem.h +++ b/Source/Core/Core/IOS/FS/FileSystem.h @@ -107,6 +107,33 @@ struct Metadata u16 fst_index; }; +// size of a single cluster in the NAND in bytes +constexpr u16 CLUSTER_SIZE = 16384; + +// total number of clusters available in the NAND +constexpr u16 TOTAL_CLUSTERS = 0x7ec0; + +// number of clusters reserved for bad blocks and similar, not accessible to normal writes +constexpr u16 RESERVED_CLUSTERS = 0x0300; + +// number of clusters actually usable by the file system +constexpr u16 USABLE_CLUSTERS = TOTAL_CLUSTERS - RESERVED_CLUSTERS; + +// size of a single 'block' as defined by the Wii System Menu in clusters +constexpr u16 CLUSTERS_PER_BLOCK = 8; + +// total number of user-accessible blocks in the NAND +constexpr u16 USER_BLOCKS = 2176; + +// total number of user-accessible clusters in the NAND +constexpr u16 USER_CLUSTERS = USER_BLOCKS * CLUSTERS_PER_BLOCK; + +// the inverse of that, the amount of usable clusters reserved for system files +constexpr u16 SYSTEM_CLUSTERS = USABLE_CLUSTERS - USER_CLUSTERS; + +// total number of inodes available in the NAND +constexpr u16 TOTAL_INODES = 0x17ff; + struct NandStats { u32 cluster_size; diff --git a/Source/Core/Core/IOS/FS/HostBackend/FS.cpp b/Source/Core/Core/IOS/FS/HostBackend/FS.cpp index f09cadb7c8..8c832b2934 100644 --- a/Source/Core/Core/IOS/FS/HostBackend/FS.cpp +++ b/Source/Core/Core/IOS/FS/HostBackend/FS.cpp @@ -29,21 +29,6 @@ namespace IOS::HLE::FS { constexpr u32 BUFFER_CHUNK_SIZE = 65536; -// size of a single cluster in the NAND -constexpr u16 CLUSTER_SIZE = 16384; - -// total number of clusters available in the NAND -constexpr u16 TOTAL_CLUSTERS = 0x7ec0; - -// number of clusters reserved for bad blocks and similar, not accessible to normal writes -constexpr u16 RESERVED_CLUSTERS = 0x0300; - -// number of clusters actually usable by the file system -constexpr u16 USABLE_CLUSTERS = TOTAL_CLUSTERS - RESERVED_CLUSTERS; - -// total number of inodes available in the NAND -constexpr u16 TOTAL_INODES = 0x17ff; - HostFileSystem::HostFilename HostFileSystem::BuildFilename(const std::string& wii_path) const { for (const auto& redirect : m_nand_redirects)