diff --git a/DVD/DDS.cs b/DVD/DDS.cs index ed81b6770..0423b33de 100644 --- a/DVD/DDS.cs +++ b/DVD/DDS.cs @@ -109,10 +109,10 @@ namespace Aaru.Decoders.DVD dds.Reserved4 = (byte)((response[7] & 0x7C) >> 2); dds.Reserved = new byte[68]; Array.Copy(response, 16, dds.Reserved, 0, 68); - dds.Zones = (ushort)((response[14] << 8) + response[15]); - dds.SpareAreaFirstPSN = (uint)((response[85] << 16) + (response[86] << 8) + response[87]); - dds.SpareAreaLastPSN = (uint)((response[89] << 16) + (response[90] << 8) + response[91]); - dds.LSN0Location = (uint)((response[93] << 16) + (response[94] << 8) + response[95]); + dds.Zones = (ushort)((response[14] << 8) + response[15]); + dds.SpareAreaFirstPSN = (uint)((response[85] << 16) + (response[86] << 8) + response[87]); + dds.SpareAreaLastPSN = (uint)((response[89] << 16) + (response[90] << 8) + response[91]); + dds.LSN0Location = (uint)((response[93] << 16) + (response[94] << 8) + response[95]); dds.StartLSNForZone = new uint[dds.Zones]; for(int i = 0; i < dds.Zones; i++) diff --git a/Floppy/Apple2.cs b/Floppy/Apple2.cs index bc186d725..99ffe1a6d 100644 --- a/Floppy/Apple2.cs +++ b/Floppy/Apple2.cs @@ -170,14 +170,14 @@ namespace Aaru.Decoders.Floppy { byte b1 = buffer[(51 * 3) - i]; byte b2 = buffer[(51 * 2) - i]; - byte b3 = buffer[51 - i]; - byte b4 = (byte)((((b1 & 2) << 1) | (b2 & 2) | ((b3 & 2) >> 1)) & 0xFF); - byte b5 = (byte)((((b1 & 1) << 2) | ((b2 & 1) << 1) | (b3 & 1)) & 0xFF); + byte b3 = buffer[51 - i]; + byte b4 = (byte)((((b1 & 2) << 1) | (b2 & 2) | ((b3 & 2) >> 1)) & 0xFF); + byte b5 = (byte)((((b1 & 1) << 2) | ((b2 & 1) << 1) | (b3 & 1)) & 0xFF); output[250 - (5 * i)] = (byte)(((buffer[i + (51 * 3) + 1] << 3) | ((b1 >> 2) & 0x7)) & 0xFF); output[251 - (5 * i)] = (byte)(((buffer[i + (51 * 4) + 1] << 3) | ((b2 >> 2) & 0x7)) & 0xFF); output[252 - (5 * i)] = (byte)(((buffer[i + (51 * 5) + 1] << 3) | ((b3 >> 2) & 0x7)) & 0xFF); - output[253 - (5 * i)] = (byte)(((buffer[i + (51 * 6) + 1] << 3) | b4) & 0xFF); - output[254 - (5 * i)] = (byte)(((buffer[i + (51 * 7) + 1] << 3) | b5) & 0xFF); + output[253 - (5 * i)] = (byte)(((buffer[i + (51 * 6) + 1] << 3) | b4) & 0xFF); + output[254 - (5 * i)] = (byte)(((buffer[i + (51 * 7) + 1] << 3) | b5) & 0xFF); } output[255] = (byte)(((buffer[409] << 3) | (buffer[0] & 0x7)) & 0xFF); diff --git a/SCSI/MMC/AACS.cs b/SCSI/MMC/AACS.cs index 87a930569..e90911911 100644 --- a/SCSI/MMC/AACS.cs +++ b/SCSI/MMC/AACS.cs @@ -305,7 +305,7 @@ namespace Aaru.Decoders.SCSI.MMC { decoded.Extents[i].Reserved = new byte[8]; Array.Copy(AACSLBAExtsResponse, 0 + (i * 16) + 4, decoded.Extents[i].Reserved, 0, 8); - decoded.Extents[i].StartLBA = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 8 + (i * 16) + 4); + decoded.Extents[i].StartLBA = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 8 + (i * 16) + 4); decoded.Extents[i].LBACount = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 12 + (i * 16) + 4); } diff --git a/SCSI/MMC/DiscInformation.cs b/SCSI/MMC/DiscInformation.cs index 2be3781a4..0e96c5c7d 100644 --- a/SCSI/MMC/DiscInformation.cs +++ b/SCSI/MMC/DiscInformation.cs @@ -211,20 +211,27 @@ namespace Aaru.Decoders.SCSI.MMC sb.AppendFormat("First track on disc is track {0}", information.Value.FirstTrackNumber).AppendLine(); sb.AppendFormat("Disc has {0} sessions", information.Value.Sessions).AppendLine(); - sb.AppendFormat("First track in last session is track {0}", information.Value.FirstTrackLastSession).AppendLine(); - sb.AppendFormat("Last track in last session is track {0}", information.Value.LastTrackLastSession).AppendLine(); + + sb.AppendFormat("First track in last session is track {0}", information.Value.FirstTrackLastSession). + AppendLine(); + + sb.AppendFormat("Last track in last session is track {0}", information.Value.LastTrackLastSession). + AppendLine(); sb.AppendFormat("Last session Lead-In address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", - information.Value.LastSessionLeadInStartLBA, (information.Value.LastSessionLeadInStartLBA & 0xFF0000) >> 16, - (information.Value.LastSessionLeadInStartLBA & 0xFF00) >> 8, + information.Value.LastSessionLeadInStartLBA, + (information.Value.LastSessionLeadInStartLBA & 0xFF0000) >> 16, + (information.Value.LastSessionLeadInStartLBA & 0xFF00) >> 8, information.Value.LastSessionLeadInStartLBA & 0xFF).AppendLine(); sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}", - information.Value.LastPossibleLeadOutStartLBA, (information.Value.LastPossibleLeadOutStartLBA & 0xFF0000) >> 16, - (information.Value.LastPossibleLeadOutStartLBA & 0xFF00) >> 8, + information.Value.LastPossibleLeadOutStartLBA, + (information.Value.LastPossibleLeadOutStartLBA & 0xFF0000) >> 16, + (information.Value.LastPossibleLeadOutStartLBA & 0xFF00) >> 8, information.Value.LastPossibleLeadOutStartLBA & 0xFF).AppendLine(); - sb.AppendLine(information.Value.URU ? "Disc is defined for unrestricted use" : "Disc is defined for restricted use"); + sb.AppendLine(information.Value.URU ? "Disc is defined for unrestricted use" + : "Disc is defined for restricted use"); if(information.Value.DID_V) sb.AppendFormat("Disc ID: {0:X6}", information.Value.DiscIdentification & 0x00FFFFFF).AppendLine(); @@ -284,7 +291,8 @@ namespace Aaru.Decoders.SCSI.MMC sb.AppendFormat("{0} maximum possible appendable tracks on the disc", information.Value.AppendableTracks). AppendLine(); - sb.AppendFormat("{0} current appendable tracks on the disc", information.Value.MaxAppendableTracks).AppendLine(); + sb.AppendFormat("{0} current appendable tracks on the disc", information.Value.MaxAppendableTracks). + AppendLine(); return sb.ToString(); } diff --git a/SCSI/MMC/Features.cs b/SCSI/MMC/Features.cs index 3073a4499..335c2f99d 100644 --- a/SCSI/MMC/Features.cs +++ b/SCSI/MMC/Features.cs @@ -4844,8 +4844,8 @@ namespace Aaru.Decoders.SCSI.MMC { var dec = new SeparatedFeatures { - DataLength = (uint)((response[0] << 24) + (response[1] << 16) + (response[2] << 8) + response[4]), - CurrentProfile = (ushort)((response[6] << 8) + response[7]) + DataLength = (uint)((response[0] << 24) + (response[1] << 16) + (response[2] << 8) + response[4]), + CurrentProfile = (ushort)((response[6] << 8) + response[7]) }; uint offset = 8; diff --git a/SCSI/Modes/08.cs b/SCSI/Modes/08.cs index 9b4f78939..0df2e51d8 100644 --- a/SCSI/Modes/08.cs +++ b/SCSI/Modes/08.cs @@ -132,7 +132,7 @@ namespace Aaru.Decoders.SCSI decoded.DRA |= (pageResponse[12] & 0x20) == 0x20; decoded.CacheSegments = pageResponse[13]; - decoded.CacheSegmentSize = (ushort)((pageResponse[14] << 8) + pageResponse[15]); + decoded.CacheSegmentSize = (ushort)((pageResponse[14] << 8) + pageResponse[15]); decoded.NonCacheSegmentSize = (uint)((pageResponse[17] << 16) + (pageResponse[18] << 8) + pageResponse[19]); decoded.NV_DIS |= (pageResponse[12] & 0x01) == 0x01; diff --git a/SCSI/Modes/Mode10.cs b/SCSI/Modes/Mode10.cs index 2c5a028da..eaea48733 100644 --- a/SCSI/Modes/Mode10.cs +++ b/SCSI/Modes/Mode10.cs @@ -294,14 +294,14 @@ namespace Aaru.Decoders.SCSI for(int i = 0; i < header.BlockDescriptors.Length; i++) { byte[] temp = BitConverter.GetBytes(header.BlockDescriptors[i].Blocks); - hdr[7 + (i * 16) + 8] = temp[0]; - hdr[6 + (i * 16) + 8] = temp[1]; - hdr[5 + (i * 16) + 8] = temp[2]; - hdr[4 + (i * 16) + 8] = temp[3]; - hdr[3 + (i * 16) + 8] = temp[4]; - hdr[2 + (i * 16) + 8] = temp[5]; - hdr[1 + (i * 16) + 8] = temp[6]; - hdr[0 + (i * 16) + 8] = temp[7]; + hdr[7 + (i * 16) + 8] = temp[0]; + hdr[6 + (i * 16) + 8] = temp[1]; + hdr[5 + (i * 16) + 8] = temp[2]; + hdr[4 + (i * 16) + 8] = temp[3]; + hdr[3 + (i * 16) + 8] = temp[4]; + hdr[2 + (i * 16) + 8] = temp[5]; + hdr[1 + (i * 16) + 8] = temp[6]; + hdr[0 + (i * 16) + 8] = temp[7]; hdr[12 + (i * 16) + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF000000) >> 24); hdr[13 + (i * 16) + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF0000) >> 16); hdr[14 + (i * 16) + 8] = (byte)((header.BlockDescriptors[i].BlockLength & 0xFF00) >> 8); diff --git a/SCSI/SSC/BlockLimits.cs b/SCSI/SSC/BlockLimits.cs index 03e9c005f..de79bf4fd 100644 --- a/SCSI/SSC/BlockLimits.cs +++ b/SCSI/SSC/BlockLimits.cs @@ -48,8 +48,8 @@ namespace Aaru.Decoders.SCSI.SSC return new BlockLimitsData { granularity = (byte)(response[0] & 0x1F), - maxBlockLen = (uint)((response[1] << 16) + (response[2] << 8) + response[3]), - minBlockLen = (ushort)((response[4] << 8) + response[5]) + maxBlockLen = (uint)((response[1] << 16) + (response[2] << 8) + response[3]), + minBlockLen = (ushort)((response[4] << 8) + response[5]) }; }