Code reformat.

This commit is contained in:
2019-11-25 00:54:38 +00:00
parent a5c650440d
commit d864bfab6c
116 changed files with 16544 additions and 19331 deletions

View File

@@ -35,56 +35,43 @@ using System.Text;
namespace DiscImageChef.Decoders.SCSI
{
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static partial class Modes
{
#region Mode Page 0x1B: Removable Block Access Capabilities page
/// <summary>
/// Removable Block Access Capabilities page
/// Page code 0x1B
/// 12 bytes in INF-8070
/// </summary>
/// <summary>Removable Block Access Capabilities page Page code 0x1B 12 bytes in INF-8070</summary>
public struct ModePage_1B
{
/// <summary>
/// Parameters can be saved
/// </summary>
/// <summary>Parameters can be saved</summary>
public bool PS;
/// <summary>
/// Supports reporting progress of format
/// </summary>
/// <summary>Supports reporting progress of format</summary>
public bool SRFP;
/// <summary>
/// Non-CD Optical Device
/// </summary>
/// <summary>Non-CD Optical Device</summary>
public bool NCD;
/// <summary>
/// Phase change dual device supporting a CD and a Non-CD Optical devices
/// </summary>
/// <summary>Phase change dual device supporting a CD and a Non-CD Optical devices</summary>
public bool SML;
/// <summary>
/// Total number of LUNs
/// </summary>
/// <summary>Total number of LUNs</summary>
public byte TLUN;
/// <summary>
/// System Floppy Type device
/// </summary>
/// <summary>System Floppy Type device</summary>
public bool SFLP;
}
public static ModePage_1B? DecodeModePage_1B(byte[] pageResponse)
{
if((pageResponse?[0] & 0x40) == 0x40) return null;
if((pageResponse?[0] & 0x40) == 0x40)
return null;
if((pageResponse?[0] & 0x3F) != 0x1B) return null;
if((pageResponse?[0] & 0x3F) != 0x1B)
return null;
if(pageResponse[1] + 2 != pageResponse.Length) return null;
if(pageResponse[1] + 2 != pageResponse.Length)
return null;
if(pageResponse.Length < 12) return null;
if(pageResponse.Length < 12)
return null;
ModePage_1B decoded = new ModePage_1B();
var decoded = new ModePage_1B();
decoded.PS |= (pageResponse[0] & 0x80) == 0x80;
decoded.SFLP |= (pageResponse[2] & 0x80) == 0x80;
@@ -102,20 +89,31 @@ namespace DiscImageChef.Decoders.SCSI
public static string PrettifyModePage_1B(ModePage_1B? modePage)
{
if(!modePage.HasValue) return null;
if(!modePage.HasValue)
return null;
ModePage_1B page = modePage.Value;
StringBuilder sb = new StringBuilder();
ModePage_1B page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Removable Block Access Capabilities page:");
if(page.PS) sb.AppendLine("\tParameters can be saved");
if(page.PS)
sb.AppendLine("\tParameters can be saved");
if(page.SFLP) sb.AppendLine("\tDrive can be used as a system floppy device");
if(page.SRFP) sb.AppendLine("\tDrive supports reporting progress of format");
if(page.NCD) sb.AppendLine("\tDrive is a Non-CD Optical Device");
if(page.SML) sb.AppendLine("\tDevice is a dual device supporting CD and Non-CD Optical");
if(page.TLUN > 0) sb.AppendFormat("\tDrive supports {0} LUNs", page.TLUN).AppendLine();
if(page.SFLP)
sb.AppendLine("\tDrive can be used as a system floppy device");
if(page.SRFP)
sb.AppendLine("\tDrive supports reporting progress of format");
if(page.NCD)
sb.AppendLine("\tDrive is a Non-CD Optical Device");
if(page.SML)
sb.AppendLine("\tDevice is a dual device supporting CD and Non-CD Optical");
if(page.TLUN > 0)
sb.AppendFormat("\tDrive supports {0} LUNs", page.TLUN).AppendLine();
return sb.ToString();
}