diff --git a/src/core/fs/archive_ext_save_data.cpp b/src/core/fs/archive_ext_save_data.cpp index be5dba50..ea7adf61 100644 --- a/src/core/fs/archive_ext_save_data.cpp +++ b/src/core/fs/archive_ext_save_data.cpp @@ -2,13 +2,25 @@ #include bool ExtSaveDataArchive::openFile(const FSPath& path) { + if (path.type != PathType::Binary) { + Helpers::panic("ExtSaveData accessed with a non-binary path in OpenFile. Type: %d", path.type); + } + Helpers::panic("ExtSaveDataArchive::OpenFile: Failed"); return false; } ArchiveBase* ExtSaveDataArchive::openArchive(const FSPath& path) { - Helpers::panic("ExtSaveDataArchive::OpenArchive: Failed. Path type: %d", path.type); - return nullptr; + if (path.type != PathType::Binary || path.size != 12) { + Helpers::panic("ExtSaveData accessed with an invalid path in OpenArchive"); + } + + u32 mediaType = mem.read32(path.pointer); + u64 saveID = mem.read64(path.pointer + 4); + + Helpers::panic("ExtSaveData: media type = %d\n", mediaType); + + return this; } std::optional ExtSaveDataArchive::readFile(FileSession* file, u64 offset, u32 size, u32 dataPointer) {