mirror of
https://github.com/aaru-dps/Aaru.Decoders.git
synced 2025-12-16 19:24:32 +00:00
General code cleanup and style refactor.
This commit is contained in:
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.ATA;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
|
||||
namespace Aaru.Decoders.ATA;
|
||||
|
||||
// Information from following standards:
|
||||
// T10-791D rev. 4c (ATA)
|
||||
// T10-948D rev. 4c (ATA-2)
|
||||
@@ -71,8 +71,8 @@ public static class Identify
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var atapi = false;
|
||||
var cfa = false;
|
||||
bool atapi = false;
|
||||
bool cfa = false;
|
||||
|
||||
CommonTypes.Structs.Devices.ATA.Identify.IdentifyDevice ATAID = IdentifyDeviceResponse.Value;
|
||||
|
||||
@@ -168,8 +168,8 @@ public static class Identify
|
||||
acs4 |= ATAID.MajorVersion.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.MajorVersionBit.ACS4);
|
||||
}
|
||||
|
||||
var maxatalevel = 0;
|
||||
var minatalevel = 255;
|
||||
int maxatalevel = 0;
|
||||
int minatalevel = 255;
|
||||
sb.Append("Supported ATA versions: ");
|
||||
|
||||
if(ata1)
|
||||
@@ -778,8 +778,7 @@ public static class Identify
|
||||
|
||||
if(minatalevel <= 5)
|
||||
if(ATAID.CurrentCylinders > 0 &&
|
||||
ATAID.CurrentHeads > 0 &&
|
||||
ATAID.CurrentSectorsPerTrack > 0)
|
||||
ATAID is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 })
|
||||
{
|
||||
sb.AppendFormat("Cylinders: {0} max., {1} current", ATAID.Cylinders, ATAID.CurrentCylinders).
|
||||
AppendLine();
|
||||
@@ -817,7 +816,7 @@ public static class Identify
|
||||
(ulong)ATAID.CurrentSectors * 512 / 1024 / 1024).AppendLine();
|
||||
else
|
||||
{
|
||||
var currentSectors = (ulong)(ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack);
|
||||
ulong currentSectors = (ulong)(ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack);
|
||||
|
||||
sb.AppendFormat("Device size in CHS mode: {0} bytes, {1} Mb, {2} MiB",
|
||||
currentSectors * logicalSectorSize,
|
||||
@@ -2192,17 +2191,17 @@ public static class Identify
|
||||
ATAID.ReservedWord116 != 0xFFFF)
|
||||
sb.AppendFormat("Word 116: 0x{0:X4}", ATAID.ReservedWord116).AppendLine();
|
||||
|
||||
for(var i = 0; i < ATAID.ReservedWords121.Length; i++)
|
||||
for(int i = 0; i < ATAID.ReservedWords121.Length; i++)
|
||||
if(ATAID.ReservedWords121[i] != 0x0000 &&
|
||||
ATAID.ReservedWords121[i] != 0xFFFF)
|
||||
sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords121[i], 121 + i).AppendLine();
|
||||
|
||||
for(var i = 0; i < ATAID.ReservedWords129.Length; i++)
|
||||
for(int i = 0; i < ATAID.ReservedWords129.Length; i++)
|
||||
if(ATAID.ReservedWords129[i] != 0x0000 &&
|
||||
ATAID.ReservedWords129[i] != 0xFFFF)
|
||||
sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords129[i], 129 + i).AppendLine();
|
||||
|
||||
for(var i = 0; i < ATAID.ReservedCFA.Length; i++)
|
||||
for(int i = 0; i < ATAID.ReservedCFA.Length; i++)
|
||||
if(ATAID.ReservedCFA[i] != 0x0000 &&
|
||||
ATAID.ReservedCFA[i] != 0xFFFF)
|
||||
sb.AppendFormat("Word {1} (CFA): 0x{0:X4}", ATAID.ReservedCFA[i], 161 + i).AppendLine();
|
||||
@@ -2235,12 +2234,12 @@ public static class Identify
|
||||
ATAID.ReservedWord221 != 0xFFFF)
|
||||
sb.AppendFormat("Word 221: 0x{0:X4}", ATAID.ReservedWord221).AppendLine();
|
||||
|
||||
for(var i = 0; i < ATAID.ReservedCEATA224.Length; i++)
|
||||
for(int i = 0; i < ATAID.ReservedCEATA224.Length; i++)
|
||||
if(ATAID.ReservedCEATA224[i] != 0x0000 &&
|
||||
ATAID.ReservedCEATA224[i] != 0xFFFF)
|
||||
sb.AppendFormat("Word {1} (CE-ATA): 0x{0:X4}", ATAID.ReservedCEATA224[i], 224 + i).AppendLine();
|
||||
|
||||
for(var i = 0; i < ATAID.ReservedWords.Length; i++)
|
||||
for(int i = 0; i < ATAID.ReservedWords.Length; i++)
|
||||
if(ATAID.ReservedWords[i] != 0x0000 &&
|
||||
ATAID.ReservedWords[i] != 0xFFFF)
|
||||
sb.AppendFormat("Word {1}: 0x{0:X4}", ATAID.ReservedWords[i], 236 + i).AppendLine();
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.ATA;
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.ATA;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
||||
public struct AtaRegistersChs
|
||||
{
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=scsi_005Cmodes/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xml:space="preserve">
|
||||
<s:Boolean
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=scsi_005Cmodes/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -30,14 +30,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
/// Information from the following standards:
|
||||
/// ANSI X3.304-1997
|
||||
/// T10/1048-D revision 9.0
|
||||
|
||||
12
Bluray/DI.cs
12
Bluray/DI.cs
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -39,6 +37,8 @@ using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -114,8 +114,8 @@ public static class DI
|
||||
Reserved2 = DIResponse[3]
|
||||
};
|
||||
|
||||
var offset = 4;
|
||||
var units = new List<DiscInformationUnits>();
|
||||
int offset = 4;
|
||||
List<DiscInformationUnits> units = new();
|
||||
|
||||
while(true)
|
||||
{
|
||||
@@ -209,7 +209,7 @@ public static class DI
|
||||
|
||||
decoded.Units = new DiscInformationUnits[units.Count];
|
||||
|
||||
for(var i = 0; i < units.Count; i++)
|
||||
for(int i = 0; i < units.Count; i++)
|
||||
decoded.Units[i] = units[i];
|
||||
|
||||
return decoded;
|
||||
@@ -401,7 +401,7 @@ public static class DI
|
||||
|
||||
public static string ManufacturerFromDI(string manufacturerId)
|
||||
{
|
||||
var manufacturer = "";
|
||||
string manufacturer = "";
|
||||
|
||||
// ReSharper disable StringLiteralTypo
|
||||
switch(manufacturerId)
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.Bluray;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -117,17 +117,17 @@ public static class CDTextOnLeadIn
|
||||
return null;
|
||||
}
|
||||
|
||||
for(var i = 0; i < (decoded.DataLength - 2) / 18; i++)
|
||||
for(int i = 0; i < (decoded.DataLength - 2) / 18; i++)
|
||||
{
|
||||
decoded.DataPacks[i].HeaderID1 = CDTextResponse[0 + i * 18 + 4];
|
||||
decoded.DataPacks[i].HeaderID2 = CDTextResponse[1 + i * 18 + 4];
|
||||
decoded.DataPacks[i].HeaderID3 = CDTextResponse[2 + i * 18 + 4];
|
||||
decoded.DataPacks[i].DBCC = Convert.ToBoolean(CDTextResponse[3 + i * 18 + 4] & 0x80);
|
||||
decoded.DataPacks[i].BlockNumber = (byte)((CDTextResponse[3 + i * 18 + 4] & 0x70) >> 4);
|
||||
decoded.DataPacks[i].CharacterPosition = (byte)(CDTextResponse[3 + i * 18 + 4] & 0x0F);
|
||||
decoded.DataPacks[i].HeaderID1 = CDTextResponse[0 + (i * 18) + 4];
|
||||
decoded.DataPacks[i].HeaderID2 = CDTextResponse[1 + (i * 18) + 4];
|
||||
decoded.DataPacks[i].HeaderID3 = CDTextResponse[2 + (i * 18) + 4];
|
||||
decoded.DataPacks[i].DBCC = Convert.ToBoolean(CDTextResponse[3 + (i * 18) + 4] & 0x80);
|
||||
decoded.DataPacks[i].BlockNumber = (byte)((CDTextResponse[3 + (i * 18) + 4] & 0x70) >> 4);
|
||||
decoded.DataPacks[i].CharacterPosition = (byte)(CDTextResponse[3 + (i * 18) + 4] & 0x0F);
|
||||
decoded.DataPacks[i].TextDataField = new byte[12];
|
||||
Array.Copy(CDTextResponse, 4 + i * 18 + 4, decoded.DataPacks[i].TextDataField, 0, 12);
|
||||
decoded.DataPacks[i].CRC = BigEndianBitConverter.ToUInt16(CDTextResponse, 16 + i * 18 + 4);
|
||||
Array.Copy(CDTextResponse, 4 + (i * 18) + 4, decoded.DataPacks[i].TextDataField, 0, 12);
|
||||
decoded.DataPacks[i].CRC = BigEndianBitConverter.ToUInt16(CDTextResponse, 16 + (i * 18) + 4);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum TocAdr : byte
|
||||
{
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
@@ -41,6 +39,8 @@ using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -90,22 +90,22 @@ public static class FullTOC
|
||||
return null;
|
||||
}
|
||||
|
||||
for(var i = 0; i < (decoded.DataLength - 2) / 11; i++)
|
||||
for(int i = 0; i < (decoded.DataLength - 2) / 11; i++)
|
||||
{
|
||||
decoded.TrackDescriptors[i].SessionNumber = CDFullTOCResponse[0 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDFullTOCResponse[1 + i * 11 + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].CONTROL = (byte)(CDFullTOCResponse[1 + i * 11 + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].TNO = CDFullTOCResponse[2 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].POINT = CDFullTOCResponse[3 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].Min = CDFullTOCResponse[4 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].Sec = CDFullTOCResponse[5 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].Frame = CDFullTOCResponse[6 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].Zero = CDFullTOCResponse[7 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].HOUR = (byte)((CDFullTOCResponse[7 + i * 11 + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].PHOUR = (byte)(CDFullTOCResponse[7 + i * 11 + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].PMIN = CDFullTOCResponse[8 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].PSEC = CDFullTOCResponse[9 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].PFRAME = CDFullTOCResponse[10 + i * 11 + 4];
|
||||
decoded.TrackDescriptors[i].SessionNumber = CDFullTOCResponse[0 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDFullTOCResponse[1 + (i * 11) + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].CONTROL = (byte)(CDFullTOCResponse[1 + (i * 11) + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].TNO = CDFullTOCResponse[2 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].POINT = CDFullTOCResponse[3 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].Min = CDFullTOCResponse[4 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].Sec = CDFullTOCResponse[5 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].Frame = CDFullTOCResponse[6 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].Zero = CDFullTOCResponse[7 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].HOUR = (byte)((CDFullTOCResponse[7 + (i * 11) + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].PHOUR = (byte)(CDFullTOCResponse[7 + (i * 11) + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].PMIN = CDFullTOCResponse[8 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].PSEC = CDFullTOCResponse[9 + (i * 11) + 4];
|
||||
decoded.TrackDescriptors[i].PFRAME = CDFullTOCResponse[10 + (i * 11) + 4];
|
||||
}
|
||||
|
||||
return decoded;
|
||||
@@ -120,14 +120,14 @@ public static class FullTOC
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var lastSession = 0;
|
||||
int lastSession = 0;
|
||||
|
||||
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
|
||||
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
|
||||
|
||||
foreach(TrackDataDescriptor descriptor in response.TrackDescriptors)
|
||||
if((descriptor.CONTROL & 0x08) == 0x08 ||
|
||||
descriptor.ADR != 1 && descriptor.ADR != 5 && descriptor.ADR != 4 && descriptor.ADR != 6 ||
|
||||
(descriptor.ADR != 1 && descriptor.ADR != 5 && descriptor.ADR != 4 && descriptor.ADR != 6) ||
|
||||
descriptor.TNO != 0)
|
||||
{
|
||||
sb.AppendLine("Unknown TOC entry format, printing values as-is");
|
||||
@@ -340,7 +340,7 @@ public static class FullTOC
|
||||
descriptor.POINT).AppendLine();
|
||||
else
|
||||
{
|
||||
var type = "Audio";
|
||||
string type = "Audio";
|
||||
|
||||
if((TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrack ||
|
||||
(TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrackIncremental)
|
||||
@@ -558,7 +558,7 @@ public static class FullTOC
|
||||
|
||||
case 6:
|
||||
{
|
||||
var id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
|
||||
uint id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
|
||||
sb.AppendFormat("Disc ID: {0:X6}", id & 0x00FFFFFF).AppendLine();
|
||||
|
||||
break;
|
||||
|
||||
34
CD/PMA.cs
34
CD/PMA.cs
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -80,21 +80,21 @@ public static class PMA
|
||||
return null;
|
||||
}
|
||||
|
||||
for(var i = 0; i < (decoded.DataLength - 2) / 11; i++)
|
||||
for(int i = 0; i < (decoded.DataLength - 2) / 11; i++)
|
||||
{
|
||||
decoded.PMADescriptors[i].Reserved = CDPMAResponse[0 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].ADR = (byte)((CDPMAResponse[1 + i * 11 + 4] & 0xF0) >> 4);
|
||||
decoded.PMADescriptors[i].CONTROL = (byte)(CDPMAResponse[1 + i * 11 + 4] & 0x0F);
|
||||
decoded.PMADescriptors[i].TNO = CDPMAResponse[2 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].POINT = CDPMAResponse[3 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].Min = CDPMAResponse[4 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].Sec = CDPMAResponse[5 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].Frame = CDPMAResponse[6 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].HOUR = (byte)((CDPMAResponse[7 + i * 11 + 4] & 0xF0) >> 4);
|
||||
decoded.PMADescriptors[i].PHOUR = (byte)(CDPMAResponse[7 + i * 11 + 4] & 0x0F);
|
||||
decoded.PMADescriptors[i].PMIN = CDPMAResponse[8 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].PSEC = CDPMAResponse[9 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].PFRAME = CDPMAResponse[10 + i * 11 + 4];
|
||||
decoded.PMADescriptors[i].Reserved = CDPMAResponse[0 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].ADR = (byte)((CDPMAResponse[1 + (i * 11) + 4] & 0xF0) >> 4);
|
||||
decoded.PMADescriptors[i].CONTROL = (byte)(CDPMAResponse[1 + (i * 11) + 4] & 0x0F);
|
||||
decoded.PMADescriptors[i].TNO = CDPMAResponse[2 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].POINT = CDPMAResponse[3 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].Min = CDPMAResponse[4 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].Sec = CDPMAResponse[5 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].Frame = CDPMAResponse[6 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].HOUR = (byte)((CDPMAResponse[7 + (i * 11) + 4] & 0xF0) >> 4);
|
||||
decoded.PMADescriptors[i].PHOUR = (byte)(CDPMAResponse[7 + (i * 11) + 4] & 0x0F);
|
||||
decoded.PMADescriptors[i].PMIN = CDPMAResponse[8 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].PSEC = CDPMAResponse[9 + (i * 11) + 4];
|
||||
decoded.PMADescriptors[i].PFRAME = CDPMAResponse[10 + (i * 11) + 4];
|
||||
}
|
||||
|
||||
return decoded;
|
||||
@@ -180,7 +180,7 @@ public static class PMA
|
||||
|
||||
break;
|
||||
case 2:
|
||||
var id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
|
||||
uint id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
|
||||
sb.AppendFormat("Disc ID: {0:X6}", id & 0x00FFFFFF).AppendLine();
|
||||
|
||||
break;
|
||||
|
||||
34
CD/Sector.cs
34
CD/Sector.cs
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
@@ -39,6 +37,8 @@ using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using Aaru.Checksums;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class Sector
|
||||
@@ -189,21 +189,21 @@ public static class Sector
|
||||
sector.Length < 2352)
|
||||
return sector;
|
||||
|
||||
var sync = new byte[12];
|
||||
byte[] sync = new byte[12];
|
||||
Array.Copy(sector, 0, sync, 0, 12);
|
||||
|
||||
if(!SyncMark.SequenceEqual(sync))
|
||||
return sector;
|
||||
|
||||
var scrambled = new byte[sector.Length];
|
||||
byte[] scrambled = new byte[sector.Length];
|
||||
|
||||
for(var i = 0; i < 2352; i++)
|
||||
for(int i = 0; i < 2352; i++)
|
||||
scrambled[i] = (byte)(sector[i] ^ ScrambleTable[i]);
|
||||
|
||||
if(sector.Length <= 2352)
|
||||
return scrambled;
|
||||
|
||||
for(var i = 2352; i < sector.Length; i++)
|
||||
for(int i = 2352; i < sector.Length; i++)
|
||||
scrambled[i] = sector[i];
|
||||
|
||||
return scrambled;
|
||||
@@ -222,7 +222,7 @@ public static class Sector
|
||||
{
|
||||
case 0: return new byte[2048];
|
||||
case 1:
|
||||
var sector = new byte[2048];
|
||||
byte[] sector = new byte[2048];
|
||||
Array.Copy(data, 16, sector, 0, 2048);
|
||||
|
||||
return sector;
|
||||
@@ -241,7 +241,7 @@ public static class Sector
|
||||
data.Length != 2336)
|
||||
return data;
|
||||
|
||||
var pos = 0;
|
||||
int pos = 0;
|
||||
|
||||
if(data.Length == 2352)
|
||||
{
|
||||
@@ -270,7 +270,7 @@ public static class Sector
|
||||
int len = (data[pos + 2] & 0x20) == 0x20 ? 2324 : 2048;
|
||||
pos += 8;
|
||||
|
||||
var sector = new byte[len];
|
||||
byte[] sector = new byte[len];
|
||||
Array.Copy(data, pos, sector, 0, len);
|
||||
|
||||
return sector;
|
||||
@@ -303,8 +303,8 @@ public static class Sector
|
||||
byte min = buffer[12];
|
||||
byte sec = buffer[13];
|
||||
byte frame = buffer[14];
|
||||
var lba = 0;
|
||||
var moreThan90 = false;
|
||||
int lba = 0;
|
||||
bool moreThan90 = false;
|
||||
|
||||
if(min > 0x90)
|
||||
{
|
||||
@@ -313,9 +313,9 @@ public static class Sector
|
||||
moreThan90 = true;
|
||||
}
|
||||
|
||||
lba += ((min >> 4) * 10 + (min & 0x0F)) * 75 * 60;
|
||||
lba += ((sec >> 4) * 10 + (sec & 0x0F)) * 75;
|
||||
lba += (frame >> 4) * 10 + (frame & 0x0F);
|
||||
lba += (((min >> 4) * 10) + (min & 0x0F)) * 75 * 60;
|
||||
lba += (((sec >> 4) * 10) + (sec & 0x0F)) * 75;
|
||||
lba += ((frame >> 4) * 10) + (frame & 0x0F);
|
||||
lba -= 150;
|
||||
|
||||
if(moreThan90)
|
||||
@@ -381,13 +381,13 @@ public static class Sector
|
||||
|
||||
CdChecksums.CheckCdSector(buffer, out bool? correctEccP, out bool? correctEccQ, out bool? correctEdc);
|
||||
|
||||
var empty = true;
|
||||
bool empty = true;
|
||||
|
||||
switch(buffer[15] & 0x03)
|
||||
{
|
||||
case 0:
|
||||
|
||||
for(var i = 16; i < 2352; i++)
|
||||
for(int i = 16; i < 2352; i++)
|
||||
if(buffer[i] != 0x00)
|
||||
{
|
||||
empty = false;
|
||||
@@ -403,7 +403,7 @@ public static class Sector
|
||||
sb.AppendLine(correctEccP == true ? "Correct ECC P." : "Incorrect ECC P.");
|
||||
sb.AppendLine(correctEccQ == true ? "Correct ECC Q." : "Incorrect ECC Q.");
|
||||
|
||||
for(var i = 2068; i < 2076; i++)
|
||||
for(int i = 2068; i < 2076; i++)
|
||||
if(buffer[i] != 0x00)
|
||||
{
|
||||
empty = false;
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
public class SectorBuilder
|
||||
{
|
||||
readonly byte[] _eccBTable;
|
||||
@@ -46,7 +46,7 @@ public class SectorBuilder
|
||||
for(uint i = 0; i < 256; i++)
|
||||
{
|
||||
uint edc = i;
|
||||
var j = (uint)((i << 1) ^ ((i & 0x80) == 0x80 ? 0x11D : 0));
|
||||
uint j = (uint)((i << 1) ^ ((i & 0x80) == 0x80 ? 0x11D : 0));
|
||||
_eccFTable[i] = (byte)j;
|
||||
_eccBTable[i ^ j] = (byte)i;
|
||||
|
||||
@@ -81,9 +81,9 @@ public class SectorBuilder
|
||||
|
||||
(byte minute, byte second, byte frame) msf = LbaToMsf(lba);
|
||||
|
||||
sector[0x00C] = (byte)(((msf.minute / 10) << 4) + msf.minute % 10);
|
||||
sector[0x00D] = (byte)(((msf.second / 10) << 4) + msf.second % 10);
|
||||
sector[0x00E] = (byte)(((msf.frame / 10) << 4) + msf.frame % 10);
|
||||
sector[0x00C] = (byte)(((msf.minute / 10) << 4) + (msf.minute % 10));
|
||||
sector[0x00D] = (byte)(((msf.second / 10) << 4) + (msf.second % 10));
|
||||
sector[0x00E] = (byte)(((msf.frame / 10) << 4) + (msf.frame % 10));
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@@ -162,7 +162,7 @@ public class SectorBuilder
|
||||
default: return;
|
||||
}
|
||||
|
||||
var zeroaddress = new byte[4];
|
||||
byte[] zeroaddress = new byte[4];
|
||||
|
||||
switch(type)
|
||||
{
|
||||
@@ -210,7 +210,7 @@ public class SectorBuilder
|
||||
|
||||
for(major = 0; major < majorCount; major++)
|
||||
{
|
||||
uint idx = (major >> 1) * majorMult + (major & 1);
|
||||
uint idx = ((major >> 1) * majorMult) + (major & 1);
|
||||
byte eccA = 0;
|
||||
byte eccB = 0;
|
||||
uint minor;
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -76,16 +76,16 @@ public static class Session
|
||||
return null;
|
||||
}
|
||||
|
||||
for(var i = 0; i < (decoded.DataLength - 2) / 8; i++)
|
||||
for(int i = 0; i < (decoded.DataLength - 2) / 8; i++)
|
||||
{
|
||||
decoded.TrackDescriptors[i].Reserved1 = CDSessionInfoResponse[0 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDSessionInfoResponse[1 + i * 8 + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].CONTROL = (byte)(CDSessionInfoResponse[1 + i * 8 + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].TrackNumber = CDSessionInfoResponse[2 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].Reserved2 = CDSessionInfoResponse[3 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].Reserved1 = CDSessionInfoResponse[0 + (i * 8) + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDSessionInfoResponse[1 + (i * 8) + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].CONTROL = (byte)(CDSessionInfoResponse[1 + (i * 8) + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].TrackNumber = CDSessionInfoResponse[2 + (i * 8) + 4];
|
||||
decoded.TrackDescriptors[i].Reserved2 = CDSessionInfoResponse[3 + (i * 8) + 4];
|
||||
|
||||
decoded.TrackDescriptors[i].TrackStartAddress =
|
||||
BigEndianBitConverter.ToUInt32(CDSessionInfoResponse, 4 + i * 8 + 4);
|
||||
BigEndianBitConverter.ToUInt32(CDSessionInfoResponse, 4 + (i * 8) + 4);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
137
CD/Subchannel.cs
137
CD/Subchannel.cs
@@ -26,11 +26,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System;
|
||||
using Aaru.Checksums;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
public static class Subchannel
|
||||
{
|
||||
static readonly string[] _isrcTable =
|
||||
@@ -53,17 +53,17 @@ public static class Subchannel
|
||||
if((q[0] & 0xF) == 1 ||
|
||||
(q[0] & 0xF) == 5)
|
||||
{
|
||||
q[1] = (byte)(((q[1] / 10) << 4) + q[1] % 10);
|
||||
q[2] = (byte)(((q[2] / 10) << 4) + q[2] % 10);
|
||||
q[3] = (byte)(((q[3] / 10) << 4) + q[3] % 10);
|
||||
q[4] = (byte)(((q[4] / 10) << 4) + q[4] % 10);
|
||||
q[5] = (byte)(((q[5] / 10) << 4) + q[5] % 10);
|
||||
q[6] = (byte)(((q[6] / 10) << 4) + q[6] % 10);
|
||||
q[7] = (byte)(((q[7] / 10) << 4) + q[7] % 10);
|
||||
q[8] = (byte)(((q[8] / 10) << 4) + q[8] % 10);
|
||||
q[1] = (byte)(((q[1] / 10) << 4) + (q[1] % 10));
|
||||
q[2] = (byte)(((q[2] / 10) << 4) + (q[2] % 10));
|
||||
q[3] = (byte)(((q[3] / 10) << 4) + (q[3] % 10));
|
||||
q[4] = (byte)(((q[4] / 10) << 4) + (q[4] % 10));
|
||||
q[5] = (byte)(((q[5] / 10) << 4) + (q[5] % 10));
|
||||
q[6] = (byte)(((q[6] / 10) << 4) + (q[6] % 10));
|
||||
q[7] = (byte)(((q[7] / 10) << 4) + (q[7] % 10));
|
||||
q[8] = (byte)(((q[8] / 10) << 4) + (q[8] % 10));
|
||||
}
|
||||
|
||||
q[9] = (byte)(((q[9] / 10) << 4) + q[9] % 10);
|
||||
q[9] = (byte)(((q[9] / 10) << 4) + (q[9] % 10));
|
||||
}
|
||||
|
||||
public static void BcdToBinaryQ(byte[] q)
|
||||
@@ -71,25 +71,25 @@ public static class Subchannel
|
||||
if((q[0] & 0xF) == 1 ||
|
||||
(q[0] & 0xF) == 5)
|
||||
{
|
||||
q[1] = (byte)(q[1] / 16 * 10 + (q[1] & 0x0F));
|
||||
q[2] = (byte)(q[2] / 16 * 10 + (q[2] & 0x0F));
|
||||
q[3] = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
|
||||
q[4] = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
|
||||
q[5] = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
|
||||
q[6] = (byte)(q[6] / 16 * 10 + (q[6] & 0x0F));
|
||||
q[7] = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
||||
q[8] = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
||||
q[1] = (byte)((q[1] / 16 * 10) + (q[1] & 0x0F));
|
||||
q[2] = (byte)((q[2] / 16 * 10) + (q[2] & 0x0F));
|
||||
q[3] = (byte)((q[3] / 16 * 10) + (q[3] & 0x0F));
|
||||
q[4] = (byte)((q[4] / 16 * 10) + (q[4] & 0x0F));
|
||||
q[5] = (byte)((q[5] / 16 * 10) + (q[5] & 0x0F));
|
||||
q[6] = (byte)((q[6] / 16 * 10) + (q[6] & 0x0F));
|
||||
q[7] = (byte)((q[7] / 16 * 10) + (q[7] & 0x0F));
|
||||
q[8] = (byte)((q[8] / 16 * 10) + (q[8] & 0x0F));
|
||||
}
|
||||
|
||||
q[9] = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
||||
q[9] = (byte)((q[9] / 16 * 10) + (q[9] & 0x0F));
|
||||
}
|
||||
|
||||
public static byte[] ConvertQToRaw(byte[] subchannel)
|
||||
{
|
||||
var pos = 0;
|
||||
var subBuf = new byte[subchannel.Length * 6];
|
||||
int pos = 0;
|
||||
byte[] subBuf = new byte[subchannel.Length * 6];
|
||||
|
||||
for(var i = 0; i < subchannel.Length; i += 16)
|
||||
for(int i = 0; i < subchannel.Length; i += 16)
|
||||
{
|
||||
// P
|
||||
if((subchannel[i + 15] & 0x80) <= 0)
|
||||
@@ -133,13 +133,13 @@ public static class Subchannel
|
||||
|
||||
public static byte[] Interleave(byte[] subchannel)
|
||||
{
|
||||
var subBuf = new byte[subchannel.Length];
|
||||
byte[] subBuf = new byte[subchannel.Length];
|
||||
|
||||
var outPos = 0;
|
||||
int outPos = 0;
|
||||
|
||||
for(var inPos = 0; inPos < subchannel.Length; inPos += 96)
|
||||
for(int inPos = 0; inPos < subchannel.Length; inPos += 96)
|
||||
{
|
||||
for(var i = 0; i < 12; i++)
|
||||
for(int i = 0; i < 12; i++)
|
||||
{
|
||||
// P
|
||||
subBuf[outPos + 0] += (byte)(subchannel[inPos + i + 0] & 0x80);
|
||||
@@ -229,12 +229,12 @@ public static class Subchannel
|
||||
|
||||
public static byte[] Deinterleave(byte[] subchannel)
|
||||
{
|
||||
var subBuf = new byte[subchannel.Length];
|
||||
var inPos = 0;
|
||||
byte[] subBuf = new byte[subchannel.Length];
|
||||
int inPos = 0;
|
||||
|
||||
for(var outPos = 0; outPos < subchannel.Length; outPos += 96)
|
||||
for(int outPos = 0; outPos < subchannel.Length; outPos += 96)
|
||||
{
|
||||
for(var i = 0; i < 12; i++)
|
||||
for(int i = 0; i < 12; i++)
|
||||
{
|
||||
// P
|
||||
subBuf[outPos + i + 0] += (byte)((subchannel[inPos + 0] & 0x80) >> 0);
|
||||
@@ -348,14 +348,14 @@ public static class Subchannel
|
||||
if(bcd)
|
||||
BcdToBinaryQ(subBuf);
|
||||
|
||||
int qPos = subBuf[3] * 60 * 75 + subBuf[4] * 75 + subBuf[5] - 150;
|
||||
int qPos = (subBuf[3] * 60 * 75) + (subBuf[4] * 75) + subBuf[5] - 150;
|
||||
byte pmin = subBuf[7];
|
||||
byte psec = subBuf[8];
|
||||
|
||||
int qStart = subBuf[7] * 60 * 75 + subBuf[8] * 75 + subBuf[9] - 150;
|
||||
int nextPos = subBuf[3] * 60 * 75 + subBuf[4] * 75 + subBuf[5] - 150;
|
||||
int qStart = (subBuf[7] * 60 * 75) + (subBuf[8] * 75) + subBuf[9] - 150;
|
||||
int nextPos = (subBuf[3] * 60 * 75) + (subBuf[4] * 75) + subBuf[5] - 150;
|
||||
byte zero = subBuf[6];
|
||||
int maxOut = subBuf[7] * 60 * 75 + subBuf[8] * 75 + subBuf[9] - 150;
|
||||
int maxOut = (subBuf[7] * 60 * 75) + (subBuf[8] * 75) + subBuf[9] - 150;
|
||||
bool final = subBuf[3] == 0xFF && subBuf[4] == 0xFF && subBuf[5] == 0xFF;
|
||||
|
||||
BinaryToBcdQ(subBuf);
|
||||
@@ -551,42 +551,39 @@ public static class Subchannel
|
||||
? "corrupted pause"
|
||||
: pause
|
||||
? "pause"
|
||||
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} position: track {
|
||||
subBuf[1]:X} index {subBuf[2]:X} relative position {subBuf[3]:X2}:{subBuf[4]
|
||||
:X2}:{subBuf[5]:X2} (LBA {qPos + 150}), absolute position {subBuf[7]
|
||||
:X2}:{subBuf[8]:X2}:{subBuf[9]:X2} (LBA {qStart}), Q CRC 0x{subBuf[10]
|
||||
:X2}{subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")}), R-W {
|
||||
(rwEmpty ? "empty" : "not empty")}",
|
||||
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} position: track {subBuf[1]
|
||||
:X} index {subBuf[2]:X} relative position {subBuf[3]:X2}:{subBuf[4]:X2}:{subBuf[5]
|
||||
:X2} (LBA {qPos + 150}), absolute position {subBuf[7]:X2}:{subBuf[8]:X2}:{subBuf[9]
|
||||
:X2} (LBA {qStart}), Q CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")
|
||||
}), R-W {(rwEmpty ? "empty" : "not empty")}",
|
||||
2 => $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
|
||||
? "corrupted pause"
|
||||
: pause
|
||||
? "pause"
|
||||
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} MCN: {DecodeMcn(subBuf)
|
||||
} frame {subBuf[9]:X2} CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({
|
||||
(crcOk ? "OK" : "BAD")}), R-W {(rwEmpty ? "empty" : "not empty")}",
|
||||
} frame {subBuf[9]:X2} CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")
|
||||
}), R-W {(rwEmpty ? "empty" : "not empty")}",
|
||||
3 => $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
|
||||
? "corrupted pause"
|
||||
: pause
|
||||
? "pause"
|
||||
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} ISRC: {
|
||||
DecodeIsrc(subBuf)} frame {subBuf[9]:X2} CRC 0x{subBuf[10]:X2}{subBuf[11]
|
||||
:X2} ({(crcOk ? "OK" : "BAD")}), R-W {(rwEmpty ? "empty" : "not empty")
|
||||
}",
|
||||
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} ISRC: {DecodeIsrc(subBuf)
|
||||
} frame {subBuf[9]:X2} CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")
|
||||
}), R-W {(rwEmpty ? "empty" : "not empty")}",
|
||||
_ => $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
|
||||
? "corrupted pause"
|
||||
: pause
|
||||
? "pause"
|
||||
: "not pause")}, {controlInfo}, {copy}, Q: {subBuf[0]:X2} {subBuf[1]:X2} {
|
||||
subBuf[2]:X2} {subBuf[3]:X2} {subBuf[4]:X2} {subBuf[5]:X2} {subBuf[6]:X2} {
|
||||
subBuf[7]:X2} {subBuf[8]:X2} {subBuf[9]:X2} CRC 0x{subBuf[10]:X2}{
|
||||
subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")}), R-W {
|
||||
(rwEmpty ? "empty" : "not empty")}"
|
||||
: "not pause")}, {controlInfo}, {copy}, Q: {subBuf[0]:X2} {subBuf[1]:X2} {subBuf[2]
|
||||
:X2} {subBuf[3]:X2} {subBuf[4]:X2} {subBuf[5]:X2} {subBuf[6]:X2} {subBuf[7]:X2} {
|
||||
subBuf[8]:X2} {subBuf[9]:X2} CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({
|
||||
(crcOk ? "OK" : "BAD")}), R-W {(rwEmpty ? "empty" : "not empty")}"
|
||||
};
|
||||
}
|
||||
|
||||
public static string DecodeIsrc(byte[] q) => $"{_isrcTable[q[1] / 4]}{_isrcTable[(q[1] & 3) * 16 + q[2] / 16]}{
|
||||
_isrcTable[(q[2] & 0xF) * 4 + q[3] / 64]}{_isrcTable[q[3] & 0x3F]}{_isrcTable[q[4] / 4]}{q[5]:X2}{q[6]:X2}{q[7]
|
||||
:X2}{q[8] / 16:X1}";
|
||||
public static string DecodeIsrc(byte[] q) => $"{_isrcTable[q[1] / 4]}{_isrcTable[((q[1] & 3) * 16) + (q[2] / 16)]}{
|
||||
_isrcTable[((q[2] & 0xF) * 4) + (q[3] / 64)]}{_isrcTable[q[3] & 0x3F]}{_isrcTable[q[4] / 4]}{q[5]:X2}{q[6]:X2}{
|
||||
q[7]:X2}{q[8] / 16:X1}";
|
||||
|
||||
public static string DecodeMcn(byte[] q) => $"{q[1]:X2}{q[2]:X2}{q[3]:X2}{q[4]:X2}{q[5]:X2}{q[6]:X2}{q[7] >> 4:X}";
|
||||
|
||||
@@ -638,7 +635,7 @@ public static class Subchannel
|
||||
if(index == 0)
|
||||
index = (byte)(isPregap ? 0 : 1);
|
||||
|
||||
var sub = new byte[96];
|
||||
byte[] sub = new byte[96];
|
||||
|
||||
// P
|
||||
if(isPregap)
|
||||
@@ -658,7 +655,7 @@ public static class Subchannel
|
||||
}
|
||||
|
||||
// Q
|
||||
var q = new byte[12];
|
||||
byte[] q = new byte[12];
|
||||
|
||||
q[0] = (byte)((flags << 4) + 1);
|
||||
q[1] = (byte)trackSequence;
|
||||
@@ -674,12 +671,12 @@ public static class Subchannel
|
||||
sector += 150;
|
||||
|
||||
int min = relative / 60 / 75;
|
||||
int sec = relative / 75 - min * 60;
|
||||
int frame = relative - min * 60 * 75 - sec * 75;
|
||||
int sec = (relative / 75) - (min * 60);
|
||||
int frame = relative - (min * 60 * 75) - (sec * 75);
|
||||
|
||||
int amin = sector / 60 / 75;
|
||||
int asec = sector / 75 - amin * 60;
|
||||
int aframe = sector - amin * 60 * 75 - asec * 75;
|
||||
int asec = (sector / 75) - (amin * 60);
|
||||
int aframe = sector - (amin * 60 * 75) - (asec * 75);
|
||||
|
||||
q[3] = (byte)min;
|
||||
q[4] = (byte)sec;
|
||||
@@ -689,16 +686,16 @@ public static class Subchannel
|
||||
q[8] = (byte)asec;
|
||||
q[9] = (byte)aframe;
|
||||
|
||||
q[1] = (byte)(((q[1] / 10) << 4) + q[1] % 10);
|
||||
q[2] = (byte)(((q[2] / 10) << 4) + q[2] % 10);
|
||||
q[3] = (byte)(((q[3] / 10) << 4) + q[3] % 10);
|
||||
q[4] = (byte)(((q[4] / 10) << 4) + q[4] % 10);
|
||||
q[5] = (byte)(((q[5] / 10) << 4) + q[5] % 10);
|
||||
q[6] = (byte)(((q[6] / 10) << 4) + q[6] % 10);
|
||||
q[7] = (byte)(((q[7] / 10) << 4) + q[7] % 10);
|
||||
q[8] = (byte)(((q[8] / 10) << 4) + q[8] % 10);
|
||||
q[1] = (byte)(((q[1] / 10) << 4) + (q[1] % 10));
|
||||
q[2] = (byte)(((q[2] / 10) << 4) + (q[2] % 10));
|
||||
q[3] = (byte)(((q[3] / 10) << 4) + (q[3] % 10));
|
||||
q[4] = (byte)(((q[4] / 10) << 4) + (q[4] % 10));
|
||||
q[5] = (byte)(((q[5] / 10) << 4) + (q[5] % 10));
|
||||
q[6] = (byte)(((q[6] / 10) << 4) + (q[6] % 10));
|
||||
q[7] = (byte)(((q[7] / 10) << 4) + (q[7] % 10));
|
||||
q[8] = (byte)(((q[8] / 10) << 4) + (q[8] % 10));
|
||||
|
||||
q[9] = (byte)(((q[9] / 10) << 4) + q[9] % 10);
|
||||
q[9] = (byte)(((q[9] / 10) << 4) + (q[9] % 10));
|
||||
|
||||
CRC16CCITTContext.Data(q, 10, out byte[] qCrc);
|
||||
q[10] = qCrc[0];
|
||||
|
||||
18
CD/TOC.cs
18
CD/TOC.cs
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.CD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -79,16 +79,16 @@ public static class TOC
|
||||
return null;
|
||||
}
|
||||
|
||||
for(var i = 0; i < (decoded.DataLength - 2) / 8; i++)
|
||||
for(int i = 0; i < (decoded.DataLength - 2) / 8; i++)
|
||||
{
|
||||
decoded.TrackDescriptors[i].Reserved1 = CDTOCResponse[0 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDTOCResponse[1 + i * 8 + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].CONTROL = (byte)(CDTOCResponse[1 + i * 8 + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].TrackNumber = CDTOCResponse[2 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].Reserved2 = CDTOCResponse[3 + i * 8 + 4];
|
||||
decoded.TrackDescriptors[i].Reserved1 = CDTOCResponse[0 + (i * 8) + 4];
|
||||
decoded.TrackDescriptors[i].ADR = (byte)((CDTOCResponse[1 + (i * 8) + 4] & 0xF0) >> 4);
|
||||
decoded.TrackDescriptors[i].CONTROL = (byte)(CDTOCResponse[1 + (i * 8) + 4] & 0x0F);
|
||||
decoded.TrackDescriptors[i].TrackNumber = CDTOCResponse[2 + (i * 8) + 4];
|
||||
decoded.TrackDescriptors[i].Reserved2 = CDTOCResponse[3 + (i * 8) + 4];
|
||||
|
||||
decoded.TrackDescriptors[i].TrackStartAddress =
|
||||
BigEndianBitConverter.ToUInt32(CDTOCResponse, 4 + i * 8 + 4);
|
||||
BigEndianBitConverter.ToUInt32(CDTOCResponse, 4 + (i * 8) + 4);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
// Copyright © 2020-2022 Rebecca Wallander
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -360,9 +360,7 @@ public static class CSS_CPRM
|
||||
|
||||
enum TypeCode
|
||||
{
|
||||
None = 0,
|
||||
Set = 1,
|
||||
LastChance = 2,
|
||||
None = 0, Set = 1, LastChance = 2,
|
||||
Perm = 3
|
||||
}
|
||||
}
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
16
DVD/DDS.cs
16
DVD/DDS.cs
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -91,7 +91,7 @@ public static class DDS
|
||||
Array.Copy(response, 14, dds.Reserved, 0, 6);
|
||||
dds.GroupCertificationFlags = new GroupCertificationFlag[24];
|
||||
|
||||
for(var i = 0; i < 24; i++)
|
||||
for(int i = 0; i < 24; i++)
|
||||
{
|
||||
dds.GroupCertificationFlags[i].InProcess |= (response[20 + i] & 0x80) == 0x80;
|
||||
dds.GroupCertificationFlags[i].PartialCertification |= (response[20 + i] & 0x40) == 0x40;
|
||||
@@ -115,9 +115,9 @@ public static class DDS
|
||||
dds.LSN0Location = (uint)((response[93] << 16) + (response[94] << 8) + response[95]);
|
||||
dds.StartLSNForZone = new uint[dds.Zones];
|
||||
|
||||
for(var i = 0; i < dds.Zones; i++)
|
||||
dds.StartLSNForZone[i] = (uint)((response[260 + i * 4 + 1] << 16) + (response[260 + i * 4 + 2] << 8) +
|
||||
response[260 + i * 4 + 3]);
|
||||
for(int i = 0; i < dds.Zones; i++)
|
||||
dds.StartLSNForZone[i] = (uint)((response[260 + (i * 4) + 1] << 16) +
|
||||
(response[260 + (i * 4) + 2] << 8) + response[260 + (i * 4) + 3]);
|
||||
}
|
||||
|
||||
return dds;
|
||||
@@ -154,7 +154,7 @@ public static class DDS
|
||||
sb.AppendFormat("DDS has been updated {0} times", decoded.UpdateCount).AppendLine();
|
||||
|
||||
if(decoded.Groups == 24)
|
||||
for(var i = 0; i < decoded.GroupCertificationFlags.Length; i++)
|
||||
for(int i = 0; i < decoded.GroupCertificationFlags.Length; i++)
|
||||
{
|
||||
if(decoded.GroupCertificationFlags[i].InProcess)
|
||||
{
|
||||
@@ -179,7 +179,7 @@ public static class DDS
|
||||
|
||||
sb.AppendFormat("LSN 0 is at PSN {0:X}h", decoded.LSN0Location).AppendLine();
|
||||
|
||||
for(var i = 0; i < decoded.StartLSNForZone.Length; i++)
|
||||
for(int i = 0; i < decoded.StartLSNForZone.Length; i++)
|
||||
sb.AppendFormat("Zone {0} starts at LSN {1}", i, decoded.StartLSNForZone[i]).AppendLine();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
23
DVD/Enums.cs
23
DVD/Enums.cs
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
#region Public enumerations
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum DiskCategory : byte
|
||||
@@ -86,9 +86,7 @@ public enum MaximumRateField : byte
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum LayerTypeFieldMask : byte
|
||||
{
|
||||
Embossed = 0x01,
|
||||
Recordable = 0x02,
|
||||
Rewritable = 0x04,
|
||||
Embossed = 0x01, Recordable = 0x02, Rewritable = 0x04,
|
||||
Reserved = 0x08
|
||||
}
|
||||
|
||||
@@ -145,8 +143,7 @@ public enum WPDiscTypes : byte
|
||||
/// <summary>Should not write without a cartridge</summary>
|
||||
DoNotWrite = 0x00,
|
||||
/// <summary>Can write without a cartridge</summary>
|
||||
CanWrite = 0x01, Reserved1 = 0x02,
|
||||
Reserved2 = 0x03
|
||||
CanWrite = 0x01, Reserved1 = 0x02, Reserved2 = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
@@ -170,21 +167,15 @@ public enum DVDRAMDiscType
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum DVDLayerStructure
|
||||
{
|
||||
Unspecified = 0,
|
||||
InvertedStack = 1,
|
||||
TwoP = 2,
|
||||
Unspecified = 0, InvertedStack = 1, TwoP = 2,
|
||||
Reserved = 3
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum DVDRecordingSpeed
|
||||
{
|
||||
None = 0,
|
||||
Two = 0,
|
||||
Four = 0x10,
|
||||
Six = 0x20,
|
||||
Eight = 0x30,
|
||||
Ten = 0x40,
|
||||
None = 0, Two = 0, Four = 0x10,
|
||||
Six = 0x20, Eight = 0x30, Ten = 0x40,
|
||||
Twelve = 0x50
|
||||
}
|
||||
#endregion
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
14
DVD/PFI.cs
14
DVD/PFI.cs
@@ -30,14 +30,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -78,7 +78,7 @@ public static class PFI
|
||||
|
||||
if(response.Length == 2048)
|
||||
{
|
||||
var tmp2 = new byte[2052];
|
||||
byte[] tmp2 = new byte[2052];
|
||||
Array.Copy(response, 0, tmp2, 4, 2048);
|
||||
response = tmp2;
|
||||
}
|
||||
@@ -855,8 +855,7 @@ public static class PFI
|
||||
sb.AppendFormat("Data area starts at PSN {0:X}h", decoded.DataAreaStartPSN).AppendLine();
|
||||
sb.AppendFormat("Data area ends at PSN {0:X}h", decoded.DataAreaEndPSN).AppendLine();
|
||||
|
||||
if(decoded.Layers == 1 &&
|
||||
!decoded.TrackPath)
|
||||
if(decoded is { Layers: 1, TrackPath: false })
|
||||
sb.AppendFormat("Layer 0 ends at PSN {0:X}h", decoded.Layer0EndPSN).AppendLine();
|
||||
}
|
||||
else
|
||||
@@ -951,14 +950,13 @@ public static class PFI
|
||||
|
||||
public static string ManufacturerFromDVDRAM(string manufacturerId) => manufacturerId switch
|
||||
{
|
||||
_ =>
|
||||
ManufacturerFromDVDPlusID(manufacturerId)
|
||||
_ => ManufacturerFromDVDPlusID(manufacturerId)
|
||||
};
|
||||
|
||||
[SuppressMessage("ReSharper", "StringLiteralTypo")]
|
||||
public static string ManufacturerFromDVDPlusID(string manufacturerId)
|
||||
{
|
||||
var manufacturer = "";
|
||||
string manufacturer = "";
|
||||
|
||||
switch(manufacturerId)
|
||||
{
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -108,7 +108,7 @@ public static class PRI
|
||||
Array.Copy(response, 37, pri.ManufacturerId3, 0, 6);
|
||||
Array.Copy(response, 44, pri.Reserved8, 0, pri.Reserved8.Length);
|
||||
|
||||
var tmp = new byte[18];
|
||||
byte[] tmp = new byte[18];
|
||||
|
||||
Array.Copy(response, 21, tmp, 0, 6);
|
||||
Array.Copy(response, 29, tmp, 6, 6);
|
||||
@@ -298,7 +298,7 @@ public static class PRI
|
||||
[SuppressMessage("ReSharper", "StringLiteralTypo")]
|
||||
public static string ManufacturerFromPrePit(string manufacturerId)
|
||||
{
|
||||
var manufacturer = "";
|
||||
string manufacturer = "";
|
||||
|
||||
// Bad thing is that it also includes a media code...
|
||||
if(manufacturerId.StartsWith("RITEK", StringComparison.Ordinal))
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.DVD;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
/// <summary>Methods and structures for Commodore Amiga decoding</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -40,6 +38,8 @@ using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
/// <summary>Methods and structures for Apple ][ floppy decoding</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
@@ -154,29 +154,29 @@ public static class Apple2
|
||||
if(data is not { Length: 410 })
|
||||
return null;
|
||||
|
||||
var buffer = new byte[data.Length];
|
||||
byte[] buffer = new byte[data.Length];
|
||||
byte carry = 0;
|
||||
|
||||
for(var i = 0; i < data.Length; i++)
|
||||
for(int i = 0; i < data.Length; i++)
|
||||
{
|
||||
carry ^= ReadTable5and3[data[i]];
|
||||
buffer[i] = carry;
|
||||
}
|
||||
|
||||
var output = new byte[256];
|
||||
byte[] output = new byte[256];
|
||||
|
||||
for(var i = 0; i < 51; i++)
|
||||
for(int i = 0; i < 51; i++)
|
||||
{
|
||||
byte b1 = buffer[51 * 3 - i];
|
||||
byte b2 = buffer[51 * 2 - i];
|
||||
byte b1 = buffer[(51 * 3) - i];
|
||||
byte b2 = buffer[(51 * 2) - i];
|
||||
byte b3 = buffer[51 - i];
|
||||
var b4 = (byte)((((b1 & 2) << 1) | (b2 & 2) | ((b3 & 2) >> 1)) & 0xFF);
|
||||
var 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);
|
||||
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[255] = (byte)(((buffer[409] << 3) | (buffer[0] & 0x7)) & 0xFF);
|
||||
@@ -191,16 +191,16 @@ public static class Apple2
|
||||
if(data is not { Length: 342 })
|
||||
return null;
|
||||
|
||||
var buffer = new byte[data.Length];
|
||||
byte[] buffer = new byte[data.Length];
|
||||
byte carry = 0;
|
||||
|
||||
for(var i = 0; i < data.Length; i++)
|
||||
for(int i = 0; i < data.Length; i++)
|
||||
{
|
||||
carry ^= ReadTable6and2[data[i]];
|
||||
buffer[i] = carry;
|
||||
}
|
||||
|
||||
var output = new byte[256];
|
||||
byte[] output = new byte[256];
|
||||
|
||||
for(uint i = 0; i < 256; i++)
|
||||
{
|
||||
@@ -219,8 +219,8 @@ public static class Apple2
|
||||
|
||||
break;
|
||||
default:
|
||||
output[i] |= (byte)(((buffer[i - 86 * 2] & 0x10) >> 3) & 0xFF);
|
||||
output[i] |= (byte)(((buffer[i - 86 * 2] & 0x20) >> 5) & 0xFF);
|
||||
output[i] |= (byte)(((buffer[i - (86 * 2)] & 0x10) >> 3) & 0xFF);
|
||||
output[i] |= (byte)(((buffer[i - (86 * 2)] & 0x20) >> 5) & 0xFF);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -327,8 +327,8 @@ public static class Apple2
|
||||
sector.addressField.epilogue[2]);
|
||||
|
||||
position += 14;
|
||||
var syncCount = 0;
|
||||
var onSync = false;
|
||||
int syncCount = 0;
|
||||
bool onSync = false;
|
||||
var gaps = new MemoryStream();
|
||||
|
||||
while(data[position] == 0xFF)
|
||||
@@ -473,12 +473,12 @@ public static class Apple2
|
||||
public static RawTrack MarshalTrack(byte[] data, out int endOffset, int offset = 0)
|
||||
{
|
||||
int position = offset;
|
||||
var firstSector = true;
|
||||
var onSync = false;
|
||||
bool firstSector = true;
|
||||
bool onSync = false;
|
||||
var gaps = new MemoryStream();
|
||||
var count = 0;
|
||||
var sectors = new List<RawSector>();
|
||||
var trackNumber = new byte[2];
|
||||
int count = 0;
|
||||
List<RawSector> sectors = new();
|
||||
byte[] trackNumber = new byte[2];
|
||||
endOffset = offset;
|
||||
|
||||
while(position < data.Length &&
|
||||
@@ -561,7 +561,7 @@ public static class Apple2
|
||||
public static List<RawTrack> MarshalDisk(byte[] data, out int endOffset, int offset = 0)
|
||||
{
|
||||
endOffset = offset;
|
||||
var tracks = new List<RawTrack>();
|
||||
List<RawTrack> tracks = new();
|
||||
int position = offset;
|
||||
|
||||
RawTrack track = MarshalTrack(data, out position, position);
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -39,6 +37,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
// Information from:
|
||||
// Inside Macintosh, Volume II, ISBN 0-201-17732-3
|
||||
|
||||
@@ -54,16 +54,16 @@ public static class AppleSony
|
||||
sector.addressField.prologue[2] != 0x96)
|
||||
return null;
|
||||
|
||||
var bf1 = new byte[175];
|
||||
var bf2 = new byte[175];
|
||||
var bf3 = new byte[175];
|
||||
byte[] bf1 = new byte[175];
|
||||
byte[] bf2 = new byte[175];
|
||||
byte[] bf3 = new byte[175];
|
||||
byte[] nib_data = sector.dataField.data;
|
||||
var ms = new MemoryStream();
|
||||
|
||||
var j = 0;
|
||||
int j = 0;
|
||||
byte w3 = 0;
|
||||
|
||||
for(var i = 0; i <= 174; i++)
|
||||
for(int i = 0; i <= 174; i++)
|
||||
{
|
||||
byte w4 = nib_data[j++];
|
||||
byte w1 = nib_data[j++];
|
||||
@@ -89,7 +89,7 @@ public static class AppleSony
|
||||
if((ck1 & 0x0100) > 0)
|
||||
ck1++;
|
||||
|
||||
var carry = (byte)((bf1[j] ^ ck1) & 0xFF);
|
||||
byte carry = (byte)((bf1[j] ^ ck1) & 0xFF);
|
||||
ck3 += carry;
|
||||
|
||||
if((ck1 & 0x0100) > 0)
|
||||
@@ -180,8 +180,8 @@ public static class AppleSony
|
||||
};
|
||||
|
||||
position += 10;
|
||||
var syncCount = 0;
|
||||
var onSync = false;
|
||||
int syncCount = 0;
|
||||
bool onSync = false;
|
||||
var gaps = new MemoryStream();
|
||||
|
||||
while(data[position] == 0xFF)
|
||||
@@ -325,11 +325,11 @@ public static class AppleSony
|
||||
public static RawTrack MarshalTrack(byte[] data, out int endOffset, int offset = 0)
|
||||
{
|
||||
int position = offset;
|
||||
var firstSector = true;
|
||||
var onSync = false;
|
||||
bool firstSector = true;
|
||||
bool onSync = false;
|
||||
var gaps = new MemoryStream();
|
||||
var count = 0;
|
||||
var sectors = new List<RawSector>();
|
||||
int count = 0;
|
||||
List<RawSector> sectors = new();
|
||||
byte trackNumber = 0;
|
||||
byte sideNumber = 0;
|
||||
endOffset = offset;
|
||||
@@ -408,7 +408,7 @@ public static class AppleSony
|
||||
public static List<RawTrack> MarshalDisk(byte[] data, out int endOffset, int offset = 0)
|
||||
{
|
||||
endOffset = offset;
|
||||
var tracks = new List<RawTrack>();
|
||||
List<RawTrack> tracks = new();
|
||||
int position = offset;
|
||||
|
||||
RawTrack track = MarshalTrack(data, out position, position);
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
/// <summary>Methods and structures for Commodore GCR floppy decoding</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
/// <summary>In-sector code for sector size</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum IBMSectorSizeCode : byte
|
||||
@@ -59,9 +59,7 @@ public enum IBMSectorSizeCode : byte
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum IBMIdType : byte
|
||||
{
|
||||
IndexMark = 0xFC,
|
||||
AddressMark = 0xFE,
|
||||
DataMark = 0xFB,
|
||||
IndexMark = 0xFC, AddressMark = 0xFE, DataMark = 0xFB,
|
||||
DeletedDataMark = 0xF8
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
// Information from:
|
||||
// National Semiconductor PC87332VLJ datasheet
|
||||
// SMsC FDC37C78 datasheet
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
// Information from:
|
||||
// National Semiconductor PC87332VLJ datasheet
|
||||
// SMsC FDC37C78 datasheet
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
// Information from:
|
||||
// National Semiconductor PC87332VLJ datasheet
|
||||
// SMsC FDC37C78 datasheet
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Aaru.Decoders.Floppy;
|
||||
|
||||
// Information from:
|
||||
// National Semiconductor PC87332VLJ datasheet
|
||||
// SMsC FDC37C78 datasheet
|
||||
|
||||
14
LisaTag.cs
14
LisaTag.cs
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders;
|
||||
|
||||
/// <summary>Represents a Lisa Office 7/7 sector tag</summary>
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal"), SuppressMessage("ReSharper", "NotAccessedField.Global"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"),
|
||||
@@ -78,7 +78,7 @@ public static class LisaTag
|
||||
|
||||
var phTag = new ProfileTag();
|
||||
|
||||
var tmp = new byte[4];
|
||||
byte[] tmp = new byte[4];
|
||||
|
||||
phTag.Version = BigEndianBitConverter.ToUInt16(tag, 0);
|
||||
phTag.Kind = (byte)((tag[2] & 0xC0) >> 6);
|
||||
@@ -125,7 +125,7 @@ public static class LisaTag
|
||||
|
||||
var pmTag = new PriamTag();
|
||||
|
||||
var tmp = new byte[4];
|
||||
byte[] tmp = new byte[4];
|
||||
|
||||
pmTag.Version = BigEndianBitConverter.ToUInt16(tag, 0);
|
||||
pmTag.Kind = (byte)((tag[2] & 0xC0) >> 6);
|
||||
@@ -301,7 +301,7 @@ public static class LisaTag
|
||||
/// <summary>Gets a byte array representation of this tag</summary>
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
var tagBytes = new byte[20];
|
||||
byte[] tagBytes = new byte[20];
|
||||
|
||||
byte[] tmp = BigEndianBitConverter.GetBytes(Version);
|
||||
Array.Copy(tmp, 0, tagBytes, 0, 2);
|
||||
@@ -399,7 +399,7 @@ public static class LisaTag
|
||||
/// <summary>Gets a byte array representation of this tag</summary>
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
var tagBytes = new byte[24];
|
||||
byte[] tagBytes = new byte[24];
|
||||
|
||||
byte[] tmp = BigEndianBitConverter.GetBytes(Version);
|
||||
Array.Copy(tmp, 0, tagBytes, 0, 2);
|
||||
@@ -485,7 +485,7 @@ public static class LisaTag
|
||||
/// <summary>Gets a byte array representation of this tag</summary>
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
var tagBytes = new byte[12];
|
||||
byte[] tagBytes = new byte[12];
|
||||
|
||||
byte[] tmp = BigEndianBitConverter.GetBytes(Version);
|
||||
Array.Copy(tmp, 0, tagBytes, 0, 2);
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
public class CID
|
||||
@@ -60,7 +60,7 @@ public static partial class Decoders
|
||||
if(response?.Length != 4)
|
||||
return null;
|
||||
|
||||
var data = new byte[16];
|
||||
byte[] data = new byte[16];
|
||||
|
||||
byte[] tmp = BitConverter.GetBytes(response[0]);
|
||||
Array.Copy(tmp, 0, data, 0, 4);
|
||||
@@ -89,7 +89,7 @@ public static partial class Decoders
|
||||
CRC = (byte)((response[15] & 0xFE) >> 1)
|
||||
};
|
||||
|
||||
var tmp = new byte[6];
|
||||
byte[] tmp = new byte[6];
|
||||
Array.Copy(response, 3, tmp, 0, 6);
|
||||
cid.ProductName = StringHandlers.CToString(tmp);
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public class CSD
|
||||
@@ -84,7 +84,7 @@ public static partial class Decoders
|
||||
if(response?.Length != 4)
|
||||
return null;
|
||||
|
||||
var data = new byte[16];
|
||||
byte[] data = new byte[16];
|
||||
|
||||
byte[] tmp = BitConverter.GetBytes(response[0]);
|
||||
Array.Copy(tmp, 0, data, 0, 4);
|
||||
@@ -148,7 +148,7 @@ public static partial class Decoders
|
||||
|
||||
double unitFactor = 0;
|
||||
double multiplier = 0;
|
||||
var unit = "";
|
||||
string unit = "";
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("MultiMediaCard Device Specific Data Register:");
|
||||
|
||||
@@ -32,16 +32,15 @@
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "UnassignedField.Global"),
|
||||
StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal"), SuppressMessage("ReSharper", "MemberCanBePrivate.Global"),
|
||||
SuppressMessage("ReSharper", "UnassignedField.Global"), StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public class ExtendedCSD
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
|
||||
@@ -221,8 +220,7 @@ public enum DeviceSupportedCommandSets : byte
|
||||
[Flags]
|
||||
public enum HPIFeatures : byte
|
||||
{
|
||||
Supported = 1 << 0,
|
||||
CMD12 = 1 << 1
|
||||
Supported = 1 << 0, CMD12 = 1 << 1
|
||||
}
|
||||
|
||||
[Flags]
|
||||
@@ -240,15 +238,13 @@ public enum DataTagSupport : byte
|
||||
[Flags]
|
||||
public enum ExtendedPartitionsSupport : byte
|
||||
{
|
||||
SystemCode = 1 << 0,
|
||||
NonPersistent = 1 << 1
|
||||
SystemCode = 1 << 0, NonPersistent = 1 << 1
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum SupportedModes : byte
|
||||
{
|
||||
FFU = 1 << 0,
|
||||
VendorSpecific = 1 << 1
|
||||
FFU = 1 << 0, VendorSpecific = 1 << 1
|
||||
}
|
||||
|
||||
[Flags]
|
||||
@@ -272,55 +268,41 @@ public enum CacheFlushingPolicy : byte
|
||||
[Flags]
|
||||
public enum SecureFeatureSupport : byte
|
||||
{
|
||||
Purge = 1 << 0,
|
||||
Defective = 1 << 2,
|
||||
Trim = 1 << 4,
|
||||
Purge = 1 << 0, Defective = 1 << 2, Trim = 1 << 4,
|
||||
Sanitize = 1 << 6
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum BootInformation : byte
|
||||
{
|
||||
Alternative = 1 << 0,
|
||||
DDR = 1 << 1,
|
||||
HighSpeed = 1 << 2
|
||||
Alternative = 1 << 0, DDR = 1 << 1, HighSpeed = 1 << 2
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum SecureWriteProtectInformation : byte
|
||||
{
|
||||
Supported = 1 << 0,
|
||||
Enabled = 1 << 1
|
||||
Supported = 1 << 0, Enabled = 1 << 1
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum DriverStrength : byte
|
||||
{
|
||||
Type0 = 1 << 0,
|
||||
Type1 = 1 << 1,
|
||||
Type2 = 1 << 2,
|
||||
Type3 = 1 << 3,
|
||||
Type4 = 1 << 4
|
||||
Type0 = 1 << 0, Type1 = 1 << 1, Type2 = 1 << 2,
|
||||
Type3 = 1 << 3, Type4 = 1 << 4
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum DeviceType : byte
|
||||
{
|
||||
HS_26 = 1 << 0,
|
||||
HS_52 = 1 << 1,
|
||||
HS_DDR_52 = 1 << 2,
|
||||
HS_DDR_52_LV = 1 << 3,
|
||||
HS200_18 = 1 << 4,
|
||||
HS200_12 = 1 << 5,
|
||||
HS400_18 = 1 << 6,
|
||||
HS400_12 = 1 << 7
|
||||
HS_26 = 1 << 0, HS_52 = 1 << 1, HS_DDR_52 = 1 << 2,
|
||||
HS_DDR_52_LV = 1 << 3, HS200_18 = 1 << 4, HS200_12 = 1 << 5,
|
||||
HS400_18 = 1 << 6, HS400_12 = 1 << 7
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum BootConfigProtection : byte
|
||||
{
|
||||
PowerCycle = 1 << 0,
|
||||
Permanent = 1 << 4
|
||||
PowerCycle = 1 << 0, Permanent = 1 << 4
|
||||
}
|
||||
|
||||
[Flags]
|
||||
@@ -332,32 +314,22 @@ public enum HighCapacityEraseGroupDefinition : byte
|
||||
[Flags]
|
||||
public enum BootAreaWriteProtectionRegister : byte
|
||||
{
|
||||
PowerOn = 1 << 0,
|
||||
PowerOnArea2 = 1 << 1,
|
||||
Permanent = 1 << 2,
|
||||
PermanentArea2 = 1 << 3,
|
||||
PermanentDisable = 1 << 4,
|
||||
PowerOnDisable = 1 << 6,
|
||||
PowerOn = 1 << 0, PowerOnArea2 = 1 << 1, Permanent = 1 << 2,
|
||||
PermanentArea2 = 1 << 3, PermanentDisable = 1 << 4, PowerOnDisable = 1 << 6,
|
||||
Selected = 1 << 7
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum UserAreaWriteProtectionRegister : byte
|
||||
{
|
||||
ApplyPowerOn = 1 << 0,
|
||||
ApplyPermanent = 1 << 2,
|
||||
DisablePowerOn = 1 << 3,
|
||||
DisablePermanent = 1 << 4,
|
||||
DisableWriteProtect = 1 << 6,
|
||||
DisablePassword = 1 << 7
|
||||
ApplyPowerOn = 1 << 0, ApplyPermanent = 1 << 2, DisablePowerOn = 1 << 3,
|
||||
DisablePermanent = 1 << 4, DisableWriteProtect = 1 << 6, DisablePassword = 1 << 7
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum PartitioningSupport : byte
|
||||
{
|
||||
Supported = 1 << 0,
|
||||
Enhanced = 1 << 1,
|
||||
Extended = 1 << 2
|
||||
Supported = 1 << 0, Enhanced = 1 << 1, Extended = 1 << 2
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public class OCR
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.MMC;
|
||||
|
||||
/// <summary>Decodes MultiMediaCard vendors</summary>
|
||||
public static class VendorString
|
||||
{
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -39,6 +37,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class CIS
|
||||
@@ -46,8 +46,8 @@ public static class CIS
|
||||
// TODO: Handle links? Or are they removed in lower layers of the operating system drivers?
|
||||
public static Tuple[] GetTuples(byte[] data)
|
||||
{
|
||||
var tuples = new List<Tuple>();
|
||||
var position = 0;
|
||||
List<Tuple> tuples = new();
|
||||
int position = 0;
|
||||
|
||||
while(position < data.Length)
|
||||
{
|
||||
@@ -95,9 +95,9 @@ public static class CIS
|
||||
return null;
|
||||
|
||||
var tuple = new DeviceGeometryTuple();
|
||||
var geometries = new List<DeviceGeometry>();
|
||||
List<DeviceGeometry> geometries = new();
|
||||
|
||||
for(var position = 2; position < data.Length; position += 6)
|
||||
for(int position = 2; position < data.Length; position += 6)
|
||||
{
|
||||
var geometry = new DeviceGeometry
|
||||
{
|
||||
@@ -219,9 +219,9 @@ public static class CIS
|
||||
if(data.Length < 4)
|
||||
return null;
|
||||
|
||||
var buffer = new List<byte>();
|
||||
List<byte> buffer = new();
|
||||
List<string> strings = null;
|
||||
var firstString = false;
|
||||
bool firstString = false;
|
||||
const bool secondString = false;
|
||||
|
||||
var tuple = new Level1VersionTuple
|
||||
@@ -232,7 +232,7 @@ public static class CIS
|
||||
MinorVersion = data[3]
|
||||
};
|
||||
|
||||
for(var position = 4; position < data.Length; position++)
|
||||
for(int position = 4; position < data.Length; position++)
|
||||
{
|
||||
if(data[position] == 0xFF)
|
||||
break;
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
/// <summary>Tuple codes.</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum TupleCodes : byte
|
||||
@@ -165,17 +165,9 @@ public enum DeviceSpeedCodes : byte
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum FunctionCodes : byte
|
||||
{
|
||||
MultiFunction = 0x00,
|
||||
Memory = 0x01,
|
||||
Serial = 0x02,
|
||||
Parallel = 0x03,
|
||||
FixedDisk = 0x04,
|
||||
Video = 0x05,
|
||||
Network = 0x06,
|
||||
AIMS = 0x07,
|
||||
SCSI = 0x08,
|
||||
Security = 0x09,
|
||||
Instrument = 0x0A,
|
||||
HighSpeedSerial = 0x0B,
|
||||
MultiFunction = 0x00, Memory = 0x01, Serial = 0x02,
|
||||
Parallel = 0x03, FixedDisk = 0x04, Video = 0x05,
|
||||
Network = 0x06, AIMS = 0x07, SCSI = 0x08,
|
||||
Security = 0x09, Instrument = 0x0A, HighSpeedSerial = 0x0B,
|
||||
VendorSpecific = 0xFE
|
||||
}
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
/// <summary>Basic classure of a PCMCIA tuple</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.PCMCIA;
|
||||
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public static class VendorCode
|
||||
{
|
||||
|
||||
@@ -30,23 +30,23 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static class DiscStructureCapabilities
|
||||
{
|
||||
public static Capability[] Decode(byte[] response)
|
||||
{
|
||||
var len = (ushort)((response[0] << 8) + response[1]);
|
||||
ushort len = (ushort)((response[0] << 8) + response[1]);
|
||||
|
||||
if(len + 2 != response.Length)
|
||||
return null;
|
||||
|
||||
var caps = new List<Capability>();
|
||||
List<Capability> caps = new();
|
||||
|
||||
uint offset = 4;
|
||||
|
||||
|
||||
70
SCSI/EVPD.cs
70
SCSI/EVPD.cs
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -42,6 +40,8 @@ using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global"),
|
||||
SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
@@ -58,7 +58,7 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var decoded = new byte[page.Length - 4];
|
||||
byte[] decoded = new byte[page.Length - 4];
|
||||
|
||||
Array.Copy(page, 4, decoded, 0, page.Length - 4);
|
||||
|
||||
@@ -80,7 +80,7 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var ascii = new byte[page[4]];
|
||||
byte[] ascii = new byte[page[4]];
|
||||
|
||||
Array.Copy(page, 5, ascii, 0, page[4]);
|
||||
|
||||
@@ -98,11 +98,11 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var ascii = new byte[page.Length - 4];
|
||||
byte[] ascii = new byte[page.Length - 4];
|
||||
|
||||
Array.Copy(page, 4, ascii, 0, page.Length - 4);
|
||||
|
||||
for(var i = 0; i < ascii.Length - 1; i++)
|
||||
for(int i = 0; i < ascii.Length - 1; i++)
|
||||
if(ascii[i] < 0x20)
|
||||
return null;
|
||||
|
||||
@@ -120,7 +120,7 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var ascii = new byte[page.Length - 4];
|
||||
byte[] ascii = new byte[page.Length - 4];
|
||||
|
||||
Array.Copy(page, 4, ascii, 0, page.Length - 4);
|
||||
|
||||
@@ -136,7 +136,7 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var ascii = new byte[page.Length - 4];
|
||||
byte[] ascii = new byte[page.Length - 4];
|
||||
|
||||
Array.Copy(page, 4, ascii, 0, page.Length - 4);
|
||||
|
||||
@@ -153,7 +153,7 @@ public static class EVPD
|
||||
if(page.Length != 12)
|
||||
return 0;
|
||||
|
||||
var bitmap = new byte[8];
|
||||
byte[] bitmap = new byte[8];
|
||||
|
||||
Array.Copy(page, 4, bitmap, 0, 8);
|
||||
|
||||
@@ -170,7 +170,7 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var ascii = new byte[page.Length - 4];
|
||||
byte[] ascii = new byte[page.Length - 4];
|
||||
|
||||
Array.Copy(page, 4, ascii, 0, page.Length - 4);
|
||||
|
||||
@@ -187,7 +187,7 @@ public static class EVPD
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
var element = new byte[page.Length - 4];
|
||||
byte[] element = new byte[page.Length - 4];
|
||||
var sb = new StringBuilder();
|
||||
|
||||
foreach(byte b in element)
|
||||
@@ -237,8 +237,8 @@ public static class EVPD
|
||||
Default = (ScsiDefinitions)(pageResponse[5] & 0x7F)
|
||||
};
|
||||
|
||||
var position = 6;
|
||||
var definitions = new List<ScsiDefinitions>();
|
||||
int position = 6;
|
||||
List<ScsiDefinitions> definitions = new();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
@@ -261,8 +261,7 @@ public static class EVPD
|
||||
ScsiDefinitions.SCSI1 => "SCSI-1",
|
||||
ScsiDefinitions.SCSI2 => "SCSI-2",
|
||||
ScsiDefinitions.SCSI3 => "SCSI-3",
|
||||
_ => $"Unknown definition code {
|
||||
(byte)definition}"
|
||||
_ => $"Unknown definition code {(byte)definition}"
|
||||
};
|
||||
|
||||
public static string PrettifyPage_81(Page_81? modePage)
|
||||
@@ -392,8 +391,8 @@ public static class EVPD
|
||||
PageLength = (byte)(pageResponse[3] + 4)
|
||||
};
|
||||
|
||||
var position = 4;
|
||||
var descriptors = new List<IdentificatonDescriptor>();
|
||||
int position = 4;
|
||||
List<IdentificatonDescriptor> descriptors = new();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
@@ -466,8 +465,8 @@ public static class EVPD
|
||||
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("\tIdentifier has unknown association with code {0}",
|
||||
(byte)descriptor.Association).AppendLine();
|
||||
sb.AppendFormat("\tIdentifier has unknown association with code {0}", (byte)descriptor.Association).
|
||||
AppendLine();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -548,7 +547,7 @@ public static class EVPD
|
||||
{
|
||||
sb.AppendFormat("\tIEEE EUI-64: {0:X2}", descriptor.Binary[0]);
|
||||
|
||||
for(var i = 1; i < descriptor.Binary.Length; i++)
|
||||
for(int i = 1; i < descriptor.Binary.Length; i++)
|
||||
sb.AppendFormat(":{0:X2}", descriptor.Binary[i]);
|
||||
|
||||
sb.AppendLine();
|
||||
@@ -562,7 +561,7 @@ public static class EVPD
|
||||
{
|
||||
sb.AppendFormat("\tNAA: {0:X2}", descriptor.Binary[0]);
|
||||
|
||||
for(var i = 1; i < descriptor.Binary.Length; i++)
|
||||
for(int i = 1; i < descriptor.Binary.Length; i++)
|
||||
sb.AppendFormat(":{0:X2}", descriptor.Binary[i]);
|
||||
|
||||
sb.AppendLine();
|
||||
@@ -600,7 +599,7 @@ public static class EVPD
|
||||
{
|
||||
sb.AppendFormat("\tMD5 logical unit identifier: {0:x2}", descriptor.Binary[0]);
|
||||
|
||||
for(var i = 1; i < descriptor.Binary.Length; i++)
|
||||
for(int i = 1; i < descriptor.Binary.Length; i++)
|
||||
sb.AppendFormat("{0:x2}", descriptor.Binary[i]);
|
||||
|
||||
sb.AppendLine();
|
||||
@@ -788,8 +787,8 @@ public static class EVPD
|
||||
PageLength = (byte)(pageResponse[3] + 4)
|
||||
};
|
||||
|
||||
var position = 4;
|
||||
var identifiers = new List<SoftwareIdentifier>();
|
||||
int position = 4;
|
||||
List<SoftwareIdentifier> identifiers = new();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
@@ -831,7 +830,7 @@ public static class EVPD
|
||||
{
|
||||
sb.AppendFormat("\t{0:X2}", identifier.Identifier[0]);
|
||||
|
||||
for(var i = 1; i < identifier.Identifier.Length; i++)
|
||||
for(int i = 1; i < identifier.Identifier.Length; i++)
|
||||
sb.AppendFormat(":{0:X2}", identifier.Identifier[i]);
|
||||
|
||||
sb.AppendLine();
|
||||
@@ -844,14 +843,9 @@ public static class EVPD
|
||||
#region EVPD Page 0x85: Management Network Addresses page
|
||||
public enum NetworkServiceTypes : byte
|
||||
{
|
||||
Unspecified = 0,
|
||||
StorageConf = 1,
|
||||
Diagnostics = 2,
|
||||
Status = 3,
|
||||
Logging = 4,
|
||||
CodeDownload = 5,
|
||||
CopyService = 6,
|
||||
Administrative = 7
|
||||
Unspecified = 0, StorageConf = 1, Diagnostics = 2,
|
||||
Status = 3, Logging = 4, CodeDownload = 5,
|
||||
CopyService = 6, Administrative = 7
|
||||
}
|
||||
|
||||
public struct NetworkDescriptor
|
||||
@@ -899,8 +893,8 @@ public static class EVPD
|
||||
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4)
|
||||
};
|
||||
|
||||
var position = 4;
|
||||
var descriptors = new List<NetworkDescriptor>();
|
||||
int position = 4;
|
||||
List<NetworkDescriptor> descriptors = new();
|
||||
|
||||
while(position < pageResponse.Length)
|
||||
{
|
||||
@@ -1717,7 +1711,7 @@ public static class EVPD
|
||||
CartridgeSerialNumber = new byte[32]
|
||||
};
|
||||
|
||||
var buf = new byte[8];
|
||||
byte[] buf = new byte[8];
|
||||
Array.Copy(pageResponse, 24, buf, 0, 8);
|
||||
decoded.InitiatorID = BitConverter.ToUInt64(buf.Reverse().ToArray(), 0);
|
||||
Array.Copy(pageResponse, 32, decoded.CartridgeSerialNumber, 0, 32);
|
||||
@@ -2133,7 +2127,7 @@ public static class EVPD
|
||||
if(pageResponse[4] != pageResponse[3] - 1)
|
||||
return null;
|
||||
|
||||
var array = new List<byte>();
|
||||
List<byte> array = new();
|
||||
|
||||
const string fwRegExStr = @"Firmware Rev\s+=\s+(?<fw>\d+\.\d+)\s+Build date\s+=\s+(?<date>(\w|\d|\s*.)*)\s*$";
|
||||
|
||||
@@ -2143,7 +2137,7 @@ public static class EVPD
|
||||
var fwcRegEx = new Regex(fwcRegExStr);
|
||||
var servoRegEx = new Regex(servoRegExStr);
|
||||
|
||||
for(var pos = 5; pos < pageResponse.Length; pos++)
|
||||
for(int pos = 5; pos < pageResponse.Length; pos++)
|
||||
if(pageResponse[pos] == 0x00)
|
||||
{
|
||||
string str = StringHandlers.CToString(array.ToArray());
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
@@ -39,6 +37,8 @@ using System.Text;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
// Information from the following standards:
|
||||
// T9/375-D revision 10l
|
||||
// T10/995-D revision 10
|
||||
@@ -2429,11 +2429,10 @@ public static class Inquiry
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
|
||||
if(response.VendorSpecific != null &&
|
||||
response.IsHiMD)
|
||||
if(response is { VendorSpecific: {}, IsHiMD: true })
|
||||
if(response.KreonPresent)
|
||||
{
|
||||
var vendor = new byte[7];
|
||||
byte[] vendor = new byte[7];
|
||||
Array.Copy(response.VendorSpecific, 11, vendor, 0, 7);
|
||||
sb.AppendLine("Vendor-specific bytes 47 to 55");
|
||||
sb.AppendLine("============================================================");
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -305,12 +305,12 @@ public static class AACS
|
||||
|
||||
decoded.Extents = new AACSLBAExtent[(AACSLBAExtsResponse.Length - 4) / 16];
|
||||
|
||||
for(var i = 0; i < (AACSLBAExtsResponse.Length - 4) / 16; i++)
|
||||
for(int i = 0; i < (AACSLBAExtsResponse.Length - 4) / 16; i++)
|
||||
{
|
||||
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].LBACount = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 12 + i * 16 + 4);
|
||||
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].LBACount = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 12 + (i * 16) + 4);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
@@ -331,7 +331,7 @@ public static class AACS
|
||||
else
|
||||
sb.AppendFormat("Drive can store {0} LBA Extents", response.MaxLBAExtents).AppendLine();
|
||||
|
||||
for(var i = 0; i < response.Extents.Length; i++)
|
||||
for(int i = 0; i < response.Extents.Length; i++)
|
||||
sb.AppendFormat("LBA Extent {0} starts at LBA {1} and goes for {2} sectors", i,
|
||||
response.Extents[i].StartLBA, response.Extents[i].LBACount);
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -95,7 +95,7 @@ public static class DiscInformation
|
||||
decoded.LastPossibleLeadOutStartLBA =
|
||||
(uint)((response[20] << 24) + (response[21] << 16) + (response[22] << 8) + response[23]);
|
||||
|
||||
var temp = new byte[8];
|
||||
byte[] temp = new byte[8];
|
||||
Array.Copy(response, 24, temp, 0, 8);
|
||||
Array.Reverse(temp);
|
||||
decoded.DiscBarcode = BitConverter.ToUInt64(temp, 0);
|
||||
@@ -107,17 +107,17 @@ public static class DiscInformation
|
||||
decoded.OPCTablesNumber = response[33];
|
||||
|
||||
if(decoded.OPCTablesNumber <= 0 ||
|
||||
response.Length != decoded.OPCTablesNumber * 8 + 34)
|
||||
response.Length != (decoded.OPCTablesNumber * 8) + 34)
|
||||
return decoded;
|
||||
|
||||
decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber];
|
||||
|
||||
for(var i = 0; i < decoded.OPCTablesNumber; i++)
|
||||
for(int i = 0; i < decoded.OPCTablesNumber; i++)
|
||||
{
|
||||
decoded.OPCTables[i].Speed = (ushort)((response[34 + i * 8 + 0] << 16) + response[34 + i * 8 + 1]);
|
||||
decoded.OPCTables[i].Speed = (ushort)((response[34 + (i * 8) + 0] << 16) + response[34 + (i * 8) + 1]);
|
||||
|
||||
decoded.OPCTables[i].OPCValues = new byte[6];
|
||||
Array.Copy(response, 34 + i * 8 + 2, decoded.OPCTables[i].OPCValues, 0, 6);
|
||||
Array.Copy(response, 34 + (i * 8) + 2, decoded.OPCTables[i].OPCValues, 0, 6);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -30,43 +30,35 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum FormatLayerTypeCodes : ushort
|
||||
{
|
||||
CDLayer = 0x0008,
|
||||
DVDLayer = 0x0010,
|
||||
BDLayer = 0x0040,
|
||||
CDLayer = 0x0008, DVDLayer = 0x0010, BDLayer = 0x0040,
|
||||
HDDVDLayer = 0x0050
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum SessionStatusCodes : byte
|
||||
{
|
||||
Empty = 0x00,
|
||||
Incomplete = 0x01,
|
||||
ReservedOrDamaged = 0x02,
|
||||
Empty = 0x00, Incomplete = 0x01, ReservedOrDamaged = 0x02,
|
||||
Complete = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum DiscStatusCodes : byte
|
||||
{
|
||||
Empty = 0x00,
|
||||
Incomplete = 0x01,
|
||||
Finalized = 0x02,
|
||||
Empty = 0x00, Incomplete = 0x01, Finalized = 0x02,
|
||||
Others = 0x03
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public enum BGFormatStatusCodes : byte
|
||||
{
|
||||
NoFormattable = 0x00,
|
||||
IncompleteBackgroundFormat = 0x01,
|
||||
BackgroundFormatInProgress = 0x02,
|
||||
NoFormattable = 0x00, IncompleteBackgroundFormat = 0x01, BackgroundFormatInProgress = 0x02,
|
||||
FormatComplete = 0x03
|
||||
}
|
||||
|
||||
@@ -74,15 +66,11 @@ public enum BGFormatStatusCodes : byte
|
||||
public enum DiscTypeCodes : byte
|
||||
{
|
||||
/// <summary>Also valid for CD-DA, DVD and BD</summary>
|
||||
CDROM = 0x00, CDi = 0x10,
|
||||
CDROMXA = 0x20,
|
||||
Undefined = 0xFF
|
||||
CDROM = 0x00, CDi = 0x10, CDROMXA = 0x20, Undefined = 0xFF
|
||||
}
|
||||
|
||||
public enum LayerJumpRecordingStatus : byte
|
||||
{
|
||||
Incremental = 0,
|
||||
Unspecified = 1,
|
||||
Manual = 2,
|
||||
Incremental = 0, Unspecified = 1, Manual = 2,
|
||||
RegularInterval = 3
|
||||
}
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -41,6 +39,8 @@ using System.Text;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
/// <summary>MMC Feature enumeration</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum FeatureNumber : ushort
|
||||
@@ -1307,7 +1307,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0000)
|
||||
return null;
|
||||
@@ -1321,8 +1321,8 @@ public static class Features
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
var offset = 4;
|
||||
var listProfiles = new List<Profile>();
|
||||
int offset = 4;
|
||||
List<Profile> listProfiles = new();
|
||||
|
||||
while(offset < feature.Length)
|
||||
{
|
||||
@@ -1349,7 +1349,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0001)
|
||||
return null;
|
||||
@@ -1385,7 +1385,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0002)
|
||||
return null;
|
||||
@@ -1415,7 +1415,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0003)
|
||||
return null;
|
||||
@@ -1451,7 +1451,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0004)
|
||||
return null;
|
||||
@@ -1485,7 +1485,7 @@ public static class Features
|
||||
if(feature.Length < 12)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0010)
|
||||
return null;
|
||||
@@ -1516,7 +1516,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x001D)
|
||||
return null;
|
||||
@@ -1541,7 +1541,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x001E)
|
||||
return null;
|
||||
@@ -1575,7 +1575,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x001F)
|
||||
return null;
|
||||
@@ -1612,7 +1612,7 @@ public static class Features
|
||||
if(feature.Length < 16)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0020)
|
||||
return null;
|
||||
@@ -1647,7 +1647,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0021)
|
||||
return null;
|
||||
@@ -1688,7 +1688,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0022)
|
||||
return null;
|
||||
@@ -1713,7 +1713,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0023)
|
||||
return null;
|
||||
@@ -1752,7 +1752,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0024)
|
||||
return null;
|
||||
@@ -1781,7 +1781,7 @@ public static class Features
|
||||
if(feature.Length < 12)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0025)
|
||||
return null;
|
||||
@@ -1812,7 +1812,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0026)
|
||||
return null;
|
||||
@@ -1837,7 +1837,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0027)
|
||||
return null;
|
||||
@@ -1862,7 +1862,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0028)
|
||||
return null;
|
||||
@@ -1895,7 +1895,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0029)
|
||||
return null;
|
||||
@@ -1924,7 +1924,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002A)
|
||||
return null;
|
||||
@@ -1955,7 +1955,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002B)
|
||||
return null;
|
||||
@@ -1982,7 +1982,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002C)
|
||||
return null;
|
||||
@@ -2012,7 +2012,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002D)
|
||||
return null;
|
||||
@@ -2049,7 +2049,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002E)
|
||||
return null;
|
||||
@@ -2085,7 +2085,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x002F)
|
||||
return null;
|
||||
@@ -2119,7 +2119,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0030)
|
||||
return null;
|
||||
@@ -2144,7 +2144,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0031)
|
||||
return null;
|
||||
@@ -2171,7 +2171,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0032)
|
||||
return null;
|
||||
@@ -2199,7 +2199,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0033)
|
||||
return null;
|
||||
@@ -2231,7 +2231,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0035)
|
||||
return null;
|
||||
@@ -2256,7 +2256,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0037)
|
||||
return null;
|
||||
@@ -2283,7 +2283,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0038)
|
||||
return null;
|
||||
@@ -2308,7 +2308,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x003A)
|
||||
return null;
|
||||
@@ -2337,7 +2337,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x003B)
|
||||
return null;
|
||||
@@ -2364,7 +2364,7 @@ public static class Features
|
||||
if(feature.Length < 32)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0040)
|
||||
return null;
|
||||
@@ -2402,7 +2402,7 @@ public static class Features
|
||||
if(feature.Length < 24)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0041)
|
||||
return null;
|
||||
@@ -2438,7 +2438,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0042)
|
||||
return null;
|
||||
@@ -2463,7 +2463,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0050)
|
||||
return null;
|
||||
@@ -2491,7 +2491,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0051)
|
||||
return null;
|
||||
@@ -2519,7 +2519,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0080)
|
||||
return null;
|
||||
@@ -2546,7 +2546,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0100)
|
||||
return null;
|
||||
@@ -2571,7 +2571,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0101)
|
||||
return null;
|
||||
@@ -2598,7 +2598,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0102)
|
||||
return null;
|
||||
@@ -2627,7 +2627,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0103)
|
||||
return null;
|
||||
@@ -2657,7 +2657,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0104)
|
||||
return null;
|
||||
@@ -2686,7 +2686,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0105)
|
||||
return null;
|
||||
@@ -2718,7 +2718,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0106)
|
||||
return null;
|
||||
@@ -2745,7 +2745,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0107)
|
||||
return null;
|
||||
@@ -2787,7 +2787,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0108)
|
||||
return null;
|
||||
@@ -2801,7 +2801,7 @@ public static class Features
|
||||
decoded.Persistent |= (feature[2] & 0x02) == 0x02;
|
||||
decoded.Version = (byte)((feature[2] & 0x3C) >> 2);
|
||||
|
||||
var serial = new byte[feature.Length];
|
||||
byte[] serial = new byte[feature.Length];
|
||||
Array.Copy(feature, 4, serial, 0, feature.Length - 4);
|
||||
decoded.Serial = StringHandlers.CToString(serial).Trim();
|
||||
|
||||
@@ -2816,7 +2816,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0109)
|
||||
return null;
|
||||
@@ -2841,7 +2841,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010A)
|
||||
return null;
|
||||
@@ -2857,9 +2857,9 @@ public static class Features
|
||||
|
||||
decoded.DCBs = new uint[feature[3] / 4];
|
||||
|
||||
for(var i = 0; i < decoded.DCBs.Length; i++)
|
||||
decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + (feature[1 + 4 + i * 4] << 16) +
|
||||
(feature[2 + 4 + i * 4] << 8) + feature[3 + 4 + i * 4]);
|
||||
for(int i = 0; i < decoded.DCBs.Length; i++)
|
||||
decoded.DCBs[i] = (uint)((feature[0 + 4 + (i * 4)] << 24) + (feature[1 + 4 + (i * 4)] << 16) +
|
||||
(feature[2 + 4 + (i * 4)] << 8) + feature[3 + 4 + (i * 4)]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -2872,7 +2872,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010B)
|
||||
return null;
|
||||
@@ -2899,7 +2899,7 @@ public static class Features
|
||||
if(feature.Length < 20)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010C)
|
||||
return null;
|
||||
@@ -2932,7 +2932,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010D)
|
||||
return null;
|
||||
@@ -2970,7 +2970,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x010E)
|
||||
return null;
|
||||
@@ -2997,7 +2997,7 @@ public static class Features
|
||||
if(feature.Length < 8)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0110)
|
||||
return null;
|
||||
@@ -3022,7 +3022,7 @@ public static class Features
|
||||
if(feature.Length < 4)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0113)
|
||||
return null;
|
||||
@@ -3047,7 +3047,7 @@ public static class Features
|
||||
if(feature.Length < 6)
|
||||
return null;
|
||||
|
||||
var number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
ushort number = (ushort)((feature[0] << 8) + feature[1]);
|
||||
|
||||
if(number != 0x0142)
|
||||
return null;
|
||||
@@ -3066,11 +3066,11 @@ public static class Features
|
||||
decoded.ME |= (feature[4] & 0x01) == 0x01;
|
||||
decoded.Profiles = new ushort[feature[5]];
|
||||
|
||||
if(feature[5] * 2 + 6 != feature.Length)
|
||||
if((feature[5] * 2) + 6 != feature.Length)
|
||||
return decoded;
|
||||
|
||||
for(var i = 0; i < feature[5]; i++)
|
||||
decoded.Profiles[i] = (ushort)((feature[0 + 6 + 2 * i] << 8) + feature[1 + 6 + 2 * i]);
|
||||
for(int i = 0; i < feature[5]; i++)
|
||||
decoded.Profiles[i] = (ushort)((feature[0 + 6 + (2 * i)] << 8) + feature[1 + 6 + (2 * i)]);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -3735,11 +3735,9 @@ public static class Features
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if(ftr.Write &&
|
||||
ftr.DVDPRead &&
|
||||
ftr.DVDPWrite)
|
||||
ftr is { DVDPRead: true, DVDPWrite: true })
|
||||
sb.Append("Drive can read and write CD-MRW and DVD+MRW");
|
||||
else if(ftr.DVDPRead &&
|
||||
ftr.DVDPWrite)
|
||||
else if(ftr is { DVDPRead: true, DVDPWrite: true })
|
||||
sb.Append("Drive can read and write DVD+MRW");
|
||||
else
|
||||
switch(ftr.Write)
|
||||
@@ -3993,8 +3991,7 @@ public static class Features
|
||||
break;
|
||||
}
|
||||
|
||||
if(ftr.RAW &&
|
||||
ftr.RAWMS)
|
||||
if(ftr is { RAW: true, RAWMS: true })
|
||||
sb.AppendLine("\tDrive can write multi-session CDs in raw mode");
|
||||
|
||||
if(ftr.RW)
|
||||
@@ -4024,8 +4021,7 @@ public static class Features
|
||||
Feature_002F ftr = feature.Value;
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if(ftr.DVDRW &&
|
||||
ftr.RDL)
|
||||
if(ftr is { DVDRW: true, RDL: true })
|
||||
sb.AppendLine("Drive supports writing DVD-R, DVD-RW and DVD-R DL");
|
||||
else if(ftr.RDL)
|
||||
sb.AppendLine("Drive supports writing DVD-R and DVD-R DL");
|
||||
@@ -4588,7 +4584,7 @@ public static class Features
|
||||
Feature_010C ftr = feature.Value;
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var temp = new byte[4];
|
||||
byte[] temp = new byte[4];
|
||||
temp[0] = (byte)((ftr.Century & 0xFF00) >> 8);
|
||||
temp[1] = (byte)(ftr.Century & 0xFF);
|
||||
temp[2] = (byte)((ftr.Year & 0xFF00) >> 8);
|
||||
@@ -4747,7 +4743,7 @@ public static class Features
|
||||
if(ftr.Profiles == null)
|
||||
return sb.ToString();
|
||||
|
||||
for(var i = 0; i < ftr.Profiles.Length; i++)
|
||||
for(int i = 0; i < ftr.Profiles.Length; i++)
|
||||
sb.AppendFormat("\tProfile {0}: {1}", i, ftr.Profiles[i]).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
@@ -4878,7 +4874,7 @@ public static class Features
|
||||
};
|
||||
|
||||
uint offset = 8;
|
||||
var descLst = new List<FeatureDescriptor>();
|
||||
List<FeatureDescriptor> descLst = new();
|
||||
|
||||
while(offset + 4 < response.Length)
|
||||
{
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
@@ -74,8 +74,8 @@ public static class Hybrid
|
||||
FormatLayers = new ushort[(FormatLayersResponse.Length - 6) / 2]
|
||||
};
|
||||
|
||||
for(var i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++)
|
||||
decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, i * 2 + 6);
|
||||
for(int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++)
|
||||
decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, (i * 2) + 6);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public static class Hybrid
|
||||
|
||||
sb.AppendFormat("{0} format layers recognized", response.NumberOfLayers);
|
||||
|
||||
for(var i = 0; i < response.FormatLayers.Length; i++)
|
||||
for(int i = 0; i < response.FormatLayers.Length; i++)
|
||||
switch(response.FormatLayers[i])
|
||||
{
|
||||
case (ushort)FormatLayerTypeCodes.BDLayer:
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class TrackInformation
|
||||
{
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI.MMC;
|
||||
|
||||
// Information from the following standards:
|
||||
// ANSI X3.304-1997
|
||||
// T10/1048-D revision 9.0
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,18 +30,18 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
public static byte[] EncodeModePage_01(ModePage_01 page)
|
||||
{
|
||||
var pg = new byte[8];
|
||||
byte[] pg = new byte[8];
|
||||
|
||||
pg[0] = 0x01;
|
||||
pg[1] = 6;
|
||||
|
||||
@@ -30,18 +30,18 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
{
|
||||
public static byte[] EncodeModePage_01_MMC(ModePage_01_MMC page)
|
||||
{
|
||||
var pg = new byte[12];
|
||||
byte[] pg = new byte[12];
|
||||
|
||||
pg[0] = 0x01;
|
||||
pg[1] = 10;
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
@@ -123,7 +123,7 @@ public static partial class Modes
|
||||
decoded.MediumFormatRecognition = (MediumFormatRecognitionValues)pageResponse[5];
|
||||
decoded.PartitionSizes = new ushort[(pageResponse.Length - 8) / 2];
|
||||
|
||||
for(var i = 8; i < pageResponse.Length; i += 2)
|
||||
for(int i = 8; i < pageResponse.Length; i += 2)
|
||||
{
|
||||
decoded.PartitionSizes[(i - 8) / 2] = (ushort)(pageResponse[i] << 8);
|
||||
decoded.PartitionSizes[(i - 8) / 2] += pageResponse[i + 1];
|
||||
@@ -243,7 +243,7 @@ public static partial class Modes
|
||||
|
||||
sb.AppendFormat("\tMedium has defined {0} partitions", page.PartitionSizes.Length).AppendLine();
|
||||
|
||||
for(var i = 0; i < page.PartitionSizes.Length; i++)
|
||||
for(int i = 0; i < page.PartitionSizes.Length; i++)
|
||||
if(page.PartitionSizes[i] == 0)
|
||||
if(page.PartitionSizes.Length == 1)
|
||||
sb.AppendLine("\tDevice recognizes one single partition spanning whole medium");
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
@@ -74,7 +74,7 @@ public static partial class Modes
|
||||
|
||||
decoded.PartitionSizes = new ushort[(pageResponse.Length - 2) / 2];
|
||||
|
||||
for(var i = 2; i < pageResponse.Length; i += 2)
|
||||
for(int i = 2; i < pageResponse.Length; i += 2)
|
||||
{
|
||||
decoded.PartitionSizes[(i - 2) / 2] = (ushort)(pageResponse[i] << 8);
|
||||
decoded.PartitionSizes[(i - 2) / 2] += pageResponse[i + 1];
|
||||
@@ -101,7 +101,7 @@ public static partial class Modes
|
||||
|
||||
sb.AppendFormat("\tMedium has defined {0} partitions", page.PartitionSizes.Length).AppendLine();
|
||||
|
||||
for(var i = 0; i < page.PartitionSizes.Length; i++)
|
||||
for(int i = 0; i < page.PartitionSizes.Length; i++)
|
||||
sb.AppendFormat("\tPartition {0} is {1} units long", i, page.PartitionSizes[i]).AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
@@ -140,34 +140,29 @@ public static partial class Modes
|
||||
if(page.PS)
|
||||
sb.AppendLine("\tParameters can be saved");
|
||||
|
||||
if(page.Standby && page.StandbyTimer > 0 ||
|
||||
page.Standby_Y && page.StandbyTimer_Y > 0)
|
||||
if(page is { Standby : true, StandbyTimer : > 0 } ||
|
||||
page is { Standby_Y: true, StandbyTimer_Y: > 0 })
|
||||
{
|
||||
if(page.Standby &&
|
||||
page.StandbyTimer > 0)
|
||||
if(page is { Standby: true, StandbyTimer: > 0 })
|
||||
sb.AppendFormat("\tStandby timer Z is set to {0} ms", page.StandbyTimer * 100).AppendLine();
|
||||
|
||||
if(page.Standby_Y &&
|
||||
page.StandbyTimer_Y > 0)
|
||||
if(page is { Standby_Y: true, StandbyTimer_Y: > 0 })
|
||||
sb.AppendFormat("\tStandby timer Y is set to {0} ms", page.StandbyTimer_Y * 100).AppendLine();
|
||||
}
|
||||
else
|
||||
sb.AppendLine("\tDrive will not enter standby mode");
|
||||
|
||||
if(page.Idle && page.IdleTimer > 0 ||
|
||||
page.Idle_B && page.IdleTimer_B > 0 ||
|
||||
page.Idle_C && page.IdleTimer_C > 0)
|
||||
if(page is { Idle : true, IdleTimer : > 0 } ||
|
||||
page is { Idle_B: true, IdleTimer_B: > 0 } ||
|
||||
page is { Idle_C: true, IdleTimer_C: > 0 })
|
||||
{
|
||||
if(page.Idle &&
|
||||
page.IdleTimer > 0)
|
||||
if(page is { Idle: true, IdleTimer: > 0 })
|
||||
sb.AppendFormat("\tIdle timer A is set to {0} ms", page.IdleTimer * 100).AppendLine();
|
||||
|
||||
if(page.Idle_B &&
|
||||
page.IdleTimer_B > 0)
|
||||
if(page is { Idle_B: true, IdleTimer_B: > 0 })
|
||||
sb.AppendFormat("\tIdle timer B is set to {0} ms", page.IdleTimer_B * 100).AppendLine();
|
||||
|
||||
if(page.Idle_C &&
|
||||
page.IdleTimer_C > 0)
|
||||
if(page is { Idle_C: true, IdleTimer_C: > 0 })
|
||||
sb.AppendFormat("\tIdle timer C is set to {0} ms", page.IdleTimer_C * 100).AppendLine();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
@@ -214,8 +214,7 @@ public static partial class Modes
|
||||
|
||||
if(modePage.WriteSpeedPerformanceDescriptors != null)
|
||||
foreach(ModePage_2A_WriteDescriptor descriptor in
|
||||
modePage.WriteSpeedPerformanceDescriptors.Where(descriptor =>
|
||||
descriptor.WriteSpeed > 0))
|
||||
modePage.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0))
|
||||
switch(descriptor.RotationControl)
|
||||
{
|
||||
case 0:
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,12 +30,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
@@ -61,7 +61,7 @@ public static partial class Modes
|
||||
if(pageResponse.Length != 30)
|
||||
return false;
|
||||
|
||||
var str = new byte[20];
|
||||
byte[] str = new byte[20];
|
||||
Array.Copy(pageResponse, 10, str, 0, 20);
|
||||
|
||||
return AppleOEMString.SequenceEqual(str);
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Aaru.Decoders.SCSI;
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static partial class Modes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user