mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
[NCCH] Add support for reading Miis out of NAND
This commit is contained in:
parent
4e64f722e5
commit
a1cb50925f
8 changed files with 6307 additions and 15 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
6140
include/fs/mii_data.hpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,7 +28,7 @@ class FSService {
|
|||
|
||||
ArchiveBase* getArchiveFromID(u32 id);
|
||||
std::optional<Handle> openArchiveHandle(u32 archiveID, const FSPath& path);
|
||||
std::optional<Handle> openFileHandle(ArchiveBase* archive, const FSPath& path, const FilePerms& perms);
|
||||
std::optional<Handle> openFileHandle(ArchiveBase* archive, const FSPath& path, const FSPath& archivePath, const FilePerms& perms);
|
||||
FSPath readPath(u32 type, u32 pointer, u32 size);
|
||||
|
||||
// Service commands
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue