mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-20 01:15:08 -05:00
Added Triforce support
This commit is contained in:
@@ -45,13 +45,11 @@ VolumeGC::VolumeGC(std::unique_ptr<BlobReader> reader)
|
||||
std::unique_ptr<FileInfo> file_info = tmp_fs->FindFileInfo("boot.id");
|
||||
if (!file_info)
|
||||
return;
|
||||
BootID triforce_header;
|
||||
const u64 file_size = ReadFile(*this, PARTITION_NONE, file_info.get(),
|
||||
reinterpret_cast<u8*>(&triforce_header), sizeof(BootID));
|
||||
if (file_size >= 4 && triforce_header.magic == BTID_MAGIC)
|
||||
reinterpret_cast<u8*>(&m_triforce_header), sizeof(BootID));
|
||||
if (file_size >= 4 && m_triforce_header.magic == BTID_MAGIC)
|
||||
{
|
||||
m_is_triforce = true;
|
||||
m_triforce_id = triforce_header.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,16 +88,23 @@ std::string VolumeGC::GetGameTDBID(const Partition& partition) const
|
||||
return GetGameID(partition);
|
||||
}
|
||||
|
||||
std::string VolumeGC::GetTriforceID() const
|
||||
{
|
||||
if (m_is_triforce)
|
||||
return (std::string(m_triforce_id.data(), m_triforce_id.size()));
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
Region VolumeGC::GetRegion() const
|
||||
{
|
||||
if (m_is_triforce)
|
||||
{
|
||||
switch (m_triforce_header.regionFlags)
|
||||
{
|
||||
default:
|
||||
case 0x02: // JAPAN
|
||||
case 0x08: // ASIA
|
||||
return Region::NTSC_J;
|
||||
case 0x0E: // USA
|
||||
return Region::NTSC_U;
|
||||
case 0x0C: // EXPORT
|
||||
return Region::PAL;
|
||||
}
|
||||
}
|
||||
|
||||
return RegionCodeToRegion(m_reader->ReadSwapped<u32>(0x458));
|
||||
}
|
||||
|
||||
@@ -184,6 +189,12 @@ std::array<u8, 20> VolumeGC::GetSyncHash() const
|
||||
|
||||
VolumeGC::ConvertedGCBanner VolumeGC::LoadBannerFile() const
|
||||
{
|
||||
// There is at least one Triforce game that has an opening.bnr file but from a different game.
|
||||
if (m_is_triforce)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
GCBanner banner_file;
|
||||
const u64 file_size = ReadFile(*this, PARTITION_NONE, "opening.bnr",
|
||||
reinterpret_cast<u8*>(&banner_file), sizeof(GCBanner));
|
||||
|
||||
Reference in New Issue
Block a user