Skip to content
Permalink
Browse files

Merge pull request #8443 from JosJuice/redumpverifier-datel-wii

RedumpVerifier: Fix handling of Datel Wii disc serials
  • Loading branch information...
lioncash committed Oct 30, 2019
2 parents 4f5badb + f9705fd commit 78fad0aafae4e72896976a5215680c88d65cbfbd
Showing with 10 additions and 8 deletions.
  1. +3 −5 Source/Core/DiscIO/VolumeGC.cpp
  2. +3 −3 Source/Core/DiscIO/VolumeVerifier.cpp
  3. +4 −0 Source/Core/DiscIO/VolumeWii.cpp
@@ -74,13 +74,11 @@ std::string VolumeGC::GetGameID(const Partition& partition) const

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())
// Don't return an ID for Datel discs
if (!GetBootDOLOffset(*this, PARTITION_NONE).has_value())
return "";

return game_id;
return GetGameID(partition);
}

Region VolumeGC::GetRegion() const
@@ -241,9 +241,9 @@ std::vector<RedumpVerifier::PotentialMatch> RedumpVerifier::ScanDatfile(const st
continue;

const std::string serials = game.child("serial").text().as_string();
if (serials.empty())
if (serials.empty() || StringBeginsWith(serials, "DS"))
{
// This case is reached for Datel discs
// GC Datel discs have no serials in Redump, Wii Datel discs have serials like "DS000101"
if (!m_game_id.empty())
continue; // Non-empty m_game_id means we're verifying a non-Datel disc
}
@@ -265,7 +265,7 @@ std::vector<RedumpVerifier::PotentialMatch> RedumpVerifier::ScanDatfile(const st
const size_t game_id_start =
first_dash == std::string::npos ? std::string::npos : first_dash + 1;

if (serial.size() < game_id_start + 4)
if (game_id_start == std::string::npos || serial.size() < game_id_start + 4)
{
ERROR_LOG(DISCIO, "Invalid serial in redump datfile: %s", serial_str.c_str());
continue;
@@ -313,6 +313,10 @@ std::string VolumeWii::GetGameID(const Partition& partition) const

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);
}

0 comments on commit 78fad0a

Please sign in to comment.
You can’t perform that action at this time.