bis_factory.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include "core/file_sys/vfs.h"
  7. namespace FileSys {
  8. enum class BisPartitionId : u32 {
  9. UserDataRoot = 20,
  10. CalibrationBinary = 27,
  11. CalibrationFile = 28,
  12. BootConfigAndPackage2Part1 = 21,
  13. BootConfigAndPackage2Part2 = 22,
  14. BootConfigAndPackage2Part3 = 23,
  15. BootConfigAndPackage2Part4 = 24,
  16. BootConfigAndPackage2Part5 = 25,
  17. BootConfigAndPackage2Part6 = 26,
  18. SafeMode = 29,
  19. System = 31,
  20. SystemProperEncryption = 32,
  21. SystemProperPartition = 33,
  22. User = 30,
  23. };
  24. class RegisteredCache;
  25. /// File system interface to the Built-In Storage
  26. /// This is currently missing accessors to BIS partitions, but seemed like a good place for the NAND
  27. /// registered caches.
  28. class BISFactory {
  29. public:
  30. explicit BISFactory(VirtualDir nand_root, VirtualDir load_root, VirtualDir dump_root);
  31. ~BISFactory();
  32. VirtualDir GetSystemNANDContentDirectory() const;
  33. VirtualDir GetUserNANDContentDirectory() const;
  34. RegisteredCache* GetSystemNANDContents() const;
  35. RegisteredCache* GetUserNANDContents() const;
  36. VirtualDir GetModificationLoadRoot(u64 title_id) const;
  37. VirtualDir GetModificationDumpRoot(u64 title_id) const;
  38. VirtualDir OpenPartition(BisPartitionId id) const;
  39. VirtualFile OpenPartitionStorage(BisPartitionId id) const;
  40. VirtualDir GetImageDirectory() const;
  41. private:
  42. VirtualDir nand_root;
  43. VirtualDir load_root;
  44. VirtualDir dump_root;
  45. std::unique_ptr<RegisteredCache> sysnand_cache;
  46. std::unique_ptr<RegisteredCache> usrnand_cache;
  47. };
  48. } // namespace FileSys