naomi: drop support for gdi. default to first bios region found
Use the first BIOS region found if the requested one can't be located.
This commit is contained in:
parent
b840a4f477
commit
9bdaa6c40b
|
|
@ -502,26 +502,17 @@ void GDCartridge::device_start(LoadProgress *progress, std::vector<u8> *digest)
|
|||
catch (const FlycastException& e)
|
||||
{
|
||||
WARN_LOG(NAOMI, "Opening chd failed: %s", e.what());
|
||||
try {
|
||||
gdrom = std::unique_ptr<Disc>(OpenDisc(gdrom_path + ".gdi", digest));
|
||||
}
|
||||
catch (const FlycastException& e)
|
||||
if (gdrom_parent_name != nullptr)
|
||||
{
|
||||
if (gdrom_parent_name != nullptr)
|
||||
{
|
||||
std::string gdrom_parent_path = hostfs::storage().getSubPath(parent, std::string(gdrom_parent_name) + "/" + gdrom_name);
|
||||
try {
|
||||
gdrom = std::unique_ptr<Disc>(OpenDisc(gdrom_parent_path + ".chd", digest));
|
||||
} catch (const FlycastException& e) {
|
||||
WARN_LOG(NAOMI, "Opening parent chd failed: %s", e.what());
|
||||
try {
|
||||
gdrom = std::unique_ptr<Disc>(OpenDisc(gdrom_parent_path + ".gdi", digest));
|
||||
} catch (const FlycastException& e) {}
|
||||
}
|
||||
std::string gdrom_parent_path = hostfs::storage().getSubPath(parent, std::string(gdrom_parent_name) + "/" + gdrom_name);
|
||||
try {
|
||||
gdrom = std::unique_ptr<Disc>(OpenDisc(gdrom_parent_path + ".chd", digest));
|
||||
} catch (const FlycastException& e) {
|
||||
WARN_LOG(NAOMI, "Opening parent chd failed: %s", e.what());
|
||||
}
|
||||
if (gdrom == nullptr)
|
||||
throw NaomiCartException("Naomi GDROM: Cannot open " + gdrom_path + ".chd or " + gdrom_path + ".gdi");
|
||||
}
|
||||
if (gdrom == nullptr)
|
||||
throw NaomiCartException("Naomi GDROM: Cannot open " + gdrom_path + ".chd");
|
||||
}
|
||||
|
||||
// primary volume descriptor
|
||||
|
|
|
|||
|
|
@ -81,12 +81,7 @@ static bool loadBios(const char *filename, Archive *child_archive, Archive *pare
|
|||
|
||||
for (int romid = 0; bios->blobs[romid].filename != nullptr; romid++)
|
||||
{
|
||||
if (region == -1)
|
||||
{
|
||||
region = bios->blobs[romid].region;
|
||||
config::Region.override(region);
|
||||
}
|
||||
else if (bios->blobs[romid].region != (u32)region)
|
||||
if (region != -1 && bios->blobs[romid].region != (u32)region)
|
||||
continue;
|
||||
|
||||
std::unique_ptr<ArchiveFile> file;
|
||||
|
|
@ -119,6 +114,8 @@ static bool loadBios(const char *filename, Archive *child_archive, Archive *pare
|
|||
md5.add(biosData + bios->blobs[romid].offset, bios->blobs[romid].length);
|
||||
DEBUG_LOG(NAOMI, "Mapped %s: %x bytes at %07x", bios->blobs[romid].filename, read, bios->blobs[romid].offset);
|
||||
found_region = true;
|
||||
if (region == -1)
|
||||
config::Region.override(bios->blobs[romid].region);
|
||||
}
|
||||
break;
|
||||
case EepromBE16:
|
||||
|
|
|
|||
Loading…
Reference in New Issue