mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 21:08:04 +03:00
Hide DirectoryBlob boot.bin files from game list
Extracted games contain a boot.bin file that contains the disc header.
These boot.bin files are considered valid volumes by Dolphin, since
Dolphin only checks the disc header to determine if something is a valid
GC/Wii disc. Running them doesn't make any sense, though.
boot.bin files used to not be scanned by Dolphin due to their file
extension, but .bin was added to the list of file extensions to scan for
in 494e2c0
. To stop them from showing up in the game list, let's update
the ShouldHideFromGameList mechanism.
This commit is contained in:
parent
805307f432
commit
552b6da9c4
1 changed files with 14 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue