From f9aaf8b9715470f0fd9182164fc6bd3c0443453b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 4 Jul 2020 14:45:15 +0200 Subject: [PATCH 1/3] Revert "Return nothing from VolumeWii::GetGameTDBID if Datel" This reverts commit f9705fd1176432755df3dba0ef5c50f505193371. GameTDB.com has covers for non-GNHE5d Datel discs. --- Source/Core/DiscIO/VolumeGC.cpp | 8 +++++--- Source/Core/DiscIO/VolumeWii.cpp | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index 83b0d3dd00..cb8c26f73e 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -59,11 +59,13 @@ const FileSystem* VolumeGC::GetFileSystem(const Partition& partition) const std::string VolumeGC::GetGameTDBID(const Partition& partition) const { - // Don't return an ID for Datel discs - if (!GetBootDOLOffset(*this, PARTITION_NONE).has_value()) + const std::string game_id = GetGameID(partition); + + // Don't return an ID for Datel discs that are using the game ID of NHL Hitz 2002 + if (game_id == "GNHE5d" && !GetBootDOLOffset(*this, partition).has_value()) return ""; - return GetGameID(partition); + return game_id; } Region VolumeGC::GetRegion() const diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index c17744f172..9880e6d79e 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -301,10 +301,6 @@ u64 VolumeWii::PartitionOffsetToRawOffset(u64 offset, const Partition& partition std::string VolumeWii::GetGameTDBID(const Partition& partition) const { - // Don't return an ID for Datel discs - if (m_game_partition == PARTITION_NONE) - return ""; - return GetGameID(partition); } From f24566bf39211671cd05fd8b88532b75d8b38e83 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 4 Jul 2020 14:51:13 +0200 Subject: [PATCH 2/3] DiscIO: Add Volume::IsDatelDisc --- Source/Core/DiscIO/Volume.h | 1 + Source/Core/DiscIO/VolumeGC.cpp | 10 ++++++---- Source/Core/DiscIO/VolumeGC.h | 1 + Source/Core/DiscIO/VolumeWad.cpp | 5 +++++ Source/Core/DiscIO/VolumeWad.h | 1 + Source/Core/DiscIO/VolumeWii.cpp | 5 +++++ Source/Core/DiscIO/VolumeWii.h | 1 + Source/Core/UICommon/GameFile.cpp | 3 +-- 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Source/Core/DiscIO/Volume.h b/Source/Core/DiscIO/Volume.h index 74a7cf35fc..a5c4e6be14 100644 --- a/Source/Core/DiscIO/Volume.h +++ b/Source/Core/DiscIO/Volume.h @@ -115,6 +115,7 @@ public: return 0; } virtual Platform GetVolumeType() const = 0; + virtual bool IsDatelDisc() const = 0; virtual bool SupportsIntegrityCheck() const { return false; } virtual bool CheckH3TableIntegrity(const Partition& partition) const { return false; } virtual bool CheckBlockIntegrity(u64 block_index, const std::vector& encrypted_data, diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index cb8c26f73e..15d71c74ca 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -62,10 +62,7 @@ std::string VolumeGC::GetGameTDBID(const Partition& partition) const const std::string game_id = GetGameID(partition); // Don't return an ID for Datel discs that are using the game ID of NHL Hitz 2002 - if (game_id == "GNHE5d" && !GetBootDOLOffset(*this, partition).has_value()) - return ""; - - return game_id; + return game_id == "GNHE5d" && IsDatelDisc() ? "" : game_id; } Region VolumeGC::GetRegion() const @@ -135,6 +132,11 @@ Platform VolumeGC::GetVolumeType() const return Platform::GameCubeDisc; } +bool VolumeGC::IsDatelDisc() const +{ + return !GetBootDOLOffset(*this, PARTITION_NONE).has_value(); +} + VolumeGC::ConvertedGCBanner VolumeGC::LoadBannerFile() const { GCBanner banner_file; diff --git a/Source/Core/DiscIO/VolumeGC.h b/Source/Core/DiscIO/VolumeGC.h index 3d16988500..56e2356877 100644 --- a/Source/Core/DiscIO/VolumeGC.h +++ b/Source/Core/DiscIO/VolumeGC.h @@ -43,6 +43,7 @@ public: std::vector GetBanner(u32* width, u32* height) const override; Platform GetVolumeType() const override; + bool IsDatelDisc() const override; Region GetRegion() const override; BlobType GetBlobType() const override; u64 GetSize() const override; diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index 7681d3932c..61b772ec31 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -284,6 +284,11 @@ Platform VolumeWAD::GetVolumeType() const return Platform::WiiWAD; } +bool VolumeWAD::IsDatelDisc() const +{ + return false; +} + std::map VolumeWAD::GetLongNames() const { if (!m_tmd.IsValid() || !IOS::ES::IsChannel(m_tmd.GetTitleId())) diff --git a/Source/Core/DiscIO/VolumeWad.h b/Source/Core/DiscIO/VolumeWad.h index ce8db892c2..d76b8853ec 100644 --- a/Source/Core/DiscIO/VolumeWad.h +++ b/Source/Core/DiscIO/VolumeWad.h @@ -59,6 +59,7 @@ public: return ""; } Platform GetVolumeType() const override; + bool IsDatelDisc() const override; Region GetRegion() const override; Country GetCountry(const Partition& partition = PARTITION_NONE) const override; diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index 9880e6d79e..73797fe1e3 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -334,6 +334,11 @@ Platform VolumeWii::GetVolumeType() const return Platform::WiiDisc; } +bool VolumeWii::IsDatelDisc() const +{ + return m_game_partition == PARTITION_NONE; +} + BlobType VolumeWii::GetBlobType() const { return m_reader->GetBlobType(); diff --git a/Source/Core/DiscIO/VolumeWii.h b/Source/Core/DiscIO/VolumeWii.h index 361c06ffe1..3af5884d3e 100644 --- a/Source/Core/DiscIO/VolumeWii.h +++ b/Source/Core/DiscIO/VolumeWii.h @@ -79,6 +79,7 @@ public: std::vector GetBanner(u32* width, u32* height) const override; Platform GetVolumeType() const override; + bool IsDatelDisc() const override; bool SupportsIntegrityCheck() const override { return m_encrypted; } bool CheckH3TableIntegrity(const Partition& partition) const override; bool CheckBlockIntegrity(u64 block_index, const std::vector& encrypted_data, diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index 31a3fa4d26..25892bca67 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -120,8 +120,7 @@ GameFile::GameFile(std::string path) : m_file_path(std::move(path)) m_file_size = volume->GetRawSize(); m_volume_size = volume->GetSize(); m_volume_size_is_accurate = volume->IsSizeAccurate(); - m_is_datel_disc = DiscIO::IsDisc(m_platform) && - !DiscIO::GetBootDOLOffset(*volume, volume->GetGamePartition()); + m_is_datel_disc = volume->IsDatelDisc(); m_internal_name = volume->GetInternalName(); m_game_id = volume->GetGameID(); From fb922781e7c06c3d5e7617c0b6bc4244662cfda0 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 4 Jul 2020 14:55:15 +0200 Subject: [PATCH 3/3] RedumpVerifier: Treat Datel game IDs as empty Replacement for the reverted commit f9705fd1176432755df3dba0ef5c50f505193371. --- Source/Core/DiscIO/VolumeVerifier.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 6a620131fb..9a8617c166 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -56,11 +56,12 @@ RedumpVerifier::DownloadState RedumpVerifier::m_wii_download_state; void RedumpVerifier::Start(const Volume& volume) { - // We use GetGameTDBID instead of GetGameID so that Datel discs will be represented by an empty - // string, which matches Redump not having any serials for Datel discs. - m_game_id = volume.GetGameTDBID(); - if (m_game_id.size() > 4) - m_game_id = m_game_id.substr(0, 4); + if (!volume.IsDatelDisc()) + { + m_game_id = volume.GetGameID(); + if (m_game_id.size() > 4) + m_game_id = m_game_id.substr(0, 4); + } m_revision = volume.GetRevision().value_or(0); m_disc_number = volume.GetDiscNumber().value_or(0);