summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-12-09 20:05:16 +0100
committerLiam <byteslice@airmail.cc>2023-12-09 20:05:16 +0100
commitd597383ab2558f27e91953035350c2ed05dcbd50 (patch)
treeca4e398736f7b0f9bc43d4f59c583f1b7f2c60db /src/core
parentMerge pull request #12289 from german77/aruid (diff)
downloadyuzu-d597383ab2558f27e91953035350c2ed05dcbd50.tar
yuzu-d597383ab2558f27e91953035350c2ed05dcbd50.tar.gz
yuzu-d597383ab2558f27e91953035350c2ed05dcbd50.tar.bz2
yuzu-d597383ab2558f27e91953035350c2ed05dcbd50.tar.lz
yuzu-d597383ab2558f27e91953035350c2ed05dcbd50.tar.xz
yuzu-d597383ab2558f27e91953035350c2ed05dcbd50.tar.zst
yuzu-d597383ab2558f27e91953035350c2ed05dcbd50.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/savedata_factory.cpp6
-rw-r--r--src/core/file_sys/savedata_factory.h4
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp8
3 files changed, 13 insertions, 5 deletions
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp
index a4d060007..8d5d593e8 100644
--- a/src/core/file_sys/savedata_factory.cpp
+++ b/src/core/file_sys/savedata_factory.cpp
@@ -12,8 +12,6 @@
namespace FileSys {
-constexpr char SAVE_DATA_SIZE_FILENAME[] = ".yuzu_save_size";
-
namespace {
void PrintSaveDataAttributeWarnings(SaveDataAttribute meta) {
@@ -197,7 +195,7 @@ SaveDataSize SaveDataFactory::ReadSaveDataSize(SaveDataType type, u64 title_id,
GetFullPath(system, dir, SaveDataSpaceId::NandUser, type, title_id, user_id, 0);
const auto relative_dir = GetOrCreateDirectoryRelative(dir, path);
- const auto size_file = relative_dir->GetFile(SAVE_DATA_SIZE_FILENAME);
+ const auto size_file = relative_dir->GetFile(GetSaveDataSizeFileName());
if (size_file == nullptr || size_file->GetSize() < sizeof(SaveDataSize)) {
return {0, 0};
}
@@ -216,7 +214,7 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us
GetFullPath(system, dir, SaveDataSpaceId::NandUser, type, title_id, user_id, 0);
const auto relative_dir = GetOrCreateDirectoryRelative(dir, path);
- const auto size_file = relative_dir->CreateFile(SAVE_DATA_SIZE_FILENAME);
+ const auto size_file = relative_dir->CreateFile(GetSaveDataSizeFileName());
if (size_file == nullptr) {
return;
}
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h
index 45c7c81fb..e3a0f8cef 100644
--- a/src/core/file_sys/savedata_factory.h
+++ b/src/core/file_sys/savedata_factory.h
@@ -83,6 +83,10 @@ struct SaveDataSize {
u64 journal;
};
+constexpr const char* GetSaveDataSizeFileName() {
+ return ".yuzu_save_size";
+}
+
/// File system interface to the SaveData archive
class SaveDataFactory {
public:
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 126cd6ffd..b1310d6e4 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -246,7 +246,13 @@ static void BuildEntryIndex(std::vector<FileSys::Entry>& entries, const std::vec
entries.reserve(entries.size() + new_data.size());
for (const auto& new_entry : new_data) {
- entries.emplace_back(new_entry->GetName(), type,
+ auto name = new_entry->GetName();
+
+ if (type == FileSys::EntryType::File && name == FileSys::GetSaveDataSizeFileName()) {
+ continue;
+ }
+
+ entries.emplace_back(name, type,
type == FileSys::EntryType::Directory ? 0 : new_entry->GetSize());
}
}