[Kernel] ExitThread [FS] Start implement archive 0x2345678A

This commit is contained in:
wheremyfoodat 2023-01-26 17:49:17 +02:00
parent 7c2dd34eba
commit 4e64f722e5
11 changed files with 215 additions and 131 deletions

View file

@ -1,27 +1,15 @@
#pragma once
#include "archive_base.hpp"
class SelfNCCHArchive : public ArchiveBase {
class NCCHArchive : public ArchiveBase {
public:
SelfNCCHArchive(Memory& mem) : ArchiveBase(mem) {}
NCCHArchive(Memory& mem) : ArchiveBase(mem) {}
u64 getFreeBytes() override { return 0; }
std::string name() override { return "SelfNCCH"; }
u64 getFreeBytes() override { Helpers::panic("NCCH::GetFreeBytes unimplemented"); return 0; }
std::string name() override { return "NCCH"; }
ArchiveBase* openArchive(const FSPath& path) override;
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());
}
};