Implement reading from RomFS

This commit is contained in:
wheremyfoodat 2022-10-09 18:28:45 +03:00
parent 272cdefca1
commit df4cd0642d
10 changed files with 157 additions and 33 deletions

View file

@ -4,25 +4,11 @@ class SelfNCCHArchive : public ArchiveBase {
public:
SelfNCCHArchive(Memory& mem) : ArchiveBase(mem) {}
u64 getFreeBytes() override { return 0; }
const char* name() override { return "SelfNCCH"; }
bool openFile(const FSPath& path) override {
if (path.type != PathType::Binary) {
printf("Invalid SelfNCCH path type");
return false;
}
return true;
}
ArchiveBase* openArchive(FSPath& path) override {
if (path.type != PathType::Empty) {
printf("Invalid path type for SelfNCCH archive: %d\n", path.type);
return nullptr;
}
return this;
}
bool openFile(const FSPath& path) override;
ArchiveBase* openArchive(FSPath& path) override;
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
};