2018-08-10 02:49:45 +02:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
2018-09-04 03:58:19 +02:00
|
|
|
|
|
|
|
#include "core/file_sys/vfs.h"
|
2018-08-10 02:49:45 +02:00
|
|
|
|
|
|
|
namespace FileSys {
|
|
|
|
|
2019-04-10 18:07:29 +02:00
|
|
|
enum class BisPartitionId : u32 {
|
|
|
|
UserDataRoot = 20,
|
|
|
|
CalibrationBinary = 27,
|
|
|
|
CalibrationFile = 28,
|
|
|
|
BootConfigAndPackage2Part1 = 21,
|
|
|
|
BootConfigAndPackage2Part2 = 22,
|
|
|
|
BootConfigAndPackage2Part3 = 23,
|
|
|
|
BootConfigAndPackage2Part4 = 24,
|
|
|
|
BootConfigAndPackage2Part5 = 25,
|
|
|
|
BootConfigAndPackage2Part6 = 26,
|
|
|
|
SafeMode = 29,
|
|
|
|
System = 31,
|
|
|
|
SystemProperEncryption = 32,
|
|
|
|
SystemProperPartition = 33,
|
|
|
|
User = 30,
|
|
|
|
};
|
|
|
|
|
2018-09-04 03:58:19 +02:00
|
|
|
class RegisteredCache;
|
|
|
|
|
2018-08-10 02:49:45 +02:00
|
|
|
/// File system interface to the Built-In Storage
|
|
|
|
/// This is currently missing accessors to BIS partitions, but seemed like a good place for the NAND
|
|
|
|
/// registered caches.
|
|
|
|
class BISFactory {
|
|
|
|
public:
|
2018-10-29 21:08:03 +01:00
|
|
|
explicit BISFactory(VirtualDir nand_root, VirtualDir load_root, VirtualDir dump_root);
|
2018-09-04 03:58:19 +02:00
|
|
|
~BISFactory();
|
2018-08-10 02:49:45 +02:00
|
|
|
|
2019-04-10 18:08:39 +02:00
|
|
|
VirtualDir GetSystemNANDContentDirectory() const;
|
|
|
|
VirtualDir GetUserNANDContentDirectory() const;
|
|
|
|
|
2018-10-16 15:05:47 +02:00
|
|
|
RegisteredCache* GetSystemNANDContents() const;
|
|
|
|
RegisteredCache* GetUserNANDContents() const;
|
2018-08-10 02:49:45 +02:00
|
|
|
|
2018-09-20 04:03:36 +02:00
|
|
|
VirtualDir GetModificationLoadRoot(u64 title_id) const;
|
2018-10-29 21:08:03 +01:00
|
|
|
VirtualDir GetModificationDumpRoot(u64 title_id) const;
|
2018-09-20 04:03:36 +02:00
|
|
|
|
2019-04-10 18:07:29 +02:00
|
|
|
VirtualDir OpenPartition(BisPartitionId id) const;
|
|
|
|
VirtualFile OpenPartitionStorage(BisPartitionId id) const;
|
|
|
|
|
2018-08-10 02:49:45 +02:00
|
|
|
private:
|
|
|
|
VirtualDir nand_root;
|
2018-09-20 04:03:36 +02:00
|
|
|
VirtualDir load_root;
|
2018-10-29 21:08:03 +01:00
|
|
|
VirtualDir dump_root;
|
2018-08-10 02:49:45 +02:00
|
|
|
|
2018-10-16 15:05:47 +02:00
|
|
|
std::unique_ptr<RegisteredCache> sysnand_cache;
|
|
|
|
std::unique_ptr<RegisteredCache> usrnand_cache;
|
2018-08-10 02:49:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace FileSys
|