[NCCH] Add support for reading Miis out of NAND

This commit is contained in:
wheremyfoodat 2023-01-28 22:25:20 +02:00
parent 4e64f722e5
commit a1cb50925f
8 changed files with 6307 additions and 15 deletions

View file

@ -90,10 +90,11 @@ struct FileSession {
ArchiveBase* archive = nullptr;
FILE* fd = nullptr; // File descriptor for file sessions that require them.
FSPath path;
FSPath archivePath;
bool isOpen;
FileSession(ArchiveBase* archive, const FSPath& filePath, FILE* fd, bool isOpen = true) :
archive(archive), path(filePath), fd(fd), isOpen(isOpen) {}
FileSession(ArchiveBase* archive, const FSPath& filePath, const FSPath& archivePath, FILE* fd, bool isOpen = true) :
archive(archive), path(filePath), archivePath(archivePath), fd(fd), isOpen(isOpen) {}
};
struct ArchiveSession {

View file

@ -12,4 +12,16 @@ public:
CreateFileResult createFile(const FSPath& path, u64 size) override;
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
// Returns whether the cart has a RomFS
bool hasRomFS() {
auto cxi = mem.getCXI();
return (cxi != nullptr && cxi->hasRomFS());
}
// Returns whether the cart has an ExeFS (All executable carts should have an ExeFS. This is just here to be safe)
bool hasExeFS() {
auto cxi = mem.getCXI();
return (cxi != nullptr && cxi->hasExeFS());
}
};

6140
include/fs/mii_data.hpp Normal file

File diff suppressed because it is too large Load diff