From 5465eb31c1ada1dd3f495417d610e18ec9bd0293 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Sat, 29 Apr 2023 01:54:31 +0300 Subject: [PATCH] [SaveData] undo derp --- src/core/fs/archive_save_data.cpp | 32 +++---------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/src/core/fs/archive_save_data.cpp b/src/core/fs/archive_save_data.cpp index e3e6c349..1107617b 100644 --- a/src/core/fs/archive_save_data.cpp +++ b/src/core/fs/archive_save_data.cpp @@ -10,11 +10,6 @@ FSResult SaveDataArchive::createFile(const FSPath& path, u64 size) { } FSResult SaveDataArchive::createDirectory(const FSPath& path) { - if (!cartHasSaveData()) { - printf("Tried to create SaveData dir without save data\n"); - return FSResult::FileNotFound; - } - if (path.type == PathType::UTF16) { if (!isPathSafe(path)) Helpers::panic("Unsafe path in SaveData::OpenFile"); @@ -30,6 +25,8 @@ FSResult SaveDataArchive::createDirectory(const FSPath& path) { bool success = fs::create_directory(p); return success ? FSResult::Success : FSResult::UnexpectedFileOrDir; + } else { + Helpers::panic("Unimplemented SaveData::CreateDirectory"); } } @@ -39,11 +36,6 @@ FSResult SaveDataArchive::deleteFile(const FSPath& path) { } FileDescriptor SaveDataArchive::openFile(const FSPath& path, const FilePerms& perms) { - if (!cartHasSaveData()) { - printf("Tried to read SaveData FS without save data\n"); - return FileError; - } - if (path.type == PathType::UTF16) { if (!isPathSafe(path)) Helpers::panic("Unsafe path in SaveData::OpenFile"); @@ -78,11 +70,6 @@ FileDescriptor SaveDataArchive::openFile(const FSPath& path, const FilePerms& pe } Rust::Result SaveDataArchive::openDirectory(const FSPath& path) { - if (!cartHasSaveData()) { - printf("Tried to open SaveData directory without save data\n"); - return Err(FSResult::UnexpectedFileOrDir); - } - if (path.type == PathType::UTF16) { if (!isPathSafe(path)) Helpers::panic("Unsafe path in SaveData::OpenDirectory"); @@ -107,7 +94,7 @@ Rust::Result SaveDataArchive::openDirectory(const FS } ArchiveBase::FormatInfo SaveDataArchive::getFormatInfo(const FSPath& path) { - Helpers::panic("Unimplemented SaveData::GetFormatInfo"); + //Helpers::panic("Unimplemented SaveData::GetFormatInfo"); return FormatInfo{ .size = 0, .numOfDirectories = 255, .numOfFiles = 255, .duplicateData = false }; } @@ -121,19 +108,6 @@ ArchiveBase* SaveDataArchive::openArchive(const FSPath& path) { } std::optional SaveDataArchive::readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) { - if (!cartHasSaveData()) { - printf("Tried to read SaveData FS without save data\n"); - return std::nullopt; - } - - auto cxi = mem.getCXI(); - const u64 saveSize = cxi->saveData.size(); - - if (offset >= saveSize) { - printf("Tried to read from past the end of save data\n"); - return std::nullopt; - } - Helpers::panic("Unimplemented SaveData::ReadFile"); return 0; } \ No newline at end of file