Make XGD extension

This commit is contained in:
Matt Nadareski
2021-03-09 09:55:08 -08:00
parent 026f999b46
commit 7c0af96dc9
3 changed files with 20 additions and 10 deletions

View File

@@ -1496,8 +1496,6 @@ namespace MPF.Aaru
case MediaType.DVD:
case MediaType.HDDVD:
case MediaType.BluRay:
bool xgd = (this.System == KnownSystem.MicrosoftXBOX || this.System == KnownSystem.MicrosoftXBOX360);
// Get the individual hash data, as per internal
if (GetISOHashValues(info.TracksAndWriteOffsets.ClrMameProData, out long size, out string crc32, out string md5, out string sha1))
{

View File

@@ -1849,8 +1849,6 @@ namespace MPF.DiscImageCreator
case MediaType.DVD:
case MediaType.HDDVD:
case MediaType.BluRay:
bool xgd = (this.System == KnownSystem.MicrosoftXBOX || this.System == KnownSystem.MicrosoftXBOX360);
// Get the individual hash data, as per internal
if (GetISOHashValues(info.TracksAndWriteOffsets.ClrMameProData, out long size, out string crc32, out string md5, out string sha1))
{
@@ -1863,7 +1861,7 @@ namespace MPF.DiscImageCreator
// Deal with the layerbreaks
if (this.Type == MediaType.DVD)
{
string layerbreak = GetLayerbreak(basePath + "_disc.txt", xgd) ?? "";
string layerbreak = GetLayerbreak(basePath + "_disc.txt", System.IsXGD()) ?? "";
info.SizeAndChecksums.Layerbreak = !string.IsNullOrEmpty(layerbreak) ? Int64.Parse(layerbreak) : default;
}
else if (this.Type == MediaType.BluRay)
@@ -1879,11 +1877,6 @@ namespace MPF.DiscImageCreator
if (layerbreak3 != null && layerbreak3 * 2048 < info.SizeAndChecksums.Size)
info.SizeAndChecksums.Layerbreak3 = layerbreak3.Value;
}
else
{
string layerbreak = GetLayerbreak(basePath + "_disc.txt", xgd) ?? "";
info.SizeAndChecksums.Layerbreak = !string.IsNullOrEmpty(layerbreak) ? Int64.Parse(layerbreak) : default;
}
}
// Read the PVD

View File

@@ -91,5 +91,24 @@ namespace MPF.Utilities
return false;
}
}
/// <summary>
/// Determine if a system is considered XGD
/// </summary>
/// <param name="system">KnownSystem value to check</param>
/// <returns>True if the system is XGD, false otherwise</returns>
public static bool IsXGD(this KnownSystem? system)
{
switch (system)
{
case KnownSystem.MicrosoftXBOX:
case KnownSystem.MicrosoftXBOX360:
case KnownSystem.MicrosoftXBOXOne:
case KnownSystem.MicrosoftXboxSeriesXS:
return true;
default:
return false;
}
}
}
}