mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
[FS] Add non-shared ExtSaveData, stub SaveData::GetFormatInfo
This commit is contained in:
parent
0d6082e241
commit
9b9f011f5b
5 changed files with 12 additions and 3 deletions
|
@ -10,6 +10,7 @@ public:
|
|||
|
||||
CreateFileResult createFile(const FSPath& path, u64 size) override;
|
||||
DeleteFileResult deleteFile(const FSPath& path) override;
|
||||
FormatInfo getFormatInfo(const FSPath& path) override;
|
||||
|
||||
ArchiveBase* openArchive(const FSPath& path) override;
|
||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||
|
|
|
@ -22,6 +22,7 @@ class FSService {
|
|||
// The different filesystem archives (Save data, SelfNCCH, SDMC, NCCH, ExtData, etc)
|
||||
SelfNCCHArchive selfNcch;
|
||||
SaveDataArchive saveData;
|
||||
ExtSaveDataArchive extSaveData;
|
||||
ExtSaveDataArchive sharedExtSaveData;
|
||||
SDMCArchive sdmc;
|
||||
NCCHArchive ncch;
|
||||
|
@ -49,8 +50,8 @@ class FSService {
|
|||
u32 priority;
|
||||
|
||||
public:
|
||||
FSService(Memory& mem, Kernel& kernel) : mem(mem), saveData(mem), sharedExtSaveData(mem), sdmc(mem), selfNcch(mem), ncch(mem),
|
||||
kernel(kernel)
|
||||
FSService(Memory& mem, Kernel& kernel) : mem(mem), saveData(mem), extSaveData(mem), sharedExtSaveData(mem), sdmc(mem),
|
||||
selfNcch(mem), ncch(mem), kernel(kernel)
|
||||
{
|
||||
sharedExtSaveData.isShared = true; // Need to do this here because templates and virtual classes do not mix well
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ ArchiveBase* ExtSaveDataArchive::openArchive(const FSPath& path) {
|
|||
Helpers::panic("ExtSaveData accessed with an invalid path in OpenArchive");
|
||||
}
|
||||
|
||||
if (path.binary[0] != 0) Helpers::panic("ExtSaveData: Tried to access something other than NAND");
|
||||
if (path.binary[0] != 0) Helpers::panic("ExtSaveData: Tried to access something other than NAND. ID: %02X", path.binary[0]);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -53,6 +53,12 @@ FileDescriptor SaveDataArchive::openFile(const FSPath& path, const FilePerms& pe
|
|||
return FileError;
|
||||
}
|
||||
|
||||
|
||||
ArchiveBase::FormatInfo SaveDataArchive::getFormatInfo(const FSPath& path) {
|
||||
Helpers::panic("Unimplemented SaveData::GetFormatInfo");
|
||||
return FormatInfo{ .size = 0, .numOfDirectories = 255, .numOfFiles = 255, .duplicateData = false };
|
||||
}
|
||||
|
||||
ArchiveBase* SaveDataArchive::openArchive(const FSPath& path) {
|
||||
if (path.type != PathType::Empty) {
|
||||
Helpers::panic("Unimplemented path type for SaveData archive: %d\n", path.type);
|
||||
|
|
|
@ -56,6 +56,7 @@ ArchiveBase* FSService::getArchiveFromID(u32 id) {
|
|||
switch (id) {
|
||||
case ArchiveID::SelfNCCH: return &selfNcch;
|
||||
case ArchiveID::SaveData: return &saveData;
|
||||
case ArchiveID::ExtSaveData: return &extSaveData;
|
||||
case ArchiveID::SharedExtSaveData: return &sharedExtSaveData;
|
||||
case ArchiveID::SDMC: return &sdmc;
|
||||
case ArchiveID::SavedataAndNcch: return &ncch; // This can only access NCCH outside of FSPXI
|
||||
|
|
Loading…
Add table
Reference in a new issue