mirror of
https://github.com/aaru-dps/Aaru.Decoders.git
synced 2025-12-16 19:24:32 +00:00
General code refactor.
This commit is contained in:
@@ -105,8 +105,8 @@ namespace Aaru.Decoders.ATA
|
||||
if(ATAID.CommandSet3.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit3.MustBeSet) &&
|
||||
!ATAID.CommandSet3.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit3.MustBeClear))
|
||||
{
|
||||
if(ATAID.EnabledCommandSet3.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit3.MediaSerial)
|
||||
)
|
||||
if(ATAID.EnabledCommandSet3.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit3.
|
||||
MediaSerial))
|
||||
{
|
||||
if(ATAID.MediaManufacturer != "")
|
||||
sb.AppendFormat("Media manufacturer: {0}", ATAID.MediaManufacturer).AppendLine();
|
||||
@@ -849,8 +849,8 @@ namespace Aaru.Decoders.ATA
|
||||
sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB",
|
||||
ATAID.ExtendedUserSectors * logicalSectorSize,
|
||||
ATAID.ExtendedUserSectors * logicalSectorSize / 1000 / 1000 / 1000 / 1000,
|
||||
ATAID.ExtendedUserSectors * logicalSectorSize / 1024 / 1024 / 1024 /
|
||||
1024).AppendLine();
|
||||
ATAID.ExtendedUserSectors * logicalSectorSize / 1024 / 1024 / 1024 / 1024).
|
||||
AppendLine();
|
||||
else if(ATAID.ExtendedUserSectors * logicalSectorSize / 1024 / 1024 > 1000)
|
||||
sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB",
|
||||
ATAID.ExtendedUserSectors * logicalSectorSize,
|
||||
@@ -933,8 +933,8 @@ namespace Aaru.Decoders.ATA
|
||||
switch(ATAID.BufferType)
|
||||
{
|
||||
case 1:
|
||||
sb.AppendFormat("{0} KiB of single ported single sector buffer",
|
||||
ATAID.BufferSize * 512 / 1024).AppendLine();
|
||||
sb.AppendFormat("{0} KiB of single ported single sector buffer", ATAID.BufferSize * 512 / 1024).
|
||||
AppendLine();
|
||||
|
||||
break;
|
||||
case 2:
|
||||
@@ -962,8 +962,8 @@ namespace Aaru.Decoders.ATA
|
||||
|
||||
sb.Append("Device capabilities:");
|
||||
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.StandardStandbyTimer)
|
||||
)
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.
|
||||
StandardStandbyTimer))
|
||||
sb.AppendLine().Append("Standby time values are standard");
|
||||
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.IORDY))
|
||||
@@ -1012,8 +1012,8 @@ namespace Aaru.Decoders.ATA
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.CommandQueue))
|
||||
sb.AppendLine().Append("ATAPI device supports command queueing");
|
||||
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.OverlapOperation)
|
||||
)
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.
|
||||
OverlapOperation))
|
||||
sb.AppendLine().Append("ATAPI device supports overlapped operations");
|
||||
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.
|
||||
@@ -1332,8 +1332,8 @@ namespace Aaru.Decoders.ATA
|
||||
}
|
||||
}
|
||||
|
||||
if(!ATAID.SATACapabilities2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit2.Clear)
|
||||
)
|
||||
if(!ATAID.SATACapabilities2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit2.
|
||||
Clear))
|
||||
{
|
||||
if(!ATAID.SATACapabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit.
|
||||
Clear) &&
|
||||
@@ -1943,8 +1943,8 @@ namespace Aaru.Decoders.ATA
|
||||
ReadLogDMAExt))
|
||||
sb.AppendLine().Append("READ LOG DMA EXT is supported");
|
||||
|
||||
if(!ATAID.SATACapabilities2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit2.Clear)
|
||||
)
|
||||
if(!ATAID.SATACapabilities2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit2.
|
||||
Clear))
|
||||
if(ATAID.SATACapabilities2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit2.
|
||||
FPDMAQ))
|
||||
sb.AppendLine().Append("RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED are supported");
|
||||
@@ -2021,8 +2021,8 @@ namespace Aaru.Decoders.ATA
|
||||
sb.Append(" and enabled");
|
||||
}
|
||||
|
||||
if(ATAID.SATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.NCQAutoSense)
|
||||
)
|
||||
if(ATAID.SATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.
|
||||
NCQAutoSense))
|
||||
sb.AppendLine().Append("NCQ Autosense is supported");
|
||||
|
||||
if(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.
|
||||
|
||||
24
LisaTag.cs
24
LisaTag.cs
@@ -36,17 +36,13 @@ using Aaru.Helpers;
|
||||
|
||||
namespace Aaru.Decoders
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Lisa Office 7/7 sector tag
|
||||
/// </summary>
|
||||
/// <summary>Represents a Lisa Office 7/7 sector tag</summary>
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal"), SuppressMessage("ReSharper", "NotAccessedField.Global"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "StructMemberCanBeMadeReadOnly")]
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"),
|
||||
SuppressMessage("ReSharper", "StructMemberCanBeMadeReadOnly")]
|
||||
public static class LisaTag
|
||||
{
|
||||
/// <summary>
|
||||
/// Decodes tag from a 3.5" Sony micro-floppy
|
||||
/// </summary>
|
||||
/// <summary>Decodes tag from a 3.5" Sony micro-floppy</summary>
|
||||
/// <param name="tag">Byte array containing raw tag data</param>
|
||||
/// <returns>Decoded tag in Sony's format</returns>
|
||||
public static SonyTag? DecodeSonyTag(byte[] tag)
|
||||
@@ -73,9 +69,7 @@ namespace Aaru.Decoders
|
||||
return snTag;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes tag from a Profile
|
||||
/// </summary>
|
||||
/// <summary>Decodes tag from a Profile</summary>
|
||||
/// <param name="tag">Byte array containing raw tag data</param>
|
||||
/// <returns>Decoded tag in Profile's format</returns>
|
||||
public static ProfileTag? DecodeProfileTag(byte[] tag)
|
||||
@@ -123,9 +117,7 @@ namespace Aaru.Decoders
|
||||
return phTag;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes tag from a Priam
|
||||
/// </summary>
|
||||
/// <summary>Decodes tag from a Priam</summary>
|
||||
/// <param name="tag">Byte array containing raw tag data</param>
|
||||
/// <returns>Decoded tag in Priam's format</returns>
|
||||
public static PriamTag? DecodePriamTag(byte[] tag)
|
||||
@@ -175,9 +167,7 @@ namespace Aaru.Decoders
|
||||
return pmTag;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes tag from any known format
|
||||
/// </summary>
|
||||
/// <summary>Decodes tag from any known format</summary>
|
||||
/// <param name="tag">Byte array containing raw tag data</param>
|
||||
/// <returns>Decoded tag in Priam's format</returns>
|
||||
public static PriamTag? DecodeTag(byte[] tag)
|
||||
|
||||
12
Sega/CD.cs
12
Sega/CD.cs
@@ -40,16 +40,12 @@ using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.Decoders.Sega
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the IP.BIN from a SEGA CD / MEGA CD
|
||||
/// </summary>
|
||||
/// <summary>Represents the IP.BIN from a SEGA CD / MEGA CD</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class CD
|
||||
{
|
||||
/// <summary>
|
||||
/// Decodes an IP.BIN sector in SEGA CD / MEGA CD format
|
||||
/// </summary>
|
||||
/// <summary>Decodes an IP.BIN sector in SEGA CD / MEGA CD format</summary>
|
||||
/// <param name="ipbin_sector">IP.BIN sector</param>
|
||||
/// <returns>Decoded IP.BIN</returns>
|
||||
public static IPBin? DecodeIPBin(byte[] ipbin_sector)
|
||||
@@ -125,9 +121,7 @@ namespace Aaru.Decoders.Sega
|
||||
: (IPBin?)null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pretty prints a decoded IP.BIN in SEGA CD / MEGA CD format
|
||||
/// </summary>
|
||||
/// <summary>Pretty prints a decoded IP.BIN in SEGA CD / MEGA CD format</summary>
|
||||
/// <param name="decoded">Decoded IP.BIN</param>
|
||||
/// <returns>Description of the IP.BIN contents</returns>
|
||||
public static string Prettify(IPBin? decoded)
|
||||
|
||||
@@ -40,16 +40,12 @@ using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.Decoders.Sega
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the IP.BIN from a SEGA Dreamcast
|
||||
/// </summary>
|
||||
/// <summary>Represents the IP.BIN from a SEGA Dreamcast</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class Dreamcast
|
||||
{
|
||||
/// <summary>
|
||||
/// Decodes an IP.BIN sector in Dreamcast format
|
||||
/// </summary>
|
||||
/// <summary>Decodes an IP.BIN sector in Dreamcast format</summary>
|
||||
/// <param name="ipbin_sector">IP.BIN sector</param>
|
||||
/// <returns>Decoded IP.BIN</returns>
|
||||
public static IPBin? DecodeIPBin(byte[] ipbin_sector)
|
||||
@@ -113,9 +109,7 @@ namespace Aaru.Decoders.Sega
|
||||
return Encoding.ASCII.GetString(ipbin.SegaHardwareID) == "SEGA SEGAKATANA " ? ipbin : (IPBin?)null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pretty prints a decoded IP.BIN in Dreamcast format
|
||||
/// </summary>
|
||||
/// <summary>Pretty prints a decoded IP.BIN in Dreamcast format</summary>
|
||||
/// <param name="decoded">Decoded IP.BIN</param>
|
||||
/// <returns>Description of the IP.BIN contents</returns>
|
||||
public static string Prettify(IPBin? decoded)
|
||||
@@ -270,9 +264,7 @@ namespace Aaru.Decoders.Sega
|
||||
return IPBinInformation.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// SEGA IP.BIN format for Dreamcast
|
||||
/// </summary>
|
||||
/// <summary>SEGA IP.BIN format for Dreamcast</summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct IPBin
|
||||
{
|
||||
|
||||
@@ -40,16 +40,12 @@ using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.Decoders.Sega
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the IP.BIN from a SEGA Saturn
|
||||
/// </summary>
|
||||
/// <summary>Represents the IP.BIN from a SEGA Saturn</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"),
|
||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public static class Saturn
|
||||
{
|
||||
/// <summary>
|
||||
/// Decodes an IP.BIN sector in Saturn format
|
||||
/// </summary>
|
||||
/// <summary>Decodes an IP.BIN sector in Saturn format</summary>
|
||||
/// <param name="ipbin_sector">IP.BIN sector</param>
|
||||
/// <returns>Decoded IP.BIN</returns>
|
||||
public static IPBin? DecodeIPBin(byte[] ipbin_sector)
|
||||
@@ -103,9 +99,7 @@ namespace Aaru.Decoders.Sega
|
||||
return Encoding.ASCII.GetString(ipbin.SegaHardwareID) == "SEGA SEGASATURN " ? ipbin : (IPBin?)null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pretty prints a decoded IP.BIN in Saturn format
|
||||
/// </summary>
|
||||
/// <summary>Pretty prints a decoded IP.BIN in Saturn format</summary>
|
||||
/// <param name="decoded">Decoded IP.BIN</param>
|
||||
/// <returns>Description of the IP.BIN contents</returns>
|
||||
public static string Prettify(IPBin? decoded)
|
||||
|
||||
Reference in New Issue
Block a user