mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
IOS/FS: Move NAND size related constants to FileSystem.h.
That way they're available for calculating NAND stats to display to the user. This also adds a few more constants.
This commit is contained in:
parent
7f40c6f2f8
commit
0d9e027a0b
@ -107,6 +107,33 @@ struct Metadata
|
|||||||
u16 fst_index;
|
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
|
struct NandStats
|
||||||
{
|
{
|
||||||
u32 cluster_size;
|
u32 cluster_size;
|
||||||
|
@ -29,21 +29,6 @@ namespace IOS::HLE::FS
|
|||||||
{
|
{
|
||||||
constexpr u32 BUFFER_CHUNK_SIZE = 65536;
|
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
|
HostFileSystem::HostFilename HostFileSystem::BuildFilename(const std::string& wii_path) const
|
||||||
{
|
{
|
||||||
for (const auto& redirect : m_nand_redirects)
|
for (const auto& redirect : m_nand_redirects)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user