Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8764 from JosJuice/volumeverifier-dual-layer-desync
VolumeVerifier: Show desync warning for dual layer discs too
  • Loading branch information
leoetlino committed Apr 27, 2020
2 parents 0a71dda + bacf0d6 commit f2f8168
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Source/Core/DiscIO/VolumeVerifier.cpp
Expand Up @@ -735,7 +735,8 @@ void VolumeVerifier::CheckDiscSize(const std::vector<Partition>& partitions)
return;

m_biggest_referenced_offset = GetBiggestReferencedOffset(partitions);
if (ShouldBeDualLayer() && m_biggest_referenced_offset <= SL_DVD_R_SIZE)
const bool should_be_dual_layer = ShouldBeDualLayer();
if (should_be_dual_layer && m_biggest_referenced_offset <= SL_DVD_R_SIZE)
{
AddProblem(Severity::Medium,
Common::GetStringT(
Expand All @@ -753,16 +754,16 @@ void VolumeVerifier::CheckDiscSize(const std::vector<Partition>& partitions)
else if (!m_is_tgc)
{
const Platform platform = m_volume.GetVolumeType();
const bool is_gc_size = platform == Platform::GameCubeDisc || m_is_datel;
const bool should_be_gc_size = platform == Platform::GameCubeDisc || m_is_datel;
const u64 size = m_volume.GetSize();

const bool valid_gamecube = size == MINI_DVD_SIZE;
const bool valid_retail_wii = size == SL_DVD_SIZE || size == DL_DVD_SIZE;
const bool valid_debug_wii = size == SL_DVD_R_SIZE || size == DL_DVD_R_SIZE;

const bool debug = IsDebugSigned();
if ((is_gc_size && !valid_gamecube) ||
(!is_gc_size && (debug ? !valid_debug_wii : !valid_retail_wii)))
if ((should_be_gc_size && !valid_gamecube) ||
(!should_be_gc_size && (debug ? !valid_debug_wii : !valid_retail_wii)))
{
if (debug && valid_retail_wii)
{
Expand All @@ -772,7 +773,15 @@ void VolumeVerifier::CheckDiscSize(const std::vector<Partition>& partitions)
}
else
{
if ((is_gc_size && size < MINI_DVD_SIZE) || (!is_gc_size && size < SL_DVD_SIZE))
u64 normal_size;
if (should_be_gc_size)
normal_size = MINI_DVD_SIZE;
else if (!should_be_dual_layer)
normal_size = SL_DVD_SIZE;
else
normal_size = DL_DVD_SIZE;

if (size < normal_size)
{
AddProblem(
Severity::Low,
Expand Down

0 comments on commit f2f8168

Please sign in to comment.