mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-13 07:58:36 +02:00
Boot: Consider DOL/ELF files as possible volumes
The old approach to detecting DOL/ELF files doesn't fit with the new way of implementing extracted discs. The game list is already doing it in a way that's similar to the approach that this commit uses.
This commit is contained in:
parent
2098ee1b15
commit
878869488d
@ -63,12 +63,19 @@ std::unique_ptr<BootParameters> BootParameters::GenerateFromFile(const std::stri
|
|||||||
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
|
std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower);
|
||||||
|
|
||||||
static const std::unordered_set<std::string> disc_image_extensions = {
|
static const std::unordered_set<std::string> disc_image_extensions = {
|
||||||
{".gcm", ".iso", ".tgc", ".wbfs", ".ciso", ".gcz"}};
|
{".gcm", ".iso", ".tgc", ".wbfs", ".ciso", ".gcz", ".dol", ".elf"}};
|
||||||
if (disc_image_extensions.find(extension) != disc_image_extensions.end() || is_drive)
|
if (disc_image_extensions.find(extension) != disc_image_extensions.end() || is_drive)
|
||||||
{
|
{
|
||||||
auto volume = DiscIO::CreateVolumeFromFilename(path);
|
std::unique_ptr<DiscIO::Volume> volume = DiscIO::CreateVolumeFromFilename(path);
|
||||||
if (!volume)
|
if (volume)
|
||||||
{
|
return std::make_unique<BootParameters>(Disc{path, std::move(volume)});
|
||||||
|
|
||||||
|
if (extension == ".elf")
|
||||||
|
return std::make_unique<BootParameters>(Executable{path, std::make_unique<ElfReader>(path)});
|
||||||
|
|
||||||
|
if (extension == ".dol")
|
||||||
|
return std::make_unique<BootParameters>(Executable{path, std::make_unique<DolReader>(path)});
|
||||||
|
|
||||||
if (is_drive)
|
if (is_drive)
|
||||||
{
|
{
|
||||||
PanicAlertT("Could not read \"%s\". "
|
PanicAlertT("Could not read \"%s\". "
|
||||||
@ -83,14 +90,6 @@ std::unique_ptr<BootParameters> BootParameters::GenerateFromFile(const std::stri
|
|||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return std::make_unique<BootParameters>(Disc{path, std::move(volume)});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extension == ".elf")
|
|
||||||
return std::make_unique<BootParameters>(Executable{path, std::make_unique<ElfReader>(path)});
|
|
||||||
|
|
||||||
if (extension == ".dol")
|
|
||||||
return std::make_unique<BootParameters>(Executable{path, std::make_unique<DolReader>(path)});
|
|
||||||
|
|
||||||
if (extension == ".dff")
|
if (extension == ".dff")
|
||||||
return std::make_unique<BootParameters>(DFF{path});
|
return std::make_unique<BootParameters>(DFF{path});
|
||||||
|
Loading…
Reference in New Issue
Block a user