mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 21:05:50 +12:00
properly handle save ids
This commit is contained in:
parent
ee4a85aa4a
commit
9ab49617ea
4 changed files with 71 additions and 22 deletions
|
@ -1,13 +1,21 @@
|
|||
#pragma once
|
||||
#include "archive_base.hpp"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct ExtSaveDataInfo {
|
||||
u8 media_type;
|
||||
u8 unknown;
|
||||
u16 reserved;
|
||||
u64 save_id;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
class ExtSaveDataArchive : public ArchiveBase {
|
||||
public:
|
||||
ExtSaveDataArchive(Memory& mem, const std::string& folder, bool isShared = false) : ArchiveBase(mem),
|
||||
isShared(isShared), backingFolder(folder) {}
|
||||
|
||||
ExtSaveDataArchive(Memory& mem, const std::string& folder, u64 saveId, bool isShared = false) : ArchiveBase(mem),
|
||||
archiveSaveId(saveId), isShared(isShared), backingFolder(folder) {}
|
||||
u64 getFreeBytes() override { Helpers::panic("ExtSaveData::GetFreeBytes unimplemented"); return 0; }
|
||||
std::string name() override { return "ExtSaveData::" + backingFolder; }
|
||||
std::string name() override { return "ExtSaveData::" + backingFolder + "::" + std::to_string(archiveSaveId); }
|
||||
|
||||
HorizonResult createDirectory(const FSPath& path) override;
|
||||
HorizonResult deleteDirectory(const FSPath& path) override;
|
||||
|
@ -30,7 +38,9 @@ public:
|
|||
// Takes in a binary ExtSaveData path, outputs a combination of the backing folder with the low and high save entries of the path
|
||||
// Used for identifying the archive format info files
|
||||
std::string getExtSaveDataPathFromBinary(const FSPath& path) const;
|
||||
std::string getExtSaveDataPath() const;
|
||||
|
||||
u64 archiveSaveId = 0;
|
||||
bool isShared = false;
|
||||
std::string backingFolder; // Backing folder for the archive. Can be NAND, Gamecard or SD depending on the archive path.
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue