mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 14:15:41 +12:00
return NotFormatted on non-shared NAND archive (??)
This commit is contained in:
parent
0cd81c9ed6
commit
fe9167ee66
3 changed files with 6 additions and 5 deletions
|
@ -13,8 +13,8 @@ struct ExtSaveDataInfo {
|
|||
|
||||
class ExtSaveDataArchive : public ArchiveBase {
|
||||
public:
|
||||
ExtSaveDataArchive(Memory& mem, const std::string& folder, u64 saveId, bool isShared = false) : ArchiveBase(mem),
|
||||
archiveSaveId(saveId), isShared(isShared), backingFolder(folder) {}
|
||||
ExtSaveDataArchive(Memory& mem, const std::string& folder, u64 saveId, bool isShared = false, bool isNAND = false) : ArchiveBase(mem),
|
||||
archiveSaveId(saveId), isShared(isShared), isNAND(isNAND), backingFolder(folder) {}
|
||||
u64 getFreeBytes() override { Helpers::panic("ExtSaveData::GetFreeBytes unimplemented"); return 0; }
|
||||
std::string name() override { return "ExtSaveData::" + backingFolder + "::" + std::to_string(archiveSaveId); }
|
||||
|
||||
|
@ -43,5 +43,6 @@ public:
|
|||
|
||||
u64 archiveSaveId = 0;
|
||||
bool isShared = false;
|
||||
bool isNAND = false;
|
||||
std::string backingFolder; // Backing folder for the archive. Can be NAND, Gamecard or SD depending on the archive path.
|
||||
};
|
||||
|
|
|
@ -296,7 +296,7 @@ Rust::Result<ArchiveBase*, HorizonResult> ExtSaveDataArchive::openArchive(const
|
|||
const fs::path formatInfoPath = getFormatInfoPath(path);
|
||||
// Format info not found so the archive is not formatted
|
||||
if (!fs::is_regular_file(formatInfoPath)) {
|
||||
return Err(Result::FS::NotFoundInvalid);
|
||||
return isNAND ? Err(Result::FS::NotFormatted) : Err(Result::FS::NotFoundInvalid);
|
||||
}
|
||||
|
||||
return Ok((ArchiveBase*)this);
|
||||
|
|
|
@ -96,14 +96,14 @@ void FSService::initializeFilesystem() {
|
|||
|
||||
ExtSaveDataArchive* FSService::getExtArchiveFromID(u64 saveId, bool isShared) {
|
||||
if (const auto entry = extSaveData_sdmc.find(saveId); entry == extSaveData_sdmc.end()) {
|
||||
extSaveData_sdmc.emplace(saveId, ExtSaveDataArchive(mem, isShared ? "../SharedFiles/SDMC" : "SDMC", saveId, isShared));
|
||||
extSaveData_sdmc.emplace(saveId, ExtSaveDataArchive(mem, isShared ? "../SharedFiles/SDMC" : "SDMC", saveId, isShared, false));
|
||||
}
|
||||
return &extSaveData_sdmc.at(saveId);
|
||||
}
|
||||
|
||||
ExtSaveDataArchive* FSService::getNANDExtArchiveFromID(u64 saveId, bool isShared) {
|
||||
if (const auto entry = nandExtSaveData_nand.find(saveId); entry == nandExtSaveData_nand.end()) {
|
||||
nandExtSaveData_nand.emplace(saveId, ExtSaveDataArchive(mem, isShared ? "../SharedFiles/NAND" : "NAND", saveId, isShared));
|
||||
nandExtSaveData_nand.emplace(saveId, ExtSaveDataArchive(mem, isShared ? "../SharedFiles/NAND" : "NAND", saveId, isShared, true));
|
||||
}
|
||||
return &nandExtSaveData_nand.at(saveId);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue