summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DirectoryBlob.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2025-05-01 21:30:10 -0400
committerGitHub <noreply@github.com>2025-05-01 21:30:10 -0400
commit757e6aba46a2d4bdbcbc223903a11a0d90e37496 (patch)
treee6ca6254ef960b2b7b48f87f68d96c6798ac5165 /Source/Core/DiscIO/DirectoryBlob.cpp
parent42f656bf0f5fb44b721b17ac32c4d6559e36f3b4 (diff)
parent552b6da9c436b807ab44c621de9d2635f786a453 (diff)
Merge pull request #13597 from JosJuice/hide-boot-bin
Hide DirectoryBlob boot.bin files from game list
Diffstat (limited to 'Source/Core/DiscIO/DirectoryBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DirectoryBlob.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp
index 035e688670..dfed684760 100644
--- a/Source/Core/DiscIO/DirectoryBlob.cpp
+++ b/Source/Core/DiscIO/DirectoryBlob.cpp
@@ -264,7 +264,7 @@ static bool IsValidDirectoryBlob(const std::string& dol_path, std::string* parti
if (!PathEndsWith(dol_path, "/sys/main.dol"))
return false;
- const size_t chars_to_remove = std::string("sys/main.dol").size();
+ static constexpr size_t chars_to_remove = std::string_view("sys/main.dol").size();
*partition_root = dol_path.substr(0, dol_path.size() - chars_to_remove);
if (File::GetSize(*partition_root + "sys/boot.bin") < 0x20)
@@ -339,9 +339,21 @@ static bool IsMainDolForNonGamePartition(const std::string& path)
return false; // volume_path is the game partition's /sys/main.dol
}
+static bool IsBootBin(const std::string& path)
+{
+ if (!PathEndsWith(path, "/sys/boot.bin"))
+ return false;
+
+ static constexpr size_t chars_to_remove = std::string_view("sys/boot.bin").size();
+ const std::string partition_root = path.substr(0, path.size() - chars_to_remove);
+
+ return File::Exists(partition_root + "sys/main.dol");
+}
+
bool ShouldHideFromGameList(const std::string& volume_path)
{
- return IsInFilesDirectory(volume_path) || IsMainDolForNonGamePartition(volume_path);
+ return IsInFilesDirectory(volume_path) || IsMainDolForNonGamePartition(volume_path) ||
+ IsBootBin(volume_path);
}
std::unique_ptr<DirectoryBlobReader> DirectoryBlobReader::Create(const std::string& dol_path)