mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
Fail and warn if an amiibo is loaded at the wrong time
This commit is contained in:
parent
72ae5d2bfa
commit
cf54fd6d1d
2 changed files with 12 additions and 0 deletions
|
@ -18,6 +18,11 @@ public:
|
||||||
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
FileDescriptor openFile(const FSPath& path, const FilePerms& perms) override;
|
||||||
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
std::optional<u32> readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) override;
|
||||||
|
|
||||||
|
Rust::Result<FormatInfo, HorizonResult> getFormatInfo(const FSPath& path) override {
|
||||||
|
Helpers::warn("Stubbed ExtSaveData::GetFormatInfo");
|
||||||
|
return Ok(FormatInfo{.size = 1_GB, .numOfDirectories = 255, .numOfFiles = 255, .duplicateData = false});
|
||||||
|
}
|
||||||
|
|
||||||
// Takes in a binary ExtSaveData path, outputs a combination of the backing folder with the low and high save entries of the path
|
// 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
|
// Used for identifying the archive format info files
|
||||||
std::string getExtSaveDataPathFromBinary(const FSPath& path);
|
std::string getExtSaveDataPathFromBinary(const FSPath& path);
|
||||||
|
|
|
@ -48,6 +48,13 @@ void NFCService::handleSyncRequest(u32 messagePointer) {
|
||||||
bool NFCService::loadAmiibo(const std::filesystem::path& path) {
|
bool NFCService::loadAmiibo(const std::filesystem::path& path) {
|
||||||
IOFile file(path, "rb");
|
IOFile file(path, "rb");
|
||||||
|
|
||||||
|
if (!initialized || tagStatus != TagStatus::Scanning) {
|
||||||
|
Helpers::warn("It's not the correct time to load an amiibo! Make sure to load amiibi when the game is searching for one!");
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!file.isOpen()) {
|
if (!file.isOpen()) {
|
||||||
printf("Failed to open Amiibo file");
|
printf("Failed to open Amiibo file");
|
||||||
file.close();
|
file.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue