Code cleanup.

This commit is contained in:
2018-06-22 08:08:38 +01:00
parent 82f474c7e3
commit 88da8fc019
581 changed files with 22423 additions and 20839 deletions

View File

@@ -228,35 +228,38 @@ namespace DiscImageChef.Decoders.Xbox
SecuritySector ss = new SecuritySector
{
DiskCategory = (DiskCategory)((response[0] & 0xF0) >> 4),
PartVersion = (byte)(response[0] & 0x0F),
DiscSize = (DVDSize)((response[1] & 0xF0) >> 4),
MaximumRate = (MaximumRateField)(response[1] & 0x0F),
Reserved3 = (response[2] & 0x80) == 0x80,
Layers = (byte)((response[2] & 0x60) >> 5),
TrackPath = (response[2] & 0x08) == 0x08,
LayerType = (LayerTypeFieldMask)(response[2] & 0x07),
DiskCategory = (DiskCategory)((response[0] & 0xF0) >> 4),
PartVersion = (byte)(response[0] & 0x0F),
DiscSize = (DVDSize)((response[1] & 0xF0) >> 4),
MaximumRate = (MaximumRateField)(response[1] & 0x0F),
Reserved3 = (response[2] & 0x80) == 0x80,
Layers = (byte)((response[2] & 0x60) >> 5),
TrackPath = (response[2] & 0x08) == 0x08,
LayerType = (LayerTypeFieldMask)(response[2] & 0x07),
LinearDensity = (LinearDensityField)((response[3] & 0xF0) >> 4),
TrackDensity = (TrackDensityField)(response[3] & 0x0F),
DataAreaStartPSN = (uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
DataAreaEndPSN = (uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
Layer0EndPSN = (uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]),
Unknown1 = response[27],
Unknown2 = new byte[28],
Unknown3 = new byte[436],
Unknown4 = new byte[4],
Unknown5 = new byte[43],
TrackDensity = (TrackDensityField)(response[3] & 0x0F),
DataAreaStartPSN =
(uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
DataAreaEndPSN =
(uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
Layer0EndPSN =
(uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]),
Unknown1 = response[27],
Unknown2 = new byte[28],
Unknown3 = new byte[436],
Unknown4 = new byte[4],
Unknown5 = new byte[43],
ChallengeTableVersion = response[768],
NoChallengeEntries = response[769],
ChallengeEntries = new ChallengeEntry[23],
Unknown6 = response[1023],
Unknown7 = new byte[48],
Unknown8 = new byte[16],
Unknown9 = new byte[16],
Unknown10 = new byte[303],
Unknown11 = new byte[104],
Extents = new SecuritySectorExtent[23],
ExtentsCopy = new SecuritySectorExtent[23]
NoChallengeEntries = response[769],
ChallengeEntries = new ChallengeEntry[23],
Unknown6 = response[1023],
Unknown7 = new byte[48],
Unknown8 = new byte[16],
Unknown9 = new byte[16],
Unknown10 = new byte[303],
Unknown11 = new byte[104],
Extents = new SecuritySectorExtent[23],
ExtentsCopy = new SecuritySectorExtent[23]
};
Array.Copy(response, 256, ss.Unknown2, 0, 28);
@@ -267,19 +270,19 @@ namespace DiscImageChef.Decoders.Xbox
for(int i = 0; i < 23; i++)
ss.ChallengeEntries[i] = new ChallengeEntry
{
Level = response[770 + i * 11 + 0],
Level = response[770 + i * 11 + 0],
ChallengeId = response[770 + i * 11 + 1],
ChallengeValue =
(uint)((response[770 + i * 11 + 2] << 24) + (response[770 + i * 11 + 3] << 16) +
(response[770 + i * 11 + 4] << 8) + response[770 + i * 11 + 5]),
(response[770 + i * 11 + 4] << 8) + response[770 + i * 11 + 5]),
ResponseModifier = response[770 + i * 11 + 6],
ResponseValue = (uint)((response[770 + i * 11 + 7] << 24) + (response[770 + i * 11 + 8] << 16) +
(response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10])
(response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10])
};
Array.Copy(response, 1052, ss.Unknown7, 0, 48);
Array.Copy(response, 1120, ss.Unknown8, 0, 16);
Array.Copy(response, 1180, ss.Unknown9, 0, 16);
Array.Copy(response, 1052, ss.Unknown7, 0, 48);
Array.Copy(response, 1120, ss.Unknown8, 0, 16);
Array.Copy(response, 1180, ss.Unknown9, 0, 16);
Array.Copy(response, 1208, ss.Unknown10, 0, 303);
Array.Copy(response, 1528, ss.Unknown11, 0, 104);
for(int i = 0; i < 23; i++)
@@ -316,7 +319,7 @@ namespace DiscImageChef.Decoders.Xbox
if(ss == null) return null;
SecuritySector decoded = ss.Value;
StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
string sizeString;
switch(decoded.DiscSize)
@@ -376,7 +379,7 @@ namespace DiscImageChef.Decoders.Xbox
}
sb.AppendFormat("Disc has {0} layers", decoded.Layers + 1).AppendLine();
if(decoded.TrackPath && decoded.Layers == 1) sb.AppendLine("Layers are in parallel track path");
if(decoded.TrackPath && decoded.Layers == 1) sb.AppendLine("Layers are in parallel track path");
else if(!decoded.TrackPath && decoded.Layers == 1) sb.AppendLine("Layers are in opposite track path");
switch(decoded.LinearDensity)
@@ -437,7 +440,8 @@ namespace DiscImageChef.Decoders.Xbox
if(decoded.Layers == 1 && !decoded.TrackPath)
sb.AppendFormat("Layer 0 ends at PSN {0:X}h", decoded.Layer0EndPSN).AppendLine();
}
else sb.AppendLine("Disc is empty");
else
sb.AppendLine("Disc is empty");
else sb.AppendLine("Disc is empty");
sb.AppendLine("Challenges:");