Move all localizable strings from Aaru.Decoders project to resources.

This commit is contained in:
2022-11-27 13:33:47 +00:00
parent bc415e205f
commit d70fd34e2b
91 changed files with 34135 additions and 4541 deletions

View File

@@ -71,7 +71,7 @@ indent_preprocessor_other = usual_indent
indent_switch_labels = true
indent_type_constraints = true
stick_comment = false
alignment_tab_fill_style = use_spaces
alignment_fill_style = use_spaces
align_multiline_parameter = true
align_multiline_extends_list = true
align_linq_query = true
@@ -475,7 +475,7 @@ csharp_indent_preprocessor_other = usual_indent
csharp_indent_switch_labels = true
csharp_indent_type_constraints = true
csharp_stick_comment = false
csharp_alignment_tab_fill_style = use_spaces
csharp_alignment_fill_style = use_spaces
csharp_align_multiline_parameter = true
csharp_align_multiline_extends_list = true
csharp_align_linq_query = true

File diff suppressed because it is too large Load Diff

View File

@@ -50,6 +50,11 @@
<Compile Include="Bluray\Spare.cs"/>
<Compile Include="CD\SectorBuilder.cs"/>
<Compile Include="CD\Subchannel.cs"/>
<Compile Include="Localization\Localization.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Localization.resx</DependentUpon>
</Compile>
<Compile Include="SCSI\Inquiry.cs"/>
<Compile Include="Floppy\Enums.cs"/>
<Compile Include="Floppy\System3740.cs"/>
@@ -188,6 +193,10 @@
<EmbeddedResource Include="..\LICENSE.LGPL">
<Link>LICENSE.LGPL</Link>
</EmbeddedResource>
<EmbeddedResource Update="Localization\Localization.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>

View File

@@ -1,5 +1,3 @@
<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>
<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/=localization/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=scsi_005Cmodes/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -76,7 +76,7 @@ public static class BCA
if(BCAResponse.Length != 68)
{
AaruConsole.DebugWriteLine("BD BCA decoder", "Found incorrect Blu-ray BCA size ({0} bytes)",
AaruConsole.DebugWriteLine("BD BCA decoder", Localization.Found_incorrect_Blu_ray_BCA_size_0_bytes,
BCAResponse.Length);
return null;
@@ -106,13 +106,13 @@ public static class BCA
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
sb.AppendFormat("Blu-ray Burst Cutting Area in hex follows:");
sb.AppendFormat(Localization.Blu_ray_Burst_Cutting_Area_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.BCA, 80));
return sb.ToString();

View File

@@ -92,7 +92,8 @@ public static class Cartridge
if(CSResponse.Length != 8)
{
AaruConsole.DebugWriteLine("BD Cartridge Status decoder",
"Found incorrect Blu-ray Cartridge Status size ({0} bytes)", CSResponse.Length);
Localization.Found_incorrect_Blu_ray_Cartridge_Status_size_0_bytes,
CSResponse.Length);
return null;
}
@@ -126,47 +127,47 @@ public static class Cartridge
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
if(response.Reserved3 != 0)
sb.AppendFormat("Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
sb.AppendFormat(Localization.Reserved3_equals_0_X8, response.Reserved3).AppendLine();
if(response.Reserved4 != 0)
sb.AppendFormat("Reserved4 = 0x{0:X8}", response.Reserved4).AppendLine();
sb.AppendFormat(Localization.Reserved4_equals_0_X8, response.Reserved4).AppendLine();
if(response.Reserved5 != 0)
sb.AppendFormat("Reserved5 = 0x{0:X8}", response.Reserved5).AppendLine();
sb.AppendFormat(Localization.Reserved5_equals_0_X8, response.Reserved5).AppendLine();
if(response.Reserved6 != 0)
sb.AppendFormat("Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
sb.AppendFormat(Localization.Reserved6_equals_0_X8, response.Reserved6).AppendLine();
if(response.Reserved7 != 0)
sb.AppendFormat("Reserved7 = 0x{0:X8}", response.Reserved7).AppendLine();
sb.AppendFormat(Localization.Reserved7_equals_0_X8, response.Reserved7).AppendLine();
#endif
if(response.Cartridge)
{
sb.AppendLine("Media is inserted in a cartridge");
sb.AppendLine(Localization.Media_is_inserted_in_a_cartridge);
if(response.OUT)
sb.AppendLine("Media has been taken out, or inserted in, the cartridge");
sb.AppendLine(Localization.Media_has_been_taken_out_or_inserted_in_the_cartridge);
if(response.CWP)
sb.AppendLine("Media is write protected");
sb.AppendLine(Localization.Media_is_write_protected);
}
else
{
sb.AppendLine("Media is not in a cartridge");
sb.AppendLine(Localization.Media_is_not_in_a_cartridge);
#if DEBUG
if(response.OUT)
sb.AppendLine("Media has out bit marked, shouldn't");
sb.AppendLine(Localization.Media_has_out_bit_marked_shouldnt);
if(response.CWP)
sb.AppendLine("Media has write protection bit marked, shouldn't");
sb.AppendLine(Localization.Media_has_write_protection_bit_marked_shouldnt);
#endif
}

View File

@@ -132,7 +132,8 @@ public static class DDS
if(decoded.Signature != DDSIdentifier)
{
AaruConsole.DebugWriteLine("BD DDS decoder", "Found incorrect DDS signature (0x{0:X4})", decoded.Signature);
AaruConsole.DebugWriteLine("BD DDS decoder", Localization.Found_incorrect_DDS_signature_0,
decoded.Signature);
return null;
}
@@ -173,50 +174,50 @@ public static class DDS
var sb = new StringBuilder();
sb.AppendFormat("DDS Format: 0x{0:X2}", response.Format).AppendLine();
sb.AppendFormat("DDS has ben updated {0} times", response.UpdateCount).AppendLine();
sb.AppendFormat("First PSN of Drive Area: 0x{0:X8}", response.DriveAreaPSN).AppendLine();
sb.AppendFormat("First PSN of Defect List: 0x{0:X8}", response.DefectListPSN).AppendLine();
sb.AppendFormat("PSN of User Data Area's LSN 0: 0x{0:X8}", response.PSNofLSNZero).AppendLine();
sb.AppendFormat("Last User Data Area's LSN 0: 0x{0:X8}", response.LastUserAreaLSN).AppendLine();
sb.AppendFormat("ISA0 size: {0}", response.ISA0).AppendLine();
sb.AppendFormat("OSA size: {0}", response.OSA).AppendLine();
sb.AppendFormat("ISA1 size: {0}", response.ISA1).AppendLine();
sb.AppendFormat("Spare Area Full Flags: 0x{0:X2}", response.SpareAreaFullFlags).AppendLine();
sb.AppendFormat("Disc Type Specific Field 1: 0x{0:X2}", response.DiscTypeSpecificField1).AppendLine();
sb.AppendFormat("Disc Type Specific Field 2: 0x{0:X8}", response.DiscTypeSpecificField2).AppendLine();
sb.AppendFormat("Blu-ray DDS Status Bits in hex follows:");
sb.AppendFormat(Localization.DDS_Format_0, response.Format).AppendLine();
sb.AppendFormat(Localization.DDS_has_ben_updated_0_times, response.UpdateCount).AppendLine();
sb.AppendFormat(Localization.First_PSN_of_Drive_Area_0, response.DriveAreaPSN).AppendLine();
sb.AppendFormat(Localization.First_PSN_of_Defect_List_0, response.DefectListPSN).AppendLine();
sb.AppendFormat(Localization.PSN_of_User_Data_Areas_LSN_0_0, response.PSNofLSNZero).AppendLine();
sb.AppendFormat(Localization.Last_User_Data_Areas_LSN_0_0, response.LastUserAreaLSN).AppendLine();
sb.AppendFormat(Localization.ISA0_size_0, response.ISA0).AppendLine();
sb.AppendFormat(Localization.OSA_size_0, response.OSA).AppendLine();
sb.AppendFormat(Localization.ISA1_size_0, response.ISA1).AppendLine();
sb.AppendFormat(Localization.Spare_Area_Full_Flags_0, response.SpareAreaFullFlags).AppendLine();
sb.AppendFormat(Localization.Disc_Type_Specific_Field_1_0, response.DiscTypeSpecificField1).AppendLine();
sb.AppendFormat(Localization.Disc_Type_Specific_Field_2_0, response.DiscTypeSpecificField2).AppendLine();
sb.AppendFormat(Localization.Blu_ray_DDS_Status_Bits_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.StatusBits, 80));
sb.AppendFormat("Blu-ray DDS Disc Type Specific Data in hex follows:");
sb.AppendFormat(Localization.Blu_ray_DDS_Disc_Type_Specific_Data_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.DiscTypeSpecificData, 80));
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
if(response.Reserved3 != 0)
sb.AppendFormat("Reserved3 = 0x{0:X2}", response.Reserved3).AppendLine();
sb.AppendFormat(Localization.Reserved_3_equals_0_X2, response.Reserved3).AppendLine();
if(response.Reserved4 != 0)
sb.AppendFormat("Reserved4 = 0x{0:X16}", response.Reserved4).AppendLine();
sb.AppendFormat(Localization.Reserved4_equals_0_X16, response.Reserved4).AppendLine();
if(response.Reserved5 != 0)
sb.AppendFormat("Reserved5 = 0x{0:X8}", response.Reserved5).AppendLine();
sb.AppendFormat(Localization.Reserved5_equals_0_X8, response.Reserved5).AppendLine();
if(response.Reserved6 != 0)
sb.AppendFormat("Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
sb.AppendFormat(Localization.Reserved6_equals_0_X8, response.Reserved6).AppendLine();
if(response.Reserved7 != 0)
sb.AppendFormat("Reserved7 = 0x{0:X2}", response.Reserved7).AppendLine();
sb.AppendFormat(Localization.Reserved7_equals_0_X2, response.Reserved7).AppendLine();
if(response.Reserved8 != 0)
sb.AppendFormat("Reserved8 = 0x{0:X2}", response.Reserved8).AppendLine();
sb.AppendFormat(Localization.Reserved8_equals_0_X2, response.Reserved8).AppendLine();
if(response.Reserved9 != 0)
sb.AppendFormat("Reserved9 = 0x{0:X8}", response.Reserved9).AppendLine();
sb.AppendFormat(Localization.Reserved9_equals_0_X8, response.Reserved9).AppendLine();
#endif
return sb.ToString();

View File

@@ -102,7 +102,8 @@ public static class DI
if(DIResponse.Length != 4100)
{
AaruConsole.DebugWriteLine("BD Disc Information decoder",
"Found incorrect Blu-ray Disc Information size ({0} bytes)", DIResponse.Length);
Localization.Found_incorrect_Blu_ray_Disc_Information_size_0_bytes,
DIResponse.Length);
return null;
}
@@ -192,7 +193,7 @@ public static class DI
default:
{
AaruConsole.DebugWriteLine("BD Disc Information decoder",
"Found unknown disc type identifier \"{0}\"",
Localization.Found_unknown_disc_type_identifier_0,
Encoding.ASCII.GetString(unit.DiscTypeIdentifier));
break;
@@ -226,56 +227,58 @@ public static class DI
foreach(DiscInformationUnits unit in response.Units)
{
sb.AppendFormat("DI Unit Sequence: {0}", unit.Sequence).AppendLine();
sb.AppendFormat("DI Unit Format: 0x{0:X2}", unit.Format).AppendLine();
sb.AppendFormat("There are {0} per block", unit.UnitsPerBlock).AppendLine();
sb.AppendFormat("This DI refers to layer {0}", unit.Layer).AppendLine();
sb.AppendFormat(Localization.DI_Unit_Sequence_0, unit.Sequence).AppendLine();
sb.AppendFormat(Localization.DI_Unit_Format_0, unit.Format).AppendLine();
sb.AppendFormat(Localization.There_are_0_per_block, unit.UnitsPerBlock).AppendLine();
sb.AppendFormat(Localization.This_DI_refers_to_layer_0, unit.Layer).AppendLine();
if(Encoding.ASCII.GetString(unit.DiscTypeIdentifier) == DiscTypeBDRE)
sb.AppendFormat("Legacy value: 0x{0:X2}", unit.Legacy).AppendLine();
sb.AppendFormat(Localization.Legacy_value_0, unit.Legacy).AppendLine();
sb.AppendLine(unit.Continuation ? "This DI continues previous unit" : "This DI starts a new unit");
sb.AppendFormat("DI Unit is {0} bytes", unit.Length).AppendLine();
sb.AppendLine(unit.Continuation ? Localization.This_DI_continues_previous_unit
: Localization.This_DI_starts_a_new_unit);
sb.AppendFormat("Disc type identifier: \"{0}\"", Encoding.ASCII.GetString(unit.DiscTypeIdentifier)).
sb.AppendFormat(Localization.DI_Unit_is_0_bytes, unit.Length).AppendLine();
sb.AppendFormat(Localization.Disc_type_identifier_0, Encoding.ASCII.GetString(unit.DiscTypeIdentifier)).
AppendLine();
switch(unit.DiscSize)
{
case BluSize.OneTwenty:
sb.AppendLine("Disc size: 120mm");
sb.AppendLine(Localization.Disc_size_120mm);
break;
case BluSize.Eighty:
sb.AppendLine("Disc size: 80mm");
sb.AppendLine(Localization.Disc_size_80mm);
break;
default:
sb.AppendFormat("Disc size: Unknown code {0}", (byte)unit.DiscSize).AppendLine();
sb.AppendFormat(Localization.Disc_size_Unknown_code_0, (byte)unit.DiscSize).AppendLine();
break;
}
sb.AppendFormat("Disc class: {0}", unit.DiscClass).AppendLine();
sb.AppendFormat("Disc version: {0}", unit.DiscVersion).AppendLine();
sb.AppendFormat("This disc has {0} layers", unit.Layers).AppendLine();
sb.AppendFormat(Localization.Disc_class_0, unit.DiscClass).AppendLine();
sb.AppendFormat(Localization.Disc_version_0, unit.DiscVersion).AppendLine();
sb.AppendFormat(Localization.This_disc_has_0_layers, unit.Layers).AppendLine();
switch(unit.DvdLayer)
{
case HybridLayer.None:
sb.AppendLine("This disc does not contain a DVD layer.");
sb.AppendLine(Localization.This_disc_does_not_contain_a_DVD_layer);
break;
case HybridLayer.ReadOnly:
sb.AppendLine("This disc contains a DVD-ROM layer.");
sb.AppendLine(Localization.This_disc_contains_a_DVD_ROM_layer);
break;
case HybridLayer.Recordable:
sb.AppendLine("This disc contains a DVD-R layer.");
sb.AppendLine(Localization.This_disc_contains_a_DVD_R_layer);
break;
case HybridLayer.Rewritable:
sb.AppendLine("This disc contains a DVD-RW layer.");
sb.AppendLine(Localization.This_disc_contains_a_DVD_RW_layer);
break;
}
@@ -283,19 +286,19 @@ public static class DI
switch(unit.CdLayer)
{
case HybridLayer.None:
sb.AppendLine("This disc does not contain a CD layer.");
sb.AppendLine(Localization.This_disc_does_not_contain_a_CD_layer);
break;
case HybridLayer.ReadOnly:
sb.AppendLine("This disc contains a CD-ROM layer.");
sb.AppendLine(Localization.This_disc_contains_a_CD_ROM_layer);
break;
case HybridLayer.Recordable:
sb.AppendLine("This disc contains a CD-R layer.");
sb.AppendLine(Localization.This_disc_contains_a_CD_R_layer);
break;
case HybridLayer.Rewritable:
sb.AppendLine("This disc contains a CD-RW layer.");
sb.AppendLine(Localization.This_disc_contains_a_CD_RW_layer);
break;
}
@@ -303,16 +306,16 @@ public static class DI
switch(unit.ChannelLength)
{
case ChannelLength.Seventy:
sb.AppendLine("Disc uses a 74.5nm channel giving 25 Gb per layer.");
sb.AppendLine(Localization.Disc_uses_a_74_5nm_channel_giving_25_Gb_per_layer);
break;
case ChannelLength.Sixty:
sb.AppendLine("Disc uses a 69.0nm channel giving 27 Gb per layer.");
sb.AppendLine(Localization.Disc_uses_a_69_0nm_channel_giving_27_Gb_per_layer);
break;
default:
sb.AppendFormat("Disc uses unknown channel length with code {0}", (byte)unit.ChannelLength).
AppendLine();
sb.AppendFormat(Localization.Disc_uses_unknown_channel_length_with_code_0,
(byte)unit.ChannelLength).AppendLine();
break;
}
@@ -320,15 +323,15 @@ public static class DI
switch(unit.Polarity)
{
case 0:
sb.AppendLine("Disc uses positive polarity.");
sb.AppendLine(Localization.Disc_uses_positive_polarity);
break;
case 1:
sb.AppendLine("Disc uses negative polarity.");
sb.AppendLine(Localization.Disc_uses_negative_polarity);
break;
default:
sb.AppendFormat("Disc uses unknown polarity with code {0}", unit.Polarity).AppendLine();
sb.AppendFormat(Localization.Disc_uses_unknown_polarity_with_code_0, unit.Polarity).AppendLine();
break;
}
@@ -337,15 +340,17 @@ public static class DI
switch(unit.RecordedPolarity)
{
case 0:
sb.AppendLine("Recorded marks have a lower reflectivity than unrecorded ones (HTL disc).");
sb.AppendLine(Localization.
Recorded_marks_have_a_lower_reflectivity_than_unrecorded_ones_HTL_disc);
break;
case 1:
sb.AppendLine("Recorded marks have a higher reflectivity than unrecorded ones (LTH disc).");
sb.AppendLine(Localization.
Recorded_marks_have_a_higher_reflectivity_than_unrecorded_ones_LTH_disc);
break;
default:
sb.AppendFormat("Disc uses unknown recorded reflectivity polarity with code {0}",
sb.AppendFormat(Localization.Disc_uses_unknown_recorded_reflectivity_polarity_with_code_0,
unit.RecordedPolarity).AppendLine();
break;
@@ -354,43 +359,47 @@ public static class DI
switch(unit.Bca)
{
case 0:
sb.AppendLine("Disc doesn't have a BCA.");
sb.AppendLine(Localization.Disc_doesn_t_have_a_BCA);
break;
case 1:
sb.AppendLine("Disc has a BCA.");
sb.AppendLine(Localization.Disc_has_a_BCA);
break;
default:
sb.AppendFormat("Disc uses unknown BCA code {0}", unit.Bca).AppendLine();
sb.AppendFormat(Localization.Disc_uses_unknown_BCA_code_0, unit.Bca).AppendLine();
break;
}
if(unit.MaxTransfer > 0)
sb.AppendFormat("Disc has a maximum transfer rate of {0} Mbit/sec.", unit.MaxTransfer).AppendLine();
sb.AppendFormat(Localization.Disc_has_a_maximum_transfer_rate_of_0_Mbit_sec, unit.MaxTransfer).
AppendLine();
else
sb.AppendLine("Disc does not specify a maximum transfer rate.");
sb.AppendLine(Localization.Disc_does_not_specify_a_maximum_transfer_rate);
sb.AppendFormat("Last user data PSN for disc: {0}", unit.LastPsn).AppendLine();
sb.AppendFormat(Localization.Last_user_data_PSN_for_disc_0, unit.LastPsn).AppendLine();
sb.AppendFormat("First address unit number of data zone in this layer: {0}", unit.FirstAun).AppendLine();
sb.AppendFormat(Localization.First_address_unit_number_of_data_zone_in_this_layer_0, unit.FirstAun).
AppendLine();
sb.AppendFormat("Last address unit number of data zone in this layer: {0}", unit.LastAun).AppendLine();
sb.AppendFormat(Localization.Last_address_unit_number_of_data_zone_in_this_layer_0, unit.LastAun).
AppendLine();
if(Encoding.ASCII.GetString(unit.DiscTypeIdentifier) == DiscTypeBDR ||
Encoding.ASCII.GetString(unit.DiscTypeIdentifier) == DiscTypeBDRE)
{
sb.AppendFormat("Disc manufacturer ID: \"{0}\"", Encoding.ASCII.GetString(unit.ManufacturerID)).
sb.AppendFormat(Localization.Disc_manufacturer_ID_0, Encoding.ASCII.GetString(unit.ManufacturerID)).
AppendLine();
sb.AppendFormat("Disc media type ID: \"{0}\"", Encoding.ASCII.GetString(unit.MediaTypeID)).AppendLine();
sb.AppendFormat(Localization.Disc_media_type_ID_0, Encoding.ASCII.GetString(unit.MediaTypeID)).
AppendLine();
sb.AppendFormat("Disc timestamp: 0x{0:X2}", unit.TimeStamp).AppendLine();
sb.AppendFormat("Disc product revision number: {0}", unit.ProductRevisionNumber).AppendLine();
sb.AppendFormat(Localization.Disc_timestamp_0, unit.TimeStamp).AppendLine();
sb.AppendFormat(Localization.Disc_product_revision_number_0, unit.ProductRevisionNumber).AppendLine();
}
sb.AppendFormat("Blu-ray DI Unit format dependent contents as hex follows:");
sb.AppendFormat(Localization.Blu_ray_DI_Unit_format_dependent_contents_as_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(unit.FormatDependentContents, 80));
}

View File

@@ -80,7 +80,8 @@ public static class Spare
if(SAIResponse.Length != 16)
{
AaruConsole.DebugWriteLine("BD Spare Area Information decoder",
"Found incorrect Blu-ray Spare Area Information size ({0} bytes)",
Localization.
Spare_Decode_Found_incorrect_Blu_ray_Spare_Area_Information_size_0_bytes,
SAIResponse.Length);
return null;
@@ -110,16 +111,16 @@ public static class Spare
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
if(response.Reserved3 != 0)
sb.AppendFormat("Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
sb.AppendFormat(Localization.Reserved3_equals_0_X8, response.Reserved3).AppendLine();
#endif
sb.AppendFormat("{0} free spare blocks", response.FreeSpareBlocks).AppendLine();
sb.AppendFormat("{0} allocated spare blocks", response.AllocatedSpareBlocks).AppendLine();
sb.AppendFormat(Localization._0_free_spare_blocks, response.FreeSpareBlocks).AppendLine();
sb.AppendFormat(Localization._0_allocated_spare_blocks, response.AllocatedSpareBlocks).AppendLine();
return sb.ToString();
}

View File

@@ -66,7 +66,8 @@ public static class ATIP
CDATIPResponse.Length != 28)
{
AaruConsole.DebugWriteLine("CD ATIP decoder",
"Expected CD ATIP size (32 bytes) is not received size ({0} bytes), not decoding",
Localization.
Expected_CD_ATIP_size_32_bytes_is_not_received_size_0_bytes_not_decoding,
CDATIPResponse.Length);
return null;
@@ -130,79 +131,80 @@ public static class ATIP
if(response.DDCD)
{
sb.AppendFormat("Indicative Target Writing Power: 0x{0:X2}", response.ITWP).AppendLine();
sb.AppendLine(response.DiscType ? "Disc is DDCD-RW" : "Disc is DDCD-R");
sb.AppendFormat(Localization.Indicative_Target_Writing_Power_0, response.ITWP).AppendLine();
sb.AppendLine(response.DiscType ? Localization.Disc_is_DDCD_RW : Localization.Disc_is_DDCD_R);
switch(response.ReferenceSpeed)
{
case 2:
sb.AppendLine("Reference speed is 4x");
sb.AppendLine(Localization.Reference_speed_is_4x);
break;
case 3:
sb.AppendLine("Reference speed is 8x");
sb.AppendLine(Localization.Reference_speed_is_8x);
break;
default:
sb.AppendFormat("Reference speed set is unknown: {0}", response.ReferenceSpeed).AppendLine();
sb.AppendFormat(Localization.Reference_speed_set_is_unknown_0, response.ReferenceSpeed).
AppendLine();
break;
}
sb.AppendFormat("ATIP Start time of Lead-in: 0x{0:X6}",
sb.AppendFormat(Localization.ATIP_Start_time_of_Lead_in_0,
(response.LeadInStartMin << 16) + (response.LeadInStartSec << 8) +
response.LeadInStartFrame).AppendLine();
sb.AppendFormat("ATIP Last possible start time of Lead-out: 0x{0:X6}",
sb.AppendFormat(Localization.ATIP_Last_possible_start_time_of_Lead_out_0,
(response.LeadOutStartMin << 16) + (response.LeadOutStartSec << 8) +
response.LeadOutStartFrame).AppendLine();
sb.AppendFormat("S4 value: 0x{0:X6}",
sb.AppendFormat(Localization.S4_value_0,
(response.S4Values[0] << 16) + (response.S4Values[1] << 8) + response.S4Values[2]).
AppendLine();
}
else
{
sb.AppendFormat("Indicative Target Writing Power: 0x{0:X2}", response.ITWP & 0x07).AppendLine();
sb.AppendFormat(Localization.Indicative_Target_Writing_Power_0, response.ITWP & 0x07).AppendLine();
if(response.DiscType)
{
switch(response.DiscSubType)
{
case 0:
sb.AppendLine("Disc is CD-RW");
sb.AppendLine(Localization.Disc_is_CD_RW);
break;
case 1:
sb.AppendLine("Disc is High-Speed CD-RW");
sb.AppendLine(Localization.Disc_is_High_Speed_CD_RW);
break;
case 2:
sb.AppendLine("Disc is Ultra-Speed CD-RW");
sb.AppendLine(Localization.Disc_is_Ultra_Speed_CD_RW);
break;
case 3:
sb.AppendLine("Disc is Ultra-Speed+ CD-RW");
sb.AppendLine(Localization.Disc_is_Ultra_Speed_Plus_CD_RW);
break;
case 4:
sb.AppendLine("Disc is medium type B, low beta category (B-) CD-RW");
sb.AppendLine(Localization.Disc_is_medium_type_B_low_beta_category_CD_RW);
break;
case 5:
sb.AppendLine("Disc is medium type B, high beta category (B+) CD-RW");
sb.AppendLine(Localization.Disc_is_medium_type_B_high_beta_category_CD_RW);
break;
case 6:
sb.AppendLine("Disc is medium type C, low beta category (C-) CD-RW");
sb.AppendLine(Localization.Disc_is_medium_type_C_low_beta_category_CD_RW);
break;
case 7:
sb.AppendLine("Disc is medium type C, high beta category (C+) CD-RW");
sb.AppendLine(Localization.Disc_is_medium_type_C_high_beta_category_CD_RW);
break;
default:
sb.AppendFormat("Unknown CD-RW disc subtype: {0}", response.DiscSubType).AppendLine();
sb.AppendFormat(Localization.Unknown_CD_RW_disc_subtype_0, response.DiscSubType).AppendLine();
break;
}
@@ -210,85 +212,86 @@ public static class ATIP
switch(response.ReferenceSpeed)
{
case 1:
sb.AppendLine("Reference speed is 2x");
sb.AppendLine(Localization.Reference_speed_is_2x);
break;
default:
sb.AppendFormat("Reference speed set is unknown: {0}", response.ReferenceSpeed).AppendLine();
sb.AppendFormat(Localization.Reference_speed_set_is_unknown_0, response.ReferenceSpeed).
AppendLine();
break;
}
}
else
{
sb.AppendLine("Disc is CD-R");
sb.AppendLine(Localization.Disc_is_CD_R);
switch(response.DiscSubType)
{
case 0:
sb.AppendLine("Disc is normal speed (CLV) CD-R");
sb.AppendLine(Localization.Disc_is_normal_speed_CLV_CD_R);
break;
case 1:
sb.AppendLine("Disc is high speed (CAV) CD-R");
sb.AppendLine(Localization.Disc_is_high_speed_CAV_CD_R);
break;
case 2:
sb.AppendLine("Disc is medium type A, low beta category (A-) CD-R");
sb.AppendLine(Localization.Disc_is_medium_type_A_low_beta_category_CD_R);
break;
case 3:
sb.AppendLine("Disc is medium type A, high beta category (A+) CD-R");
sb.AppendLine(Localization.Disc_is_medium_type_A_high_beta_category_CD_R);
break;
case 4:
sb.AppendLine("Disc is medium type B, low beta category (B-) CD-R");
sb.AppendLine(Localization.Disc_is_medium_type_B_low_beta_category_CD_R);
break;
case 5:
sb.AppendLine("Disc is medium type B, high beta category (B+) CD-R");
sb.AppendLine(Localization.Disc_is_medium_type__high_beta_category__CD_R);
break;
case 6:
sb.AppendLine("Disc is medium type C, low beta category (C-) CD-R");
sb.AppendLine(Localization.Disc_is_medium_type_C_low_beta_category__CD_R);
break;
case 7:
sb.AppendLine("Disc is medium type C, high beta category (C+) CD-R");
sb.AppendLine(Localization.Disc_is_medium_type_C_high_beta_category__CD_R);
break;
default:
sb.AppendFormat("Unknown CD-R disc subtype: {0}", response.DiscSubType).AppendLine();
sb.AppendFormat(Localization.Unknown_CD_R_disc_subtype_0, response.DiscSubType).AppendLine();
break;
}
}
sb.AppendLine(response.URU ? "Disc use is unrestricted" : "Disc use is restricted");
sb.AppendLine(response.URU ? Localization.Disc_use_is_unrestricted : Localization.Disc_use_is_restricted);
sb.AppendFormat("ATIP Start time of Lead-in: {0}:{1:D2}:{2:D2}", response.LeadInStartMin,
sb.AppendFormat(Localization.ATIP_Start_time_of_Lead_in_0_1_2, response.LeadInStartMin,
response.LeadInStartSec, response.LeadInStartFrame).AppendLine();
sb.AppendFormat("ATIP Last possible start time of Lead-out: {0}:{1:D2}:{2:D2}", response.LeadOutStartMin,
sb.AppendFormat(Localization.ATIP_Last_possible_start_time_of_Lead_out_0_1_2, response.LeadOutStartMin,
response.LeadOutStartSec, response.LeadOutStartFrame).AppendLine();
if(response.A1Valid)
sb.AppendFormat("A1 value: 0x{0:X6}",
sb.AppendFormat(Localization.A1_value_0,
(response.A1Values[0] << 16) + (response.A1Values[1] << 8) + response.A1Values[2]).
AppendLine();
if(response.A2Valid)
sb.AppendFormat("A2 value: 0x{0:X6}",
sb.AppendFormat(Localization.A2_value_0,
(response.A2Values[0] << 16) + (response.A2Values[1] << 8) + response.A2Values[2]).
AppendLine();
if(response.A3Valid)
sb.AppendFormat("A3 value: 0x{0:X6}",
sb.AppendFormat(Localization.A3_value_0,
(response.A3Values[0] << 16) + (response.A3Values[1] << 8) + response.A3Values[2]).
AppendLine();
if(response.S4Values != null)
sb.AppendFormat("S4 value: 0x{0:X6}",
sb.AppendFormat(Localization.S4_value_0,
(response.S4Values[0] << 16) + (response.S4Values[1] << 8) + response.S4Values[2]).
AppendLine();
}
@@ -300,15 +303,15 @@ public static class ATIP
int frm = response.LeadInStartFrame - type;
if(response.DiscType)
sb.AppendLine("Disc uses phase change");
sb.AppendLine(Localization.Disc_uses_phase_change);
else
sb.AppendLine(type < 5 ? "Disc uses long strategy type dye (Cyanine, AZO, etc...)"
: "Disc uses short strategy type dye (Phthalocyanine, etc...)");
sb.AppendLine(type < 5 ? Localization.Disc_uses_long_strategy_type_dye_Cyanine_AZO_etc
: Localization.Disc_uses_short_strategy_type_dye_Phthalocyanine_etc);
string manufacturer = ManufacturerFromATIP(response.LeadInStartSec, frm);
if(manufacturer != "")
sb.AppendFormat("Disc manufactured by: {0}", manufacturer).AppendLine();
sb.AppendFormat(Localization.Disc_manufactured_by_0, manufacturer).AppendLine();
return sb.ToString();
}

View File

@@ -111,7 +111,8 @@ public static class CDTextOnLeadIn
if(decoded.DataLength + 2 != CDTextResponse.Length)
{
AaruConsole.DebugWriteLine("CD-TEXT decoder",
"Expected CD-TEXT size ({0} bytes) is not received size ({1} bytes), not decoding",
Localization.
Expected_CD_TEXT_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
decoded.DataLength + 2, CDTextResponse.Length);
return null;
@@ -143,10 +144,10 @@ public static class CDTextOnLeadIn
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
foreach(CDTextPack descriptor in response.DataPacks)
@@ -154,7 +155,8 @@ public static class CDTextOnLeadIn
{
// Ignore NOPs
if((descriptor.HeaderID1 & 0x80) != 0)
sb.AppendFormat("Incorrect CD-Text pack type {0}, not decoding", descriptor.HeaderID1).AppendLine();
sb.AppendFormat(Localization.Incorrect_CD_Text_pack_type_0_not_decoding, descriptor.HeaderID1).
AppendLine();
}
else
{
@@ -162,36 +164,33 @@ public static class CDTextOnLeadIn
{
case 0x80:
{
sb.Append("CD-Text pack contains title for ");
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("album");
sb.AppendLine(Localization.CD_Text_pack_contains_title_for_album);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.CD_Text_pack_contains_title_for_track_0, descriptor.HeaderID2).
AppendLine();
break;
}
case 0x81:
{
sb.Append("CD-Text pack contains performer for ");
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("album");
sb.AppendLine(Localization.CD_Text_pack_contains_performer_for_album);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.CD_Text_pack_contains_performer_for_track_0,
descriptor.HeaderID2).AppendLine();
break;
}
case 0x82:
{
sb.Append("CD-Text pack contains songwriter for ");
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("album");
sb.AppendLine(Localization.CD_Text_pack_contains_songwriter_for_album);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.CD_Text_pack_contains_songwriter_for_track_0,
descriptor.HeaderID2).AppendLine();
break;
}
@@ -199,61 +198,59 @@ public static class CDTextOnLeadIn
case 0x83:
{
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("album");
sb.AppendLine(Localization.album);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.track_0, descriptor.HeaderID2).AppendLine();
break;
}
case 0x84:
{
sb.Append("CD-Text pack contains arranger for ");
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("album");
sb.AppendLine(Localization.CD_Text_pack_contains_arranger_for_album);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.CD_Text_pack_contains_arranger_for_track_0,
descriptor.HeaderID2).AppendLine();
break;
}
case 0x85:
{
sb.Append("CD-Text pack contains content provider's message for ");
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("album");
sb.AppendLine(Localization.CD_Text_pack_contains_content_provider_message_for_album);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.CD_Text_pack_contains_content_provider_message_for_track_0,
descriptor.HeaderID2).AppendLine();
break;
}
case 0x86:
{
sb.AppendLine("CD-Text pack contains disc identification information");
sb.AppendLine(Localization.CD_Text_pack_contains_disc_identification_information);
break;
}
case 0x87:
{
sb.AppendLine("CD-Text pack contains genre identification information");
sb.AppendLine(Localization.CD_Text_pack_contains_genre_identification_information);
break;
}
case 0x88:
{
sb.AppendLine("CD-Text pack contains table of contents information");
sb.AppendLine(Localization.CD_Text_pack_contains_table_of_contents_information);
break;
}
case 0x89:
{
sb.AppendLine("CD-Text pack contains second table of contents information");
sb.AppendLine(Localization.CD_Text_pack_contains_second_table_of_contents_information);
break;
}
@@ -262,14 +259,14 @@ public static class CDTextOnLeadIn
case 0x8B:
case 0x8C:
{
sb.AppendLine("CD-Text pack contains reserved data");
sb.AppendLine(Localization.CD_Text_pack_contains_reserved_data);
break;
}
case 0x8D:
{
sb.AppendLine("CD-Text pack contains data reserved for content provider only");
sb.AppendLine(Localization.CD_Text_pack_contains_data_reserved_for_content_provider_only);
break;
}
@@ -277,16 +274,16 @@ public static class CDTextOnLeadIn
case 0x8E:
{
if(descriptor.HeaderID2 == 0x00)
sb.AppendLine("CD-Text pack contains UPC");
sb.AppendLine(Localization.CD_Text_pack_contains_UPC);
else
sb.AppendFormat("track {0}", descriptor.HeaderID2).AppendLine();
sb.AppendFormat(Localization.track_0, descriptor.HeaderID2).AppendLine();
break;
}
case 0x8F:
{
sb.AppendLine("CD-Text pack contains size block information");
sb.AppendLine(Localization.CD_Text_pack_contains_size_block_information);
break;
}
@@ -305,12 +302,12 @@ public static class CDTextOnLeadIn
case 0x8E:
{
if(descriptor.DBCC)
sb.AppendLine("Double Byte Character Code is used");
sb.AppendLine(Localization.Double_Byte_Character_Code_is_used);
sb.AppendFormat("Block number {0}", descriptor.BlockNumber).AppendLine();
sb.AppendFormat("Character position {0}", descriptor.CharacterPosition).AppendLine();
sb.AppendFormat(Localization.Block_number_0, descriptor.BlockNumber).AppendLine();
sb.AppendFormat(Localization.Character_position_0, descriptor.CharacterPosition).AppendLine();
sb.AppendFormat("Text field: \"{0}\"",
sb.AppendFormat(Localization.Text_field_0,
StringHandlers.CToString(descriptor.TextDataField,
Encoding.GetEncoding("iso-8859-1"))).AppendLine();
@@ -319,14 +316,14 @@ public static class CDTextOnLeadIn
default:
{
sb.AppendFormat("Binary contents: {0}",
sb.AppendFormat(Localization.Binary_contents_0,
PrintHex.ByteArrayToHexArrayString(descriptor.TextDataField, 28)).AppendLine();
break;
}
}
sb.AppendFormat("CRC: 0x{0:X4}", descriptor.CRC).AppendLine();
sb.AppendFormat(Localization.CRC_0_X4, descriptor.CRC).AppendLine();
}
return sb.ToString();

View File

@@ -60,13 +60,6 @@ namespace Aaru.Decoders.CD;
SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public static class FullTOC
{
const string StereoNoPre = "Stereo audio track with no pre-emphasis";
const string StereoPreEm = "Stereo audio track with 50/15 μs pre-emphasis";
const string QuadNoPreEm = "Quadraphonic audio track with no pre-emphasis";
const string QuadPreEmph = "Quadraphonic audio track with 50/15 μs pre-emphasis";
const string DataUnintrp = "Data track, recorded uninterrupted";
const string DataIncrtly = "Data track, recorded incrementally";
public static CDFullTOC? Decode(byte[] CDFullTOCResponse)
{
if(CDFullTOCResponse is not { Length: > 4 })
@@ -84,7 +77,8 @@ public static class FullTOC
if(decoded.DataLength + 2 != CDFullTOCResponse.Length)
{
AaruConsole.DebugWriteLine("CD full TOC decoder",
"Expected CDFullTOC size ({0} bytes) is not received size ({1} bytes), not decoding",
Localization.
Expected_CDFullTOC_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
decoded.DataLength + 2, CDFullTOCResponse.Length);
return null;
@@ -122,34 +116,34 @@ public static class FullTOC
int lastSession = 0;
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
sb.AppendFormat(Localization.First_complete_session_number_0, response.FirstCompleteSession).AppendLine();
sb.AppendFormat(Localization.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.TNO != 0)
{
sb.AppendLine("Unknown TOC entry format, printing values as-is");
sb.AppendFormat("SessionNumber = {0}", descriptor.SessionNumber).AppendLine();
sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine();
sb.AppendFormat("CONTROL = {0}", descriptor.CONTROL).AppendLine();
sb.AppendFormat("TNO = {0}", descriptor.TNO).AppendLine();
sb.AppendFormat("POINT = {0}", descriptor.POINT).AppendLine();
sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine();
sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine();
sb.AppendFormat("Frame = {0}", descriptor.Frame).AppendLine();
sb.AppendFormat("HOUR = {0}", descriptor.HOUR).AppendLine();
sb.AppendFormat("PHOUR = {0}", descriptor.PHOUR).AppendLine();
sb.AppendFormat("PMIN = {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat("PSEC = {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat("PFRAME = {0}", descriptor.PFRAME).AppendLine();
sb.AppendLine(Localization.Unknown_TOC_entry_format_printing_values_as_is);
sb.AppendLine($"SessionNumber = {descriptor.SessionNumber}");
sb.AppendLine($"ADR = {descriptor.ADR}");
sb.AppendLine($"CONTROL = {descriptor.CONTROL}");
sb.AppendLine($"TNO = {descriptor.TNO}");
sb.AppendLine($"POINT = {descriptor.POINT}");
sb.AppendLine($"Min = {descriptor.Min}");
sb.AppendLine($"Sec = {descriptor.Sec}");
sb.AppendLine($"Frame = {descriptor.Frame}");
sb.AppendLine($"HOUR = {descriptor.HOUR}");
sb.AppendLine($"PHOUR = {descriptor.PHOUR}");
sb.AppendLine($"PMIN = {descriptor.PMIN}");
sb.AppendLine($"PSEC = {descriptor.PSEC}");
sb.AppendLine($"PFRAME = {descriptor.PFRAME}");
}
else
{
if(descriptor.SessionNumber > lastSession)
{
sb.AppendFormat("Session {0}", descriptor.SessionNumber).AppendLine();
sb.AppendFormat(Localization.Session_0, descriptor.SessionNumber).AppendLine();
lastSession = descriptor.SessionNumber;
}
@@ -162,40 +156,45 @@ public static class FullTOC
{
case 0xA0 when descriptor.ADR == 4:
{
sb.AppendFormat("First video track number: {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat(Localization.First_video_track_number_0, descriptor.PMIN).AppendLine();
switch(descriptor.PSEC)
{
case 0x10:
sb.AppendLine("CD-V single in NTSC format with digital stereo sound");
sb.AppendLine(Localization.
CD_V_single_in_NTSC_format_with_digital_stereo_sound);
break;
case 0x11:
sb.AppendLine("CD-V single in NTSC format with digital bilingual sound");
sb.AppendLine(Localization.
CD_V_single_in_NTSC_format_with_digital_bilingual_sound);
break;
case 0x12:
sb.AppendLine("CD-V disc in NTSC format with digital stereo sound");
sb.AppendLine(Localization.CD_V_disc_in_NTSC_format_with_digital_stereo_sound);
break;
case 0x13:
sb.AppendLine("CD-V disc in NTSC format with digital bilingual sound");
sb.AppendLine(Localization.
CD_V_disc_in_NTSC_format_with_digital_bilingual_sound);
break;
case 0x20:
sb.AppendLine("CD-V single in PAL format with digital stereo sound");
sb.AppendLine(Localization.CD_V_single_in_PAL_format_with_digital_stereo_sound);
break;
case 0x21:
sb.AppendLine("CD-V single in PAL format with digital bilingual sound");
sb.AppendLine(Localization.
CD_V_single_in_PAL_format_with_digital_bilingual_sound);
break;
case 0x22:
sb.AppendLine("CD-V disc in PAL format with digital stereo sound");
sb.AppendLine(Localization.CD_V_disc_in_PAL_format_with_digital_stereo_sound);
break;
case 0x23:
sb.AppendLine("CD-V disc in PAL format with digital bilingual sound");
sb.AppendLine(Localization.
CD_V_disc_in_PAL_format_with_digital_bilingual_sound);
break;
}
@@ -205,80 +204,80 @@ public static class FullTOC
case 0xA0 when descriptor.ADR == 1:
{
sb.AppendFormat("First track number: {0} (", descriptor.PMIN);
sb.AppendFormat(Localization.First_track_number_0_open_parenthesis, descriptor.PMIN);
switch((TocControl)(descriptor.CONTROL & 0x0D))
{
case TocControl.TwoChanNoPreEmph:
sb.Append(StereoNoPre);
sb.Append(Localization.Stereo_audio_track_with_no_pre_emphasis);
break;
case TocControl.TwoChanPreEmph:
sb.Append(StereoPreEm);
sb.Append(Localization.Stereo_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.FourChanNoPreEmph:
sb.Append(QuadNoPreEm);
sb.Append(Localization.Quadraphonic_audio_track_with_no_pre_emphasis);
break;
case TocControl.FourChanPreEmph:
sb.Append(QuadPreEmph);
sb.Append(Localization.Quadraphonic_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.DataTrack:
sb.Append(DataUnintrp);
sb.Append(Localization.Data_track_recorded_uninterrupted);
break;
case TocControl.DataTrackIncremental:
sb.Append(DataIncrtly);
sb.Append(Localization.Data_track_recorded_incrementally);
break;
}
sb.AppendLine(")");
sb.AppendFormat("Disc type: {0}", descriptor.PSEC).AppendLine();
sb.AppendLine(Localization.close_parenthesis);
sb.AppendFormat(Localization.Disc_type_0, descriptor.PSEC).AppendLine();
//sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
break;
}
case 0xA1 when descriptor.ADR == 4:
sb.AppendFormat("Last video track number: {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat(Localization.Last_video_track_number_0, descriptor.PMIN).AppendLine();
break;
case 0xA1 when descriptor.ADR == 1:
{
sb.AppendFormat("Last track number: {0} (", descriptor.PMIN);
sb.AppendFormat(Localization.Last_track_number_0_open_parenthesis, descriptor.PMIN);
switch((TocControl)(descriptor.CONTROL & 0x0D))
{
case TocControl.TwoChanNoPreEmph:
sb.Append(StereoNoPre);
sb.Append(Localization.Stereo_audio_track_with_no_pre_emphasis);
break;
case TocControl.TwoChanPreEmph:
sb.Append(StereoPreEm);
sb.Append(Localization.Stereo_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.FourChanNoPreEmph:
sb.Append(QuadNoPreEm);
sb.Append(Localization.Quadraphonic_audio_track_with_no_pre_emphasis);
break;
case TocControl.FourChanPreEmph:
sb.Append(QuadPreEmph);
sb.Append(Localization.Quadraphonic_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.DataTrack:
sb.Append(DataUnintrp);
sb.Append(Localization.Data_track_recorded_uninterrupted);
break;
case TocControl.DataTrackIncremental:
sb.Append(DataIncrtly);
sb.Append(Localization.Data_track_recorded_incrementally);
break;
}
sb.AppendLine(")");
sb.AppendLine(Localization.close_parenthesis);
//sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
break;
@@ -287,11 +286,10 @@ public static class FullTOC
case 0xA2:
{
if(descriptor.PHOUR > 0)
sb.AppendFormat("Lead-out start position: {3:D2}:{0:D2}:{1:D2}:{2:D2}",
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR).AppendLine();
sb.AppendFormat(Localization.Lead_out_start_position_3_0_1_2, descriptor.PMIN,
descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR).AppendLine();
else
sb.AppendFormat("Lead-out start position: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN,
sb.AppendFormat(Localization.Lead_out_start_position_0_1_2, descriptor.PMIN,
descriptor.PSEC, descriptor.PFRAME).AppendLine();
//sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
@@ -302,12 +300,12 @@ public static class FullTOC
case TocControl.TwoChanPreEmph:
case TocControl.FourChanNoPreEmph:
case TocControl.FourChanPreEmph:
sb.AppendLine("Lead-out is audio type");
sb.AppendLine(Localization.Lead_out_is_audio_type);
break;
case TocControl.DataTrack:
case TocControl.DataTrackIncremental:
sb.AppendLine("Lead-out is data type");
sb.AppendLine(Localization.Lead_out_is_data_type);
break;
}
@@ -317,16 +315,16 @@ public static class FullTOC
case 0xF0:
{
sb.AppendFormat("Book type: 0x{0:X2}", descriptor.PMIN);
sb.AppendFormat("Material type: 0x{0:X2}", descriptor.PSEC);
sb.AppendFormat("Moment of inertia: 0x{0:X2}", descriptor.PFRAME);
sb.AppendFormat(Localization.Book_type_0, descriptor.PMIN);
sb.AppendFormat(Localization.Material_type_0, descriptor.PSEC);
sb.AppendFormat(Localization.Moment_of_inertia_0, descriptor.PFRAME);
if(descriptor.PHOUR > 0)
sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min,
descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine();
sb.AppendFormat(Localization.Absolute_time_3_0_1_2, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR).AppendLine();
else
sb.AppendFormat("Absolute time: {0:D2}:{1:D2}:{2:D2}", descriptor.Min,
descriptor.Sec, descriptor.Frame).AppendLine();
sb.AppendFormat(Localization.Absolute_time_0_1_2, descriptor.Min, descriptor.Sec,
descriptor.Frame).AppendLine();
break;
}
@@ -335,70 +333,70 @@ public static class FullTOC
{
if(descriptor.POINT is >= 0x01 and <= 0x63)
if(descriptor.ADR == 4)
sb.AppendFormat("Video track {3} starts at: {0:D2}:{1:D2}:{2:D2}",
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.POINT).AppendLine();
sb.AppendFormat(Localization.Video_track_3_starts_at_0_1_2, descriptor.PMIN,
descriptor.PSEC, descriptor.PFRAME, descriptor.POINT).
AppendLine();
else
{
string type = "Audio";
if((TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrack ||
(TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrackIncremental)
type = "Data";
bool data = (TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrack ||
(TocControl)(descriptor.CONTROL & 0x0D) ==
TocControl.DataTrackIncremental;
if(descriptor.PHOUR > 0)
sb.AppendFormat("{5} track {3} starts at: {4:D2}:{0:D2}:{1:D2}:{2:D2} (",
sb.AppendFormat(data ? Localization.Data_track_3_starts_at_4_0_1_2_open_parenthesis : Localization.Audio_track_3_starts_at_4_0_1_2_open_parenthesis,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.POINT, descriptor.PHOUR, type);
descriptor.POINT, descriptor.PHOUR);
else
sb.AppendFormat("{4} track {3} starts at: {0:D2}:{1:D2}:{2:D2} (",
sb.AppendFormat(data ? Localization.Data_track_3_starts_at_0_1_2_open_parenthesis : Localization.Audio_track_3_starts_at_0_1_2_open_parenthesis,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.POINT, type);
descriptor.POINT);
switch((TocControl)(descriptor.CONTROL & 0x0D))
{
case TocControl.TwoChanNoPreEmph:
sb.Append(StereoNoPre);
sb.Append(Localization.Stereo_audio_track_with_no_pre_emphasis);
break;
case TocControl.TwoChanPreEmph:
sb.Append(StereoPreEm);
sb.Append(Localization.Stereo_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.FourChanNoPreEmph:
sb.Append(QuadNoPreEm);
sb.Append(Localization.Quadraphonic_audio_track_with_no_pre_emphasis);
break;
case TocControl.FourChanPreEmph:
sb.Append(QuadPreEmph);
sb.Append(Localization.
Quadraphonic_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.DataTrack:
sb.Append(DataUnintrp);
sb.Append(Localization.Data_track_recorded_uninterrupted);
break;
case TocControl.DataTrackIncremental:
sb.Append(DataIncrtly);
sb.Append(Localization.Data_track_recorded_incrementally);
break;
}
sb.AppendLine(")");
sb.AppendLine(Localization.close_parenthesis);
}
else
{
sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine();
sb.AppendFormat("CONTROL = {0}", descriptor.CONTROL).AppendLine();
sb.AppendFormat("TNO = {0}", descriptor.TNO).AppendLine();
sb.AppendFormat("POINT = {0}", descriptor.POINT).AppendLine();
sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine();
sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine();
sb.AppendFormat("Frame = {0}", descriptor.Frame).AppendLine();
sb.AppendFormat("HOUR = {0}", descriptor.HOUR).AppendLine();
sb.AppendFormat("PHOUR = {0}", descriptor.PHOUR).AppendLine();
sb.AppendFormat("PMIN = {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat("PSEC = {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat("PFRAME = {0}", descriptor.PFRAME).AppendLine();
sb.Append($"ADR = {descriptor.ADR}").AppendLine();
sb.Append($"CONTROL = {descriptor.CONTROL}").AppendLine();
sb.Append($"TNO = {descriptor.TNO}").AppendLine();
sb.Append($"POINT = {descriptor.POINT}").AppendLine();
sb.Append($"Min = {descriptor.Min}").AppendLine();
sb.Append($"Sec = {descriptor.Sec}").AppendLine();
sb.Append($"Frame = {descriptor.Frame}").AppendLine();
sb.Append($"HOUR = {descriptor.HOUR}").AppendLine();
sb.Append($"PHOUR = {descriptor.PHOUR}").AppendLine();
sb.Append($"PMIN = {descriptor.PMIN}").AppendLine();
sb.Append($"PSEC = {descriptor.PSEC}").AppendLine();
sb.Append($"PFRAME = {descriptor.PFRAME}").AppendLine();
}
break;
@@ -417,23 +415,23 @@ public static class FullTOC
if(descriptor.PHOUR > 0)
{
sb.
AppendFormat("Start of next possible program in the recordable area of the disc: {3:D2}:{0:D2}:{1:D2}:{2:D2}",
AppendFormat(Localization.Start_of_next_possible_program_in_the_recordable_area_of_the_disc_3_0_1_2,
descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).
AppendLine();
sb.
AppendFormat("Maximum start of outermost Lead-out in the recordable area of the disc: {3:D2}:{0:D2}:{1:D2}:{2:D2}",
AppendFormat(Localization.Maximum_start_of_outermost_Lead_out_in_the_recordable_area_of_the_disc_3_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR).AppendLine();
}
else
{
sb.
AppendFormat("Start of next possible program in the recordable area of the disc: {0:D2}:{1:D2}:{2:D2}",
AppendFormat(Localization.Start_of_next_possible_program_in_the_recordable_area_of_the_disc_0_1_2,
descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine();
sb.
AppendFormat("Maximum start of outermost Lead-out in the recordable area of the disc: {0:D2}:{1:D2}:{2:D2}",
AppendFormat(Localization.Maximum_start_of_outermost_Lead_out_in_the_recordable_area_of_the_disc_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
}
@@ -442,9 +440,11 @@ public static class FullTOC
case 0xB1:
{
sb.AppendFormat("Number of skip interval pointers: {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat(Localization.Number_of_skip_interval_pointers_0, descriptor.PMIN).
AppendLine();
sb.AppendFormat("Number of skip track pointers: {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat(Localization.Number_of_skip_track_pointers_0, descriptor.PSEC).
AppendLine();
break;
}
@@ -453,44 +453,43 @@ public static class FullTOC
case 0xB3:
case 0xB4:
{
sb.AppendFormat("Skip track {0}", descriptor.Min).AppendLine();
sb.AppendFormat("Skip track {0}", descriptor.Sec).AppendLine();
sb.AppendFormat("Skip track {0}", descriptor.Frame).AppendLine();
sb.AppendFormat("Skip track {0}", descriptor.Zero).AppendLine();
sb.AppendFormat("Skip track {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat("Skip track {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat("Skip track {0}", descriptor.PFRAME).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.Min).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.Sec).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.Frame).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.Zero).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.PMIN).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.PSEC).AppendLine();
sb.AppendFormat(Localization.Skip_track_0, descriptor.PFRAME).AppendLine();
break;
}
case 0xC0:
{
sb.AppendFormat("Optimum recording power: 0x{0:X2}", descriptor.Min).AppendLine();
sb.AppendFormat(Localization.Optimum_recording_power_0, descriptor.Min).AppendLine();
if(descriptor.PHOUR > 0)
sb.
AppendFormat("Start time of the first Lead-in area in the disc: {3:D2}:{0:D2}:{1:D2}:{2:D2}",
AppendFormat(Localization.Start_time_of_the_first_Lead_in_area_in_the_disc_3_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR).AppendLine();
else
sb.
AppendFormat("Start time of the first Lead-in area in the disc: {0:D2}:{1:D2}:{2:D2}",
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
sb.AppendFormat(Localization.Start_time_of_the_first_Lead_in_area_in_the_disc_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
break;
}
case 0xC1:
{
sb.AppendFormat("Copy of information of A1 from ATIP found");
sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine();
sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine();
sb.AppendFormat("Frame = {0}", descriptor.Frame).AppendLine();
sb.AppendFormat("Zero = {0}", descriptor.Zero).AppendLine();
sb.AppendFormat("PMIN = {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat("PSEC = {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat("PFRAME = {0}", descriptor.PFRAME).AppendLine();
sb.AppendFormat(Localization.Copy_of_information_of_A1_from_ATIP_found);
sb.Append($"Min = {descriptor.Min}").AppendLine();
sb.Append($"Sec = {descriptor.Sec}").AppendLine();
sb.Append($"Frame = {descriptor.Frame}").AppendLine();
sb.Append($"Zero = {descriptor.Zero}").AppendLine();
sb.Append($"PMIN = {descriptor.PMIN}").AppendLine();
sb.Append($"PSEC = {descriptor.PSEC}").AppendLine();
sb.Append($"PFRAME = {descriptor.PFRAME}").AppendLine();
break;
}
@@ -499,22 +498,20 @@ public static class FullTOC
{
if(descriptor.PHOUR > 0)
{
sb.
AppendFormat("Start position of outer part lead-in area: {3:D2}:{0:D2}:{1:D2}:{2:D2}",
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR).AppendLine();
sb.AppendFormat(Localization.Start_position_of_outer_part_lead_in_area_3_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR).AppendLine();
sb.
AppendFormat("Stop position of inner part lead-out area: {3:D2}:{0:D2}:{1:D2}:{2:D2}",
descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).
AppendLine();
sb.AppendFormat(Localization.Stop_position_of_inner_part_lead_out_area_3_0_1_2,
descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).
AppendLine();
}
else
{
sb.AppendFormat("Start position of outer part lead-in area: {0:D2}:{1:D2}:{2:D2}",
sb.AppendFormat(Localization.Start_position_of_outer_part_lead_in_area_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
sb.AppendFormat("Stop position of inner part lead-out area: {0:D2}:{1:D2}:{2:D2}",
sb.AppendFormat(Localization.Stop_position_of_inner_part_lead_out_area_0_1_2,
descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine();
}
@@ -525,28 +522,26 @@ public static class FullTOC
{
if(descriptor.POINT is >= 0x01 and <= 0x40)
{
sb.
AppendFormat("Start time for interval that should be skipped: {0:D2}:{1:D2}:{2:D2}",
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
sb.AppendFormat(Localization.Start_time_for_interval_that_should_be_skipped_0_1_2,
descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine();
sb.
AppendFormat("Ending time for interval that should be skipped: {0:D2}:{1:D2}:{2:D2}",
descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine();
sb.AppendFormat(Localization.Ending_time_for_interval_that_should_be_skipped_0_1_2,
descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine();
}
else
{
sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine();
sb.AppendFormat("CONTROL = {0}", descriptor.CONTROL).AppendLine();
sb.AppendFormat("TNO = {0}", descriptor.TNO).AppendLine();
sb.AppendFormat("POINT = {0}", descriptor.POINT).AppendLine();
sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine();
sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine();
sb.AppendFormat("Frame = {0}", descriptor.Frame).AppendLine();
sb.AppendFormat("HOUR = {0}", descriptor.HOUR).AppendLine();
sb.AppendFormat("PHOUR = {0}", descriptor.PHOUR).AppendLine();
sb.AppendFormat("PMIN = {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat("PSEC = {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat("PFRAME = {0}", descriptor.PFRAME).AppendLine();
sb.Append($"ADR = {descriptor.ADR}").AppendLine();
sb.Append($"CONTROL = {descriptor.CONTROL}").AppendLine();
sb.Append($"TNO = {descriptor.TNO}").AppendLine();
sb.Append($"POINT = {descriptor.POINT}").AppendLine();
sb.Append($"Min = {descriptor.Min}").AppendLine();
sb.Append($"Sec = {descriptor.Sec}").AppendLine();
sb.Append($"Frame = {descriptor.Frame}").AppendLine();
sb.Append($"HOUR = {descriptor.HOUR}").AppendLine();
sb.Append($"PHOUR = {descriptor.PHOUR}").AppendLine();
sb.Append($"PMIN = {descriptor.PMIN}").AppendLine();
sb.Append($"PSEC = {descriptor.PSEC}").AppendLine();
sb.Append($"PFRAME = {descriptor.PFRAME}").AppendLine();
}
break;
@@ -559,7 +554,7 @@ public static class FullTOC
case 6:
{
uint id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
sb.AppendFormat("Disc ID: {0:X6}", id & 0x00FFFFFF).AppendLine();
sb.AppendFormat(Localization.Disc_ID_0_X6, id & 0x00FFFFFF).AppendLine();
break;
}

192
CD/PMA.cs
View File

@@ -30,6 +30,7 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Aaru.Console;
@@ -74,7 +75,8 @@ public static class PMA
if(decoded.DataLength + 2 != CDPMAResponse.Length)
{
AaruConsole.DebugWriteLine("CD PMA decoder",
"Expected CD PMA size ({0} bytes) is not received size ({1} bytes), not decoding",
Localization.
Expected_CD_PMA_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
decoded.DataLength + 2, CDPMAResponse.Length);
return null;
@@ -111,17 +113,19 @@ public static class PMA
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
List<string> tracks;
foreach(CDPMADescriptors descriptor in response.PMADescriptors)
{
#if DEBUG
if(descriptor.Reserved != 0)
sb.AppendFormat("Reserved = 0x{0:X2}", descriptor.Reserved).AppendLine();
sb.AppendFormat(Localization.Reserved_equals_0_X2, descriptor.Reserved).AppendLine();
#endif
switch(descriptor.ADR)
@@ -129,50 +133,88 @@ public static class PMA
case 1:
if(descriptor.POINT > 0)
{
sb.AppendFormat("Track {0}", descriptor.POINT);
switch((TocControl)(descriptor.CONTROL & 0x0D))
{
case TocControl.TwoChanNoPreEmph:
sb.Append(" (Stereo audio track with no pre-emphasis)");
if(descriptor.PHOUR > 0)
sb.AppendFormat(Localization.Track_0_Stereo_audio_track_with_no_pre_emphasis_starts_at_4_1_2_3_and_ends_at_8_5_6_7,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(Localization.Track_0_Stereo_audio_track_with_no_pre_emphasis_starts_at_1_2_3_and_ends_at_4_5_6,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.Min, descriptor.Sec,
descriptor.Frame);
break;
case TocControl.TwoChanPreEmph:
sb.Append(" (Stereo audio track with 50/15 μs pre-emphasis)");
if(descriptor.PHOUR > 0)
sb.AppendFormat(Localization.Track_0_Stereo_audio_track_with_50_15_s_pre_emphasis_starts_at_4_1_2_3_and_ends_at_8_5_6_7,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(Localization.Track_0_Stereo_audio_track_with_50_15_us_pre_emphasis_starts_at_1_2_3_and_ends_at_4_5_6,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.Min, descriptor.Sec,
descriptor.Frame);
break;
case TocControl.FourChanNoPreEmph:
sb.Append(" (Quadraphonic audio track with no pre-emphasis)");
if(descriptor.PHOUR > 0)
sb.AppendFormat(Localization.Track_0_Quadraphonic_audio_track_with_no_pre_emphasis_starts_at_4_1_2_3_and_ends_at_8_5_6_7,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(Localization.Track_0_Quadraphonic_audio_track_with_no_pre_emphasis_starts_at_1_2_3_and_ends_at_4_5_6,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.Min, descriptor.Sec,
descriptor.Frame);
break;
case TocControl.FourChanPreEmph:
sb.Append(" (Quadraphonic audio track with 50/15 μs pre-emphasis)");
if(descriptor.PHOUR > 0)
sb.AppendFormat(Localization.Track_0_Quadraphonic_audio_track_with_50_15_us_pre_emphasis_starts_at_4_1_2_3_and_ends_at_8_5_6_7,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(Localization.Track_0_Quadraphonic_audio_track_with_50_15_us_pre_emphasis_starts_at_1_2_3_and_ends_at_4_5_6,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.Min, descriptor.Sec,
descriptor.Frame);
break;
case TocControl.DataTrack:
sb.Append(" (Data track, recorded uninterrupted)");
if(descriptor.PHOUR > 0)
sb.AppendFormat(Localization.Track_0_Data_track_recorded_uninterrupted_starts_at_4_1_2_3_and_ends_at_8_5_6_7,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(Localization.Track_0_Data_track_recorded_uninterrupted_starts_at_1_2_3_and_ends_at_4_5_6,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.Min, descriptor.Sec,
descriptor.Frame);
break;
case TocControl.DataTrackIncremental:
sb.Append(" (Data track, recorded incrementally)");
if(descriptor.PHOUR > 0)
sb.AppendFormat(Localization.Track_0_Data_track_recorded_incrementally_starts_at_4_1_2_3_and_ends_at_8_5_6_7,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR, descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(Localization.Track_0_Data_track_recorded_incrementally_starts_at_1_2_3_and_ends_at_4_5_6,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.Min, descriptor.Sec,
descriptor.Frame);
break;
}
if(descriptor.PHOUR > 0)
sb.AppendFormat(" starts at {3}:{0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR);
else
sb.AppendFormat(" starts at {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME);
if(descriptor.PHOUR > 0)
sb.AppendFormat(" and ends at {3}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec,
descriptor.Frame, descriptor.HOUR);
else
sb.AppendFormat(" and ends at {0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec,
descriptor.Frame);
sb.AppendLine();
}
else
@@ -181,109 +223,97 @@ public static class PMA
break;
case 2:
uint id = (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame);
sb.AppendFormat("Disc ID: {0:X6}", id & 0x00FFFFFF).AppendLine();
sb.AppendFormat(Localization.Disc_ID_0_X6, id & 0x00FFFFFF).AppendLine();
break;
case 3:
sb.AppendFormat("Skip track assignment {0} says that tracks ", descriptor.POINT);
tracks = new List<string>();
if(descriptor.Min > 0)
sb.AppendFormat("{0} ", descriptor.Min);
tracks.Add($"{descriptor.Min}");
if(descriptor.Sec > 0)
sb.AppendFormat("{0} ", descriptor.Sec);
tracks.Add($"{descriptor.Sec}");
if(descriptor.Frame > 0)
sb.AppendFormat("{0} ", descriptor.Frame);
tracks.Add($"{descriptor.Frame}");
if(descriptor.PMIN > 0)
sb.AppendFormat("{0} ", descriptor.PMIN);
tracks.Add($"{descriptor.PMIN}");
if(descriptor.PSEC > 0)
sb.AppendFormat("{0} ", descriptor.PSEC);
tracks.Add($"{descriptor.PSEC}");
if(descriptor.PFRAME > 0)
sb.AppendFormat("{0} ", descriptor.PFRAME);
tracks.Add($"{descriptor.PFRAME}");
sb.AppendLine("should be skipped");
sb.AppendFormat(Localization.Skip_track_assignment_0_says_that_tracks_1_should_be_skipped,
descriptor.POINT, string.Join(' ', tracks));
break;
case 4:
sb.AppendFormat("Unskip track assignment {0} says that tracks ", descriptor.POINT);
tracks = new List<string>();
if(descriptor.Min > 0)
sb.AppendFormat("{0} ", descriptor.Min);
tracks.Add($"{descriptor.Min}");
if(descriptor.Sec > 0)
sb.AppendFormat("{0} ", descriptor.Sec);
tracks.Add($"{descriptor.Sec}");
if(descriptor.Frame > 0)
sb.AppendFormat("{0} ", descriptor.Frame);
tracks.Add($"{descriptor.Frame}");
if(descriptor.PMIN > 0)
sb.AppendFormat("{0} ", descriptor.PMIN);
tracks.Add($"{descriptor.PMIN}");
if(descriptor.PSEC > 0)
sb.AppendFormat("{0} ", descriptor.PSEC);
tracks.Add($"{descriptor.PSEC}");
if(descriptor.PFRAME > 0)
sb.AppendFormat("{0} ", descriptor.PFRAME);
tracks.Add($"{descriptor.PFRAME}");
sb.AppendLine("should not be skipped");
sb.AppendFormat(Localization.Unskip_track_assignment_0_says_that_tracks_1_should_not_be_skipped,
descriptor.POINT, string.Join(' ', tracks));
break;
case 5:
sb.AppendFormat("Skip time interval assignment {0} says that from ", descriptor.POINT);
if(descriptor.PHOUR > 0)
sb.AppendFormat("{3}:{0:D2}:{1:D2}:{2:D2} to ", descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR);
else
sb.AppendFormat("{0:D2}:{1:D2}:{2:D2} to ", descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME);
if(descriptor.PHOUR > 0)
sb.AppendFormat("{3}:{0:D2}:{1:D2}:{2:D2} ", descriptor.Min, descriptor.Sec, descriptor.Frame,
sb.AppendFormat(Localization.Skip_time_interval_assignment_0_says_that_from_4_1_2_3_to_8_5_6_7_should_be_skipped,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR, descriptor.Min, descriptor.Sec, descriptor.Frame,
descriptor.HOUR);
else
sb.AppendFormat("{0:D2}:{1:D2}:{2:D2} ", descriptor.Min, descriptor.Sec, descriptor.Frame);
sb.AppendLine("should be skipped");
sb.AppendFormat(Localization.Skip_time_interval_assignment_0_says_that_from_1_2_3_to_4_5_6_should_be_skipped,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.Min, descriptor.Sec, descriptor.Frame);
break;
case 6:
sb.AppendFormat("Unskip time interval assignment {0} says that from ", descriptor.POINT);
if(descriptor.PHOUR > 0)
sb.AppendFormat("{3}:{0:D2}:{1:D2}:{2:D2} to ", descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME, descriptor.PHOUR);
else
sb.AppendFormat("{0:D2}:{1:D2}:{2:D2} to ", descriptor.PMIN, descriptor.PSEC,
descriptor.PFRAME);
if(descriptor.PHOUR > 0)
sb.AppendFormat("{3}:{0:D2}:{1:D2}:{2:D2} ", descriptor.Min, descriptor.Sec, descriptor.Frame,
sb.AppendFormat(Localization.Unskip_time_interval_assignment_0_says_that_from_4_1_2_3_to_8_5_6_7_should_not_be_skipped,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.PHOUR, descriptor.Min, descriptor.Sec, descriptor.Frame,
descriptor.HOUR);
else
sb.AppendFormat("{0:D2}:{1:D2}:{2:D2} ", descriptor.Min, descriptor.Sec, descriptor.Frame);
sb.AppendLine("should not be skipped");
sb.AppendFormat(Localization.Unskip_time_interval_assignment_0_says_that_from_1_2_3_to_4_5_6_should_not_be_skipped,
descriptor.POINT, descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME,
descriptor.Min, descriptor.Sec, descriptor.Frame);
break;
default:
sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine();
sb.AppendFormat("CONTROL = {0}", descriptor.CONTROL).AppendLine();
sb.AppendFormat("TNO = {0}", descriptor.TNO).AppendLine();
sb.AppendFormat("POINT = {0}", descriptor.POINT).AppendLine();
sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine();
sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine();
sb.AppendFormat("Frame = {0}", descriptor.Frame).AppendLine();
sb.AppendFormat("HOUR = {0}", descriptor.HOUR).AppendLine();
sb.AppendFormat("PHOUR = {0}", descriptor.PHOUR).AppendLine();
sb.AppendFormat("PMIN = {0}", descriptor.PMIN).AppendLine();
sb.AppendFormat("PSEC = {0}", descriptor.PSEC).AppendLine();
sb.AppendFormat("PFRAME = {0}", descriptor.PFRAME).AppendLine();
sb.AppendLine($"ADR = {descriptor.ADR}");
sb.AppendLine($"CONTROL = {descriptor.CONTROL}");
sb.AppendLine($"TNO = {descriptor.TNO}");
sb.AppendLine($"POINT = {descriptor.POINT}");
sb.AppendLine($"Min = {descriptor.Min}");
sb.AppendLine($"Sec = {descriptor.Sec}");
sb.AppendLine($"Frame = {descriptor.Frame}");
sb.AppendLine($"HOUR = {descriptor.HOUR}");
sb.AppendLine($"PHOUR = {descriptor.PHOUR}");
sb.AppendLine($"PMIN = {descriptor.PMIN}");
sb.AppendLine($"PSEC = {descriptor.PSEC}");
sb.AppendLine($"PFRAME = {descriptor.PFRAME}");
break;
}

View File

@@ -294,11 +294,11 @@ public static class Sector
buffer[9] != 0xFF ||
buffer[10] != 0xFF ||
buffer[11] != 0x00)
return "CD sector.";
return Localization.CD_sector;
var sb = new StringBuilder();
sb.AppendLine("CD-ROM sector.");
sb.AppendLine(Localization.CD_ROM_sector);
byte min = buffer[12];
byte sec = buffer[13];
@@ -321,24 +321,24 @@ public static class Sector
if(moreThan90)
min += 0x90;
sb.AppendFormat("Position {0:X2}:{1:X2}:{2:X2} (LBA {3})", min, sec, frame, lba).AppendLine();
sb.AppendFormat(Localization.Position_0_1_2_LBA_3, min, sec, frame, lba).AppendLine();
switch(buffer[15] & 0x03)
{
case 0:
sb.AppendLine("Mode 0.");
sb.AppendLine(Localization.Mode_0);
break;
case 1:
sb.AppendLine("Mode 1.");
sb.AppendLine(Localization.Mode_1);
break;
case 2:
sb.AppendLine("Mode 2.");
sb.AppendLine(Localization.Mode_2);
break;
case 3:
sb.AppendLine("Invalid mode 0.");
sb.AppendLine(Localization.Invalid_mode_3);
break;
}
@@ -346,35 +346,35 @@ public static class Sector
switch((buffer[15] & 0xE0) >> 5)
{
case 0:
sb.AppendLine("User data block");
sb.AppendLine(Localization.User_data_block);
break;
case 1:
sb.AppendLine("Fourth run-in block");
sb.AppendLine(Localization.Fourth_run_in_block);
break;
case 2:
sb.AppendLine("Third run-in block");
sb.AppendLine(Localization.Third_run_in_block);
break;
case 3:
sb.AppendLine("Second run-in block");
sb.AppendLine(Localization.Second_run_in_block);
break;
case 4:
sb.AppendLine("First run-in block");
sb.AppendLine(Localization.First_run_in_block);
break;
case 5:
sb.AppendLine("Link block");
sb.AppendLine(Localization.Link_block);
break;
case 6:
sb.AppendLine("Second run-out block");
sb.AppendLine(Localization.Second_run_out_block);
break;
case 7:
sb.AppendLine("First run-out block");
sb.AppendLine(Localization.First_run_out_block);
break;
}
@@ -395,13 +395,13 @@ public static class Sector
break;
}
sb.AppendLine(empty ? "Correct sector contents." : "Incorrect sector contents.");
sb.AppendLine(empty ? Localization.Correct_sector_contents : Localization.Incorrect_sector_contents);
break;
case 1:
sb.AppendLine(correctEdc == true ? "Correct EDC." : "Incorrect EDC.");
sb.AppendLine(correctEccP == true ? "Correct ECC P." : "Incorrect ECC P.");
sb.AppendLine(correctEccQ == true ? "Correct ECC Q." : "Incorrect ECC Q.");
sb.AppendLine(correctEdc == true ? Localization.Correct_EDC : Localization.Incorrect_EDC);
sb.AppendLine(correctEccP == true ? Localization.Correct_ECC_P : Localization.Incorrect_ECC_P);
sb.AppendLine(correctEccQ == true ? Localization.Correct_ECC_Q : Localization.Incorrect_ECC_Q);
for(int i = 2068; i < 2076; i++)
if(buffer[i] != 0x00)
@@ -411,7 +411,7 @@ public static class Sector
break;
}
sb.AppendLine(empty ? "Correct zero fill." : "Incorrect zero fill.");
sb.AppendLine(empty ? Localization.Correct_zero_fill : Localization.Incorrect_zero_fill);
break;
case 2:
@@ -420,48 +420,48 @@ public static class Sector
buffer[18] != buffer[22] ||
buffer[19] != buffer[23])
{
sb.AppendLine("Subheader copies differ.");
sb.AppendLine(correctEdc == true ? "Correct EDC." : "Incorrect EDC.");
sb.AppendLine(correctEccP == true ? "Correct ECC P." : "Incorrect ECC P.");
sb.AppendLine(correctEccQ == true ? "Correct ECC Q." : "Incorrect ECC Q.");
sb.AppendLine(Localization.Subheader_copies_differ);
sb.AppendLine(correctEdc == true ? Localization.Correct_EDC : Localization.Incorrect_EDC);
sb.AppendLine(correctEccP == true ? Localization.Correct_ECC_P : Localization.Incorrect_ECC_P);
sb.AppendLine(correctEccQ == true ? Localization.Correct_ECC_Q : Localization.Incorrect_ECC_Q);
break;
}
sb.AppendFormat("File number: {0}", buffer[16]).AppendLine();
sb.AppendFormat("Channel number: {0}", buffer[17]).AppendLine();
sb.AppendFormat("Coding information number: {0}", buffer[19]).AppendLine();
sb.AppendFormat(Localization.File_number_0, buffer[16]).AppendLine();
sb.AppendFormat(Localization.Channel_number_0, buffer[17]).AppendLine();
sb.AppendFormat(Localization.Coding_information_number_0, buffer[19]).AppendLine();
if((buffer[18] & 0x80) == 0x80)
sb.AppendLine("End of file.");
sb.AppendLine(Localization.End_of_file);
if((buffer[18] & 0x40) == 0x40)
sb.AppendLine("Real-time block.");
sb.AppendLine(Localization.Real_time_block);
sb.AppendLine((buffer[18] & 0x20) == 0x20 ? "Form 2." : "Form 1.");
sb.AppendLine((buffer[18] & 0x20) == 0x20 ? Localization.Form_2 : Localization.Form_1);
if((buffer[18] & 0x10) == 0x10)
sb.AppendLine("Trigger block.");
sb.AppendLine(Localization.Trigger_block);
if((buffer[18] & 0x08) == 0x08)
sb.AppendLine("Data block.");
sb.AppendLine(Localization.Data_block);
if((buffer[18] & 0x04) == 0x04)
sb.AppendLine("Audio block.");
sb.AppendLine(Localization.Audio_block);
if((buffer[18] & 0x02) == 0x02)
sb.AppendLine("Video block.");
sb.AppendLine(Localization.Video_block);
if((buffer[18] & 0x01) == 0x01)
sb.AppendLine("End of record.");
sb.AppendLine(Localization.End_of_record);
if((buffer[18] & 0x20) != 0x20)
{
sb.AppendLine(correctEccP == true ? "Correct ECC P." : "Incorrect ECC P.");
sb.AppendLine(correctEccQ == true ? "Correct ECC Q." : "Incorrect ECC Q.");
sb.AppendLine(correctEccP == true ? Localization.Correct_ECC_P : Localization.Incorrect_ECC_P);
sb.AppendLine(correctEccQ == true ? Localization.Correct_ECC_Q : Localization.Incorrect_ECC_Q);
}
sb.AppendLine(correctEdc == true ? "Correct EDC." : "Incorrect EDC.");
sb.AppendLine(correctEdc == true ? Localization.Correct_EDC : Localization.Incorrect_EDC);
break;
}

View File

@@ -70,7 +70,8 @@ public static class Session
if(decoded.DataLength + 2 != CDSessionInfoResponse.Length)
{
AaruConsole.DebugWriteLine("CD Session Info decoder",
"Expected CDSessionInfo size ({0} bytes) is not received size ({1} bytes), not decoding",
Localization.
Expected_CDSessionInfo_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
decoded.DataLength + 2, CDSessionInfoResponse.Length);
return null;
@@ -100,14 +101,15 @@ public static class Session
var sb = new StringBuilder();
sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine();
sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine();
sb.AppendFormat(Localization.First_complete_session_number_0, response.FirstCompleteSession).AppendLine();
sb.AppendFormat(Localization.Last_complete_session_number_0, response.LastCompleteSession).AppendLine();
foreach(TrackDataDescriptor descriptor in response.TrackDescriptors)
{
sb.AppendFormat("First track number in last complete session: {0}", descriptor.TrackNumber).AppendLine();
sb.AppendFormat(Localization.First_track_number_in_last_complete_session_0, descriptor.TrackNumber).
AppendLine();
sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress,
sb.AppendFormat(Localization.Track_starts_at_LBA_0_or_MSF_2_3, descriptor.TrackStartAddress,
(descriptor.TrackStartAddress & 0x0000FF00) >> 8,
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
@@ -115,65 +117,65 @@ public static class Session
switch((TocAdr)descriptor.ADR)
{
case TocAdr.NoInformation:
sb.AppendLine("Q subchannel mode not given");
sb.AppendLine(Localization.Q_subchannel_mode_not_given);
break;
case TocAdr.CurrentPosition:
sb.AppendLine("Q subchannel stores current position");
sb.AppendLine(Localization.Q_subchannel_stores_current_position);
break;
case TocAdr.ISRC:
sb.AppendLine("Q subchannel stores ISRC");
sb.AppendLine(Localization.Q_subchannel_stores_ISRC);
break;
case TocAdr.MediaCatalogNumber:
sb.AppendLine("Q subchannel stores media catalog number");
sb.AppendLine(Localization.Q_subchannel_stores_media_catalog_number);
break;
}
if((descriptor.CONTROL & (byte)TocControl.ReservedMask) == (byte)TocControl.ReservedMask)
sb.AppendFormat("Reserved flags 0x{0:X2} set", descriptor.CONTROL).AppendLine();
sb.AppendFormat(Localization.Reserved_flags_0_set, descriptor.CONTROL).AppendLine();
else
{
switch((TocControl)(descriptor.CONTROL & 0x0D))
{
case TocControl.TwoChanNoPreEmph:
sb.AppendLine("Stereo audio track with no pre-emphasis");
sb.AppendLine(Localization.Stereo_audio_track_with_no_pre_emphasis);
break;
case TocControl.TwoChanPreEmph:
sb.AppendLine("Stereo audio track with 50/15 μs pre-emphasis");
sb.AppendLine(Localization.Stereo_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.FourChanNoPreEmph:
sb.AppendLine("Quadraphonic audio track with no pre-emphasis");
sb.AppendLine(Localization.Quadraphonic_audio_track_with_no_pre_emphasis);
break;
case TocControl.FourChanPreEmph:
sb.AppendLine("Stereo audio track with 50/15 μs pre-emphasis");
sb.AppendLine(Localization.Stereo_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.DataTrack:
sb.AppendLine("Data track, recorded uninterrupted");
sb.AppendLine(Localization.Data_track_recorded_uninterrupted);
break;
case TocControl.DataTrackIncremental:
sb.AppendLine("Data track, recorded incrementally");
sb.AppendLine(Localization.Data_track_recorded_incrementally);
break;
}
sb.AppendLine((descriptor.CONTROL & (byte)TocControl.CopyPermissionMask) ==
(byte)TocControl.CopyPermissionMask ? "Digital copy of track is permitted"
: "Digital copy of track is prohibited");
(byte)TocControl.CopyPermissionMask ? Localization.Digital_copy_of_track_is_permitted
: Localization.Digital_copy_of_track_is_prohibited);
#if DEBUG
if(descriptor.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", descriptor.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, descriptor.Reserved1).AppendLine();
if(descriptor.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", descriptor.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, descriptor.Reserved2).AppendLine();
#endif
sb.AppendLine();

View File

@@ -337,13 +337,17 @@ public static class Subchannel
string controlInfo = ((control & 0xC) / 4) switch
{
0 => $"stereo audio {((control & 0x01) == 1 ? "with" : "without")} pre-emphasis",
1 => $"{((control & 0x01) == 1 ? "incremental" : "uninterrupted")} data",
2 => $"quadraphonic audio {((control & 0x01) == 1 ? "with" : "without")} pre-emphasis",
_ => $"reserved control value {control & 0x01}"
0 => (control & 0x01) == 1 ? Localization.Subchannel_PrettifyQ_stereo_audio_with_pre_emphasis
: Localization.Subchannel_PrettifyQ_stereo_audio_without_pre_emphasis,
1 => (control & 0x01) == 1 ? Localization.Subchannel_PrettifyQ_incremental_data
: Localization.Subchannel_PrettifyQ_uninterrupted_data,
2 => (control & 0x01) == 1 ? Localization.Subchannel_PrettifyQ_quadraphonic_audio_with_pre_emphasis
: Localization.Subchannel_PrettifyQ_quadraphonic_audio_without_pre_emphasis,
_ => string.Format(Localization.Subchannel_PrettifyQ_reserved_control_value__0_, control & 0x01)
};
string copy = (control & 0x02) > 0 ? "copy permitted" : "copy prohibited";
string copy = (control & 0x02) > 0 ? Localization.Subchannel_PrettifyQ_copy_permitted
: Localization.Subchannel_PrettifyQ_copy_prohibited;
if(bcd)
BcdToBinaryQ(subBuf);
@@ -362,160 +366,246 @@ public static class Subchannel
if(lba < 0)
{
area = "Lead-In";
area = Localization.Subchannel_PrettifyQ_Lead_In;
switch(adr)
{
case 1 when subBuf[2] < 0xA0:
return $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} position: {subBuf[3]
:X2}:{subBuf[4]:X2}:{subBuf[5]:X2} (LBA {qPos}), track {subBuf[2]
:X} starts at {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")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_position_9_10_11_LBA_12_track_13_starts_at_14_15_16_LBA_17_Q_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], qPos, subBuf[2],
subBuf[7], subBuf[8], subBuf[9], qStart, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
case 1 when subBuf[2] == 0xA0:
{
string format = subBuf[8] switch
{
0x00 => "CD-DA / CD-ROM",
0x10 => "CD-i",
0x20 => "CD-ROM XA",
_ => $"unknown {subBuf[0]:X2}"
0x00 => Localization.Subchannel_PrettifyQ_CD_DA_CD_ROM,
0x10 => Localization.Subchannel_PrettifyQ_CD_i,
0x20 => Localization.Subchannel_PrettifyQ_CD_ROM_XA,
_ => string.Format(Localization.Subchannel_PrettifyQ_unknown_0, subBuf[0])
};
return $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} position: {subBuf[3]
:X2}:{subBuf[4]:X2}:{subBuf[5]:X2} (LBA {qPos}), track {subBuf[2]
:X} is first program area track in {format} format, Q CRC 0x{subBuf[10]:X2}{
subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")}), R-W {
(rwEmpty ? "empty" : "not empty")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_position_9_10_11_LBA_12_track_13_is_first_program_area_track_in_14_format_Q_CRC_15_16_17_R_W_18,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], qPos, subBuf[2], format,
subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
}
case 1 when subBuf[2] == 0xA1:
return $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} position: {subBuf[3]
:X2}:{subBuf[4]:X2}:{subBuf[5]:X2} (LBA {qPos}), track {subBuf[2]
:X} is last program area track, Q CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({
(crcOk ? "OK" : "BAD")}), R-W {(rwEmpty ? "empty" : "not empty")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_position_9_10_11_LBA_12_track_13_is_last_program_area_track_Q_CRC_14_15_16_R_W_17,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], qPos, subBuf[2],
subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
case 1:
return subBuf[2] == 0xA2 ? $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {
(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr} position: {subBuf[3]:X2}:{
subBuf[4]:X2}:{subBuf[5]:X2} (LBA {qPos}), track {subBuf[2]:X} starts at {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")}" : $"{
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")}";
return subBuf[2] == 0xA2
? string.
Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_position_9_10_11_LBA_12_track_13_starts_at_14_15_16_LBA_17_Q_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], qPos, subBuf[2],
subBuf[7], subBuf[8], subBuf[9], qStart, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty)
: string.
Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_8_9_10_11_12_13_14_15_16_17_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, subBuf[0], subBuf[1], subBuf[2], subBuf[3], subBuf[4],
subBuf[5], subBuf[6], subBuf[7], subBuf[8], subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
case 2:
return $"{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")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_MCN_9_frame_10_CRC_11_12_13_R_W_14,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, DecodeMcn(subBuf), subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
}
if(adr != 5)
return $"{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")
}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_8_9_10_11_12_13_14_15_16_17_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, subBuf[0], subBuf[1], subBuf[2], subBuf[3], subBuf[4], subBuf[5],
subBuf[6], subBuf[7], subBuf[8], subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK : Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
switch(subBuf[2])
{
case <= 0x40:
return $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr
} skip interval start time {subBuf[7]:X2}{subBuf[8]:X2}{subBuf[9]
:X2}, skip interval stop time {subBuf[3]:X2}{subBuf[4]:X2}{subBuf[5]
:X2}, CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")}), R-W {
(rwEmpty ? "empty" : "not empty")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_skip_interval_start_time_9_10_11_skip_interval_stop_time_12_13_14_CRC_15_16_17_R_W_18,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[7], subBuf[8], subBuf[9], subBuf[3], subBuf[4],
subBuf[5], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
case 0xB0:
return final ? $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr
} next program area can start at {subBuf[3]:X2}:{subBuf[4]:X2}:{subBuf[5]
:X2} (LBA {nextPos}), last-session, {zero} mode 5 pointers, 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 mode {
adr} next program area can start at {subBuf[3]
:X2}:{subBuf[4]:X2}:{subBuf[5]:X2} (LBA {
nextPos}), maximum Lead-out at {subBuf[7]
:X2}:{subBuf[8]:X2}:{subBuf[9]
:X2} (LBA {maxOut}), {zero
} mode 5 pointers, CRC 0x{subBuf[10]:X2}{
subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")
}), R-W {(rwEmpty ? "empty"
: "not empty")}";
return final
? string.
Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_next_program_area_can_start_at_9_10_11_LBA_12_last_session_13_mode_5_pointers_CRC_14_15_16_R_W_17,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], nextPos, zero,
subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty)
: string.
Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_next_program_area_can_start_at_9_10_11_LBA_12_maximum_Lead_out_at_13_14_15_LBA_16_17_mode_5_pointers_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], nextPos, subBuf[7],
subBuf[8], subBuf[9], maxOut, zero, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
case 0xB1:
return $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr}, {pmin
} skip interval pointers, {psec} skip track assignments, CRC 0x{subBuf[10]:X2}{
subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")}), R-W {
(rwEmpty ? "empty" : "not empty")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_9_skip_interval_pointers_10_skip_track_assignments_CRC_11_12_13_R_W_14,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, pmin, psec, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
}
if(subBuf[2] != 0xB2 &&
subBuf[2] != 0xB3 &&
subBuf[2] != 0xB4)
return subBuf[2] == 0xC0 ? $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {
(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr}, ATIP values {subBuf[3]:X2}, {
subBuf[4]:X2}, {subBuf[5]:X2}, first disc Lead-in starts at {subBuf[7]:X2}{subBuf[8]:X2}{
subBuf[9]:X2} (LBA {qStart}), 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")}";
return subBuf[2] == 0xC0
? string.
Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_ATIP_values_9_10_11_first_disc_Lead_in_starts_at_12_13_14_LBA_15_CRC_16_17_18_R_W_19,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[3], subBuf[4], subBuf[5], subBuf[7], subBuf[8],
subBuf[9], qStart, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty)
: string.
Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_8_9_10_11_12_13_14_15_16_17_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.
Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.
Subchannel_PrettifyQ_pause
: Localization.
Subchannel_PrettifyQ_not_pause,
controlInfo, copy, subBuf[0], subBuf[1], subBuf[2], subBuf[3], subBuf[4],
subBuf[5], subBuf[6], subBuf[7], subBuf[8], subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK
: Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
string skipTracks = $"{subBuf[3]:X2}";
@@ -534,56 +624,75 @@ public static class Subchannel
if(subBuf[9] > 0)
skipTracks += $", {subBuf[4]:X2}";
return $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "corrupted pause"
: pause
? "pause"
: "not pause")}, {controlInfo}, {copy}, Q mode {adr}, tracks {skipTracks
} to be skipped, CRC 0x{subBuf[10]:X2}{subBuf[11]:X2} ({(crcOk ? "OK" : "BAD")}), R-W {
(rwEmpty ? "empty" : "not empty")}";
return
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_tracks_9_to_be_skipped_CRC_10_11_12_R_W_13,
minute, second, frame, lba, area, corruptedPause
? Localization.Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.Subchannel_PrettifyQ_pause
: Localization.Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, skipTracks, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK : Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty);
}
area = subBuf[1] == 0xAA ? "Lead-out" : "Program";
area = subBuf[1] == 0xAA ? Localization.Subchannel_PrettifyQ_Lead_out
: Localization.Subchannel_PrettifyQ_Program;
return adr switch
{
1 => $"{minute:D2}:{second:D2}:{frame:D2} - LBA {lba,6}: {area} area, {(corruptedPause
? "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")}",
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")}",
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")}",
_ => $"{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")}"
1 =>
string.Format(Localization.Subchannel_PrettifyQ_0_D2_1_2_LBA_3_4_area_5_6_7_Q_mode_8_position_track_9_index_10_relative_position_11_12_13_LBA_14_absolute_position_15_16_17_LBA_18_Q_CRC_19_20_21_R_W_22,
minute, second, frame, lba, area, corruptedPause
? Localization.Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.Subchannel_PrettifyQ_pause
: Localization.Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, subBuf[1], subBuf[2], subBuf[3], subBuf[4], subBuf[5], qPos + 150,
subBuf[7], subBuf[8], subBuf[9], qStart, subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK : Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty),
2 =>
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_MCN_9_frame_10_CRC_11_12_13_R_W_14,
minute, second, frame, lba, area, corruptedPause
? Localization.Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.Subchannel_PrettifyQ_pause
: Localization.Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, DecodeMcn(subBuf), subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK : Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty),
3 =>
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_mode_8_ISRC_9_frame_10_CRC_11_12_13_R_W_14,
minute, second, frame, lba, area, corruptedPause
? Localization.Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.Subchannel_PrettifyQ_pause
: Localization.Subchannel_PrettifyQ_not_pause,
controlInfo, copy, adr, DecodeIsrc(subBuf), subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK : Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_not_empty),
_ =>
string.Format(Localization.Subchannel_PrettifyQ_0_1_2_LBA_3_4_area_5_6_7_Q_8_9_10_11_12_13_14_15_16_17_CRC_18_19_20_R_W_21,
minute, second, frame, lba, area, corruptedPause
? Localization.Subchannel_PrettifyQ_corrupted_pause
: pause
? Localization.Subchannel_PrettifyQ_pause
: Localization.Subchannel_PrettifyQ_not_pause,
controlInfo, copy, subBuf[0], subBuf[1], subBuf[2], subBuf[3], subBuf[4], subBuf[5],
subBuf[6], subBuf[7], subBuf[8], subBuf[9], subBuf[10], subBuf[11],
crcOk ? Localization.Subchannel_PrettifyQ_OK : Localization.Subchannel_PrettifyQ_BAD,
rwEmpty ? Localization.Subchannel_PrettifyQ_empty
: Localization.Subchannel_PrettifyQ_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}";

View File

@@ -73,7 +73,8 @@ public static class TOC
if(decoded.DataLength + 2 != CDTOCResponse.Length)
{
AaruConsole.DebugWriteLine("CD TOC decoder",
"Expected CD TOC size ({0} bytes) is not received size ({1} bytes), not decoding",
Localization.
Expected_CD_TOC_size_0_bytes_is_not_received_size_1_bytes_not_decoding,
decoded.DataLength + 2, CDTOCResponse.Length);
return null;
@@ -103,17 +104,17 @@ public static class TOC
var sb = new StringBuilder();
sb.AppendFormat("First track number in first complete session: {0}", response.FirstTrack).AppendLine();
sb.AppendFormat("Last track number in last complete session: {0}", response.LastTrack).AppendLine();
sb.AppendFormat(Localization.First_track_number_in_first_complete_session_0, response.FirstTrack).AppendLine();
sb.AppendFormat(Localization.Last_track_number_in_last_complete_session_0, response.LastTrack).AppendLine();
foreach(CDTOCTrackDataDescriptor descriptor in response.TrackDescriptors)
{
if(descriptor.TrackNumber == 0xAA)
sb.AppendLine("Track number: Lead-Out");
sb.AppendLine(Localization.Track_number_Lead_Out);
else
sb.AppendFormat("Track number: {0}", descriptor.TrackNumber).AppendLine();
sb.AppendFormat(Localization.Track_number_0, descriptor.TrackNumber).AppendLine();
sb.AppendFormat("Track starts at LBA {0}, or MSF {1:X2}:{2:X2}:{3:X2}", descriptor.TrackStartAddress,
sb.AppendFormat(Localization.Track_starts_at_LBA_0_or_MSF_2_3, descriptor.TrackStartAddress,
(descriptor.TrackStartAddress & 0x0000FF00) >> 8,
(descriptor.TrackStartAddress & 0x00FF0000) >> 16,
(descriptor.TrackStartAddress & 0xFF000000) >> 24).AppendLine();
@@ -121,73 +122,73 @@ public static class TOC
switch((TocAdr)descriptor.ADR)
{
case TocAdr.NoInformation:
sb.AppendLine("Q subchannel mode not given");
sb.AppendLine(Localization.Q_subchannel_mode_not_given);
break;
case TocAdr.TrackPointer:
sb.AppendLine("Q subchannel stores track pointer");
sb.AppendLine(Localization.Q_subchannel_stores_track_pointer);
break;
case TocAdr.VideoTrackPointer:
sb.AppendLine("Q subchannel stores video track pointer");
sb.AppendLine(Localization.Q_subchannel_stores_video_track_pointer);
break;
case TocAdr.ISRC:
sb.AppendLine("Q subchannel stores ISRC");
sb.AppendLine(Localization.Q_subchannel_stores_ISRC);
break;
case TocAdr.MediaCatalogNumber:
sb.AppendLine("Q subchannel stores media catalog number");
sb.AppendLine(Localization.Q_subchannel_stores_media_catalog_number);
break;
default:
sb.AppendFormat("Q subchannel mode {0}", descriptor.ADR).AppendLine();
sb.AppendFormat(Localization.Q_subchannel_mode_0, descriptor.ADR).AppendLine();
break;
}
if((descriptor.CONTROL & (byte)TocControl.ReservedMask) == (byte)TocControl.ReservedMask)
sb.AppendFormat("Reserved flags 0x{0:X2} set", descriptor.CONTROL).AppendLine();
sb.AppendFormat(Localization.Reserved_flags_0_set, descriptor.CONTROL).AppendLine();
else
{
switch((TocControl)(descriptor.CONTROL & 0x0D))
{
case TocControl.TwoChanNoPreEmph:
sb.AppendLine("Stereo audio track with no pre-emphasis");
sb.AppendLine(Localization.Stereo_audio_track_with_no_pre_emphasis);
break;
case TocControl.TwoChanPreEmph:
sb.AppendLine("Stereo audio track with 50/15 μs pre-emphasis");
sb.AppendLine(Localization.Stereo_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.FourChanNoPreEmph:
sb.AppendLine("Quadraphonic audio track with no pre-emphasis");
sb.AppendLine(Localization.Quadraphonic_audio_track_with_no_pre_emphasis);
break;
case TocControl.FourChanPreEmph:
sb.AppendLine("Quadraphonic audio track with 50/15 μs pre-emphasis");
sb.AppendLine(Localization.Quadraphonic_audio_track_with_50_15_us_pre_emphasis);
break;
case TocControl.DataTrack:
sb.AppendLine("Data track, recorded uninterrupted");
sb.AppendLine(Localization.Data_track_recorded_uninterrupted);
break;
case TocControl.DataTrackIncremental:
sb.AppendLine("Data track, recorded incrementally");
sb.AppendLine(Localization.Data_track_recorded_incrementally);
break;
}
sb.AppendLine((descriptor.CONTROL & (byte)TocControl.CopyPermissionMask) ==
(byte)TocControl.CopyPermissionMask ? "Digital copy of track is permitted"
: "Digital copy of track is prohibited");
(byte)TocControl.CopyPermissionMask ? Localization.Digital_copy_of_track_is_permitted
: Localization.Digital_copy_of_track_is_prohibited);
#if DEBUG
if(descriptor.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", descriptor.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, descriptor.Reserved1).AppendLine();
if(descriptor.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", descriptor.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, descriptor.Reserved2).AppendLine();
#endif
sb.AppendLine();

View File

@@ -105,39 +105,40 @@ public static class CSS_CPRM
switch(typeCode)
{
case TypeCode.None:
sb.AppendLine("No drive region setting.");
sb.AppendLine(Localization.No_drive_region_setting);
break;
case TypeCode.Set:
sb.AppendLine("Drive region is set.");
sb.AppendLine(Localization.Drive_region_is_set);
break;
case TypeCode.LastChance:
sb.AppendLine("Drive region is set, with additional restrictions required to make a change.");
sb.AppendLine(Localization.Drive_region_is_set_with_additional_restrictions_required_to_make_a_change);
break;
case TypeCode.Perm:
sb.AppendLine("Drive region has been set permanently, but may be reset by the vendor if necessary.");
sb.AppendLine(Localization.
Drive_region_has_been_set_permanently_but_may_be_reset_by_the_vendor_if_necessary);
break;
}
sb.AppendLine($"Drive has {vendorResets} vendor resets available.");
sb.AppendLine($"Drive has {userControlledChanges} user controlled changes available.");
sb.AppendLine(string.Format(Localization.Drive_has_0_vendor_resets_available, vendorResets));
sb.AppendLine(string.Format(Localization.Drive_has_0_user_controlled_changes_available, userControlledChanges));
switch(decoded.RegionMask)
{
case 0xFF:
sb.AppendLine("Drive has no region set.");
sb.AppendLine(Localization.Drive_has_no_region_set);
break;
case 0x00:
sb.AppendLine("Drive is region free.");
sb.AppendLine(Localization.Drive_is_region_free);
break;
default:
{
sb.Append("Drive has the following regions set:");
sb.Append(Localization.Drive_has_the_following_regions_set);
if((decoded.RegionMask & 0x01) != 0x01)
sb.Append(" 1");
@@ -172,15 +173,16 @@ public static class CSS_CPRM
switch(decoded.RPCScheme)
{
case 0x00:
sb.AppendLine("The Logical Unit does not enforce Region Playback Controls (RPC).");
sb.AppendLine(Localization.The_Logical_Unit_does_not_enforce_Region_Playback_Controls_RPC);
break;
case 0x01:
sb.AppendLine("The Logical Unit shall adhere to the specification and all requirements of the CSS license agreement concerning RPC.");
sb.AppendLine(Localization.
The_Logical_Unit_shall_adhere_to_the_specification_and_all_requirements_of_the_CSS_license_agreement_concerning_RPC);
break;
default:
sb.AppendLine("The Logical Unit uses an unknown region enforcement scheme.");
sb.AppendLine(Localization.The_Logical_Unit_uses_an_unknown_region_enforcement_scheme);
break;
}
@@ -202,23 +204,24 @@ public static class CSS_CPRM
switch(decoded.CopyrightType)
{
case CopyrightType.NoProtection:
sb.AppendLine("Disc has no encryption.");
sb.AppendLine(Localization.Disc_has_no_encryption);
break;
case CopyrightType.CSS:
sb.AppendLine("Disc is encrypted using CSS or CPPM.");
sb.AppendLine(Localization.Disc_is_encrypted_using_CSS_or_CPPM);
break;
case CopyrightType.CPRM:
sb.AppendLine("Disc is encrypted using CPRM.");
sb.AppendLine(Localization.Disc_is_encrypted_using_CPRM);
break;
case CopyrightType.AACS:
sb.AppendLine("Disc is encrypted using AACS.");
sb.AppendLine(Localization.Disc_is_encrypted_using_AACS);
break;
default:
sb.AppendFormat("Disc is encrypted using unknown algorithm with ID {0}.", decoded.CopyrightType);
sb.AppendFormat(Localization.Disc_is_encrypted_using_unknown_algorithm_with_ID_0,
decoded.CopyrightType);
break;
}
@@ -229,16 +232,16 @@ public static class CSS_CPRM
switch(decoded.RegionInformation)
{
case 0xFF:
sb.AppendLine("Disc cannot be played in any region at all.");
sb.AppendLine(Localization.Disc_cannot_be_played_in_any_region_at_all);
break;
case 0x00:
sb.AppendLine("Disc can be played in any region.");
sb.AppendLine(Localization.Disc_can_be_played_in_any_region);
break;
default:
{
sb.Append("Disc can be played in the following regions:");
sb.Append(Localization.Disc_can_be_played_in_the_following_regions);
if((decoded.RegionInformation & 0x01) != 0x01)
sb.Append(" 1");

View File

@@ -85,31 +85,31 @@ public static class Cartridge
var sb = new StringBuilder();
if(decoded.PWP)
sb.AppendLine("Disc surface is set to write protected status");
sb.AppendLine(Localization.Disc_surface_is_set_to_write_protected_status);
if(decoded.Cartridge)
{
sb.AppendLine("Disc comes in a cartridge");
sb.AppendLine(Localization.Disc_comes_in_a_cartridge);
if(decoded.OUT)
sb.AppendLine("Disc has been extracted from the cartridge");
sb.AppendLine(Localization.Disc_has_been_extracted_from_the_cartridge);
if(decoded.CWP)
sb.AppendLine("Cartridge is set to write protected");
sb.AppendLine(Localization.Cartridge_is_set_to_write_protected);
}
switch(decoded.DiscType)
{
case 0:
sb.AppendLine("Disc shall not be written without a cartridge");
sb.AppendLine(Localization.Disc_shall_not_be_written_without_a_cartridge);
break;
case 0x10:
sb.AppendLine("Disc may be written without a cartridge");
sb.AppendLine(Localization.Disc_may_be_written_without_a_cartridge);
break;
default:
sb.AppendFormat("Unknown disc type id {0}", decoded.DiscType).AppendLine();
sb.AppendFormat(Localization.Unknown_disc_type_id_0, decoded.DiscType).AppendLine();
break;
}
@@ -121,15 +121,16 @@ public static class Cartridge
{
case 0: break;
case 1:
sb.AppendLine("Disc is write inhibited because it has been extracted from the cartridge");
sb.AppendLine(Localization.Disc_is_write_inhibited_because_it_has_been_extracted_from_the_cartridge);
break;
case 0xFF:
sb.AppendLine("Disc is write inhibited for an unspecified reason");
sb.AppendLine(Localization.Disc_is_write_inhibited_for_an_unspecified_reason);
break;
default:
sb.AppendFormat("Disc has unknown reason {0} for write inhibition", decoded.RAMSWI).AppendLine();
sb.AppendFormat(Localization.Disc_has_unknown_reason_0_for_write_inhibition, decoded.RAMSWI).
AppendLine();
break;
}

View File

@@ -133,54 +133,54 @@ public static class DDS
if(decoded.InProcess)
{
sb.AppendLine("Formatting in progress.");
sb.AppendLine(Localization.Formatting_in_progress);
if(decoded.Groups == 24)
{
if(decoded.PartialCertification)
sb.AppendLine("Formatting is only using partial certification");
sb.AppendLine(Localization.Formatting_is_only_using_partial_certification);
if(decoded.FormattingOnlyAGroup)
sb.AppendLine("Only a group is being formatted");
sb.AppendLine(Localization.Only_a_group_is_being_formatted);
}
}
if(decoded.UserCertification)
sb.AppendLine("Disc has been certified by an user");
sb.AppendLine(Localization.Disc_has_been_certified_by_a_user);
if(decoded.ManufacturerCertification)
sb.AppendLine("Disc has been certified by a manufacturer");
sb.AppendLine(Localization.Disc_has_been_certified_by_a_manufacturer);
sb.AppendFormat("DDS has been updated {0} times", decoded.UpdateCount).AppendLine();
sb.AppendFormat(Localization.DDS_has_been_updated_0_times, decoded.UpdateCount).AppendLine();
if(decoded.Groups == 24)
for(int i = 0; i < decoded.GroupCertificationFlags.Length; i++)
{
if(decoded.GroupCertificationFlags[i].InProcess)
{
sb.AppendFormat("Group {0} is being formatted", i).AppendLine();
sb.AppendFormat(Localization.Group_0_is_being_formatted, i).AppendLine();
if(decoded.GroupCertificationFlags[i].PartialCertification)
sb.AppendFormat("Group {0} is being certified partially", i).AppendLine();
sb.AppendFormat(Localization.Group_0_is_being_certified_partially, i).AppendLine();
}
if(decoded.GroupCertificationFlags[i].UserCertification)
sb.AppendFormat("Group {0} has been certified by an user", i).AppendLine();
sb.AppendFormat(Localization.Group_0_has_been_certified_by_an_user, i).AppendLine();
}
if(decoded.Groups != 1)
return sb.ToString();
{
sb.AppendFormat("Disc has {0} zones", decoded.Zones).AppendLine();
sb.AppendFormat(Localization.Disc_has_0_zones, decoded.Zones).AppendLine();
sb.AppendFormat("Primary Spare Area stats at PSN {0:X}h and ends at PSN {1:X}h, inclusively",
sb.AppendFormat(Localization.Primary_Spare_Area_stats_at_PSN_0_and_ends_at_PSN_1_inclusively,
decoded.SpareAreaFirstPSN, decoded.SpareAreaLastPSN).AppendLine();
sb.AppendFormat("LSN 0 is at PSN {0:X}h", decoded.LSN0Location).AppendLine();
sb.AppendFormat(Localization.LSN_zero_is_at_PSN_0, decoded.LSN0Location).AppendLine();
for(int i = 0; i < decoded.StartLSNForZone.Length; i++)
sb.AppendFormat("Zone {0} starts at LSN {1}", i, decoded.StartLSNForZone[i]).AppendLine();
sb.AppendFormat(Localization.Zone_0_starts_at_LSN_1, i, decoded.StartLSNForZone[i]).AppendLine();
}
return sb.ToString();

View File

@@ -479,42 +479,42 @@ public static class PFI
string sizeString = decoded.DiscSize switch
{
DVDSize.Eighty => "80mm",
DVDSize.OneTwenty => "120mm",
_ => $"unknown size identifier {decoded.DiscSize}"
DVDSize.Eighty => Localization._80mm,
DVDSize.OneTwenty => Localization._120mm,
_ => string.Format(Localization.unknown_size_identifier_0, decoded.DiscSize)
};
const string categorySentence = "Disc is a {0} {1} version {2}";
switch(decoded.DiskCategory)
{
case DiskCategory.DVDROM:
sb.AppendFormat(categorySentence, sizeString, "DVD-ROM", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD-ROM", decoded.PartVersion).
AppendLine();
switch(decoded.DiscSize)
{
case DVDSize.OneTwenty when decoded.PartVersion == 1:
sb.AppendLine("Disc claims conformation to ECMA-267");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_267);
break;
case DVDSize.Eighty when decoded.PartVersion == 1:
sb.AppendLine("Disc claims conformation to ECMA-268");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_268);
break;
}
break;
case DiskCategory.DVDRAM:
sb.AppendFormat(categorySentence, sizeString, "DVD-RAM", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD-RAM", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 1:
sb.AppendLine("Disc claims conformation to ECMA-272");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_272);
break;
case 6:
sb.AppendLine("Disc claims conformation to ECMA-330");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_330);
break;
}
@@ -522,22 +522,24 @@ public static class PFI
break;
case DiskCategory.DVDR:
if(decoded.PartVersion >= 6)
sb.AppendFormat(categorySentence, sizeString, "DVD-R DL", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD-R DL", decoded.PartVersion).
AppendLine();
else
sb.AppendFormat(categorySentence, sizeString, "DVD-R", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD-R", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 1:
sb.AppendLine("Disc claims conformation to ECMA-279");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_279);
break;
case 5:
sb.AppendLine("Disc claims conformation to ECMA-359");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_359);
break;
case 6:
sb.AppendLine("Disc claims conformation to ECMA-382");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_382);
break;
}
@@ -545,18 +547,20 @@ public static class PFI
break;
case DiskCategory.DVDRW:
if(decoded.PartVersion >= 15)
sb.AppendFormat(categorySentence, sizeString, "DVD-RW DL", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD-RW DL", decoded.PartVersion).
AppendLine();
else
sb.AppendFormat(categorySentence, sizeString, "DVD-RW", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD-RW", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 2:
sb.AppendLine("Disc claims conformation to ECMA-338");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_338);
break;
case 3:
sb.AppendLine("Disc claims conformation to ECMA-384");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_384);
break;
}
@@ -564,70 +568,76 @@ public static class PFI
break;
case DiskCategory.UMD:
if(decoded.DiscSize == DVDSize.OneTwenty)
sb.AppendFormat(categorySentence, "60mm", "UMD", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, Localization._60mm, "UMD",
decoded.PartVersion).AppendLine();
else
sb.AppendFormat(categorySentence, "invalid size", "UMD", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, Localization.invalid_size, "UMD",
decoded.PartVersion).AppendLine();
switch(decoded.PartVersion)
{
case 0:
sb.AppendLine("Disc claims conformation to ECMA-365");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_365);
break;
}
break;
case DiskCategory.DVDPRW:
sb.AppendFormat(categorySentence, sizeString, "DVD+RW", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD+RW", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 1:
sb.AppendLine("Disc claims conformation to ECMA-274");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_274);
break;
case 2:
sb.AppendLine("Disc claims conformation to ECMA-337");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_337);
break;
case 3:
sb.AppendLine("Disc claims conformation to ECMA-371");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_371);
break;
}
break;
case DiskCategory.DVDPR:
sb.AppendFormat(categorySentence, sizeString, "DVD+R", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD+R", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 1:
sb.AppendLine("Disc claims conformation to ECMA-349");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_349);
break;
}
break;
case DiskCategory.DVDPRWDL:
sb.AppendFormat(categorySentence, sizeString, "DVD+RW DL", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD+RW DL", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 1:
sb.AppendLine("Disc claims conformation to ECMA-374");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_374);
break;
}
break;
case DiskCategory.DVDPRDL:
sb.AppendFormat(categorySentence, sizeString, "DVD+R DL", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "DVD+R DL", decoded.PartVersion).
AppendLine();
switch(decoded.PartVersion)
{
case 1:
sb.AppendLine("Disc claims conformation to ECMA-364");
sb.AppendLine(Localization.Disc_claims_conformation_to_ECMA_364);
break;
}
@@ -636,9 +646,9 @@ public static class PFI
case DiskCategory.Nintendo:
if(decoded.PartVersion == 15)
if(decoded.DiscSize == DVDSize.Eighty)
sb.AppendLine("Disc is a Nintendo Gamecube Optical Disc (GOD)");
sb.AppendLine(Localization.Disc_is_a_Nintendo_Gamecube_Optical_Disc_GOD);
else if(decoded.DiscSize == DVDSize.OneTwenty)
sb.AppendLine("Disc is a Nintendo Wii Optical Disc (WOD)");
sb.AppendLine(Localization.Disc_is_a_Nintendo_Wii_Optical_Disc_WOD);
else
goto default;
else
@@ -646,93 +656,96 @@ public static class PFI
break;
case DiskCategory.HDDVDROM:
sb.AppendFormat(categorySentence, sizeString, "HD DVD-ROM", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "HD DVD-ROM", decoded.PartVersion).
AppendLine();
break;
case DiskCategory.HDDVDRAM:
sb.AppendFormat(categorySentence, sizeString, "HD DVD-RAM", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "HD DVD-RAM", decoded.PartVersion).
AppendLine();
break;
case DiskCategory.HDDVDR:
sb.AppendFormat(categorySentence, sizeString, "HD DVD-R", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "HD DVD-R", decoded.PartVersion).
AppendLine();
break;
case DiskCategory.HDDVDRW:
sb.AppendFormat(categorySentence, sizeString, "HD DVD-RW", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, "HD DVD-RW", decoded.PartVersion).
AppendLine();
break;
default:
sb.AppendFormat(categorySentence, sizeString, "unknown disc type", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, Localization.unknown_disc_type,
decoded.PartVersion).AppendLine();
break;
}
if(decoded.RecordedBookType != decoded.DiskCategory)
{
const string bookTypeSentence = "Disc book type is {0}";
switch(decoded.RecordedBookType)
{
case DiskCategory.DVDROM:
sb.AppendFormat(bookTypeSentence, "DVD-ROM").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD-ROM").AppendLine();
break;
case DiskCategory.DVDRAM:
sb.AppendFormat(bookTypeSentence, "DVD-RAM").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD-RAM").AppendLine();
break;
case DiskCategory.DVDR:
if(decoded.PartVersion >= 6)
sb.AppendFormat(bookTypeSentence, "DVD-R DL").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD-R DL").AppendLine();
else
sb.AppendFormat(bookTypeSentence, "DVD-R").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD-R").AppendLine();
break;
case DiskCategory.DVDRW:
if(decoded.PartVersion >= 15)
sb.AppendFormat(bookTypeSentence, "DVD-RW DL").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD-RW DL").AppendLine();
else
sb.AppendFormat(bookTypeSentence, "DVD-RW").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD-RW").AppendLine();
break;
case DiskCategory.UMD:
sb.AppendFormat(bookTypeSentence, "UMD").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "UMD").AppendLine();
break;
case DiskCategory.DVDPRW:
sb.AppendFormat(bookTypeSentence, "DVD+RW").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD+RW").AppendLine();
break;
case DiskCategory.DVDPR:
sb.AppendFormat(bookTypeSentence, "DVD+R").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD+R").AppendLine();
break;
case DiskCategory.DVDPRWDL:
sb.AppendFormat(bookTypeSentence, "DVD+RW DL").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD+RW DL").AppendLine();
break;
case DiskCategory.DVDPRDL:
sb.AppendFormat(bookTypeSentence, "DVD+R DL").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "DVD+R DL").AppendLine();
break;
case DiskCategory.HDDVDROM:
sb.AppendFormat(bookTypeSentence, "HD DVD-ROM").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "HD DVD-ROM").AppendLine();
break;
case DiskCategory.HDDVDRAM:
sb.AppendFormat(bookTypeSentence, "HD DVD-RAM").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "HD DVD-RAM").AppendLine();
break;
case DiskCategory.HDDVDR:
sb.AppendFormat(bookTypeSentence, "HD DVD-R").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "HD DVD-R").AppendLine();
break;
case DiskCategory.HDDVDRW:
sb.AppendFormat(bookTypeSentence, "HD DVD-RW").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, "HD DVD-RW").AppendLine();
break;
default:
sb.AppendFormat(bookTypeSentence, "unknown").AppendLine();
sb.AppendFormat(Localization.Disc_book_type_is_0, Localization.unit_unknown).AppendLine();
break;
}
@@ -741,46 +754,46 @@ public static class PFI
switch(decoded.MaximumRate)
{
case MaximumRateField.TwoMbps:
sb.AppendLine("Disc maximum transfer rate is 2,52 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_2_52_Mbit_sec);
break;
case MaximumRateField.FiveMbps:
sb.AppendLine("Disc maximum transfer rate is 5,04 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_5_04_Mbit_sec);
break;
case MaximumRateField.TenMbps:
sb.AppendLine("Disc maximum transfer rate is 10,08 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_10_08_Mbit_sec);
break;
case MaximumRateField.TwentyMbps:
sb.AppendLine("Disc maximum transfer rate is 20,16 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_20_16_Mbit_sec);
break;
case MaximumRateField.ThirtyMbps:
sb.AppendLine("Disc maximum transfer rate is 30,24 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_30_24_Mbit_sec);
break;
case MaximumRateField.Unspecified:
sb.AppendLine("Disc maximum transfer rate is unspecified.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_unspecified);
break;
default:
sb.AppendFormat("Disc maximum transfer rate is specified by unknown key {0}", decoded.MaximumRate).
AppendLine();
sb.AppendFormat(Localization.Disc_maximum_transfer_rate_is_specified_by_unknown_key_0,
decoded.MaximumRate).AppendLine();
break;
}
sb.AppendFormat("Disc has {0} layers", decoded.Layers + 1).AppendLine();
sb.AppendFormat(Localization.Disc_has_0_layers, decoded.Layers + 1).AppendLine();
switch(decoded.TrackPath)
{
case true when decoded.Layers == 1:
sb.AppendLine("Layers are in parallel track path");
sb.AppendLine(Localization.Layers_are_in_parallel_track_path);
break;
case false when decoded.Layers == 1:
sb.AppendLine("Layers are in opposite track path");
sb.AppendLine(Localization.Layers_are_in_opposite_track_path);
break;
}
@@ -788,35 +801,35 @@ public static class PFI
switch(decoded.LinearDensity)
{
case LinearDensityField.TwoSix:
sb.AppendLine("Pitch size is 0,267 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_267_μm_bit);
break;
case LinearDensityField.TwoNine:
sb.AppendLine("Pitch size is 0,147 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_147_μm_bit);
break;
case LinearDensityField.FourZero:
sb.AppendLine("Pitch size is between 0,409 μm/bit and 0,435 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_between_0_409_μm_bit_and_0_435_μm_bit);
break;
case LinearDensityField.TwoEight:
sb.AppendLine("Pitch size is between 0,140 μm/bit and 0,148 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_between_0_140_μm_bit_and_0_148_μm_bit);
break;
case LinearDensityField.OneFive:
sb.AppendLine("Pitch size is 0,153 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_153_μm_bit);
break;
case LinearDensityField.OneThree:
sb.AppendLine("Pitch size is between 0,130 μm/bit and 0,140 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_between_0_130_μm_bit_and_0_140_μm_bit);
break;
case LinearDensityField.ThreeFive:
sb.AppendLine("Pitch size is 0,353 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_353_μm_bit);
break;
default:
sb.AppendFormat("Unknown pitch size key {0}", decoded.LinearDensity).AppendLine();
sb.AppendFormat(Localization.Unknown_pitch_size_key_0, decoded.LinearDensity).AppendLine();
break;
}
@@ -824,27 +837,27 @@ public static class PFI
switch(decoded.TrackDensity)
{
case TrackDensityField.Seven:
sb.AppendLine("Track size is 0,74 μm");
sb.AppendLine(Localization.Track_size_is_0_74_μm);
break;
case TrackDensityField.Eight:
sb.AppendLine("Track size is 0,80 μm");
sb.AppendLine(Localization.Track_size_is_0_80_μm);
break;
case TrackDensityField.Six:
sb.AppendLine("Track size is 0,615 μm");
sb.AppendLine(Localization.Track_size_is_0_615_μm);
break;
case TrackDensityField.Four:
sb.AppendLine("Track size is 0,40 μm");
sb.AppendLine(Localization.Track_size_is_0_40_μm);
break;
case TrackDensityField.Three:
sb.AppendLine("Track size is 0,34 μm");
sb.AppendLine(Localization.Track_size_is_0_34_μm);
break;
default:
sb.AppendFormat("Unknown track size key {0}", decoded.LinearDensity).AppendLine();
sb.AppendFormat(Localization.Unknown_track_size_key__0_, decoded.LinearDensity).AppendLine();
break;
}
@@ -852,59 +865,60 @@ public static class PFI
if(decoded.DataAreaStartPSN > 0)
if(decoded.DataAreaEndPSN > 0)
{
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();
sb.AppendFormat(Localization.Data_area_starts_at_PSN_0, decoded.DataAreaStartPSN).AppendLine();
sb.AppendFormat(Localization.Data_area_ends_at_PSN_0, decoded.DataAreaEndPSN).AppendLine();
if(decoded is { Layers: 1, TrackPath: false })
sb.AppendFormat("Layer 0 ends at PSN {0:X}h", decoded.Layer0EndPSN).AppendLine();
sb.AppendFormat(Localization.Layer_zero_ends_at_PSN_0, decoded.Layer0EndPSN).AppendLine();
}
else
sb.AppendLine("Disc is empty");
sb.AppendLine(Localization.Disc_is_empty);
else
sb.AppendLine("Disc is empty");
sb.AppendLine(Localization.Disc_is_empty);
if(decoded.BCA)
sb.AppendLine("Disc has a burst cutting area");
sb.AppendLine(Localization.Disc_has_a_burst_cutting_area);
switch(decoded.DiskCategory)
{
case DiskCategory.UMD:
sb.AppendFormat("Media attribute is {0}", decoded.MediaAttribute).AppendLine();
sb.AppendFormat(Localization.Media_attribute_is_0, decoded.MediaAttribute).AppendLine();
break;
case DiskCategory.DVDRAM:
switch(decoded.DiscType)
{
case DVDRAMDiscType.Cased:
sb.AppendLine("Disc shall be recorded with a case");
sb.AppendLine(Localization.Disc_shall_be_recorded_with_a_case);
break;
case DVDRAMDiscType.Uncased:
sb.AppendLine("Disc can be recorded with or without a case");
sb.AppendLine(Localization.Disc_can_be_recorded_with_or_without_a_case);
break;
default:
sb.AppendFormat("Unknown DVD-RAM case type key {0}", decoded.DiscType).AppendLine();
sb.AppendFormat(Localization.Unknown_DVD_RAM_case_type_key_0, decoded.DiscType).AppendLine();
break;
}
if(decoded.PartVersion == 6)
{
sb.AppendFormat("Disc manufacturer is {0}", ManufacturerFromDVDRAM(decoded.DiskManufacturer)).
AppendLine();
sb.AppendFormat(Localization.Disc_manufacturer_is_0,
ManufacturerFromDVDRAM(decoded.DiskManufacturer)).AppendLine();
sb.AppendFormat("Disc manufacturer supplementary information is {0}",
sb.AppendFormat(Localization.Disc_manufacturer_supplementary_information_is_0,
decoded.DiskManufacturerSupplementary).AppendLine();
}
break;
case DiskCategory.DVDR when decoded.PartVersion < 6:
case DiskCategory.DVDRW when decoded.PartVersion < 15:
sb.AppendFormat("Current Border-Out first sector is PSN {0:X}h", decoded.CurrentBorderOutSector).
sb.AppendFormat(Localization.Current_Border_Out_first_sector_is_PSN_0, decoded.CurrentBorderOutSector).
AppendLine();
sb.AppendFormat("Next Border-In first sector is PSN {0:X}h", decoded.NextBorderInSector).AppendLine();
sb.AppendFormat(Localization.Next_Border_In_first_sector_is_PSN_0, decoded.NextBorderInSector).
AppendLine();
break;
case DiskCategory.DVDPR:
@@ -912,15 +926,15 @@ public static class PFI
case DiskCategory.DVDPRDL:
case DiskCategory.DVDPRWDL:
if(decoded.VCPS)
sb.AppendLine("Disc contains extended information for VCPS");
sb.AppendLine(Localization.Disc_contains_extended_information_for_VCPS);
sb.AppendFormat("Disc application code is {0}", decoded.ApplicationCode).AppendLine();
sb.AppendFormat(Localization.Disc_application_code_is_0, decoded.ApplicationCode).AppendLine();
sb.AppendFormat("Disc manufacturer is {0}", ManufacturerFromDVDPlusID(decoded.DiskManufacturerID)).
AppendLine();
sb.AppendFormat(Localization.Disc_manufacturer_is_0,
ManufacturerFromDVDPlusID(decoded.DiskManufacturerID)).AppendLine();
sb.AppendFormat("Disc media type is {0}", decoded.MediaTypeID).AppendLine();
sb.AppendFormat("Disc product revision is {0}", decoded.ProductRevision).AppendLine();
sb.AppendFormat(Localization.Disc_media_type_is_0, decoded.MediaTypeID).AppendLine();
sb.AppendFormat(Localization.Disc_product_revision_is_0, decoded.ProductRevision).AppendLine();
break;
}
@@ -929,19 +943,19 @@ public static class PFI
(decoded.DiskCategory != DiskCategory.DVDRW || decoded.PartVersion < 15))
return sb.ToString();
sb.AppendFormat("Current RMD in extra Border zone starts at PSN {0:X}h", decoded.CurrentRMDExtraBorderPSN).
AppendLine();
sb.AppendFormat(Localization.Current_RMD_in_extra_Border_zone_starts_at_PSN_0,
decoded.CurrentRMDExtraBorderPSN).AppendLine();
sb.AppendFormat("PFI in extra Border zone starts at PSN {0:X}h", decoded.PFIExtraBorderPSN).AppendLine();
sb.AppendFormat(Localization.PFI_in_extra_Border_zone_starts_at_PSN_0, decoded.PFIExtraBorderPSN).AppendLine();
if(!decoded.PreRecordedControlDataInv)
sb.AppendLine("Control Data Zone is pre-recorded");
sb.AppendLine(Localization.Control_Data_Zone_is_pre_recorded);
if(decoded.PreRecordedLeadIn)
sb.AppendLine("Lead-In is pre-recorded");
sb.AppendLine(Localization.Lead_In_is_pre_recorded);
if(decoded.PreRecordedLeadOut)
sb.AppendLine("Lead-Out is pre-recorded");
sb.AppendLine(Localization.Lead_Out_is_pre_recorded);
return sb.ToString();
}

View File

@@ -137,46 +137,51 @@ public static class PRI
if((decoded.DiscApplicationCode & 0x40) > 0)
{
sb.AppendLine("Disc for unrestricted use.");
sb.AppendLine(Localization.Disc_for_unrestricted_use);
if((decoded.DiscApplicationCode & 0x3F) > 0)
sb.AppendFormat("Invalid purpose field with value {0}", decoded.DiscApplicationCode & 0x3F).
sb.AppendFormat(Localization.Invalid_purpose_field_with_value_0, decoded.DiscApplicationCode & 0x3F).
AppendLine();
else
sb.AppendLine("Consumer purpose disc for use in consumer purpose drives");
sb.AppendLine(Localization.Consumer_purpose_disc_for_use_in_consumer_purpose_drives);
}
else
{
sb.AppendLine("Disc for restricted use.");
sb.AppendLine(Localization.Disc_for_restricted_use);
if((decoded.DiscApplicationCode & 0x3F) > 0)
sb.AppendFormat("Disc for use in special drives according with purpose value {0}",
sb.AppendFormat(Localization.Disc_for_use_in_special_drives_according_with_purpose_value_0,
decoded.DiscApplicationCode & 0x3F).AppendLine();
else
sb.AppendLine("General purpose disc for use in general purpose drives");
sb.AppendLine(Localization.General_purpose_disc_for_use_in_general_purpose_drives);
}
sb.AppendLine((decoded.DiscPhysicalCode & 0x80) > 0 ? "Disc track pitch is 0,74 μm" : "Unknown track pitch");
sb.AppendLine((decoded.DiscPhysicalCode & 0x80) > 0 ? Localization.Disc_track_pitch_is_0_74_μm
: Localization.Unknown_track_pitch);
sb.AppendLine((decoded.DiscPhysicalCode & 0x40) > 0 ? "Reference velocity is 3,49 m/s"
: "Unknown reference velocity");
sb.AppendLine((decoded.DiscPhysicalCode & 0x40) > 0 ? Localization.Reference_velocity_is_3_49_m_s
: Localization.Unknown_reference_velocity);
sb.AppendLine((decoded.DiscPhysicalCode & 0x20) > 0 ? "Disc has 80mm diameter" : "Disc has 120mm diameter");
sb.AppendLine((decoded.DiscPhysicalCode & 0x20) > 0 ? Localization.Disc_has_80mm_diameter
: Localization.Disc_has_120mm_diameter);
sb.AppendLine((decoded.DiscPhysicalCode & 0x10) > 0 ? "Disc reflectivity is between 18% and 30%"
: "Disc reflectivity is between 45% and 85%");
sb.AppendLine((decoded.DiscPhysicalCode & 0x10) > 0 ? Localization.Disc_reflectivity_is_between_18_and_30
: Localization.Disc_reflectivity_is_between_45_and_85);
sb.AppendLine((decoded.DiscPhysicalCode & 0x04) > 0 ? "Dye is organic" : "Dye is phase change");
sb.AppendLine((decoded.DiscPhysicalCode & 0x04) > 0 ? Localization.Dye_is_organic
: Localization.Dye_is_phase_change);
sb.AppendLine((decoded.DiscPhysicalCode & 0x02) > 0 ? "Disc is RW (rewritable)" : "Disc is R (recordable)");
sb.AppendLine((decoded.DiscPhysicalCode & 0x02) > 0 ? Localization.Disc_is_RW_rewritable
: Localization.Disc_is_R_recordable);
sb.AppendLine((decoded.DiscPhysicalCode & 0x01) > 0 ? "Wavelength is 650nm" : "Unknown wavelength");
sb.AppendLine((decoded.DiscPhysicalCode & 0x01) > 0 ? Localization.Wavelength_is_650nm
: Localization.Unknown_wavelength);
sb.AppendFormat("Last writable ECC block address: 0x{0:X6}", decoded.LastAddressOfDataRecordableArea).
sb.AppendFormat(Localization.Last_writable_ECC_block_address_0_X6_, decoded.LastAddressOfDataRecordableArea).
AppendLine();
if(decoded.PartVersion > 0)
sb.AppendFormat("Part version {0}", decoded.PartVersion).AppendLine();
sb.AppendFormat(Localization.Part_version_0, decoded.PartVersion).AppendLine();
bool rw = (decoded.DiscPhysicalCode & 0x02) > 0;
@@ -204,10 +209,10 @@ public static class PRI
_ => 0
};
sb.AppendFormat("Recommended recording power is {0} mW", recordingPower).AppendLine();
sb.AppendFormat(Localization.Recommended_recording_power_is_0_mW, recordingPower).AppendLine();
}
else
sb.AppendLine("Recording power is not specified");
sb.AppendLine(Localization.Recording_power_is_not_specified);
if((decoded.WaveLengthCode & 0xF) > 0)
{
@@ -231,10 +236,10 @@ public static class PRI
_ => 0
};
sb.AppendFormat("Recommended erasing power ratio is {0} ε", erasingPower).AppendLine();
sb.AppendFormat(Localization.Recommended_erasing_power_ratio_is_0, erasingPower).AppendLine();
}
else
sb.AppendLine("Erasing power ratio is not specified");
sb.AppendLine(Localization.Erasing_power_ratio_is_not_specified);
}
else
{
@@ -258,7 +263,7 @@ public static class PRI
_ => 0
};
sb.AppendFormat("Recommended recording power is {0} mW", recordingPower).AppendLine();
sb.AppendFormat(Localization.Recommended_recording_power_is_0_mW, recordingPower).AppendLine();
}
if(decoded.WaveLengthCode > 0)
@@ -284,11 +289,12 @@ public static class PRI
_ => 0
};
sb.AppendFormat("Recommended recording power is {0} mW", wavelength).AppendLine();
sb.AppendFormat(Localization.Recommended_recording_power_is_0_mW, wavelength).AppendLine();
}
}
sb.AppendFormat("Disc manufacturer is {0}", ManufacturerFromPrePit(decoded.ManufacturerId)).AppendLine();
sb.AppendFormat(Localization.Disc_manufacturer_is_0, ManufacturerFromPrePit(decoded.ManufacturerId)).
AppendLine();
return sb.ToString();
}

View File

@@ -78,10 +78,13 @@ public static class Spare
SpareAreaInformation decoded = sai.Value;
var sb = new StringBuilder();
sb.AppendFormat("{0} unused primary spare blocks", decoded.UnusedPrimaryBlocks).AppendLine();
sb.AppendFormat("{0} unused supplementary spare blocks", decoded.UnusedSupplementaryBlocks).AppendLine();
sb.AppendFormat(Localization._0_unused_primary_spare_blocks, decoded.UnusedPrimaryBlocks).AppendLine();
sb.AppendFormat("{0} allocated supplementary spare blocks", decoded.AllocatedSupplementaryBlocks).AppendLine();
sb.AppendFormat(Localization._0_unused_supplementary_spare_blocks, decoded.UnusedSupplementaryBlocks).
AppendLine();
sb.AppendFormat(Localization._0_allocated_supplementary_spare_blocks, decoded.AllocatedSupplementaryBlocks).
AppendLine();
return sb.ToString();
}

View File

@@ -37,6 +37,7 @@ using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Aaru.Console;
using Aaru.Localization;
namespace Aaru.Decoders.Floppy;
@@ -268,7 +269,7 @@ public static class Apple2
if(data[position] == 0xD5 &&
data[position + 1] == 0xAA)
{
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Prologue found at {0}", position);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Prologue_found_at_0, position);
// Epilogue not in correct position
if(data[position + 11] != 0xDE ||
@@ -306,23 +307,23 @@ public static class Apple2
}
};
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Volume {0}",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Volume_0,
(((sector.addressField.volume[0] & 0x55) << 1) |
(sector.addressField.volume[1] & 0x55)) & 0xFF);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Track {0}",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Core.Track_0,
(((sector.addressField.track[0] & 0x55) << 1) |
(sector.addressField.track[1] & 0x55)) & 0xFF);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Sector {0}",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Sector_0,
(((sector.addressField.sector[0] & 0x55) << 1) |
(sector.addressField.sector[1] & 0x55)) & 0xFF);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Checksum {0}",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Checksum_0,
(((sector.addressField.checksum[0] & 0x55) << 1) |
(sector.addressField.checksum[1] & 0x55)) & 0xFF);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Epilogue {0:X2}{1:X2}{2:X2}",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Epilogue_0_1_2,
sector.addressField.epilogue[0], sector.addressField.epilogue[1],
sector.addressField.epilogue[2]);
@@ -351,10 +352,10 @@ public static class Apple2
sector.innerGap = gaps.ToArray();
sector.dataField = new RawDataField();
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Inner gap has {0} bytes",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Inner_gap_has_0_bytes,
sector.innerGap.Length);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Prologue found at {0}", position);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Prologue_found_at_0, position);
sector.dataField.prologue = new byte[3];
sector.dataField.prologue[0] = data[position];
sector.dataField.prologue[1] = data[position + 1];
@@ -377,7 +378,7 @@ public static class Apple2
sector.dataField.data = gaps.ToArray();
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Data has {0} bytes",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Data_has_0_bytes,
sector.dataField.data.Length);
sector.dataField.checksum = data[position];
@@ -408,8 +409,11 @@ public static class Apple2
// Return current position to be able to read separate sectors
endOffset = position;
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Got {0} bytes of gap", sector.gap.Length);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Finished sector at {0}", position);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Got_0_bytes_of_gap,
sector.gap.Length);
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Finished_sector_at_0, position);
return sector;
}
@@ -519,7 +523,7 @@ public static class Apple2
break;
}
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", "Adding sector {0} of track {1}",
AaruConsole.DebugWriteLine("Apple ][ GCR Decoder", Localization.Adding_sector_0_of_track_1,
(((sector.addressField.sector[0] & 0x55) << 1) |
(sector.addressField.sector[1] & 0x55)) & 0xFF,
(((sector.addressField.track[0] & 0x55) << 1) |

19439
Localization/Localization.Designer.cs generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -103,58 +103,58 @@ public static partial class Decoders
var sb = new StringBuilder();
sb.AppendLine("MultiMediaCard Device Identification Register:");
sb.AppendFormat("\tManufacturer: {0}", VendorString.Prettify(cid.Manufacturer)).AppendLine();
sb.AppendLine(Localization.MultiMediaCard_Device_Identification_Register);
sb.AppendFormat("\t" + Localization.Manufacturer_0, VendorString.Prettify(cid.Manufacturer)).AppendLine();
switch(cid.DeviceType)
{
case 0:
sb.AppendLine("\tRemovable device");
sb.AppendLine("\t" + Localization.Removable_device);
break;
case 1:
sb.AppendLine("\tBGA device");
sb.AppendLine("\t" + Localization.BGA_device);
break;
case 2:
sb.AppendLine("\tPOP device");
sb.AppendLine("\t" + Localization.POP_device);
break;
}
sb.AppendFormat("\tApplication ID: {0}", cid.ApplicationID).AppendLine();
sb.AppendFormat("\tProduct name: {0}", cid.ProductName).AppendLine();
sb.AppendFormat("\t" + Localization.Application_ID_0, cid.ApplicationID).AppendLine();
sb.AppendFormat("\t" + Localization.Product_name_0, cid.ProductName).AppendLine();
sb.AppendFormat("\tProduct revision: {0:X2}.{1:X2}", (cid.ProductRevision & 0xF0) >> 4,
sb.AppendFormat("\t" + Localization.Product_revision_0_1, (cid.ProductRevision & 0xF0) >> 4,
cid.ProductRevision & 0x0F).AppendLine();
sb.AppendFormat("\tProduct serial number: {0}", cid.ProductSerialNumber).AppendLine();
sb.AppendFormat("\t" + Localization.Product_serial_number_0, cid.ProductSerialNumber).AppendLine();
string year = (cid.ManufacturingDate & 0x0F) switch
{
0 => "1997 or 2013",
1 => "1998 or 2014",
2 => "1999 or 2015",
3 => "2000 or 2016",
4 => "2001 or 2017",
5 => "2002 or 2018",
6 => "2003 or 2019",
7 => "2004 or 2020",
8 => "2005 or 2021",
9 => "2006 or 2022",
10 => "2007 or 2023",
11 => "2008 or 2024",
12 => "2009 or 2025",
0 => Localization._1997_or_2013,
1 => Localization._1998_or_2014,
2 => Localization._1999_or_2015,
3 => Localization._2000_or_2016,
4 => Localization._2001_or_2017,
5 => Localization._2002_or_2018,
6 => Localization._2003_or_2019,
7 => Localization._2004_or_2020,
8 => Localization._2005_or_2021,
9 => Localization._2006_or_2022,
10 => Localization._2007_or_2023,
11 => Localization._2008_or_2024,
12 => Localization._2009_or_2025,
13 => "2010",
14 => "2011",
15 => "2012",
_ => ""
};
sb.AppendFormat("\tDevice manufactured month {0} of {1}", (cid.ManufacturingDate & 0xF0) >> 4, year).
AppendLine();
sb.AppendFormat("\t" + Localization.Device_manufactured_month_0_of_1, (cid.ManufacturingDate & 0xF0) >> 4,
year).AppendLine();
sb.AppendFormat("\tCID CRC: 0x{0:X2}", cid.CRC).AppendLine();
sb.AppendFormat("\t" + Localization.CID_CRC_0, cid.CRC).AppendLine();
return sb.ToString();
}

View File

@@ -151,24 +151,25 @@ public static partial class Decoders
string unit = "";
var sb = new StringBuilder();
sb.AppendLine("MultiMediaCard Device Specific Data Register:");
sb.AppendLine(Localization.MultiMediaCard_Device_Specific_Data_Register_);
switch(csd.Structure)
{
case 0:
sb.AppendLine("\tRegister version 1.0");
sb.AppendLine("\t" + Localization.Register_version_1_0);
break;
case 1:
sb.AppendLine("\tRegister version 1.1");
sb.AppendLine("\t" + Localization.Register_version_1_1);
break;
case 2:
sb.AppendLine("\tRegister version 1.2");
sb.AppendLine("\t" + Localization.Register_version_1_2);
break;
case 3:
sb.AppendLine("\tRegister version is defined in Extended Device Specific Data Register");
sb.AppendLine("\t" + Localization.
Register_version_is_defined_in_Extended_Device_Specific_Data_Register);
break;
}
@@ -176,42 +177,42 @@ public static partial class Decoders
switch(csd.TAAC & 0x07)
{
case 0:
unit = "ns";
unit = Localization.unit_ns;
unitFactor = 1;
break;
case 1:
unit = "ns";
unit = Localization.unit_ns;
unitFactor = 10;
break;
case 2:
unit = "ns";
unit = Localization.unit_ns;
unitFactor = 100;
break;
case 3:
unit = "μs";
unit = Localization.unit_μs;
unitFactor = 1;
break;
case 4:
unit = "μs";
unit = Localization.unit_μs;
unitFactor = 10;
break;
case 5:
unit = "μs";
unit = Localization.unit_μs;
unitFactor = 100;
break;
case 6:
unit = "ms";
unit = Localization.unit_ms;
unitFactor = 1;
break;
case 7:
unit = "ms";
unit = Localization.unit_ms;
unitFactor = 10;
break;
@@ -239,11 +240,12 @@ public static partial class Decoders
};
double result = unitFactor * multiplier;
sb.AppendFormat("\tAsynchronous data access time is {0}{1}", result, unit).AppendLine();
sb.AppendFormat("\t" + Localization.Asynchronous_data_access_time_is_0_1, result, unit).AppendLine();
sb.AppendFormat("\tClock dependent part of data access is {0} clock cycles", csd.NSAC * 100).AppendLine();
sb.AppendFormat("\t" + Localization.Clock_dependent_part_of_data_access_is_0_clock_cycles, csd.NSAC * 100).
AppendLine();
unit = "MHz";
unit = Localization.unit_MHz;
switch(csd.Speed & 0x07)
{
@@ -264,7 +266,7 @@ public static partial class Decoders
break;
default:
unit = "unknown";
unit = Localization.unit_unknown;
unitFactor = 0;
break;
@@ -292,7 +294,7 @@ public static partial class Decoders
};
result = unitFactor * multiplier;
sb.AppendFormat("\tDevice's clock frequency: {0}{1}", result, unit).AppendLine();
sb.AppendFormat("\t" + Localization.Device_s_clock_frequency_0_1, result, unit).AppendLine();
unit = "";
@@ -300,49 +302,51 @@ public static partial class Decoders
if((csd.Classes & mask) == mask)
unit += $" {cl}";
sb.AppendFormat("\tDevice support command classes {0}", unit).AppendLine();
sb.AppendFormat("\t" + Localization.Device_support_command_classes_0, unit).AppendLine();
if(csd.ReadBlockLength == 15)
sb.AppendLine("\tRead block length size is defined in extended CSD");
sb.AppendLine("\t" + Localization.Read_block_length_size_is_defined_in_extended_CSD);
else
sb.AppendFormat("\tRead block length is {0} bytes", Math.Pow(2, csd.ReadBlockLength)).AppendLine();
sb.AppendFormat("\t" + Localization.Read_block_length_is_0_bytes, Math.Pow(2, csd.ReadBlockLength)).
AppendLine();
if(csd.ReadsPartialBlocks)
sb.AppendLine("\tDevice allows reading partial blocks");
sb.AppendLine("\t" + Localization.Device_allows_reading_partial_blocks);
if(csd.WriteMisalignment)
sb.AppendLine("\tWrite commands can cross physical block boundaries");
sb.AppendLine("\t" + Localization.Write_commands_can_cross_physical_block_boundaries);
if(csd.ReadMisalignment)
sb.AppendLine("\tRead commands can cross physical block boundaries");
sb.AppendLine("\t" + Localization.Read_commands_can_cross_physical_block_boundaries);
if(csd.DSRImplemented)
sb.AppendLine("\tDevice implements configurable driver stage");
sb.AppendLine("\t" + Localization.Device_implements_configurable_driver_stage);
if(csd.Size == 0xFFF)
sb.AppendLine("\tDevice may be bigger than 2GiB and have its real size defined in the extended CSD");
sb.AppendLine("\t" + Localization.
Device_may_be_bigger_than_2GiB_and_have_its_real_size_defined_in_the_extended_CSD);
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2);
sb.AppendFormat("\tDevice has {0} blocks", (int)result).AppendLine();
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2);
sb.AppendFormat("\t" + Localization.Device_has_0_blocks, (int)result).AppendLine();
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2) * Math.Pow(2, csd.ReadBlockLength);
switch(result)
{
case > 1073741824:
sb.AppendFormat("\tDevice has {0} GiB", result / 1073741824.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_GiB, result / 1073741824.0).AppendLine();
break;
case > 1048576:
sb.AppendFormat("\tDevice has {0} MiB", result / 1048576.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_MiB, result / 1048576.0).AppendLine();
break;
case > 1024:
sb.AppendFormat("\tDevice has {0} KiB", result / 1024.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_KiB, result / 1024.0).AppendLine();
break;
default:
sb.AppendFormat("\tDevice has {0} bytes", result).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_bytes, result).AppendLine();
break;
}
@@ -350,35 +354,35 @@ public static partial class Decoders
switch(csd.ReadCurrentAtVddMin & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 0.5mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_0_5mA_for_reading_at_minimum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 1mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_reading_at_minimum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 5mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_reading_at_minimum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 10mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_reading_at_minimum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 25mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_reading_at_minimum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 35mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_reading_at_minimum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 60mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_60mA_for_reading_at_minimum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 100mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_100mA_for_reading_at_minimum_voltage);
break;
}
@@ -386,35 +390,35 @@ public static partial class Decoders
switch(csd.ReadCurrentAtVddMax & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 1mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_reading_at_maximum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 5mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_reading_at_maximum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 10mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_reading_at_maximum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 25mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_reading_at_maximum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 35mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_reading_at_maximum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 45mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_45mA_for_reading_at_maximum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 80mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_80mA_for_reading_at_maximum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 200mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_200mA_for_reading_at_maximum_voltage);
break;
}
@@ -422,35 +426,35 @@ public static partial class Decoders
switch(csd.WriteCurrentAtVddMin & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 0.5mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_0_5mA_for_writing_at_minimum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 1mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_writing_at_minimum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 5mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_writing_at_minimum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 10mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_writing_at_minimum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 25mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_writing_at_minimum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 35mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_writing_at_minimum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 60mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_60mA_for_writing_at_minimum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 100mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_100mA_for_writing_at_minimum_voltage);
break;
}
@@ -458,35 +462,35 @@ public static partial class Decoders
switch(csd.WriteCurrentAtVddMax & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 1mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_writing_at_maximum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 5mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_writing_at_maximum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 10mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_writing_at_maximum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 25mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_writing_at_maximum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 35mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_writing_at_maximum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 45mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_45mA_for_writing_at_maximum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 80mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_80mA_for_writing_at_maximum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 200mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_200mA_for_writing_at_maximum_voltage);
break;
}
@@ -495,100 +499,105 @@ public static partial class Decoders
unitFactor = Convert.ToDouble(csd.EraseGroupSize);
multiplier = Convert.ToDouble(csd.EraseGroupSizeMultiplier);
result = (unitFactor + 1) * (multiplier + 1);
sb.AppendFormat("\tDevice can erase a minimum of {0} blocks at a time", (int)result).AppendLine();
sb.AppendFormat("\t" + Localization.Device_can_erase_a_minimum_of_0_blocks_at_a_time, (int)result).AppendLine();
if(csd.WriteProtectGroupEnable)
{
sb.AppendLine("\tDevice can write protect regions");
sb.AppendLine("\t" + Localization.Device_can_write_protect_regions);
// TODO: Check specification
// unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize);
sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)).
AppendLine();
sb.AppendFormat("\t" + Localization.Device_can_write_protect_a_minimum_of_0_blocks_at_a_time,
(int)(result + 1)).AppendLine();
}
else
sb.AppendLine("\tDevice can't write protect regions");
sb.AppendLine("\t" + Localization.Device_cant_write_protect_regions);
switch(csd.DefaultECC)
{
case 0:
sb.AppendLine("\tDevice uses no ECC by default");
sb.AppendLine("\t" + Localization.Device_uses_no_ECC_by_default);
break;
case 1:
sb.AppendLine("\tDevice uses BCH(542, 512) ECC by default");
sb.AppendLine("\t" + Localization.Device_uses_BCH_542_512_ECC_by_default);
break;
case 2:
sb.AppendFormat("\tDevice uses unknown ECC code {0} by default", csd.DefaultECC).AppendLine();
sb.AppendFormat("\t" + Localization.Device_uses_unknown_ECC_code_0_by_default, csd.DefaultECC).
AppendLine();
break;
}
sb.AppendFormat("\tWriting is {0} times slower than reading", Math.Pow(2, csd.WriteSpeedFactor)).AppendLine();
sb.AppendFormat("\t" + Localization.Writing_is_0_times_slower_than_reading, Math.Pow(2, csd.WriteSpeedFactor)).
AppendLine();
if(csd.WriteBlockLength == 15)
sb.AppendLine("\tWrite block length size is defined in extended CSD");
sb.AppendLine("\t" + Localization.Write_block_length_size_is_defined_in_extended_CSD);
else
sb.AppendFormat("\tWrite block length is {0} bytes", Math.Pow(2, csd.WriteBlockLength)).AppendLine();
sb.AppendFormat("\t" + Localization.Write_block_length_is_0_bytes, Math.Pow(2, csd.WriteBlockLength)).
AppendLine();
if(csd.WritesPartialBlocks)
sb.AppendLine("\tDevice allows writing partial blocks");
sb.AppendLine("\t" + Localization.Device_allows_writing_partial_blocks);
if(csd.ContentProtection)
sb.AppendLine("\tDevice supports content protection");
sb.AppendLine("\t" + Localization.Device_supports_content_protection);
if(!csd.Copy)
sb.AppendLine("\tDevice contents are original");
sb.AppendLine("\t" + Localization.Device_contents_are_original);
if(csd.PermanentWriteProtect)
sb.AppendLine("\tDevice is permanently write protected");
sb.AppendLine("\t" + Localization.Device_is_permanently_write_protected);
if(csd.TemporaryWriteProtect)
sb.AppendLine("\tDevice is temporarily write protected");
sb.AppendLine("\t" + Localization.Device_is_temporarily_write_protected);
if(!csd.FileFormatGroup)
switch(csd.FileFormat)
{
case 0:
sb.AppendLine("\tDevice is formatted like a hard disk");
sb.AppendLine("\t" + Localization.Device_is_formatted_like_a_hard_disk);
break;
case 1:
sb.AppendLine("\tDevice is formatted like a floppy disk using Microsoft FAT");
sb.AppendLine("\t" + Localization.Device_is_formatted_like_a_floppy_disk_using_Microsoft_FAT);
break;
case 2:
sb.AppendLine("\tDevice uses Universal File Format");
sb.AppendLine("\t" + Localization.Device_uses_Universal_File_Format);
break;
default:
sb.AppendFormat("\tDevice uses unknown file format code {0}", csd.FileFormat).AppendLine();
sb.AppendFormat("\t" + Localization.Device_uses_unknown_file_format_code_0, csd.FileFormat).
AppendLine();
break;
}
else
sb.AppendFormat("\tDevice uses unknown file format code {0} and file format group 1", csd.FileFormat).
AppendLine();
sb.AppendFormat("\t" + Localization.Device_uses_unknown_file_format_code_0_and_file_format_group_1,
csd.FileFormat).AppendLine();
switch(csd.ECC)
{
case 0:
sb.AppendLine("\tDevice currently uses no ECC");
sb.AppendLine("\t" + Localization.Device_currently_uses_no_ECC);
break;
case 1:
sb.AppendLine("\tDevice currently uses BCH(542, 512) ECC by default");
sb.AppendLine("\t" + Localization.Device_currently_uses_BCH_542_512_ECC);
break;
case 2:
sb.AppendFormat("\tDevice currently uses unknown ECC code {0}", csd.DefaultECC).AppendLine();
sb.AppendFormat("\t" + Localization.Device_currently_uses_unknown_ECC_code_0, csd.DefaultECC).
AppendLine();
break;
}
sb.AppendFormat("\tCSD CRC: 0x{0:X2}", csd.CRC).AppendLine();
sb.AppendFormat("\t" + Localization.CSD_CRC_0, csd.CRC).AppendLine();
return sb.ToString();
}

File diff suppressed because it is too large Load Diff

View File

@@ -103,74 +103,74 @@ public static partial class Decoders
return null;
var sb = new StringBuilder();
sb.AppendLine("MultiMediaCard Operation Conditions Register:");
sb.AppendLine(Localization.MultiMediaCard_Operation_Conditions_Register);
if(!ocr.PowerUp)
sb.AppendLine("\tDevice is powering up");
sb.AppendLine("\t" + Localization.Device_is_powering_up);
switch(ocr.AccessMode)
{
case 0:
sb.AppendLine("\tDevice is byte addressed");
sb.AppendLine("\t" + Localization.Device_is_byte_addressed);
break;
case 2:
sb.AppendLine("\tDevice is sector addressed");
sb.AppendLine("\t" + Localization.Device_is_sector_addressed);
break;
default:
sb.AppendFormat("\tUnknown device access mode {0}", ocr.AccessMode).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_device_access_mode_0, ocr.AccessMode).AppendLine();
break;
}
if(ocr.ThreeFive)
sb.AppendLine("\tDevice can work with supply 3.5~3.6V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_5_3_6V);
if(ocr.ThreeFour)
sb.AppendLine("\tDevice can work with supply 3.4~3.5V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_4_3_5V);
if(ocr.ThreeThree)
sb.AppendLine("\tDevice can work with supply 3.3~3.4V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_3_3_4V);
if(ocr.ThreeTwo)
sb.AppendLine("\tDevice can work with supply 3.2~3.3V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_2_3_3V);
if(ocr.ThreeOne)
sb.AppendLine("\tDevice can work with supply 3.1~3.2V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_1_3_2V);
if(ocr.TwoNine)
sb.AppendLine("\tDevice can work with supply 2.9~3.0V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_9_3_0V);
if(ocr.TwoEight)
sb.AppendLine("\tDevice can work with supply 2.8~2.9V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_8_2_9V);
if(ocr.TwoSeven)
sb.AppendLine("\tDevice can work with supply 2.7~2.8V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_7_2_8V);
if(ocr.TwoSix)
sb.AppendLine("\tDevice can work with supply 2.6~2.7V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_6_2_7V);
if(ocr.TwoFive)
sb.AppendLine("\tDevice can work with supply 2.5~2.6V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_5_2_6V);
if(ocr.TwoFour)
sb.AppendLine("\tDevice can work with supply 2.4~2.5V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_4_2_5V);
if(ocr.TwoThree)
sb.AppendLine("\tDevice can work with supply 2.3~2.4V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_3_2_4V);
if(ocr.TwoTwo)
sb.AppendLine("\tDevice can work with supply 2.2~2.3V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_2_2_3V);
if(ocr.TwoOne)
sb.AppendLine("\tDevice can work with supply 2.1~2.2V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_1_2_2V);
if(ocr.TwoZero)
sb.AppendLine("\tDevice can work with supply 2.0~2.1V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_0_2_1V);
if(ocr.OneSix)
sb.AppendLine("\tDevice can work with supply 1.65~1.95V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_1_65_1_95V);
return sb.ToString();
}

View File

@@ -46,6 +46,6 @@ public static class VendorString
0x07 => "Nokia",
0x15 => "Samsung",
0x2C => "extreMEmory",
_ => $"Unknown manufacturer ID 0x{mmcVendorId:X2}"
_ => string.Format(Localization.Unknown_manufacturer_ID_0, mmcVendorId)
};
}

View File

@@ -129,23 +129,25 @@ public static class CIS
return null;
var sb = new StringBuilder();
sb.AppendLine("PCMCIA Device Geometry Tuples:");
sb.AppendLine(Localization.PCMCIA_Device_Geometry_Tuples);
foreach(DeviceGeometry geometry in tuple.Geometries)
{
sb.AppendLine("\tGeometry:");
sb.AppendFormat("\t\tDevice width: {0} bits", (1 << (geometry.CardInterface - 1)) * 8).AppendLine();
sb.AppendLine("\t" + Localization.Geometry);
sb.AppendFormat("\t\tErase block = {0} bytes",
sb.AppendFormat("\t\t" + Localization.Device_width_0_bits, (1 << (geometry.CardInterface - 1)) * 8).
AppendLine();
sb.AppendFormat("\t\t" + Localization.Erase_block_0_bytes,
(1 << (geometry.EraseBlockSize - 1)) * (1 << (geometry.Interleaving - 1))).AppendLine();
sb.AppendFormat("\t\tRead block = {0} bytes",
sb.AppendFormat("\t\t" + Localization.Read_block_0_bytes,
(1 << (geometry.ReadBlockSize - 1)) * (1 << (geometry.Interleaving - 1))).AppendLine();
sb.AppendFormat("\t\tWrite block = {0} bytes",
sb.AppendFormat("\t\t" + Localization.Write_block_0_bytes,
(1 << (geometry.WriteBlockSize - 1)) * (1 << (geometry.Interleaving - 1))).AppendLine();
sb.AppendFormat("\t\tPartition alignment = {0} bytes",
sb.AppendFormat("\t\t" + Localization.Partition_alignment_0_bytes,
(1 << (geometry.EraseBlockSize - 1)) * (1 << (geometry.Interleaving - 1)) *
(1 << (geometry.Partitions - 1))).AppendLine();
}
@@ -190,9 +192,9 @@ public static class CIS
return null;
var sb = new StringBuilder();
sb.AppendLine("PCMCIA Manufacturer Identification Tuple:");
sb.AppendFormat("\tManufacturer ID: {0}", VendorCode.Prettify(tuple.ManufacturerID)).AppendLine();
sb.AppendFormat("\tCard ID:D 0x{0:X4}", tuple.CardID).AppendLine();
sb.AppendLine(Localization.Manufacturer_Identification_Tuple);
sb.AppendFormat("\t" + Localization.Manufacturer_ID_0, VendorCode.Prettify(tuple.ManufacturerID)).AppendLine();
sb.AppendFormat("\t" + Localization.Card_ID_0, tuple.CardID).AppendLine();
return sb.ToString();
}
@@ -280,27 +282,27 @@ public static class CIS
return null;
var sb = new StringBuilder();
sb.AppendLine("PCMCIA Level 1 Version / Product Information Tuple:");
sb.AppendLine(Localization.PCMCIA_Level_1_Version_Product_Information_Tuple);
sb.AppendFormat("\tCard indicates compliance with PC Card Standard Release {0}.{1}", tuple.MajorVersion,
tuple.MinorVersion).AppendLine();
sb.AppendFormat("\t" + Localization.Card_indicates_compliance_with_PC_Card_Standard_Release_0_1,
tuple.MajorVersion, tuple.MinorVersion).AppendLine();
if(string.IsNullOrEmpty(tuple.Manufacturer))
sb.AppendLine("\tNo manufacturer information string.");
sb.AppendLine("\t" + Localization.No_manufacturer_information_string);
else
sb.AppendFormat("\tManufacturer: {0}", tuple.Manufacturer).AppendLine();
sb.AppendFormat(Localization.Manufacturer_0, tuple.Manufacturer).AppendLine();
if(string.IsNullOrEmpty(tuple.Product))
sb.AppendLine("\tNo product name string.");
sb.AppendLine("\t" + Localization.No_product_name_string);
else
sb.AppendFormat("\tProduct name: {0}", tuple.Product).AppendLine();
sb.AppendFormat(Localization.Product_name_0, tuple.Product).AppendLine();
if(tuple.AdditionalInformation == null ||
tuple.AdditionalInformation.Length == 0)
sb.AppendLine("\tNo additional information.");
sb.AppendLine("\t" + Localization.No_additional_information);
else
{
sb.AppendLine("\tAdditional information:");
sb.AppendLine("\t" + Localization.Additional_information);
foreach(string info in tuple.AdditionalInformation.Where(info => !string.IsNullOrEmpty(info)))
sb.AppendFormat("\t\t{0}", info).AppendLine();

View File

@@ -357,7 +357,7 @@ public static class VendorCode
case 0xC020: return "NextCom K.K.";
case 0xC250: return "EMTAC Technology Corporation";
case 0xD601: return "Elsa";
default: return $"Unknown vendor id 0x{id:X4}";
default: return string.Format(Localization.Unknown_vendor_id_0, id);
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -83,12 +83,12 @@ public static class AACS
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
sb.AppendFormat("AACS Volume Identifier in hex follows:");
sb.AppendFormat(Localization.AACS_Volume_Identifier_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VolumeIdentifier, 80));
return sb.ToString();
@@ -130,12 +130,12 @@ public static class AACS
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
sb.AppendFormat("AACS Media Serial Number in hex follows:");
sb.AppendFormat(Localization.AACS_Media_Serial_Number_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaSerialNumber, 80));
return sb.ToString();
@@ -177,12 +177,12 @@ public static class AACS
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
sb.AppendFormat("AACS Media Identifier in hex follows:");
sb.AppendFormat(Localization.AACS_Media_Identifier_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaIdentifier, 80));
return sb.ToString();
@@ -224,11 +224,12 @@ public static class AACS
#if DEBUG
if(response.Reserved != 0)
sb.AppendFormat("Reserved = 0x{0:X2}", response.Reserved).AppendLine();
sb.AppendFormat(Localization.Reserved_equals_0_X2, response.Reserved).AppendLine();
#endif
sb.AppendFormat("Total number of media key blocks available to transfer {0}", response.TotalPacks).AppendLine();
sb.AppendFormat(Localization.Total_number_of_media_key_blocks_available_to_transfer_0, response.TotalPacks).
AppendLine();
sb.AppendFormat("AACS Media Key Blocks in hex follows:");
sb.AppendFormat(Localization.AACS_Media_Key_Blocks_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaKeyBlockPacks, 80));
return sb.ToString();
@@ -270,12 +271,12 @@ public static class AACS
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
#endif
sb.AppendFormat("AACS Data Keys in hex follows:");
sb.AppendFormat(Localization.AACS_Data_Keys_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.DataKeys, 80));
return sb.ToString();
@@ -326,13 +327,13 @@ public static class AACS
var sb = new StringBuilder();
if(response.MaxLBAExtents == 0)
sb.AppendLine(response.DataLength > 2 ? "Drive can store 256 LBA Extents"
: "Drive cannot store LBA Extents");
sb.AppendLine(response.DataLength > 2 ? Localization.Drive_can_store_256_LBA_Extents
: Localization.Drive_cannot_store_LBA_Extents);
else
sb.AppendFormat("Drive can store {0} LBA Extents", response.MaxLBAExtents).AppendLine();
sb.AppendFormat(Localization.Drive_can_store_0_LBA_Extents, response.MaxLBAExtents).AppendLine();
for(int i = 0; i < response.Extents.Length; i++)
sb.AppendFormat("LBA Extent {0} starts at LBA {1} and goes for {2} sectors", i,
sb.AppendFormat(Localization.LBA_Extent_0_starts_at_LBA_1_and_goes_for_2_sectors, i,
response.Extents[i].StartLBA, response.Extents[i].LBACount);
return sb.ToString();

View File

@@ -83,12 +83,12 @@ public static class CPRM
#if DEBUG
if(response.Reserved != 0)
sb.AppendFormat("Reserved = 0x{0:X2}", response.Reserved).AppendLine();
sb.AppendFormat(Localization.Reserved_equals_0_X2, response.Reserved).AppendLine();
#endif
sb.AppendFormat("Total number of CPRM Media Key Blocks available to transfer: {0}", response.TotalPacks).
AppendLine();
sb.AppendFormat(Localization.Total_number_of_CPRM_Media_Key_Blocks_available_to_transfer_0,
response.TotalPacks).AppendLine();
sb.AppendFormat("CPRM Media Key Blocks in hex follows:");
sb.AppendFormat(Localization.CPRM_Media_Key_Blocks_in_hex_follows);
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MKBPackData, 80));
return sb.ToString();

View File

@@ -133,23 +133,23 @@ public static class DiscInformation
switch(information.Value.DiscType)
{
case 0x00:
sb.AppendLine("Disc type declared as CD-DA or CD-ROM");
sb.AppendLine(Localization.Disc_type_declared_as_CD_DA_or_CD_ROM);
break;
case 0x10:
sb.AppendLine("Disc type declared as CD-i");
sb.AppendLine(Localization.Disc_type_declared_as_CD_i);
break;
case 0x20:
sb.AppendLine("Disc type declared as CD-ROM XA");
sb.AppendLine(Localization.Disc_type_declared_as_CD_ROM_XA);
break;
case 0xFF:
sb.AppendLine("Disc type is undefined");
sb.AppendLine(Localization.Disc_type_is_undefined);
break;
default:
sb.AppendFormat("Unknown disc type {0:X2}h", information.Value.DiscType).AppendLine();
sb.AppendFormat(Localization.Unknown_disc_type_0, information.Value.DiscType).AppendLine();
break;
}
@@ -157,38 +157,38 @@ public static class DiscInformation
switch(information.Value.DiscStatus)
{
case 0:
sb.AppendLine("Disc is empty");
sb.AppendLine(Localization.Disc_is_empty);
break;
case 1:
sb.AppendLine("Disc is incomplete");
sb.AppendLine(Localization.Disc_is_incomplete);
break;
case 2:
sb.AppendLine("Disc is finalized");
sb.AppendLine(Localization.Disc_is_finalized);
break;
}
if(information.Value.Erasable)
sb.AppendLine("Disc is erasable");
sb.AppendLine(Localization.Disc_is_erasable);
switch(information.Value.LastSessionStatus)
{
case 0:
sb.AppendLine("Last session is empty");
sb.AppendLine(Localization.Last_session_is_empty);
break;
case 1:
sb.AppendLine("Last session is incomplete");
sb.AppendLine(Localization.Last_session_is_incomplete);
break;
case 2:
sb.AppendLine("Last session is damaged");
sb.AppendLine(Localization.Last_session_is_damaged);
break;
case 3:
sb.AppendLine("Last session is complete");
sb.AppendLine(Localization.Last_session_is_complete);
break;
}
@@ -196,61 +196,63 @@ public static class DiscInformation
switch(information.Value.BGFormatStatus)
{
case 1:
sb.AppendLine("Media was being formatted in the background but it is stopped and incomplete");
sb.AppendLine(Localization.
Media_was_being_formatted_in_the_background_but_it_is_stopped_and_incomplete);
break;
case 2:
sb.AppendLine("Media is currently being formatted in the background");
sb.AppendLine(Localization.Media_is_currently_being_formatted_in_the_background);
break;
case 3:
sb.AppendLine("Media background formatting has completed");
sb.AppendLine(Localization.Media_background_formatting_has_completed);
break;
}
if(information.Value.Dbit)
sb.AppendLine("MRW is dirty");
sb.AppendLine(Localization.MRW_is_dirty);
sb.AppendFormat("First track on disc is track {0}", information.Value.FirstTrackNumber).AppendLine();
sb.AppendFormat("Disc has {0} sessions", information.Value.Sessions).AppendLine();
sb.AppendFormat(Localization.First_track_on_disc_is_track_0, information.Value.FirstTrackNumber).AppendLine();
sb.AppendFormat(Localization.Disc_has_0_sessions, information.Value.Sessions).AppendLine();
sb.AppendFormat("First track in last session is track {0}", information.Value.FirstTrackLastSession).
sb.AppendFormat(Localization.First_track_in_last_session_is_track_0, information.Value.FirstTrackLastSession).
AppendLine();
sb.AppendFormat("Last track in last session is track {0}", information.Value.LastTrackLastSession).AppendLine();
sb.AppendFormat(Localization.Last_track_in_last_session_is_track_0, information.Value.LastTrackLastSession).
AppendLine();
sb.AppendFormat("Last session Lead-In address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}",
sb.AppendFormat(Localization.Last_session_Lead_In_address_is_0_as_LBA_or_1_2_3,
information.Value.LastSessionLeadInStartLBA,
(information.Value.LastSessionLeadInStartLBA & 0xFF0000) >> 16,
(information.Value.LastSessionLeadInStartLBA & 0xFF00) >> 8,
information.Value.LastSessionLeadInStartLBA & 0xFF).AppendLine();
sb.AppendFormat("Last possible Lead-Out address is {0} (as LBA) or {1:X2}:{2:X2}:{3:X2}",
sb.AppendFormat(Localization.Last_possible_Lead_Out_address_is_0_as_LBA_or_1_2_3,
information.Value.LastPossibleLeadOutStartLBA,
(information.Value.LastPossibleLeadOutStartLBA & 0xFF0000) >> 16,
(information.Value.LastPossibleLeadOutStartLBA & 0xFF00) >> 8,
information.Value.LastPossibleLeadOutStartLBA & 0xFF).AppendLine();
sb.AppendLine(information.Value.URU ? "Disc is defined for unrestricted use"
: "Disc is defined for restricted use");
sb.AppendLine(information.Value.URU ? Localization.Disc_is_defined_for_unrestricted_use
: Localization.Disc_is_defined_for_restricted_use);
if(information.Value.DID_V)
sb.AppendFormat("Disc ID: {0:X6}", information.Value.DiscIdentification & 0x00FFFFFF).AppendLine();
sb.AppendFormat(Localization.Disc_ID_0_X6, information.Value.DiscIdentification & 0x00FFFFFF).AppendLine();
if(information.Value.DBC_V)
sb.AppendFormat("Disc barcode: {0:X16}", information.Value.DiscBarcode).AppendLine();
sb.AppendFormat(Localization.Disc_barcode_0, information.Value.DiscBarcode).AppendLine();
if(information.Value.DAC_V)
sb.AppendFormat("Disc application code: {0}", information.Value.DiscApplicationCode).AppendLine();
sb.AppendFormat(Localization.Disc_application_code_0, information.Value.DiscApplicationCode).AppendLine();
if(information.Value.OPCTables == null)
return sb.ToString();
foreach(OPCTable table in information.Value.OPCTables)
sb.AppendFormat("OPC values for {0}Kbit/sec.: {1}, {2}, {3}, {4}, {5}, {6}", table.Speed,
table.OPCValues[0], table.OPCValues[1], table.OPCValues[2], table.OPCValues[3],
table.OPCValues[4], table.OPCValues[5]).AppendLine();
sb.AppendFormat(Localization.OPC_values_for_0_Kbit_sec_1_2_3_4_5_6, table.Speed, table.OPCValues[0],
table.OPCValues[1], table.OPCValues[2], table.OPCValues[3], table.OPCValues[4],
table.OPCValues[5]).AppendLine();
return sb.ToString();
}
@@ -287,13 +289,13 @@ public static class DiscInformation
var sb = new StringBuilder();
sb.AppendFormat("{0} maximum possible tracks on the disc", information.Value.MaxTracks).AppendLine();
sb.AppendFormat("{0} assigned tracks on the disc", information.Value.AssignedTracks).AppendLine();
sb.AppendFormat(Localization._0_maximum_possible_tracks_on_the_disc, information.Value.MaxTracks).AppendLine();
sb.AppendFormat(Localization._0_assigned_tracks_on_the_disc, information.Value.AssignedTracks).AppendLine();
sb.AppendFormat("{0} maximum possible appendable tracks on the disc", information.Value.AppendableTracks).
AppendLine();
sb.AppendFormat(Localization._0_maximum_possible_appendable_tracks_on_the_disc,
information.Value.AppendableTracks).AppendLine();
sb.AppendFormat("{0} current appendable tracks on the disc", information.Value.MaxAppendableTracks).
sb.AppendFormat(Localization._0_current_appendable_tracks_on_the_disc, information.Value.MaxAppendableTracks).
AppendLine();
return sb.ToString();
@@ -336,12 +338,13 @@ public static class DiscInformation
var sb = new StringBuilder();
sb.AppendFormat("{0} remaining POW replacements", information.Value.RemainingPOWReplacements).AppendLine();
sb.AppendFormat("{0} remaining POW reallocation map entries", information.Value.RemainingPOWReallocation).
sb.AppendFormat(Localization._0_remaining_POW_replacements, information.Value.RemainingPOWReplacements).
AppendLine();
sb.AppendFormat("{0} remaining POW updates", information.Value.RemainingPOWUpdates).AppendLine();
sb.AppendFormat(Localization._0_remaining_POW_reallocation_map_entries,
information.Value.RemainingPOWReallocation).AppendLine();
sb.AppendFormat(Localization._0_remaining_POW_updates, information.Value.RemainingPOWUpdates).AppendLine();
return sb.ToString();
}

File diff suppressed because it is too large Load Diff

View File

@@ -89,72 +89,73 @@ public static class Hybrid
var sb = new StringBuilder();
sb.AppendFormat("{0} format layers recognized", response.NumberOfLayers);
sb.AppendFormat(Localization._0_format_layers_recognized, response.NumberOfLayers);
for(int i = 0; i < response.FormatLayers.Length; i++)
switch(response.FormatLayers[i])
{
case (ushort)FormatLayerTypeCodes.BDLayer:
{
sb.AppendFormat("Layer {0} is of type Blu-ray", i).AppendLine();
sb.AppendFormat(Localization.Layer_0_is_of_type_Blu_ray, i).AppendLine();
if(response.DefaultFormatLayer == i)
sb.AppendLine("This is the default layer.");
sb.AppendLine(Localization.This_is_the_default_layer);
if(response.OnlineFormatLayer == i)
sb.AppendLine("This is the layer actually in use.");
sb.AppendLine(Localization.This_is_the_layer_actually_in_use);
break;
}
case (ushort)FormatLayerTypeCodes.CDLayer:
{
sb.AppendFormat("Layer {0} is of type CD", i).AppendLine();
sb.AppendFormat(Localization.Layer_0_is_of_type_CD, i).AppendLine();
if(response.DefaultFormatLayer == i)
sb.AppendLine("This is the default layer.");
sb.AppendLine(Localization.This_is_the_default_layer);
if(response.OnlineFormatLayer == i)
sb.AppendLine("This is the layer actually in use.");
sb.AppendLine(Localization.This_is_the_layer_actually_in_use);
break;
}
case (ushort)FormatLayerTypeCodes.DVDLayer:
{
sb.AppendFormat("Layer {0} is of type DVD", i).AppendLine();
sb.AppendFormat(Localization.Layer_0_is_of_type_DVD, i).AppendLine();
if(response.DefaultFormatLayer == i)
sb.AppendLine("This is the default layer.");
sb.AppendLine(Localization.This_is_the_default_layer);
if(response.OnlineFormatLayer == i)
sb.AppendLine("This is the layer actually in use.");
sb.AppendLine(Localization.This_is_the_layer_actually_in_use);
break;
}
case (ushort)FormatLayerTypeCodes.HDDVDLayer:
{
sb.AppendFormat("Layer {0} is of type HD DVD", i).AppendLine();
sb.AppendFormat(Localization.Layer_0_is_of_type_HD_DVD, i).AppendLine();
if(response.DefaultFormatLayer == i)
sb.AppendLine("This is the default layer.");
sb.AppendLine(Localization.This_is_the_default_layer);
if(response.OnlineFormatLayer == i)
sb.AppendLine("This is the layer actually in use.");
sb.AppendLine(Localization.This_is_the_layer_actually_in_use);
break;
}
default:
{
sb.AppendFormat("Layer {0} is of unknown type 0x{1:X4}", i, response.FormatLayers[i]).AppendLine();
sb.AppendFormat(Localization.Layer_0_is_of_unknown_type_1, i, response.FormatLayers[i]).
AppendLine();
if(response.DefaultFormatLayer == i)
sb.AppendLine("This is the default layer.");
sb.AppendLine(Localization.This_is_the_default_layer);
if(response.OnlineFormatLayer == i)
sb.AppendLine("This is the layer actually in use.");
sb.AppendLine(Localization.This_is_the_layer_actually_in_use);
break;
}

View File

@@ -87,35 +87,35 @@ public static class WriteProtect
var sb = new StringBuilder();
if(response.MSWI)
sb.AppendLine("Writing inhibited by media specific reason");
sb.AppendLine(Localization.Writing_inhibited_by_media_specific_reason);
if(response.CWP)
sb.AppendLine("Cartridge sets write protection");
sb.AppendLine(Localization.Cartridge_sets_write_protection);
if(response.PWP)
sb.AppendLine("Media surface sets write protection");
sb.AppendLine(Localization.Media_surface_sets_write_protection);
if(response.SWPP)
sb.AppendLine("Software write protection is set until power down");
sb.AppendLine(Localization.Software_write_protection_is_set_until_power_down);
#if DEBUG
if(response.Reserved1 != 0)
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
sb.AppendFormat(Localization.Reserved1_equals_0_X8, response.Reserved1).AppendLine();
if(response.Reserved2 != 0)
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
sb.AppendFormat(Localization.Reserved2_equals_0_X8, response.Reserved2).AppendLine();
if(response.Reserved3 != 0)
sb.AppendFormat("Reserved3 = 0x{0:X2}", response.Reserved3).AppendLine();
sb.AppendFormat(Localization.Reserved_3_equals_0_X2, response.Reserved3).AppendLine();
if(response.Reserved4 != 0)
sb.AppendFormat("Reserved4 = 0x{0:X2}", response.Reserved4).AppendLine();
sb.AppendFormat(Localization.Reserved_4_equals_0_X2, response.Reserved4).AppendLine();
if(response.Reserved5 != 0)
sb.AppendFormat("Reserved5 = 0x{0:X2}", response.Reserved5).AppendLine();
sb.AppendFormat(Localization.Reserved_5_equals_0_X2, response.Reserved5).AppendLine();
if(response.Reserved6 != 0)
sb.AppendFormat("Reserved6 = 0x{0:X2}", response.Reserved6).AppendLine();
sb.AppendFormat(Localization.Reserved_6_equals_0_X2, response.Reserved6).AppendLine();
#endif
return sb.ToString();

View File

@@ -93,21 +93,21 @@ public static partial class Modes
ModePage_00_SFF page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Drive Operation Mode page:");
sb.AppendLine(Localization.SCSI_Drive_Operation_Mode_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.DVW)
sb.AppendLine("\tVerifying after writing is disabled");
sb.AppendLine("\t" + Localization.Verifying_after_writing_is_disabled);
if(page.DDE)
sb.AppendLine("\tDrive will abort when a writing error is detected");
sb.AppendLine("\t" + Localization.Drive_will_abort_when_a_writing_error_is_detected);
if(!page.SLM)
return sb.ToString();
sb.Append("\tDrive has two LUNs with rewritable being ");
sb.Append("\t" + Localization.Drive_has_two_LUNs_with_rewritable_being);
sb.AppendLine(page.SLR ? "LUN 1" : "LUN 0");
return sb.ToString();

View File

@@ -180,47 +180,51 @@ public static partial class Modes
ModePage_01 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Read-write error recovery page:");
sb.AppendLine(Localization.SCSI_Read_write_error_recovery_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.AWRE)
sb.AppendLine("\tAutomatic write reallocation is enabled");
sb.AppendLine("\t" + Localization.Automatic_write_reallocation_is_enabled);
if(page.ARRE)
sb.AppendLine("\tAutomatic read reallocation is enabled");
sb.AppendLine("\t" + Localization.Automatic_read_reallocation_is_enabled);
if(page.TB)
sb.AppendLine("\tData not recovered within limits shall be transferred back before a CHECK CONDITION");
sb.AppendLine("\t" + Localization.
Data_not_recovered_within_limits_shall_be_transferred_back_before_a_CHECK_CONDITION);
if(page.RC)
sb.AppendLine("\tDrive will transfer the entire requested length without delaying to perform error recovery");
sb.AppendLine("\t" + Localization.
Drive_will_transfer_the_entire_requested_length_without_delaying_to_perform_error_recovery);
if(page.EER)
sb.AppendLine("\tDrive will use the most expedient form of error recovery first");
sb.AppendLine("\t" + Localization.Drive_will_use_the_most_expedient_form_of_error_recovery_first);
if(page.PER)
sb.AppendLine("\tDrive shall report recovered errors");
sb.AppendLine("\t" + Localization.Drive_shall_report_recovered_errors);
if(page.DTE)
sb.AppendLine("\tTransfer will be terminated upon error detection");
sb.AppendLine("\t" + Localization.Transfer_will_be_terminated_upon_error_detection);
if(page.DCR)
sb.AppendLine("\tError correction is disabled");
sb.AppendLine("\t" + Localization.Error_correction_is_disabled);
if(page.ReadRetryCount > 0)
sb.AppendFormat("\tDrive will repeat read operations {0} times", page.ReadRetryCount).AppendLine();
if(page.WriteRetryCount > 0)
sb.AppendFormat("\tDrive will repeat write operations {0} times", page.WriteRetryCount).AppendLine();
if(page.RecoveryTimeLimit > 0)
sb.AppendFormat("\tDrive will employ a maximum of {0} ms to recover data", page.RecoveryTimeLimit).
sb.AppendFormat("\t" + Localization.Drive_will_repeat_read_operations_0_times, page.ReadRetryCount).
AppendLine();
if(page.WriteRetryCount > 0)
sb.AppendFormat("\t" + Localization.Drive_will_repeat_write_operations_0_times, page.WriteRetryCount).
AppendLine();
if(page.RecoveryTimeLimit > 0)
sb.AppendFormat("\t" + Localization.Drive_will_employ_a_maximum_of_0_ms_to_recover_data,
page.RecoveryTimeLimit).AppendLine();
if(page.LBPERE)
sb.AppendLine("Logical block provisioning error reporting is enabled");
sb.AppendLine(Localization.Logical_block_provisioning_error_reporting_is_enabled);
return sb.ToString();
}

View File

@@ -120,30 +120,34 @@ public static partial class Modes
ModePage_01_MMC page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Read error recovery page for MultiMedia Devices:");
sb.AppendLine(Localization.SCSI_Read_error_recovery_page_for_MultiMedia_Devices);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.ReadRetryCount > 0)
sb.AppendFormat("\tDrive will repeat read operations {0} times", page.ReadRetryCount).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_repeat_read_operations_0_times, page.ReadRetryCount).
AppendLine();
const string AllUsed = "\tAll available recovery procedures will be used.\n";
const string CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n";
const string RetriesUsed = "\tOnly retries are used.\n";
const string RecoveredNotReported = "\tRecovered errors will not be reported.\n";
const string RecoveredReported = "\tRecovered errors will be reported.\n";
const string RecoveredAbort = "\tRecovered errors will be reported and aborted with CHECK CONDITION.\n";
const string UnrecECCAbort = "\tUnrecovered ECC errors will return CHECK CONDITION.";
const string UnrecCIRCAbort = "\tUnrecovered CIRC errors will return CHECK CONDITION.";
const string UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
const string UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
string AllUsed = "\t" + Localization.All_available_recovery_procedures_will_be_used + "\n";
string CIRCRetriesUsed = "\t" + Localization.Only_retries_and_CIRC_are_used + "\n";
string RetriesUsed = "\t" + Localization.Only_retries_are_used + "\n";
string RecoveredNotReported = "\t" + Localization.Recovered_errors_will_not_be_reported + "\n";
string RecoveredReported = "\t" + Localization.Recovered_errors_will_be_reported + "\n";
const string UnrecECCAbortData =
"\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
string RecoveredAbort = "\t" + Localization.Recovered_errors_will_be_reported_and_aborted_with_CHECK_CONDITION +
"\n";
const string UnrecCIRCAbortData =
"\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
string UnrecECCAbort = "\t" + Localization.Unrecovered_ECC_errors_will_return_CHECK_CONDITION;
string UnrecCIRCAbort = "\t" + Localization.Unrecovered_CIRC_errors_will_return_CHECK_CONDITION;
string UnrecECCNotAbort = "\t" + Localization.Unrecovered_ECC_errors_will_not_abort_the_transfer;
string UnrecCIRCNotAbort = "\t" + Localization.Unrecovered_CIRC_errors_will_not_abort_the_transfer;
string UnrecECCAbortData =
"\t" + Localization.Unrecovered_ECC_errors_will_return_CHECK_CONDITION_and_the_uncorrected_data;
string UnrecCIRCAbortData =
"\t" + Localization.Unrecovered_CIRC_errors_will_return_CHECK_CONDITION_and_the_uncorrected_data;
switch(page.Parameter)
{
@@ -216,17 +220,18 @@ public static partial class Modes
case 0x34: goto case 0x14;
case 0x35: goto case 0x15;
default:
sb.AppendFormat("Unknown recovery parameter 0x{0:X2}", page.Parameter).AppendLine();
sb.AppendFormat(Localization.Unknown_recovery_parameter_0, page.Parameter).AppendLine();
break;
}
if(page.WriteRetryCount > 0)
sb.AppendFormat("\tDrive will repeat write operations {0} times", page.WriteRetryCount).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_repeat_write_operations_0_times, page.WriteRetryCount).
AppendLine();
if(page.RecoveryTimeLimit > 0)
sb.AppendFormat("\tDrive will employ a maximum of {0} ms to recover data", page.RecoveryTimeLimit).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_employ_a_maximum_of_0_ms_to_recover_data,
page.RecoveryTimeLimit).AppendLine();
return sb.ToString();
}

View File

@@ -122,62 +122,69 @@ public static partial class Modes
ModePage_02 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Disconnect-Reconnect mode page:");
sb.AppendLine(Localization.SCSI_Disconnect_Reconnect_mode_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.BufferFullRatio > 0)
sb.AppendFormat("\t{0} ratio of buffer that shall be full prior to attempting a reselection",
sb.AppendFormat("\t" + Localization._0_ratio_of_buffer_that_shall_be_full_prior_to_attempting_a_reselection,
page.BufferFullRatio).AppendLine();
if(page.BufferEmptyRatio > 0)
sb.AppendFormat("\t{0} ratio of buffer that shall be empty prior to attempting a reselection",
page.BufferEmptyRatio).AppendLine();
sb.
AppendFormat("\t" + Localization._0_ratio_of_buffer_that_shall_be_empty_prior_to_attempting_a_reselection,
page.BufferEmptyRatio).AppendLine();
if(page.BusInactivityLimit > 0)
sb.AppendFormat("\t{0} µs maximum permitted to assert BSY without a REQ/ACK handshake",
sb.AppendFormat("\t" + Localization._0_µs_maximum_permitted_to_assert_BSY_without_a_REQ_ACK_handshake,
page.BusInactivityLimit * 100).AppendLine();
if(page.DisconnectTimeLimit > 0)
sb.AppendFormat("\t{0} µs maximum permitted wait after releasing the bus before attempting reselection",
page.DisconnectTimeLimit * 100).AppendLine();
sb.
AppendFormat("\t" + Localization._0_µs_maximum_permitted_wait_after_releasing_the_bus_before_attempting_reselection,
page.DisconnectTimeLimit * 100).AppendLine();
if(page.ConnectTimeLimit > 0)
sb.
AppendFormat("\t{0} µs allowed to use the bus before disconnecting, if granted the privilege and not restricted",
AppendFormat("\t" + Localization._0_µs_allowed_to_use_the_bus_before_disconnecting_if_granted_the_privilege_and_not_restricted,
page.ConnectTimeLimit * 100).AppendLine();
if(page.MaxBurstSize > 0)
sb.AppendFormat("\t{0} bytes maximum can be transferred before disconnecting", page.MaxBurstSize * 512).
AppendLine();
sb.AppendFormat("\t" + Localization._0_bytes_maximum_can_be_transferred_before_disconnecting,
page.MaxBurstSize * 512).AppendLine();
if(page.FirstBurstSize > 0)
sb.AppendFormat("\t{0} bytes maximum can be transferred for a command along with the disconnect command",
page.FirstBurstSize * 512).AppendLine();
sb.
AppendFormat("\t" + Localization._0_bytes_maximum_can_be_transferred_for_a_command_along_with_the_disconnect_command,
page.FirstBurstSize * 512).AppendLine();
if(page.DIMM)
sb.AppendLine("\tTarget shall not transfer data for a command during the same interconnect tenancy");
sb.AppendLine("\t" + Localization.
Target_shall_not_transfer_data_for_a_command_during_the_same_interconnect_tenancy);
if(page.EMDP)
sb.AppendLine("\tTarget is allowed to re-order the data transfer");
sb.AppendLine("\t" + Localization.Target_is_allowed_to_reorder_the_data_transfer);
switch(page.DTDC)
{
case 0:
sb.AppendLine("\tData transfer disconnect control is not used");
sb.AppendLine("\t" + Localization.Data_transfer_disconnect_control_is_not_used);
break;
case 1:
sb.AppendLine("\tAll data for a command shall be transferred within a single interconnect tenancy");
sb.AppendLine("\t" + Localization.
All_data_for_a_command_shall_be_transferred_within_a_single_interconnect_tenancy);
break;
case 3:
sb.AppendLine("\tAll data and the response for a command shall be transferred within a single interconnect tenancy");
sb.AppendLine("\t" + Localization.
All_data_and_the_response_for_a_command_shall_be_transferred_within_a_single_interconnect_tenancy);
break;
default:
sb.AppendFormat("\tReserved data transfer disconnect control value {0}", page.DTDC).AppendLine();
sb.AppendFormat("\t" + Localization.Reserved_data_transfer_disconnect_control_value_0, page.DTDC).
AppendLine();
break;
}

View File

@@ -121,46 +121,48 @@ public static partial class Modes
ModePage_03 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Format device page:");
sb.AppendLine(Localization.SCSI_Format_device_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.
AppendFormat("\t{0} tracks per zone to use in dividing the capacity for the purpose of allocating alternate sectors",
AppendFormat("\t" + Localization._0_tracks_per_zone_to_use_in_dividing_the_capacity_for_the_purpose_of_allocating_alternate_sectors,
page.TracksPerZone).AppendLine();
sb.AppendFormat("\t{0} sectors per zone that shall be reserved for defect handling", page.AltSectorsPerZone).
AppendLine();
sb.AppendFormat("\t" + Localization._0_sectors_per_zone_that_shall_be_reserved_for_defect_handling,
page.AltSectorsPerZone).AppendLine();
sb.AppendFormat("\t{0} tracks per zone that shall be reserved for defect handling", page.AltTracksPerZone).
AppendLine();
sb.AppendFormat("\t" + Localization._0_tracks_per_zone_that_shall_be_reserved_for_defect_handling,
page.AltTracksPerZone).AppendLine();
sb.AppendFormat("\t{0} tracks per LUN that shall be reserved for defect handling", page.AltTracksPerLun).
AppendLine();
sb.AppendFormat("\t" + Localization._0_tracks_per_LUN_that_shall_be_reserved_for_defect_handling,
page.AltTracksPerLun).AppendLine();
sb.AppendFormat("\t{0} physical sectors per track", page.SectorsPerTrack).AppendLine();
sb.AppendFormat("\t{0} Bytes per physical sector", page.BytesPerSector).AppendLine();
sb.AppendFormat("\tTarget-dependent interleave value is {0}", page.Interleave).AppendLine();
sb.AppendFormat("\t" + Localization._0_physical_sectors_per_track, page.SectorsPerTrack).AppendLine();
sb.AppendFormat("\t" + Localization._0_Bytes_per_physical_sector, page.BytesPerSector).AppendLine();
sb.AppendFormat("\t" + Localization.Target_dependent_interleave_value_is_0, page.Interleave).AppendLine();
sb.AppendFormat("\t{0} sectors between last block of one track and first block of the next", page.TrackSkew).
AppendLine();
sb.AppendFormat("\t" + Localization._0_sectors_between_last_block_of_one_track_and_first_block_of_the_next,
page.TrackSkew).AppendLine();
sb.AppendFormat("\t{0} sectors between last block of a cylinder and first block of the next one",
sb.AppendFormat("\t" + Localization._0_sectors_between_last_block_of_a_cylinder_and_first_block_of_the_next_one,
page.CylinderSkew).AppendLine();
if(page.SSEC)
sb.AppendLine("\tDrive supports soft-sectoring format");
sb.AppendLine("\t" + Localization.Drive_supports_soft_sectoring_format);
if(page.HSEC)
sb.AppendLine("\tDrive supports hard-sectoring format");
sb.AppendLine("\t" + Localization.Drive_supports_hard_sectoring_format);
if(page.RMB)
sb.AppendLine("\tDrive media is removable");
sb.AppendLine("\t" + Localization.Drive_media_is_removable);
sb.AppendLine(page.SURF
? "\tSector addressing is progressively incremented in one surface before going to the next"
: "\tSector addressing is progressively incremented in one cylinder before going to the next");
? "\t" + Localization.
Sector_addressing_is_progressively_incremented_in_one_surface_before_going_to_the_next
: "\t" + Localization.
Sector_addressing_is_progressively_incremented_in_one_cylinder_before_going_to_the_next);
return sb.ToString();
}

View File

@@ -111,44 +111,46 @@ public static partial class Modes
ModePage_04 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Rigid disk drive geometry page:");
sb.AppendLine(Localization.SCSI_Rigid_disk_drive_geometry_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\t{0} heads", page.Heads).AppendLine();
sb.AppendFormat("\t{0} cylinders", page.Cylinders).AppendLine();
sb.AppendFormat("\t" + Localization._0_heads, page.Heads).AppendLine();
sb.AppendFormat("\t" + Localization._0_cylinders, page.Cylinders).AppendLine();
if(page.WritePrecompCylinder < page.Cylinders)
sb.AppendFormat("\tWrite pre-compensation starts at cylinder {0}", page.WritePrecompCylinder).AppendLine();
sb.AppendFormat("\t" + Localization.Write_pre_compensation_starts_at_cylinder_0, page.WritePrecompCylinder).
AppendLine();
if(page.WriteReduceCylinder < page.Cylinders)
sb.AppendFormat("\tWrite current reduction starts at cylinder {0}", page.WriteReduceCylinder).AppendLine();
sb.AppendFormat("\t" + Localization.Write_current_reduction_starts_at_cylinder_0, page.WriteReduceCylinder).
AppendLine();
if(page.DriveStepRate > 0)
sb.AppendFormat("\tDrive steps in {0} ns", (uint)page.DriveStepRate * 100).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_steps_in_0_ns, (uint)page.DriveStepRate * 100).AppendLine();
sb.AppendFormat("\tHeads park in cylinder {0}", page.LandingCylinder).AppendLine();
sb.AppendFormat("\t" + Localization.Heads_park_in_cylinder_0, page.LandingCylinder).AppendLine();
if(page.MediumRotationRate > 0)
sb.AppendFormat("\tMedium rotates at {0} rpm", page.MediumRotationRate).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_rotates_at_0_rpm, page.MediumRotationRate).AppendLine();
switch(page.RPL)
{
case 0:
sb.AppendLine("\tSpindle synchronization is disable or unsupported");
sb.AppendLine("\t" + Localization.Spindle_synchronization_is_disable_or_unsupported);
break;
case 1:
sb.AppendLine("\tTarget operates as a synchronized-spindle slave");
sb.AppendLine("\t" + Localization.Target_operates_as_a_synchronized_spindle_slave);
break;
case 2:
sb.AppendLine("\tTarget operates as a synchronized-spindle master");
sb.AppendLine("\t" + Localization.Target_operates_as_a_synchronized_spindle_master);
break;
case 3:
sb.AppendLine("\tTarget operates as a synchronized-spindle master control");
sb.AppendLine("\t" + Localization.Target_operates_as_a_synchronized_spindle_master_control);
break;
}

View File

@@ -157,89 +157,94 @@ public static partial class Modes
ModePage_05 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Flexible disk page:");
sb.AppendLine(Localization.SCSI_Flexible_disk_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\tTransfer rate: {0} kbit/s", page.TransferRate).AppendLine();
sb.AppendFormat("\t{0} heads", page.Heads).AppendLine();
sb.AppendFormat("\t{0} cylinders", page.Cylinders).AppendLine();
sb.AppendFormat("\t{0} sectors per track", page.SectorsPerTrack).AppendLine();
sb.AppendFormat("\t{0} bytes per sector", page.BytesPerSector).AppendLine();
sb.AppendFormat("\t" + Localization.Transfer_rate_0_kbits, page.TransferRate).AppendLine();
sb.AppendFormat("\t" + Localization._0_heads, page.Heads).AppendLine();
sb.AppendFormat("\t" + Localization._0_cylinders, page.Cylinders).AppendLine();
sb.AppendFormat("\t" + Localization._0_sectors_per_track, page.SectorsPerTrack).AppendLine();
sb.AppendFormat("\t" + Localization._0_bytes_per_sector, page.BytesPerSector).AppendLine();
if(page.WritePrecompCylinder < page.Cylinders)
sb.AppendFormat("\tWrite pre-compensation starts at cylinder {0}", page.WritePrecompCylinder).AppendLine();
sb.AppendFormat("\t" + Localization.Write_pre_compensation_starts_at_cylinder_0, page.WritePrecompCylinder).
AppendLine();
if(page.WriteReduceCylinder < page.Cylinders)
sb.AppendFormat("\tWrite current reduction starts at cylinder {0}", page.WriteReduceCylinder).AppendLine();
sb.AppendFormat("\t" + Localization.Write_current_reduction_starts_at_cylinder_0, page.WriteReduceCylinder).
AppendLine();
if(page.DriveStepRate > 0)
sb.AppendFormat("\tDrive steps in {0} μs", (uint)page.DriveStepRate * 100).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_steps_in_0_μs, (uint)page.DriveStepRate * 100).AppendLine();
if(page.DriveStepPulse > 0)
sb.AppendFormat("\tEach step pulse is {0} ms", page.DriveStepPulse).AppendLine();
sb.AppendFormat("\t" + Localization.Each_step_pulse_is_0_ms, page.DriveStepPulse).AppendLine();
if(page.HeadSettleDelay > 0)
sb.AppendFormat("\tHeads settles in {0} μs", (uint)page.HeadSettleDelay * 100).AppendLine();
sb.AppendFormat("\t" + Localization.Heads_settles_in_0_μs, (uint)page.HeadSettleDelay * 100).AppendLine();
if(!page.TRDY)
sb.
AppendFormat("\tTarget shall wait {0} seconds before attempting to access the medium after motor on is asserted",
AppendFormat("\t" + Localization.Target_shall_wait_0_seconds_before_attempting_to_access_the_medium_after_motor_on_is_asserted,
(double)page.MotorOnDelay * 10).AppendLine();
else
sb.
AppendFormat("\tTarget shall wait {0} seconds after drive is ready before aborting medium access attempts",
AppendFormat("\t" + Localization.Target_shall_wait_0_seconds_after_drive_is_ready_before_aborting_medium_access_attempts,
(double)page.MotorOnDelay * 10).AppendLine();
if(page.MotorOffDelay != 0xFF)
sb.AppendFormat("\tTarget shall wait {0} seconds before releasing the motor on signal after becoming idle",
(double)page.MotorOffDelay * 10).AppendLine();
sb.
AppendFormat("\t" + Localization.Target_shall_wait_0_seconds_before_releasing_the_motor_on_signal_after_becoming_idle,
(double)page.MotorOffDelay * 10).AppendLine();
else
sb.AppendLine("\tTarget shall never release the motor on signal");
sb.AppendLine("\t" + Localization.Target_shall_never_release_the_motor_on_signal);
if(page.TRDY)
sb.AppendLine("\tThere is a drive ready signal");
sb.AppendLine("\t" + Localization.There_is_a_drive_ready_signal);
if(page.SSN)
sb.AppendLine("\tSectors start at 1");
sb.AppendLine("\t" + Localization.Sectors_start_at_1);
if(page.MO)
sb.AppendLine("\tThe motor on signal shall remain released");
sb.AppendLine("\t" + Localization.The_motor_on_signal_shall_remain_released);
sb.AppendFormat("\tDrive needs to do {0} step pulses per cylinder", page.SPC + 1).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_needs_to_do_0_step_pulses_per_cylinder, page.SPC + 1).AppendLine();
if(page.WriteCompensation > 0)
sb.AppendFormat("\tWrite pre-compensation is {0}", page.WriteCompensation).AppendLine();
sb.AppendFormat("\t" + Localization.Write_pre_compensation_is_0, page.WriteCompensation).AppendLine();
if(page.HeadLoadDelay > 0)
sb.AppendFormat("\tHead takes {0} ms to load", page.HeadLoadDelay).AppendLine();
sb.AppendFormat("\t" + Localization.Head_takes_0_ms_to_load, page.HeadLoadDelay).AppendLine();
if(page.HeadUnloadDelay > 0)
sb.AppendFormat("\tHead takes {0} ms to unload", page.HeadUnloadDelay).AppendLine();
sb.AppendFormat("\t" + Localization.Head_takes_0_ms_to_unload, page.HeadUnloadDelay).AppendLine();
if(page.MediumRotationRate > 0)
sb.AppendFormat("\tMedium rotates at {0} rpm", page.MediumRotationRate).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_rotates_at_0_rpm, page.MediumRotationRate).AppendLine();
switch(page.Pin34 & 0x07)
{
case 0:
sb.AppendLine("\tPin 34 is unconnected");
sb.AppendLine("\t" + Localization.Pin_34_is_unconnected);
break;
case 1:
sb.Append("\tPin 34 indicates drive is ready when active ");
sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
sb.Append("\t" + ((page.Pin34 & 0x08) == 0x08
? Localization.Pin_34_indicates_drive_is_ready_when_active_high
: Localization.Pin_34_indicates_drive_is_ready_when_active_low));
break;
case 2:
sb.Append("\tPin 34 indicates disk has changed when active ");
sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
sb.Append("\t" + ((page.Pin34 & 0x08) == 0x08
? Localization.Pin_34_indicates_disk_has_changed_when_active_high
: Localization.Pin_34_indicates_disk_has_changed_when_active_low));
break;
default:
sb.AppendFormat("\tPin 34 indicates unknown function {0} when active ", page.Pin34 & 0x07);
sb.Append((page.Pin34 & 0x08) == 0x08 ? "high" : "low");
sb.AppendFormat("\t" + ((page.Pin34 & 0x08) == 0x08 ? Localization.Pin_34_indicates_unknown_function_0_when_active_high : Localization.Pin_34_indicates_unknown_function_0_when_active_low),
page.Pin34 & 0x07);
break;
}
@@ -247,27 +252,28 @@ public static partial class Modes
switch(page.Pin4 & 0x07)
{
case 0:
sb.AppendLine("\tPin 4 is unconnected");
sb.AppendLine("\t" + Localization.Pin_4_is_unconnected);
break;
case 1:
sb.Append("\tPin 4 indicates drive is in use when active ");
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
sb.Append("\t" + ((page.Pin4 & 0x08) == 0x08
? Localization.Pin_4_indicates_drive_is_in_use_when_active_high
: Localization.Pin_4_indicates_drive_is_in_use_when_active_low));
break;
case 2:
sb.Append("\tPin 4 indicates eject when active ");
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
sb.Append("\t" + ((page.Pin4 & 0x08) == 0x08 ? Localization.Pin_4_indicates_eject_when_active_high
: Localization.Pin_4_indicates_eject_when_active_low));
break;
case 3:
sb.Append("\tPin 4 indicates head load when active ");
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
sb.Append("\t" + ((page.Pin4 & 0x08) == 0x08 ? Localization.Pin_4_indicates_head_load_when_active_high
: Localization.Pin_4_indicates_head_load_when_active_low));
break;
default:
sb.AppendFormat("\tPin 4 indicates unknown function {0} when active ", page.Pin4 & 0x07);
sb.Append((page.Pin4 & 0x08) == 0x08 ? "high" : "low");
sb.AppendFormat("\t" + ((page.Pin4 & 0x08) == 0x08 ? Localization.Pin_4_indicates_unknown_function_0_when_active_high : Localization.Pin_4_indicates_unknown_function_0_when_active_low),
page.Pin4 & 0x07);
break;
}
@@ -275,12 +281,12 @@ public static partial class Modes
switch(page.Pin2 & 0x07)
{
case 0:
sb.AppendLine("\tPin 2 is unconnected");
sb.AppendLine("\t" + Localization.Pin_2_is_unconnected);
break;
default:
sb.AppendFormat("\tPin 2 indicates unknown function {0} when active ", page.Pin2 & 0x07);
sb.Append((page.Pin2 & 0x08) == 0x08 ? "high" : "low");
sb.AppendFormat("\t" + ((page.Pin2 & 0x08) == 0x08 ? Localization.Pin_2_indicates_unknown_function_0_when_active_high : Localization.Pin_2_indicates_unknown_function_0_when_active_low),
page.Pin2 & 0x07);
break;
}
@@ -288,17 +294,18 @@ public static partial class Modes
switch(page.Pin1 & 0x07)
{
case 0:
sb.AppendLine("\tPin 1 is unconnected");
sb.AppendLine("\t" + Localization.Pin_1_is_unconnected);
break;
case 1:
sb.Append("\tPin 1 indicates disk change reset when active ");
sb.Append((page.Pin1 & 0x08) == 0x08 ? "high" : "low");
sb.Append("\t" + ((page.Pin1 & 0x08) == 0x08
? Localization.Pin_1_indicates_disk_change_reset_when_active_high
: Localization.Pin_1_indicates_disk_change_reset_when_active_low));
break;
default:
sb.AppendFormat("\tPin 1 indicates unknown function {0} when active ", page.Pin1 & 0x07);
sb.Append((page.Pin1 & 0x08) == 0x08 ? "high" : "low");
sb.AppendFormat("\t" + ((page.Pin1 & 0x08) == 0x08 ? Localization.Pin_1_indicates_unknown_function_0_when_active_high : Localization.Pin_1_indicates_unknown_function_0_when_active_low),
page.Pin1 & 0x07);
break;
}

View File

@@ -82,13 +82,13 @@ public static partial class Modes
ModePage_06 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI optical memory:");
sb.AppendLine(Localization.SCSI_optical_memory);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.RUBR)
sb.AppendLine("\tOn reading an updated block drive will return RECOVERED ERROR");
sb.AppendLine("\t" + Localization.On_reading_an_updated_block_drive_will_return_RECOVERED_ERROR);
return sb.ToString();
}

View File

@@ -101,29 +101,30 @@ public static partial class Modes
ModePage_07 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Verify error recovery page:");
sb.AppendLine(Localization.SCSI_Verify_error_recovery_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.EER)
sb.AppendLine("\tDrive will use the most expedient form of error recovery first");
sb.AppendLine("\t" + Localization.Drive_will_use_the_most_expedient_form_of_error_recovery_first);
if(page.PER)
sb.AppendLine("\tDrive shall report recovered errors");
sb.AppendLine("\t" + Localization.Drive_shall_report_recovered_errors);
if(page.DTE)
sb.AppendLine("\tTransfer will be terminated upon error detection");
sb.AppendLine("\t" + Localization.Transfer_will_be_terminated_upon_error_detection);
if(page.DCR)
sb.AppendLine("\tError correction is disabled");
sb.AppendLine("\t" + Localization.Error_correction_is_disabled);
if(page.VerifyRetryCount > 0)
sb.AppendFormat("\tDrive will repeat verify operations {0} times", page.VerifyRetryCount).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_repeat_verify_operations_0_times, page.VerifyRetryCount).
AppendLine();
if(page.RecoveryTimeLimit > 0)
sb.AppendFormat("\tDrive will employ a maximum of {0} ms to recover data", page.RecoveryTimeLimit).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_employ_a_maximum_of_0_ms_to_recover_data,
page.RecoveryTimeLimit).AppendLine();
return sb.ToString();
}

View File

@@ -85,30 +85,34 @@ public static partial class Modes
ModePage_07_MMC page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Verify error recovery page for MultiMedia Devices:");
sb.AppendLine(Localization.SCSI_Verify_error_recovery_page_for_MultiMedia_Devices);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.VerifyRetryCount > 0)
sb.AppendFormat("\tDrive will repeat verify operations {0} times", page.VerifyRetryCount).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_repeat_verify_operations_0_times, page.VerifyRetryCount).
AppendLine();
const string AllUsed = "\tAll available recovery procedures will be used.\n";
const string CIRCRetriesUsed = "\tOnly retries and CIRC are used.\n";
const string RetriesUsed = "\tOnly retries are used.\n";
const string RecoveredNotReported = "\tRecovered errors will not be reported.\n";
const string RecoveredReported = "\tRecovered errors will be reported.\n";
const string RecoveredAbort = "\tRecovered errors will be reported and aborted with CHECK CONDITION.\n";
const string UnrecECCAbort = "\tUnrecovered ECC errors will return CHECK CONDITION.";
const string UnrecCIRCAbort = "\tUnrecovered CIRC errors will return CHECK CONDITION.";
const string UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
const string UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
string AllUsed = "\t" + Localization.All_available_recovery_procedures_will_be_used + "\n";
string CIRCRetriesUsed = "\t" + Localization.Only_retries_and_CIRC_are_used + "\n";
string RetriesUsed = "\t" + Localization.Only_retries_are_used + "\n";
string RecoveredNotReported = "\t" + Localization.Recovered_errors_will_not_be_reported + "\n";
string RecoveredReported = "\t" + Localization.Recovered_errors_will_be_reported + "\n";
const string UnrecECCAbortData =
"\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
string RecoveredAbort = "\t" + Localization.Recovered_errors_will_be_reported_and_aborted_with_CHECK_CONDITION +
"\n";
const string UnrecCIRCAbortData =
"\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
string UnrecECCAbort = "\t" + Localization.Unrecovered_ECC_errors_will_return_CHECK_CONDITION;
string UnrecCIRCAbort = "\t" + Localization.Unrecovered_CIRC_errors_will_return_CHECK_CONDITION;
string UnrecECCNotAbort = "\t" + Localization.Unrecovered_ECC_errors_will_not_abort_the_transfer;
string UnrecCIRCNotAbort = "\t" + Localization.Unrecovered_CIRC_errors_will_not_abort_the_transfer;
string UnrecECCAbortData =
"\t" + Localization.Unrecovered_ECC_errors_will_return_CHECK_CONDITION_and_the_uncorrected_data;
string UnrecCIRCAbortData =
"\t" + Localization.Unrecovered_CIRC_errors_will_return_CHECK_CONDITION_and_the_uncorrected_data;
switch(page.Parameter)
{
@@ -181,7 +185,7 @@ public static partial class Modes
case 0x34: goto case 0x14;
case 0x35: goto case 0x15;
default:
sb.AppendFormat("Unknown recovery parameter 0x{0:X2}", page.Parameter).AppendLine();
sb.AppendFormat(Localization.Unknown_recovery_parameter_0, page.Parameter).AppendLine();
break;
}

View File

@@ -151,34 +151,36 @@ public static partial class Modes
ModePage_08 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Caching mode page:");
sb.AppendLine(Localization.SCSI_Caching_mode_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.RCD)
sb.AppendLine("\tRead-cache is enabled");
sb.AppendLine("\t" + Localization.Read_cache_is_enabled);
if(page.WCE)
sb.AppendLine("\tWrite-cache is enabled");
sb.AppendLine("\t" + Localization.Write_cache_is_enabled);
switch(page.DemandReadRetentionPrio)
{
case 0:
sb.AppendLine("\tDrive does not distinguish between cached read data");
sb.AppendLine("\t" + Localization.Drive_does_not_distinguish_between_cached_read_data);
break;
case 1:
sb.AppendLine("\tData put by READ commands should be evicted from cache sooner than data put in read cache by other means");
sb.AppendLine("\t" + Localization.
Data_put_by_READ_commands_should_be_evicted_from_cache_sooner_than_data_put_in_read_cache_by_other_means);
break;
case 0xF:
sb.AppendLine("\tData put by READ commands should not be evicted if there is data cached by other means that can be evicted");
sb.AppendLine("\t" + Localization.
Data_put_by_READ_commands_should_not_be_evicted_if_there_is_data_cached_by_other_means_that_can_be_evicted);
break;
default:
sb.AppendFormat("\tUnknown demand read retention priority value {0}", page.DemandReadRetentionPrio).
AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_demand_read_retention_priority_value_0,
page.DemandReadRetentionPrio).AppendLine();
break;
}
@@ -186,89 +188,96 @@ public static partial class Modes
switch(page.WriteRetentionPriority)
{
case 0:
sb.AppendLine("\tDrive does not distinguish between cached write data");
sb.AppendLine("\t" + Localization.Drive_does_not_distinguish_between_cached_write_data);
break;
case 1:
sb.AppendLine("\tData put by WRITE commands should be evicted from cache sooner than data put in write cache by other means");
sb.AppendLine("\t" + Localization.
Data_put_by_WRITE_commands_should_be_evicted_from_cache_sooner_than_data_put_in_write_cache_by_other_means);
break;
case 0xF:
sb.AppendLine("\tData put by WRITE commands should not be evicted if there is data cached by other means that can be evicted");
sb.AppendLine("\t" + Localization.
Data_put_by_WRITE_commands_should_not_be_evicted_if_there_is_data_cached_by_other_means_that_can_be_evicted);
break;
default:
sb.AppendFormat("\tUnknown demand write retention priority value {0}", page.DemandReadRetentionPrio).
AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_demand_write_retention_priority_value_0,
page.DemandReadRetentionPrio).AppendLine();
break;
}
if(page.DRA)
sb.AppendLine("\tRead-ahead is disabled");
sb.AppendLine("\t" + Localization.Read_ahead_is_disabled);
else
{
if(page.MF)
sb.AppendLine("\tPre-fetch values indicate a block multiplier");
sb.AppendLine("\t" + Localization.Pre_fetch_values_indicate_a_block_multiplier);
if(page.DisablePreFetch == 0)
sb.AppendLine("\tNo pre-fetch will be done");
sb.AppendLine("\t" + Localization.No_pre_fetch_will_be_done);
else
{
sb.AppendFormat("\tPre-fetch will be done for READ commands of {0} blocks or less",
sb.AppendFormat("\t" + Localization.Pre_fetch_will_be_done_for_READ_commands_of_0_blocks_or_less,
page.DisablePreFetch).AppendLine();
if(page.MinimumPreFetch > 0)
sb.AppendFormat("At least {0} blocks will be always pre-fetched", page.MinimumPreFetch).
sb.AppendFormat(Localization.At_least_0_blocks_will_be_always_pre_fetched, page.MinimumPreFetch).
AppendLine();
if(page.MaximumPreFetch > 0)
sb.AppendFormat("\tA maximum of {0} blocks will be pre-fetched", page.MaximumPreFetch).AppendLine();
sb.AppendFormat("\t" + Localization.A_maximum_of_0_blocks_will_be_pre_fetched,
page.MaximumPreFetch).AppendLine();
if(page.MaximumPreFetchCeiling > 0)
sb.
AppendFormat("\tA maximum of {0} blocks will be pre-fetched even if it is commanded to pre-fetch more",
AppendFormat("\t" + Localization.A_maximum_of_0_blocks_will_be_pre_fetched_even_if_it_is_commanded_to_pre_fetch_more,
page.MaximumPreFetchCeiling).AppendLine();
if(page.IC)
sb.AppendLine("\tDevice should use number of cache segments or cache segment size for caching");
sb.AppendLine("\t" + Localization.
Device_should_use_number_of_cache_segments_or_cache_segment_size_for_caching);
if(page.ABPF)
sb.AppendLine("\tPre-fetch should be aborted upon receiving a new command");
sb.AppendLine("\t" + Localization.Pre_fetch_should_be_aborted_upon_receiving_a_new_command);
if(page.CAP)
sb.AppendLine("\tCaching analysis is permitted");
sb.AppendLine("\t" + Localization.Caching_analysis_is_permitted);
if(page.Disc)
sb.AppendLine("\tPre-fetch can continue across discontinuities (such as cylinders or tracks)");
sb.AppendLine("\t" + Localization.
Pre_fetch_can_continue_across_discontinuities_such_as_cylinders_or_tracks);
}
}
if(page.FSW)
sb.AppendLine("\tDrive should not reorder the sequence of write commands to be faster");
sb.AppendLine("\t" + Localization.Drive_should_not_reorder_the_sequence_of_write_commands_to_be_faster);
if(page.Size)
{
if(page.CacheSegmentSize > 0)
if(page.LBCSS)
sb.AppendFormat("\tDrive cache segments should be {0} blocks long", page.CacheSegmentSize).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_cache_segments_should_be_0_blocks_long,
page.CacheSegmentSize).AppendLine();
else
sb.AppendFormat("\tDrive cache segments should be {0} bytes long", page.CacheSegmentSize).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_cache_segments_should_be_0_bytes_long,
page.CacheSegmentSize).AppendLine();
}
else
{
if(page.CacheSegments > 0)
sb.AppendFormat("\tDrive should have {0} cache segments", page.CacheSegments).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_should_have_0_cache_segments, page.CacheSegments).
AppendLine();
}
if(page.NonCacheSegmentSize > 0)
sb.AppendFormat("\tDrive shall allocate {0} bytes to buffer even when all cached data cannot be evicted",
page.NonCacheSegmentSize).AppendLine();
sb.
AppendFormat("\t" + Localization.Drive_shall_allocate_0_bytes_to_buffer_even_when_all_cached_data_cannot_be_evicted,
page.NonCacheSegmentSize).AppendLine();
if(page.NV_DIS)
sb.AppendLine("\tNon-Volatile cache is disabled");
sb.AppendLine("\t" + Localization.Non_Volatile_cache_is_disabled);
return sb.ToString();
}

View File

@@ -183,77 +183,83 @@ public static partial class Modes
ModePage_0A page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Control mode page:");
sb.AppendLine(Localization.SCSI_Control_mode_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.RLEC)
sb.AppendLine("\tIf set, target shall report log exception conditions");
sb.AppendLine("\t" + Localization.If_set_target_shall_report_log_exception_conditions);
if(page.DQue)
sb.AppendLine("\tTagged queuing is disabled");
sb.AppendLine("\t" + Localization.Tagged_queuing_is_disabled);
if(page.EECA)
sb.AppendLine("\tExtended Contingent Allegiance is enabled");
sb.AppendLine("\t" + Localization.Extended_Contingent_Allegiance_is_enabled);
if(page.RAENP)
sb.AppendLine("\tTarget may issue an asynchronous event notification upon completing its initialization");
sb.AppendLine("\t" + Localization.
Target_may_issue_an_asynchronous_event_notification_upon_completing_its_initialization);
if(page.UAAENP)
sb.AppendLine("\tTarget may issue an asynchronous event notification instead of a unit attention condition");
sb.AppendLine("\t" + Localization.
Target_may_issue_an_asynchronous_event_notification_instead_of_a_unit_attention_condition);
if(page.EAENP)
sb.AppendLine("\tTarget may issue an asynchronous event notification instead of a deferred error");
sb.AppendLine("\t" + Localization.
Target_may_issue_an_asynchronous_event_notification_instead_of_a_deferred_error);
if(page.GLTSD)
sb.AppendLine("\tGlobal logging target save disabled");
sb.AppendLine("\t" + Localization.Global_logging_target_save_disabled);
if(page.RAC)
sb.AppendLine("\tCHECK CONDITION should be reported rather than a long busy condition");
sb.AppendLine("\t" + Localization.CHECK_CONDITION_should_be_reported_rather_than_a_long_busy_condition);
if(page.SWP)
sb.AppendLine("\tSoftware write protect is active");
sb.AppendLine("\t" + Localization.Software_write_protect_is_active);
if(page.TAS)
sb.AppendLine("\tTasks aborted by other initiator's actions should be terminated with TASK ABORTED");
sb.AppendLine("\t" + Localization.
Tasks_aborted_by_other_initiator_s_actions_should_be_terminated_with_TASK_ABORTED);
if(page.TMF_ONLY)
sb.AppendLine("\tAll tasks received in nexus with ACA ACTIVE is set and an ACA condition is established shall terminate");
sb.AppendLine("\t" + Localization.
All_tasks_received_in_nexus_with_ACA_ACTIVE_is_set_and_an_ACA_condition_is_established_shall_terminate);
if(page.D_SENSE)
sb.AppendLine("\tDevice shall return descriptor format sense data when returning sense data in the same transactions as a CHECK CONDITION");
sb.AppendLine("\t" + Localization.
Device_shall_return_descriptor_format_sense_data_when_returning_sense_data_in_the_same_transactions_as_a_CHECK_CONDITION);
if(page.ATO)
sb.AppendLine("\tLOGICAL BLOCK APPLICATION TAG should not be modified");
sb.AppendLine("\t" + Localization.LOGICAL_BLOCK_APPLICATION_TAG_should_not_be_modified);
if(page.DPICZ)
sb.AppendLine("\tProtector information checking is disabled");
sb.AppendLine("\t" + Localization.Protector_information_checking_is_disabled);
if(page.NUAR)
sb.AppendLine("\tNo unit attention on release");
sb.AppendLine("\t" + Localization.No_unit_attention_on_release);
if(page.ATMPE)
sb.AppendLine("\tApplication Tag mode page is enabled");
sb.AppendLine("\t" + Localization.Application_Tag_mode_page_is_enabled);
if(page.RWWP)
sb.AppendLine("\tAbort any write command without protection information");
sb.AppendLine("\t" + Localization.Abort_any_write_command_without_protection_information);
if(page.SBLP)
sb.AppendLine("\tSupports block lengths and protection information");
sb.AppendLine("\t" + Localization.Supports_block_lengths_and_protection_information);
switch(page.TST)
{
case 0:
sb.AppendLine("\tThe logical unit maintains one task set for all nexuses");
sb.AppendLine("\t" + Localization.The_logical_unit_maintains_one_task_set_for_all_nexuses);
break;
case 1:
sb.AppendLine("\tThe logical unit maintains separate task sets for each nexus");
sb.AppendLine("\t" + Localization.The_logical_unit_maintains_separate_task_sets_for_each_nexus);
break;
default:
sb.AppendFormat("\tUnknown Task set type {0}", page.TST).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_Task_set_type_0, page.TST).AppendLine();
break;
}
@@ -261,15 +267,16 @@ public static partial class Modes
switch(page.QueueAlgorithm)
{
case 0:
sb.AppendLine("\tCommands should be sent strictly ordered");
sb.AppendLine("\t" + Localization.Commands_should_be_sent_strictly_ordered);
break;
case 1:
sb.AppendLine("\tCommands can be reordered in any manner");
sb.AppendLine("\t" + Localization.Commands_can_be_reordered_in_any_manner);
break;
default:
sb.AppendFormat("\tUnknown Queue Algorithm Modifier {0}", page.QueueAlgorithm).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_Queue_Algorithm_Modifier_0, page.QueueAlgorithm).
AppendLine();
break;
}
@@ -277,19 +284,22 @@ public static partial class Modes
switch(page.QErr)
{
case 0:
sb.AppendLine("\tIf ACA is established, the task set commands shall resume after it is cleared, otherwise they shall terminate with CHECK CONDITION");
sb.AppendLine("\t" + Localization.
If_ACA_is_established_the_task_set_commands_shall_resume_after_it_is_cleared_otherwise_they_shall_terminate_with_CHECK_CONDITION);
break;
case 1:
sb.AppendLine("\tAll the affected commands in the task set shall be aborted when CHECK CONDITION is returned");
sb.AppendLine("\t" + Localization.
All_the_affected_commands_in_the_task_set_shall_be_aborted_when_CHECK_CONDITION_is_returned);
break;
case 3:
sb.AppendLine("\tAffected commands in the task set belonging with the CHECK CONDITION nexus shall be aborted");
sb.AppendLine("\t" + Localization.
Affected_commands_in_the_task_set_belonging_with_the_CHECK_CONDITION_nexus_shall_be_aborted);
break;
default:
sb.AppendLine("\tReserved QErr value 2 is set");
sb.AppendLine("\t" + Localization.Reserved_QErr_value_2_is_set);
break;
}
@@ -297,19 +307,21 @@ public static partial class Modes
switch(page.UA_INTLCK_CTRL)
{
case 0:
sb.AppendLine("\tLUN shall clear unit attention condition reported in the same nexus");
sb.AppendLine("\t" + Localization.LUN_shall_clear_unit_attention_condition_reported_in_the_same_nexus);
break;
case 2:
sb.AppendLine("\tLUN shall not clear unit attention condition reported in the same nexus");
sb.AppendLine("\t" + Localization.
LUN_shall_not_clear_unit_attention_condition_reported_in_the_same_nexus);
break;
case 3:
sb.AppendLine("\tLUN shall not clear unit attention condition reported in the same nexus and shall establish a unit attention condition for the initiator");
sb.AppendLine("\t" + Localization.
LUN_shall_not_clear_unit_attention_condition_reported_in_the_same_nexus_and_shall_establish_a_unit_attention_condition_for_the_initiator);
break;
default:
sb.AppendLine("\tReserved UA_INTLCK_CTRL value 1 is set");
sb.AppendLine("\t" + Localization.Reserved_UA_INTLCK_CTRL_value_1_is_set);
break;
}
@@ -317,36 +329,39 @@ public static partial class Modes
switch(page.AutoloadMode)
{
case 0:
sb.AppendLine("\tOn medium insertion, it shall be loaded for full access");
sb.AppendLine("\t" + Localization.On_medium_insertion_it_shall_be_loaded_for_full_access);
break;
case 1:
sb.AppendLine("\tOn medium insertion, it shall be loaded for auxiliary memory access only");
sb.AppendLine("\t" + Localization.
On_medium_insertion_it_shall_be_loaded_for_auxiliary_memory_access_only);
break;
case 2:
sb.AppendLine("\tOn medium insertion, it shall not be loaded");
sb.AppendLine("\t" + Localization.On_medium_insertion_it_shall_not_be_loaded);
break;
default:
sb.AppendFormat("\tReserved autoload mode {0} set", page.AutoloadMode).AppendLine();
sb.AppendFormat("\t" + Localization.Reserved_autoload_mode_0_set, page.AutoloadMode).AppendLine();
break;
}
if(page.ReadyAENHoldOffPeriod > 0)
sb.AppendFormat("\t{0} ms before attempting asynchronous event notifications after initialization",
page.ReadyAENHoldOffPeriod).AppendLine();
sb.
AppendFormat("\t" + Localization._0_ms_before_attempting_asynchronous_event_notifications_after_initialization,
page.ReadyAENHoldOffPeriod).AppendLine();
if(page.BusyTimeoutPeriod > 0)
if(page.BusyTimeoutPeriod == 0xFFFF)
sb.AppendLine("\tThere is no limit on the maximum time that is allowed to remain busy");
sb.AppendLine("\t" + Localization.There_is_no_limit_on_the_maximum_time_that_is_allowed_to_remain_busy);
else
sb.AppendFormat("\tA maximum of {0} ms are allowed to remain busy", page.BusyTimeoutPeriod * 100).
AppendLine();
sb.AppendFormat("\t" + Localization.A_maximum_of_0_ms_are_allowed_to_remain_busy,
page.BusyTimeoutPeriod * 100).AppendLine();
if(page.ExtendedSelfTestCompletionTime > 0)
sb.AppendFormat("\t{0} seconds to complete extended self-test", page.ExtendedSelfTestCompletionTime);
sb.AppendFormat("\t" + Localization._0_seconds_to_complete_extended_self_test,
page.ExtendedSelfTestCompletionTime);
return sb.ToString();
}
@@ -414,31 +429,32 @@ public static partial class Modes
ModePage_0A_S01 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Control extension page:");
sb.AppendLine(Localization.SCSI_Control_extension_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.TCMOS)
{
sb.Append("\tTimestamp can be initialized by methods outside of the SCSI standards");
if(page.SCSIP)
sb.Append(", but SCSI's SET TIMESTAMP shall take precedence over them");
sb.AppendLine();
sb.AppendLine("\t" + Localization.
S01_Timestamp_can_be_initialized_by_methods_outside_of_the_SCSI_standards_but_SCSI_SET_TIMESTAMP_shall_take_precedence_over_them);
else
sb.AppendLine("\t" + Localization.
Timestamp_can_be_initialized_by_methods_outside_of_the_SCSI_standards);
}
if(page.IALUAE)
sb.AppendLine("\tImplicit Asymmetric Logical Unit Access is enabled");
sb.AppendLine("\t" + Localization.Implicit_Asymmetric_Logical_Unit_Access_is_enabled);
sb.AppendFormat("\tInitial priority is {0}", page.InitialPriority).AppendLine();
sb.AppendFormat("\t" + Localization.Initial_priority_is_0, page.InitialPriority).AppendLine();
if(page.DLC)
sb.AppendLine("\tDevice will not degrade performance to extend its life");
sb.AppendLine("\t" + Localization.Device_will_not_degrade_performance_to_extend_its_life);
if(page.MaximumSenseLength > 0)
sb.AppendFormat("\tMaximum sense data would be {0} bytes", page.MaximumSenseLength).AppendLine();
sb.AppendFormat("\t" + Localization.Maximum_sense_data_would_be_0_bytes, page.MaximumSenseLength).
AppendLine();
return sb.ToString();
}

View File

@@ -87,23 +87,26 @@ public static partial class Modes
ModePage_0B page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Medium types supported page:");
sb.AppendLine(Localization.SCSI_Medium_types_supported_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.MediumType1 != MediumTypes.Default)
sb.AppendFormat("Supported medium type one: {0}", GetMediumTypeDescription(page.MediumType1)).AppendLine();
sb.AppendFormat(Localization.Supported_medium_type_one_0, GetMediumTypeDescription(page.MediumType1)).
AppendLine();
if(page.MediumType2 != MediumTypes.Default)
sb.AppendFormat("Supported medium type two: {0}", GetMediumTypeDescription(page.MediumType2)).AppendLine();
sb.AppendFormat(Localization.Supported_medium_type_two_0, GetMediumTypeDescription(page.MediumType2)).
AppendLine();
if(page.MediumType3 != MediumTypes.Default)
sb.AppendFormat("Supported medium type three: {0}", GetMediumTypeDescription(page.MediumType3)).
sb.AppendFormat(Localization.Supported_medium_type_three_0, GetMediumTypeDescription(page.MediumType3)).
AppendLine();
if(page.MediumType4 != MediumTypes.Default)
sb.AppendFormat("Supported medium type four: {0}", GetMediumTypeDescription(page.MediumType4)).AppendLine();
sb.AppendFormat(Localization.Supported_medium_type_four_0, GetMediumTypeDescription(page.MediumType4)).
AppendLine();
return sb.ToString();
}

View File

@@ -88,84 +88,89 @@ public static partial class Modes
ModePage_0D page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI CD-ROM parameters page:");
sb.AppendLine(Localization.SCSI_CD_ROM_parameters_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.InactivityTimerMultiplier)
{
case 0:
sb.AppendLine("\tDrive will remain in track hold state a vendor-specified time after a seek or read");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_track_hold_state_a_vendor_specified_time_after_a_seek_or_read);
break;
case 1:
sb.AppendLine("\tDrive will remain in track hold state 125 ms after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_125_ms_after_a_seek_or_read);
break;
case 2:
sb.AppendLine("\tDrive will remain in track hold state 250 ms after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_250_ms_after_a_seek_or_read);
break;
case 3:
sb.AppendLine("\tDrive will remain in track hold state 500 ms after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_500_ms_after_a_seek_or_read);
break;
case 4:
sb.AppendLine("\tDrive will remain in track hold state 1 second after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_1_second_after_a_seek_or_read);
break;
case 5:
sb.AppendLine("\tDrive will remain in track hold state 2 seconds after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_2_seconds_after_a_seek_or_read);
break;
case 6:
sb.AppendLine("\tDrive will remain in track hold state 4 seconds after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_4_seconds_after_a_seek_or_read);
break;
case 7:
sb.AppendLine("\tDrive will remain in track hold state 8 seconds after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_8_seconds_after_a_seek_or_read);
break;
case 8:
sb.AppendLine("\tDrive will remain in track hold state 16 seconds after a seek or read");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_track_hold_state_16_seconds_after_a_seek_or_read);
break;
case 9:
sb.AppendLine("\tDrive will remain in track hold state 32 seconds after a seek or read");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_track_hold_state_32_seconds_after_a_seek_or_read);
break;
case 10:
sb.AppendLine("\tDrive will remain in track hold state 1 minute after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_1_minute_after_a_seek_or_read);
break;
case 11:
sb.AppendLine("\tDrive will remain in track hold state 2 minutes after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_2_minutes_after_a_seek_or_read);
break;
case 12:
sb.AppendLine("\tDrive will remain in track hold state 4 minutes after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_4_minutes_after_a_seek_or_read);
break;
case 13:
sb.AppendLine("\tDrive will remain in track hold state 8 minutes after a seek or read");
sb.AppendLine("\t" + Localization.Drive_will_remain_in_track_hold_state_8_minutes_after_a_seek_or_read);
break;
case 14:
sb.AppendLine("\tDrive will remain in track hold state 16 minutes after a seek or read");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_track_hold_state_16_minutes_after_a_seek_or_read);
break;
case 15:
sb.AppendLine("\tDrive will remain in track hold state 32 minutes after a seek or read");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_track_hold_state_32_minutes_after_a_seek_or_read);
break;
}
if(page.SecondsPerMinute > 0)
sb.AppendFormat("\tEach minute has {0} seconds", page.SecondsPerMinute).AppendLine();
sb.AppendFormat("\t" + Localization.Each_minute_has_0_seconds, page.SecondsPerMinute).AppendLine();
if(page.FramesPerSecond > 0)
sb.AppendFormat("\tEach second has {0} frames", page.FramesPerSecond).AppendLine();
sb.AppendFormat("\t" + Localization.Each_second_has_0_frames, page.FramesPerSecond).AppendLine();
return sb.ToString();
}

View File

@@ -118,16 +118,16 @@ public static partial class Modes
ModePage_0E page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI CD-ROM audio control parameters page:");
sb.AppendLine(Localization.SCSI_CD_ROM_audio_control_parameters_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendLine(page.Immed ? "\tDrive will return from playback command immediately"
: "\tDrive will return from playback command when playback ends");
sb.AppendLine(page.Immed ? "\t" + Localization.Drive_will_return_from_playback_command_immediately
: "\t" + Localization.Drive_will_return_from_playback_command_when_playback_ends);
if(page.SOTC)
sb.AppendLine("\tDrive will stop playback on track end");
sb.AppendLine("\t" + Localization.Drive_will_stop_playback_on_track_end);
if(page.APRVal)
{
@@ -138,12 +138,12 @@ public static partial class Modes
else
blocks = page.BlocksPerSecondOfAudio;
sb.AppendFormat("\tThere are {0} blocks per each second of audio", blocks).AppendLine();
sb.AppendFormat("\t" + Localization.There_are_0_blocks_per_each_second_of_audio, blocks).AppendLine();
}
if(page.OutputPort0ChannelSelection > 0)
{
sb.Append("\tOutput port 0 has channels ");
sb.Append("\t" + Localization.Output_port_0_has_channels);
if((page.OutputPort0ChannelSelection & 0x01) == 0x01)
sb.Append("0 ");
@@ -160,15 +160,15 @@ public static partial class Modes
switch(page.OutputPort0Volume)
{
case 0:
sb.AppendLine("muted");
sb.AppendLine(Localization.muted);
break;
case 0xFF:
sb.AppendLine("at maximum volume");
sb.AppendLine(Localization.at_maximum_volume);
break;
default:
sb.AppendFormat("at volume {0}", page.OutputPort0Volume).AppendLine();
sb.AppendFormat(Localization.at_volume_0, page.OutputPort0Volume).AppendLine();
break;
}
@@ -176,7 +176,7 @@ public static partial class Modes
if(page.OutputPort1ChannelSelection > 0)
{
sb.Append("\tOutput port 1 has channels ");
sb.Append("\t" + Localization.Output_port_1_has_channels);
if((page.OutputPort1ChannelSelection & 0x01) == 0x01)
sb.Append("0 ");
@@ -193,15 +193,15 @@ public static partial class Modes
switch(page.OutputPort1Volume)
{
case 0:
sb.AppendLine("muted");
sb.AppendLine(Localization.muted);
break;
case 0xFF:
sb.AppendLine("at maximum volume");
sb.AppendLine(Localization.at_maximum_volume);
break;
default:
sb.AppendFormat("at volume {0}", page.OutputPort1Volume).AppendLine();
sb.AppendFormat(Localization.at_volume_0, page.OutputPort1Volume).AppendLine();
break;
}
@@ -209,7 +209,7 @@ public static partial class Modes
if(page.OutputPort2ChannelSelection > 0)
{
sb.Append("\tOutput port 2 has channels ");
sb.Append("\t" + Localization.Output_port_2_has_channels);
if((page.OutputPort2ChannelSelection & 0x01) == 0x01)
sb.Append("0 ");
@@ -226,15 +226,15 @@ public static partial class Modes
switch(page.OutputPort2Volume)
{
case 0:
sb.AppendLine("muted");
sb.AppendLine(Localization.muted);
break;
case 0xFF:
sb.AppendLine("at maximum volume");
sb.AppendLine(Localization.at_maximum_volume);
break;
default:
sb.AppendFormat("at volume {0}", page.OutputPort2Volume).AppendLine();
sb.AppendFormat(Localization.at_volume_0, page.OutputPort2Volume).AppendLine();
break;
}
@@ -243,7 +243,7 @@ public static partial class Modes
if(page.OutputPort3ChannelSelection <= 0)
return sb.ToString();
sb.Append("\tOutput port 3 has channels ");
sb.Append("\t" + Localization.Output_port_3_has_channels);
if((page.OutputPort3ChannelSelection & 0x01) == 0x01)
sb.Append("0 ");
@@ -260,15 +260,15 @@ public static partial class Modes
switch(page.OutputPort3Volume)
{
case 0:
sb.AppendLine("muted");
sb.AppendLine(Localization.muted);
break;
case 0xFF:
sb.AppendLine("at maximum volume");
sb.AppendLine(Localization.at_maximum_volume);
break;
default:
sb.AppendFormat("at volume {0}", page.OutputPort3Volume).AppendLine();
sb.AppendFormat(Localization.at_volume_0, page.OutputPort3Volume).AppendLine();
break;
}

View File

@@ -102,47 +102,47 @@ public static partial class Modes
ModePage_0F page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Data compression page:");
sb.AppendLine(Localization.SCSI_Data_compression_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.DCC)
{
sb.AppendLine("\tDrive supports data compression");
sb.AppendLine("\t" + Localization.Drive_supports_data_compression);
if(page.DCE)
{
sb.Append("\tData compression is enabled with ");
sb.Append("\t" + Localization.Data_compression_is_enabled_with);
switch(page.CompressionAlgo)
{
case 3:
sb.AppendLine("IBM ALDC with 512 byte buffer");
sb.AppendLine(Localization.IBM_ALDC_with_512_byte_buffer);
break;
case 4:
sb.AppendLine("IBM ALDC with 1024 byte buffer");
sb.AppendLine(Localization.IBM_ALDC_with_1024_byte_buffer);
break;
case 5:
sb.AppendLine("IBM ALDC with 2048 byte buffer");
sb.AppendLine(Localization.IBM_ALDC_with_2048_byte_buffer);
break;
case 0x10:
sb.AppendLine("IBM IDRC");
sb.AppendLine(Localization.IBM_IDRC);
break;
case 0x20:
sb.AppendLine("DCLZ");
sb.AppendLine(Localization.DCLZ);
break;
case 0xFF:
sb.AppendLine("an unregistered compression algorithm");
sb.AppendLine(Localization.an_unregistered_compression_algorithm);
break;
default:
sb.AppendFormat("an unknown algorithm coded {0}", page.CompressionAlgo).AppendLine();
sb.AppendFormat(Localization.an_unknown_algorithm_coded_0, page.CompressionAlgo).AppendLine();
break;
}
@@ -150,52 +150,53 @@ public static partial class Modes
if(page.DDE)
{
sb.AppendLine("\tData decompression is enabled");
sb.AppendLine("\t" + Localization.Data_decompression_is_enabled);
if(page.DecompressionAlgo == 0)
sb.AppendLine("\tLast data read was uncompressed");
sb.AppendLine("\t" + Localization.Last_data_read_was_uncompressed);
else
{
sb.Append("\tLast data read was compressed with ");
sb.Append("\t" + Localization.Last_data_read_was_compressed_with_);
switch(page.CompressionAlgo)
{
case 3:
sb.AppendLine("IBM ALDC with 512 byte buffer");
sb.AppendLine(Localization.IBM_ALDC_with_512_byte_buffer);
break;
case 4:
sb.AppendLine("IBM ALDC with 1024 byte buffer");
sb.AppendLine(Localization.IBM_ALDC_with_1024_byte_buffer);
break;
case 5:
sb.AppendLine("IBM ALDC with 2048 byte buffer");
sb.AppendLine(Localization.IBM_ALDC_with_2048_byte_buffer);
break;
case 0x10:
sb.AppendLine("IBM IDRC");
sb.AppendLine(Localization.IBM_IDRC);
break;
case 0x20:
sb.AppendLine("DCLZ");
sb.AppendLine(Localization.DCLZ);
break;
case 0xFF:
sb.AppendLine("an unregistered compression algorithm");
sb.AppendLine(Localization.an_unregistered_compression_algorithm);
break;
default:
sb.AppendFormat("an unknown algorithm coded {0}", page.CompressionAlgo).AppendLine();
sb.AppendFormat(Localization.an_unknown_algorithm_coded_0, page.CompressionAlgo).
AppendLine();
break;
}
}
}
sb.AppendFormat("\tReport exception on compression is set to {0}", page.RED).AppendLine();
sb.AppendFormat("\t" + Localization.Report_exception_on_compression_is_set_to_0, page.RED).AppendLine();
}
else
sb.AppendLine("\tDrive does not support data compression");
sb.AppendLine("\t" + Localization.Drive_does_not_support_data_compression);
return sb.ToString();
}

View File

@@ -102,29 +102,30 @@ public static partial class Modes
ModePage_10 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI XOR control mode page:");
sb.AppendLine(Localization.SCSI_XOR_control_mode_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.XORDIS)
sb.AppendLine("\tXOR operations are disabled");
sb.AppendLine("\t" + Localization.XOR_operations_are_disabled);
else
{
if(page.MaxXorWrite > 0)
sb.AppendFormat("\tDrive accepts a maximum of {0} blocks in a single XOR WRITE command",
sb.AppendFormat("\t" + Localization.Drive_accepts_a_maximum_of_0_blocks_in_a_single_XOR_WRITE_command,
page.MaxXorWrite).AppendLine();
if(page.MaxRegenSize > 0)
sb.AppendFormat("\tDrive accepts a maximum of {0} blocks in a REGENERATE command", page.MaxRegenSize).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_accepts_a_maximum_of_0_blocks_in_a_REGENERATE_command,
page.MaxRegenSize).AppendLine();
if(page.MaxRebuildRead > 0)
sb.AppendFormat("\tDrive accepts a maximum of {0} blocks in a READ command during rebuild",
page.MaxRebuildRead).AppendLine();
sb.
AppendFormat("\t" + Localization.Drive_accepts_a_maximum_of_0_blocks_in_a_READ_command_during_rebuild,
page.MaxRebuildRead).AppendLine();
if(page.RebuildDelay > 0)
sb.AppendFormat("\tDrive needs a minimum of {0} ms between READ commands during rebuild",
sb.AppendFormat("\t" + Localization.Drive_needs_a_minimum_of_0_ms_between_READ_commands_during_rebuild,
page.RebuildDelay).AppendLine();
}

View File

@@ -170,71 +170,72 @@ public static partial class Modes
ModePage_10_SSC page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Device configuration page:");
sb.AppendLine(Localization.SCSI_Device_configuration_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\tActive format: {0}", page.ActiveFormat).AppendLine();
sb.AppendFormat("\tActive partition: {0}", page.ActivePartition).AppendLine();
sb.AppendFormat("\t" + Localization.Active_format_0, page.ActiveFormat).AppendLine();
sb.AppendFormat("\t" + Localization.Active_partition_0, page.ActivePartition).AppendLine();
sb.AppendFormat("\tWrite buffer shall have a full ratio of {0} before being flushed to medium",
sb.AppendFormat("\t" + Localization.Write_buffer_shall_have_a_full_ratio_of_0_before_being_flushed_to_medium,
page.WriteBufferFullRatio).AppendLine();
sb.AppendFormat("\tRead buffer shall have an empty ratio of {0} before more data is read from medium",
page.ReadBufferEmptyRatio).AppendLine();
sb.
AppendFormat("\t" + Localization.Read_buffer_shall_have_an_empty_ratio_of_0_before_more_data_is_read_from_medium,
page.ReadBufferEmptyRatio).AppendLine();
sb.
AppendFormat("\tDrive will delay {0} ms before buffered data is forcefully written to the medium even before buffer is full",
AppendFormat("\t" + Localization.Drive_will_delay_0_ms_before_buffered_data_is_forcefully_written_to_the_medium_even_before_buffer_is_full,
page.WriteDelayTime * 100).AppendLine();
if(page.DBR)
{
sb.AppendLine("\tDrive supports recovering data from buffer");
sb.AppendLine("\t" + Localization.Drive_supports_recovering_data_from_buffer);
sb.AppendLine(page.RBO ? "\tRecovered buffer data comes in LIFO order"
: "\tRecovered buffer data comes in FIFO order");
sb.AppendLine(page.RBO ? "\t" + Localization.Recovered_buffer_data_comes_in_LIFO_order
: "\t" + Localization.Recovered_buffer_data_comes_in_FIFO_order);
}
if(page.BIS)
sb.AppendLine("\tMedium supports block IDs");
sb.AppendLine("\t" + Localization.Medium_supports_block_IDs);
if(page.RSmk)
sb.AppendLine("\tDrive reports setmarks");
sb.AppendLine("\t" + Localization.Drive_reports_setmarks);
switch(page.SOCF)
{
case 0:
sb.AppendLine("\tDrive will pre-read until buffer is full");
sb.AppendLine("\t" + Localization.Drive_will_pre_read_until_buffer_is_full);
break;
case 1:
sb.AppendLine("\tDrive will pre-read until one filemark is detected");
sb.AppendLine("\t" + Localization.Drive_will_pre_read_until_one_filemark_is_detected);
break;
case 2:
sb.AppendLine("\tDrive will pre-read until two filemark is detected");
sb.AppendLine("\t" + Localization.Drive_will_pre_read_until_two_filemark_is_detected);
break;
case 3:
sb.AppendLine("\tDrive will pre-read until three filemark is detected");
sb.AppendLine("\t" + Localization.Drive_will_pre_read_until_three_filemark_is_detected);
break;
}
if(page.REW)
{
sb.AppendLine("\tDrive reports early warnings");
sb.AppendLine("\t" + Localization.Drive_reports_early_warnings);
if(page.SEW)
sb.AppendLine("\tDrive will synchronize buffer to medium on early warnings");
sb.AppendLine("\t" + Localization.Drive_will_synchronize_buffer_to_medium_on_early_warnings);
}
switch(page.GapSize)
{
case 0: break;
case 1:
sb.AppendLine("\tInter-block gap is long enough to support update in place");
sb.AppendLine("\t" + Localization.Inter_block_gap_is_long_enough_to_support_update_in_place);
break;
case 2:
@@ -251,59 +252,60 @@ public static partial class Modes
case 13:
case 14:
case 15:
sb.AppendFormat("\tInter-block gap is {0} times the device's defined gap size", page.GapSize).
AppendLine();
sb.AppendFormat("\t" + Localization.Inter_block_gap_is_0_times_the_device_defined_gap_size,
page.GapSize).AppendLine();
break;
default:
sb.AppendFormat("\tInter-block gap is unknown value {0}", page.GapSize).AppendLine();
sb.AppendFormat("\t" + Localization.Inter_block_gap_is_unknown_value_0, page.GapSize).AppendLine();
break;
}
if(page.EEG)
sb.AppendLine("\tDrive generates end-of-data");
sb.AppendLine("\t" + Localization.Drive_generates_end_of_data);
switch(page.SelectedCompression)
{
case 0:
sb.AppendLine("\tDrive does not use compression");
sb.AppendLine("\t" + Localization.Drive_does_not_use_compression);
break;
case 1:
sb.AppendLine("\tDrive uses default compression");
sb.AppendLine("\t" + Localization.Drive_uses_default_compression);
break;
default:
sb.AppendFormat("\tDrive uses unknown compression {0}", page.SelectedCompression).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_uses_unknown_compression_0, page.SelectedCompression).
AppendLine();
break;
}
if(page.SWP)
sb.AppendLine("\tSoftware write protect is enabled");
sb.AppendLine("\t" + Localization.Software_write_protect_is_enabled);
if(page.ASOCWP)
sb.AppendLine("\tAssociated write protect is enabled");
sb.AppendLine("\t" + Localization.Associated_write_protect_is_enabled);
if(page.PERSWP)
sb.AppendLine("\tPersistent write protect is enabled");
sb.AppendLine("\t" + Localization.Persistent_write_protect_is_enabled);
if(page.PRMWP)
sb.AppendLine("\tPermanent write protect is enabled");
sb.AppendLine("\t" + Localization.Permanent_write_protect_is_enabled);
if(page.BAML)
sb.AppendLine(page.BAM ? "\tDrive operates using explicit address mode"
: "\tDrive operates using implicit address mode");
sb.AppendLine(page.BAM ? "\t" + Localization.Drive_operates_using_explicit_address_mode
: "\t" + Localization.Drive_operates_using_implicit_address_mode);
switch(page.RewindOnReset)
{
case 1:
sb.AppendLine("\tDrive shall position to beginning of default data partition on reset");
sb.AppendLine("\t" + Localization.Drive_shall_position_to_beginning_of_default_data_partition_on_reset);
break;
case 2:
sb.AppendLine("\tDrive shall maintain its position on reset");
sb.AppendLine("\t" + Localization.Drive_shall_maintain_its_position_on_reset);
break;
}
@@ -311,17 +313,17 @@ public static partial class Modes
switch(page.WTRE)
{
case 1:
sb.AppendLine("\tDrive will do nothing on WORM tampered medium");
sb.AppendLine("\t" + Localization.Drive_will_do_nothing_on_WORM_tampered_medium);
break;
case 2:
sb.AppendLine("\tDrive will return CHECK CONDITION on WORM tampered medium");
sb.AppendLine("\t" + Localization.Drive_will_return_CHECK_CONDITION_on_WORM_tampered_medium);
break;
}
if(page.OIR)
sb.AppendLine("\tDrive will only respond to commands if it has received a reservation");
sb.AppendLine("\t" + Localization.Drive_will_only_respond_to_commands_if_it_has_received_a_reservation);
return sb.ToString();
}

View File

@@ -143,42 +143,49 @@ public static partial class Modes
ModePage_11 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI medium partition page:");
sb.AppendLine(Localization.SCSI_medium_partition_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\t{0} maximum additional partitions", page.MaxAdditionalPartitions).AppendLine();
sb.AppendFormat("\t{0} additional partitions defined", page.AdditionalPartitionsDefined).AppendLine();
sb.AppendFormat("\t" + Localization._0_maximum_additional_partitions, page.MaxAdditionalPartitions).
AppendLine();
sb.AppendFormat("\t" + Localization._0_additional_partitions_defined, page.AdditionalPartitionsDefined).
AppendLine();
if(page.FDP)
sb.AppendLine("\tPartitions are fixed under device definitions");
sb.AppendLine("\t" + Localization.Partitions_are_fixed_under_device_definitions);
if(page.SDP)
sb.AppendLine("\tNumber of partitions can be defined but their size is defined by the device");
sb.AppendLine("\t" + Localization.
Number_of_partitions_can_be_defined_but_their_size_is_defined_by_the_device);
if(page.IDP)
sb.AppendLine("\tNumber and size of partitions can be manually defined");
sb.AppendLine("\t" + Localization.Number_and_size_of_partitions_can_be_manually_defined);
if(page.POFM)
sb.AppendLine("\tPartition parameters will not be applied until a FORMAT MEDIUM command is received");
sb.AppendLine("\t" + Localization.
Partition_parameters_will_not_be_applied_until_a_FORMAT_MEDIUM_command_is_received);
switch(page.CLEAR)
{
case false when !page.ADDP:
sb.AppendLine("\tDevice may erase any or all partitions on MODE SELECT for partitioning");
sb.AppendLine("\t" + Localization.
Device_may_erase_any_or_all_partitions_on_MODE_SELECT_for_partitioning);
break;
case true when !page.ADDP:
sb.AppendLine("\tDevice shall erase all partitions on MODE SELECT for partitioning");
sb.AppendLine("\t" + Localization.Device_shall_erase_all_partitions_on_MODE_SELECT_for_partitioning);
break;
case false:
sb.AppendLine("\tDevice shall not erase any partition on MODE SELECT for partitioning");
sb.AppendLine("\t" + Localization.Device_shall_not_erase_any_partition_on_MODE_SELECT_for_partitioning);
break;
default:
sb.AppendLine("\tDevice shall erase all partitions differing on size on MODE SELECT for partitioning");
sb.AppendLine("\t" + Localization.
Device_shall_erase_all_partitions_differing_on_size_on_MODE_SELECT_for_partitioning);
break;
}
@@ -188,30 +195,30 @@ public static partial class Modes
switch(page.PSUM)
{
case PartitionSizeUnitOfMeasures.Bytes:
sb.AppendLine("\tPartitions are defined in bytes");
measure = "bytes";
sb.AppendLine("\t" + Localization.Partitions_are_defined_in_bytes);
measure = Localization.bytes;
break;
case PartitionSizeUnitOfMeasures.Kilobytes:
sb.AppendLine("\tPartitions are defined in kilobytes");
measure = "kilobytes";
sb.AppendLine("\t" + Localization.Partitions_are_defined_in_kilobytes);
measure = Localization.kilobytes;
break;
case PartitionSizeUnitOfMeasures.Megabytes:
sb.AppendLine("\tPartitions are defined in megabytes");
measure = "megabytes";
sb.AppendLine("\t" + Localization.Partitions_are_defined_in_megabytes);
measure = Localization.megabytes;
break;
case PartitionSizeUnitOfMeasures.Exponential:
sb.AppendFormat("\tPartitions are defined in units of {0} bytes", Math.Pow(10, page.PartitionUnits)).
AppendLine();
sb.AppendFormat("\t" + Localization.Partitions_are_defined_in_units_of_0_bytes,
Math.Pow(10, page.PartitionUnits)).AppendLine();
measure = $"units of {Math.Pow(10, page.PartitionUnits)} bytes";
measure = string.Format(Localization.units_of_0_bytes, Math.Pow(10, page.PartitionUnits));
break;
default:
sb.AppendFormat("\tUnknown partition size unit code {0}", (byte)page.PSUM).AppendLine();
measure = "units";
sb.AppendFormat("\t" + Localization.Unknown_partition_size_unit_code_0, (byte)page.PSUM).AppendLine();
measure = Localization.units;
break;
}
@@ -219,38 +226,40 @@ public static partial class Modes
switch(page.MediumFormatRecognition)
{
case MediumFormatRecognitionValues.Capable:
sb.AppendLine("\tDevice is capable of recognizing both medium partitions and format");
sb.AppendLine("\t" + Localization.Device_is_capable_of_recognizing_both_medium_partitions_and_format);
break;
case MediumFormatRecognitionValues.FormatCapable:
sb.AppendLine("\tDevice is capable of recognizing medium format");
sb.AppendLine("\t" + Localization.Device_is_capable_of_recognizing_medium_format);
break;
case MediumFormatRecognitionValues.PartitionCapable:
sb.AppendLine("\tDevice is capable of recognizing medium partitions");
sb.AppendLine("\t" + Localization.Device_is_capable_of_recognizing_medium_partitions);
break;
case MediumFormatRecognitionValues.Incapable:
sb.AppendLine("\tDevice is not capable of recognizing neither medium partitions nor format");
sb.AppendLine("\t" + Localization.
Device_is_not_capable_of_recognizing_neither_medium_partitions_nor_format);
break;
default:
sb.AppendFormat("\tUnknown medium recognition code {0}", (byte)page.MediumFormatRecognition).
AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_medium_recognition_code_0,
(byte)page.MediumFormatRecognition).AppendLine();
break;
}
sb.AppendFormat("\tMedium has defined {0} partitions", page.PartitionSizes.Length).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_has_defined_0_partitions, page.PartitionSizes.Length).AppendLine();
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");
sb.AppendLine("\t" + Localization.Device_recognizes_one_single_partition_spanning_whole_medium);
else
sb.AppendFormat("\tPartition {0} runs for rest of medium", i).AppendLine();
sb.AppendFormat("\t" + Localization.Partition_0_runs_for_rest_of_medium, i).AppendLine();
else
sb.AppendFormat("\tPartition {0} is {1} {2} long", i, page.PartitionSizes[i], measure).AppendLine();
sb.AppendFormat("\t" + Localization.Partition_0_is_1_2_long, i, page.PartitionSizes[i], measure).
AppendLine();
return sb.ToString();
}

View File

@@ -94,15 +94,15 @@ public static partial class Modes
ModePage_12_13_14 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI medium partition page (extra):");
sb.AppendLine(Localization.SCSI_medium_partition_page_extra);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\tMedium has defined {0} partitions", page.PartitionSizes.Length).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_has_defined_0_partitions, page.PartitionSizes.Length).AppendLine();
for(int i = 0; i < page.PartitionSizes.Length; i++)
sb.AppendFormat("\tPartition {0} is {1} units long", i, page.PartitionSizes[i]).AppendLine();
sb.AppendFormat("\t" + Localization.Partition_0_is_1_units_long, i, page.PartitionSizes[i]).AppendLine();
return sb.ToString();
}

View File

@@ -138,45 +138,47 @@ public static partial class Modes
sb.AppendLine("SCSI Power condition page:");
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page is { Standby : true, StandbyTimer : > 0 } ||
page is { Standby_Y: true, StandbyTimer_Y: > 0 })
{
if(page is { Standby: true, StandbyTimer: > 0 })
sb.AppendFormat("\tStandby timer Z is set to {0} ms", page.StandbyTimer * 100).AppendLine();
sb.AppendFormat("\t" + "Standby timer Z is set to {0} ms", page.StandbyTimer * 100).AppendLine();
if(page is { Standby_Y: true, StandbyTimer_Y: > 0 })
sb.AppendFormat("\tStandby timer Y is set to {0} ms", page.StandbyTimer_Y * 100).AppendLine();
sb.AppendFormat("\t" + "Standby timer Y is set to {0} ms", page.StandbyTimer_Y * 100).AppendLine();
}
else
sb.AppendLine("\tDrive will not enter standby mode");
sb.AppendLine("\t" + "Drive will not enter standby mode");
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 is { Idle: true, IdleTimer: > 0 })
sb.AppendFormat("\tIdle timer A is set to {0} ms", page.IdleTimer * 100).AppendLine();
sb.AppendFormat("\t" + "Idle timer A is set to {0} ms", page.IdleTimer * 100).AppendLine();
if(page is { Idle_B: true, IdleTimer_B: > 0 })
sb.AppendFormat("\tIdle timer B is set to {0} ms", page.IdleTimer_B * 100).AppendLine();
sb.AppendFormat("\t" + "Idle timer B is set to {0} ms", page.IdleTimer_B * 100).AppendLine();
if(page is { Idle_C: true, IdleTimer_C: > 0 })
sb.AppendFormat("\tIdle timer C is set to {0} ms", page.IdleTimer_C * 100).AppendLine();
sb.AppendFormat("\t" + "Idle timer C is set to {0} ms", page.IdleTimer_C * 100).AppendLine();
}
else
sb.AppendLine("\tDrive will not enter idle mode");
sb.AppendLine("\t" + "Drive will not enter idle mode");
switch(page.PM_BG_Precedence)
{
case 0: break;
case 1:
sb.AppendLine("\tPerforming background functions take precedence over maintaining low power conditions");
sb.AppendLine("\t" +
"Performing background functions take precedence over maintaining low power conditions");
break;
case 2:
sb.AppendLine("\tMaintaining low power conditions take precedence over performing background functions");
sb.AppendLine("\t" +
"Maintaining low power conditions take precedence over performing background functions");
break;
}
@@ -234,28 +236,29 @@ public static partial class Modes
ModePage_1A_S01 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Power Consumption page:");
sb.AppendLine(Localization.SCSI_Power_Consumption_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.ActiveLevel)
{
case 0:
sb.AppendFormat("\tDevice power consumption is dictated by identifier {0} of Power Consumption VPD",
page.PowerConsumptionIdentifier).AppendLine();
sb.
AppendFormat("\t" + Localization.Device_power_consumption_is_dictated_by_identifier_0_of_Power_Consumption_VPD,
page.PowerConsumptionIdentifier).AppendLine();
break;
case 1:
sb.AppendLine("\tDevice is in highest relative power consumption level");
sb.AppendLine("\t" + Localization.Device_is_in_highest_relative_power_consumption_level);
break;
case 2:
sb.AppendLine("\tDevice is in intermediate relative power consumption level");
sb.AppendLine("\t" + Localization.Device_is_in_intermediate_relative_power_consumption_level);
break;
case 3:
sb.AppendLine("\tDevice is in lowest relative power consumption level");
sb.AppendLine("\t" + Localization.Device_is_in_lowest_relative_power_consumption_level);
break;
}

View File

@@ -95,25 +95,25 @@ public static partial class Modes
ModePage_1B page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Removable Block Access Capabilities page:");
sb.AppendLine(Localization.SCSI_Removable_Block_Access_Capabilities_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.SFLP)
sb.AppendLine("\tDrive can be used as a system floppy device");
sb.AppendLine("\t" + Localization.Drive_can_be_used_as_a_system_floppy_device);
if(page.SRFP)
sb.AppendLine("\tDrive supports reporting progress of format");
sb.AppendLine("\t" + Localization.Drive_supports_reporting_progress_of_format);
if(page.NCD)
sb.AppendLine("\tDrive is a Non-CD Optical Device");
sb.AppendLine("\t" + Localization.Drive_is_a_Non_CD_Optical_Device);
if(page.SML)
sb.AppendLine("\tDevice is a dual device supporting CD and Non-CD Optical");
sb.AppendLine("\t" + Localization.Device_is_a_dual_device_supporting_CD_and_Non_CD_Optical);
if(page.TLUN > 0)
sb.AppendFormat("\tDrive supports {0} LUNs", page.TLUN).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_supports_0_LUNs, page.TLUN).AppendLine();
return sb.ToString();
}

View File

@@ -120,81 +120,84 @@ public static partial class Modes
ModePage_1C page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Informational exceptions control page:");
sb.AppendLine(Localization.SCSI_Informational_exceptions_control_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.DExcpt)
sb.AppendLine("\tInformational exceptions are disabled");
sb.AppendLine("\t" + Localization.Informational_exceptions_are_disabled);
else
{
sb.AppendLine("\tInformational exceptions are enabled");
sb.AppendLine("\t" + Localization.Informational_exceptions_are_enabled);
switch(page.MRIE)
{
case 0:
sb.AppendLine("\tNo reporting of informational exception condition");
sb.AppendLine("\t" + Localization.No_reporting_of_informational_exception_condition);
break;
case 1:
sb.AppendLine("\tAsynchronous event reporting of informational exceptions");
sb.AppendLine("\t" + Localization.Asynchronous_event_reporting_of_informational_exceptions);
break;
case 2:
sb.AppendLine("\tGenerate unit attention on informational exceptions");
sb.AppendLine("\t" + Localization.Generate_unit_attention_on_informational_exceptions);
break;
case 3:
sb.AppendLine("\tConditionally generate recovered error on informational exceptions");
sb.AppendLine("\t" + Localization.
Conditionally_generate_recovered_error_on_informational_exceptions);
break;
case 4:
sb.AppendLine("\tUnconditionally generate recovered error on informational exceptions");
sb.AppendLine("\t" + Localization.
Unconditionally_generate_recovered_error_on_informational_exceptions);
break;
case 5:
sb.AppendLine("\tGenerate no sense on informational exceptions");
sb.AppendLine("\t" + Localization.Generate_no_sense_on_informational_exceptions);
break;
case 6:
sb.AppendLine("\tOnly report informational exception condition on request");
sb.AppendLine("\t" + Localization.Only_report_informational_exception_condition_on_request);
break;
default:
sb.AppendFormat("\tUnknown method of reporting {0}", page.MRIE).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_method_of_reporting_0, page.MRIE).AppendLine();
break;
}
if(page.Perf)
sb.AppendLine("\tInformational exceptions reporting should not affect drive performance");
sb.AppendLine("\t" + Localization.
Informational_exceptions_reporting_should_not_affect_drive_performance);
if(page.Test)
sb.AppendLine("\tA test informational exception will raise on next timer");
sb.AppendLine("\t" + Localization.A_test_informational_exception_will_raise_on_next_timer);
if(page.LogErr)
sb.AppendLine("\tDrive shall log informational exception conditions");
sb.AppendLine("\t" + Localization.Drive_shall_log_informational_exception_conditions);
if(page.IntervalTimer > 0)
if(page.IntervalTimer == 0xFFFFFFFF)
sb.AppendLine("\tTimer interval is vendor-specific");
sb.AppendLine("\t" + Localization.Timer_interval_is_vendor_specific);
else
sb.AppendFormat("\tTimer interval is {0} ms", page.IntervalTimer * 100).AppendLine();
sb.AppendFormat("\t" + Localization.Timer_interval_is_0_ms, page.IntervalTimer * 100).AppendLine();
if(page.ReportCount > 0)
sb.AppendFormat("\tInformational exception conditions will be reported a maximum of {0} times",
sb.AppendFormat("\t" + Localization.Informational_exception_conditions_will_be_reported_a_maximum_of_0_times,
page.ReportCount);
}
if(page.EWasc)
sb.AppendLine("\tWarning reporting is enabled");
sb.AppendLine("\t" + Localization.Warning_reporting_is_enabled);
if(page.EBF)
sb.AppendLine("\tBackground functions are enabled");
sb.AppendLine("\t" + Localization.Background_functions_are_enabled);
if(page.EBACKERR)
sb.AppendLine("\tDrive will report background self-test errors");
sb.AppendLine("\t" + Localization.Drive_will_report_background_self_test_errors);
return sb.ToString();
}
@@ -269,38 +272,40 @@ public static partial class Modes
ModePage_1C_S01 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Background Control page:");
sb.AppendLine(Localization.SCSI_Background_Control_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.S_L_Full)
sb.AppendLine("\tBackground scans will be halted if log is full");
sb.AppendLine("\t" + Localization.Background_scans_will_be_halted_if_log_is_full);
if(page.LOWIR)
sb.AppendLine("\tBackground scans will only be logged if they require intervention");
sb.AppendLine("\t" + Localization.Background_scans_will_only_be_logged_if_they_require_intervention);
if(page.En_Bms)
sb.AppendLine("\tBackground medium scans are enabled");
sb.AppendLine("\t" + Localization.Background_medium_scans_are_enabled);
if(page.En_Ps)
sb.AppendLine("\tBackground pre-scans are enabled");
sb.AppendLine("\t" + Localization.Background_pre_scans_are_enabled);
if(page.BackgroundScanInterval > 0)
sb.AppendFormat("\t{0} hours shall be between the start of a background scan operation and the next",
page.BackgroundScanInterval).AppendLine();
sb.
AppendFormat("\t" + Localization._0__hours_shall_be_between_the_start_of_a_background_scan_operation_and_the_next,
page.BackgroundScanInterval).AppendLine();
if(page.BackgroundPrescanTimeLimit > 0)
sb.AppendFormat("\tBackground pre-scan operations can take a maximum of {0} hours",
sb.AppendFormat("\t" + Localization.Background_pre_scan_operations_can_take_a_maximum_of_0_hours,
page.BackgroundPrescanTimeLimit).AppendLine();
if(page.MinIdleBeforeBgScan > 0)
sb.AppendFormat("\tAt least {0} ms must be idle before resuming a suspended background scan operation",
page.MinIdleBeforeBgScan).AppendLine();
sb.
AppendFormat("\t" + Localization.At_least_0_ms_must_be_idle_before_resuming_a_suspended_background_scan_operation,
page.MinIdleBeforeBgScan).AppendLine();
if(page.MaxTimeSuspendBgScan > 0)
sb.
AppendFormat("\tAt most {0} ms must be before suspending a background scan operation and processing received commands",
AppendFormat("\t" + Localization.At_most_0_ms_must_be_before_suspending_a_background_scan_operation_and_processing_received_commands,
page.MaxTimeSuspendBgScan).AppendLine();
return sb.ToString();

View File

@@ -89,81 +89,97 @@ public static partial class Modes
ModePage_1C_SFF page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Timer & Protect page:");
sb.AppendLine(Localization.SCSI_Timer_Protect_page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.DISP)
sb.AppendLine("\tDrive is disabled until power is cycled");
sb.AppendLine("\t" + Localization.Drive_is_disabled_until_power_is_cycled);
if(page.SWPP)
sb.AppendLine("\tDrive is software write-protected until powered down");
sb.AppendLine("\t" + Localization.Drive_is_software_write_protected_until_powered_down);
switch(page.InactivityTimeMultiplier)
{
case 0:
sb.AppendLine("\tDrive will remain in same status a vendor-specified time after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_a_vendor_specified_time_after_a_seek_read_or_write_operation);
break;
case 1:
sb.AppendLine("\tDrive will remain in same status 125 ms after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_125_ms_after_a_seek_read_or_write_operation);
break;
case 2:
sb.AppendLine("\tDrive will remain in same status 250 ms after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_250_ms_after_a_seek_read_or_write_operation);
break;
case 3:
sb.AppendLine("\tDrive will remain in same status 500 ms after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_500_ms_after_a_seek_read_or_write_operation);
break;
case 4:
sb.AppendLine("\tDrive will remain in same status 1 second after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_1_second_after_a_seek_read_or_write_operation);
break;
case 5:
sb.AppendLine("\tDrive will remain in same status 2 seconds after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_2_seconds_after_a_seek_read_or_write_operation);
break;
case 6:
sb.AppendLine("\tDrive will remain in same status 4 seconds after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_4_seconds_after_a_seek_read_or_write_operation);
break;
case 7:
sb.AppendLine("\tDrive will remain in same status 8 seconds after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_8_seconds_after_a_seek_read_or_write_operation);
break;
case 8:
sb.AppendLine("\tDrive will remain in same status 16 seconds after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_16_seconds_after_a_seek_read_or_write_operation);
break;
case 9:
sb.AppendLine("\tDrive will remain in same status 32 seconds after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_32_seconds_after_a_seek_read_or_write_operation);
break;
case 10:
sb.AppendLine("\tDrive will remain in same status 1 minute after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_1_minute_after_a_seek_read_or_write_operation);
break;
case 11:
sb.AppendLine("\tDrive will remain in same status 2 minutes after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_2_minutes_after_a_seek_read_or_write_operation);
break;
case 12:
sb.AppendLine("\tDrive will remain in same status 4 minutes after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_4_minutes_after_a_seek_read_or_write_operation);
break;
case 13:
sb.AppendLine("\tDrive will remain in same status 8 minutes after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_8_minutes_after_a_seek_read_or_write_operation);
break;
case 14:
sb.AppendLine("\tDrive will remain in same status 16 minutes after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_16_minutes_after_a_seek_read_or_write_operation);
break;
case 15:
sb.AppendLine("\tDrive will remain in same status 32 minutes after a seek, read or write operation");
sb.AppendLine("\t" + Localization.
Drive_will_remain_in_same_status_32_minutes_after_a_seek_read_or_write_operation);
break;
}

View File

@@ -84,31 +84,31 @@ public static partial class Modes
ModePage_1D page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("SCSI Medium Configuration Mode Page:");
sb.AppendLine(Localization.SCSI_Medium_Configuration_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.WORMM)
sb.AppendLine("\tDrive is operating in WORM mode");
sb.AppendLine("\t" + Localization.Drive_is_operating_in_WORM_mode);
switch(page.WormModeLabelRestrictions)
{
case 0:
sb.AppendLine("\tDrive does not allow any logical blocks to be overwritten");
sb.AppendLine("\t" + Localization.Drive_does_not_allow_any_logical_blocks_to_be_overwritten);
break;
case 1:
sb.AppendLine("\tDrive allows a tape header to be overwritten");
sb.AppendLine("\t" + Localization.Drive_allows_a_tape_header_to_be_overwritten);
break;
case 2:
sb.AppendLine("\tDrive allows all format labels to be overwritten");
sb.AppendLine("\t" + Localization.Drive_allows_all_format_labels_to_be_overwritten);
break;
default:
sb.AppendFormat("\tUnknown WORM mode label restrictions code {0}", page.WormModeLabelRestrictions).
AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_WORM_mode_label_restrictions_code_0,
page.WormModeLabelRestrictions).AppendLine();
break;
}
@@ -116,16 +116,18 @@ public static partial class Modes
switch(page.WormModeFilemarkRestrictions)
{
case 2:
sb.AppendLine("\tDrive allows any number of filemarks immediately preceding EOD to be overwritten except filemark closes to BOP");
sb.AppendLine("\t" +
"Drive allows any number of filemarks immediately preceding EOD to be overwritten except filemark closes to BOP");
break;
case 3:
sb.AppendLine("\tDrive allows any number of filemarks immediately preceding EOD to be overwritten");
sb.AppendLine("\t" +
"Drive allows any number of filemarks immediately preceding EOD to be overwritten");
break;
default:
sb.AppendFormat("\tUnknown WORM mode filemark restrictions code {0}", page.WormModeLabelRestrictions).
AppendLine();
sb.AppendFormat("\t" + "Unknown WORM mode filemark restrictions code {0}",
page.WormModeLabelRestrictions).AppendLine();
break;
}

View File

@@ -94,20 +94,20 @@ public static partial class Modes
Certance_ModePage_21 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("Certance Drive Capabilities Control Mode Page:");
sb.AppendLine(Localization.Certance_Drive_Capabilities_Control_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.OperatingSystemsSupport)
{
case 0:
sb.AppendLine("\tOperating systems support is standard LTO");
sb.AppendLine("\t" + Localization.Operating_systems_support_is_standard_LTO);
break;
default:
sb.AppendFormat("\tOperating systems support is unknown code {0}", page.OperatingSystemsSupport).
AppendLine();
sb.AppendFormat("\t" + Localization.Operating_systems_support_is_unknown_code_0,
page.OperatingSystemsSupport).AppendLine();
break;
}
@@ -116,19 +116,20 @@ public static partial class Modes
switch(page.FirmwareTestControl)
{
case 0:
sb.AppendLine("\tFactory test code is disabled");
sb.AppendLine("\t" + Localization.Factory_test_code_is_disabled);
break;
case 1:
sb.AppendLine("\tFactory test code 1 is disabled");
sb.AppendLine("\t" + Localization.Factory_test_code_1_is_disabled);
break;
case 2:
sb.AppendLine("\tFactory test code 2 is disabled");
sb.AppendLine("\t" + Localization.Factory_test_code_2_is_disabled);
break;
default:
sb.AppendFormat("\tUnknown factory test code {0}", page.FirmwareTestControl).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_factory_test_code_0, page.FirmwareTestControl).
AppendLine();
break;
}
@@ -136,15 +137,16 @@ public static partial class Modes
switch(page.ExtendedPOSTMode)
{
case 0:
sb.AppendLine("\tPower-On Self-Test is enabled");
sb.AppendLine("\t" + Localization.Power_On_Self_Test_is_enabled);
break;
case 1:
sb.AppendLine("\tPower-On Self-Test is disable");
sb.AppendLine("\t" + Localization.Power_On_Self_Test_is_disable);
break;
default:
sb.AppendFormat("\tUnknown Power-On Self-Test code {0}", page.ExtendedPOSTMode).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_Power_On_Self_Test_code_0, page.ExtendedPOSTMode).
AppendLine();
break;
}
@@ -152,48 +154,50 @@ public static partial class Modes
switch(page.DataCompressionControl)
{
case 0:
sb.AppendLine("\tCompression is controlled using mode pages 0Fh and 10h");
sb.AppendLine("\t" + Localization.Compression_is_controlled_using_mode_pages_0Fh_and_10h);
break;
case 1:
sb.AppendLine("\tCompression is enabled and not controllable");
sb.AppendLine("\t" + Localization.Compression_is_enabled_and_not_controllable);
break;
case 2:
sb.AppendLine("\tCompression is disabled and not controllable");
sb.AppendLine("\t" + Localization.Compression_is_disabled_and_not_controllable);
break;
default:
sb.AppendFormat("\tUnknown compression control code {0}", page.DataCompressionControl).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_compression_control_code_0, page.DataCompressionControl).
AppendLine();
break;
}
if(page.HostUnloadOverride)
sb.AppendLine("\tSCSI UNLOAD command will not eject the cartridge");
sb.AppendLine("\t" + Localization.SCSI_UNLOAD_command_will_not_eject_the_cartridge);
sb.Append("\tHow should tapes be unloaded in a power cycle, tape incompatibility, firmware download or cleaning end: ");
sb.Append("\t" + Localization.
How_should_tapes_be_unloaded_in_a_power_cycle_tape_incompatibility_firmware_download_or_cleaning_end);
switch(page.AutoUnloadMode)
{
case 0:
sb.AppendLine("\tTape will stay threaded at beginning");
sb.AppendLine("\t" + Localization.Tape_will_stay_threaded_at_beginning);
break;
case 1:
sb.AppendLine("\tTape will be unthreaded");
sb.AppendLine("\t" + Localization.Tape_will_be_unthreaded);
break;
case 2:
sb.AppendLine("\tTape will be unthreaded and unloaded");
sb.AppendLine("\t" + Localization.Tape_will_be_unthreaded_and_unloaded);
break;
case 3:
sb.AppendLine("\tData tapes will be threaded at beginning, rest will be unloaded");
sb.AppendLine("\t" + Localization.Data_tapes_will_be_threaded_at_beginning_rest_will_be_unloaded);
break;
default:
sb.AppendFormat("\tUnknown auto unload code {0}", page.AutoUnloadMode).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_auto_unload_code_0, page.AutoUnloadMode).AppendLine();
break;
}

View File

@@ -100,56 +100,57 @@ public static partial class Modes
Certance_ModePage_22 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("Certance Interface Control Mode Page:");
sb.AppendLine(Localization.Certance_Interface_Control_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.BaudRate)
{
case 0:
case 1:
case 2:
sb.AppendLine("\tLibrary interface will operate at 9600 baud on next reset");
sb.AppendLine("\t" + Localization.Library_interface_will_operate_at_9600_baud_on_next_reset);
break;
case 3:
sb.AppendLine("\tLibrary interface will operate at 19200 baud on next reset");
sb.AppendLine("\t" + Localization.Library_interface_will_operate_at_19200_baud_on_next_reset);
break;
case 4:
sb.AppendLine("\tLibrary interface will operate at 38400 baud on next reset");
sb.AppendLine("\t" + Localization.Library_interface_will_operate_at_38400_baud_on_next_reset);
break;
case 5:
sb.AppendLine("\tLibrary interface will operate at 57600 baud on next reset");
sb.AppendLine("\t" + Localization.Library_interface_will_operate_at_57600_baud_on_next_reset);
break;
case 6:
sb.AppendLine("\tLibrary interface will operate at 115200 baud on next reset");
sb.AppendLine("\t" + Localization.Library_interface_will_operate_at_115200_baud_on_next_reset);
break;
default:
sb.AppendFormat("\tUnknown library interface baud rate code {0}", page.BaudRate).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_library_interface_baud_rate_code_0, page.BaudRate).
AppendLine();
break;
}
sb.AppendLine(page.StopBits ? "Library interface transmits 2 stop bits per byte"
: "Library interface transmits 1 stop bits per byte");
sb.AppendLine(page.StopBits ? Localization.Library_interface_transmits_2_stop_bits_per_byte
: Localization.Library_interface_transmits_1_stop_bits_per_byte);
switch(page.CmdFwd)
{
case 0:
sb.AppendLine("\tCommand forwarding is disabled");
sb.AppendLine("\t" + Localization.Command_forwarding_is_disabled);
break;
case 1:
sb.AppendLine("\tCommand forwarding is enabled");
sb.AppendLine("\t" + Localization.Command_forwarding_is_enabled);
break;
default:
sb.AppendFormat("\tUnknown command forwarding code {0}", page.CmdFwd).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_command_forwarding_code_0, page.CmdFwd).AppendLine();
break;
}
@@ -157,30 +158,33 @@ public static partial class Modes
switch(page.PortATransportType)
{
case 0:
sb.AppendLine("\tPort A link is down");
sb.AppendLine("\t" + Localization.Port_A_link_is_down);
break;
case 3:
sb.AppendLine("\tPort A uses Parallel SCSI Ultra-160 interface");
sb.AppendLine("\t" + Localization.Port_A_uses_Parallel_SCSI_Ultra160_interface);
break;
default:
sb.AppendFormat("\tUnknown port A transport type code {0}", page.PortATransportType).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_port_A_transport_type_code_0, page.PortATransportType).
AppendLine();
break;
}
if(page.PortATransportType > 0)
sb.AppendFormat("\tDrive responds to SCSI ID {0}", page.PortAPresentSelectionID).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_responds_to_SCSI_ID_0, page.PortAPresentSelectionID).AppendLine();
sb.AppendFormat("\tDrive will respond to SCSI ID {0} on Port A enabling", page.NextSelectionID).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_will_respond_to_SCSI_ID_0_on_Port_A_enabling, page.NextSelectionID).
AppendLine();
sb.AppendFormat("\tDrive jumpers choose SCSI ID {0}", page.JumperedSelectionID).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_jumpers_choose_SCSI_ID_0, page.JumperedSelectionID).AppendLine();
sb.AppendLine(page.PortAEnabled ? "\tSCSI port is enabled" : "\tSCSI port is disabled");
sb.AppendLine(page.PortAEnabled ? "\t" + Localization.SCSI_port_is_enabled
: "\t" + Localization.SCSI_port_is_disabled);
sb.AppendLine(page.PortAEnabledOnPower ? "\tSCSI port will be enabled on next power up"
: "\tSCSI port will be disabled on next power up");
sb.AppendLine(page.PortAEnabledOnPower ? "\t" + Localization.SCSI_port_will_be_enabled_on_next_power_up
: "\t" + Localization.SCSI_port_will_be_disabled_on_next_power_up);
return sb.ToString();
}

View File

@@ -86,21 +86,21 @@ public static partial class Modes
IBM_ModePage_24 page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("IBM Vendor-Specific Control Mode Page:");
sb.AppendLine(Localization.IBM_Vendor_Specific_Control_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\tVendor-specific mode control: {0}", page.ModeControl);
sb.AppendFormat("\tVendor-specific velocity setting: {0}", page.VelocitySetting);
sb.AppendFormat("\t" + Localization.Vendor_specific_mode_control_0, page.ModeControl);
sb.AppendFormat("\t" + Localization.Vendor_specific_velocity_setting_0, page.VelocitySetting);
if(!page.EncryptionCapable)
return sb.ToString();
sb.AppendLine("\tDrive supports encryption");
sb.AppendLine("\t" + Localization.Drive_supports_encryption);
if(page.EncryptionEnabled)
sb.AppendLine("\tDrive has encryption enabled");
sb.AppendLine("\t" + Localization.Drive_has_encryption_enabled);
return sb.ToString();
}

View File

@@ -52,151 +52,159 @@ public static partial class Modes
var sb = new StringBuilder();
sb.AppendLine("SCSI CD-ROM capabilities page:");
sb.AppendLine(Localization.SCSI_CD_ROM_capabilities_page);
if(modePage.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(modePage.AudioPlay)
sb.AppendLine("\tDrive can play audio");
sb.AppendLine("\t" + Localization.Drive_can_play_audio);
if(modePage.Mode2Form1)
sb.AppendLine("\tDrive can read sectors in Mode 2 Form 1 format");
sb.AppendLine("\t" + Localization.Drive_can_read_sectors_in_Mode_2_Form_1_format);
if(modePage.Mode2Form2)
sb.AppendLine("\tDrive can read sectors in Mode 2 Form 2 format");
sb.AppendLine("\t" + Localization.Drive_can_read_sectors_in_Mode_2_Form_2_format);
if(modePage.MultiSession)
sb.AppendLine("\tDrive supports multi-session discs and/or Photo-CD");
sb.AppendLine("\t" + Localization.Drive_supports_multi_session_discs_and_or_Photo_CD);
if(modePage.CDDACommand)
sb.AppendLine("\tDrive can read digital audio");
sb.AppendLine("\t" + Localization.Drive_can_read_digital_audio);
if(modePage.AccurateCDDA)
sb.AppendLine("\tDrive can continue from streaming loss");
sb.AppendLine("\t" + Localization.Drive_can_continue_from_streaming_loss);
if(modePage.Subchannel)
sb.AppendLine("\tDrive can read uncorrected and interleaved R-W subchannels");
sb.AppendLine("\t" + Localization.Drive_can_read_uncorrected_and_interleaved_R_W_subchannels);
if(modePage.DeinterlaveSubchannel)
sb.AppendLine("\tDrive can read, deinterleave and correct R-W subchannels");
sb.AppendLine("\t" + Localization.Drive_can_read__deinterleave_and_correct_R_W_subchannels);
if(modePage.C2Pointer)
sb.AppendLine("\tDrive supports C2 pointers");
sb.AppendLine("\t" + Localization.Drive_supports_C2_pointers);
if(modePage.UPC)
sb.AppendLine("\tDrive can read Media Catalogue Number");
sb.AppendLine("\t" + Localization.Drive_can_read_Media_Catalogue_Number);
if(modePage.ISRC)
sb.AppendLine("\tDrive can read ISRC");
sb.AppendLine("\t" + Localization.Drive_can_read_ISRC);
switch(modePage.LoadingMechanism)
{
case 0:
sb.AppendLine("\tDrive uses media caddy");
sb.AppendLine("\t" + Localization.Drive_uses_media_caddy);
break;
case 1:
sb.AppendLine("\tDrive uses a tray");
sb.AppendLine("\t" + Localization.Drive_uses_a_tray);
break;
case 2:
sb.AppendLine("\tDrive is pop-up");
sb.AppendLine("\t" + Localization.Drive_is_pop_up);
break;
case 4:
sb.AppendLine("\tDrive is a changer with individually changeable discs");
sb.AppendLine("\t" + Localization.Drive_is_a_changer_with_individually_changeable_discs);
break;
case 5:
sb.AppendLine("\tDrive is a changer using cartridges");
sb.AppendLine("\t" + Localization.Drive_is_a_changer_using_cartridges);
break;
default:
sb.AppendFormat("\tDrive uses unknown loading mechanism type {0}", modePage.LoadingMechanism).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_uses_unknown_loading_mechanism_type__0_,
modePage.LoadingMechanism).AppendLine();
break;
}
if(modePage.Lock)
sb.AppendLine("\tDrive can lock media");
sb.AppendLine("\t" + Localization.Drive_can_lock_media);
if(modePage.PreventJumper)
{
sb.AppendLine("\tDrive power ups locked");
sb.AppendLine("\t" + Localization.Drive_power_ups_locked);
sb.AppendLine(modePage.LockState ? "\tDrive is locked, media cannot be ejected or inserted"
: "\tDrive is not locked, media can be ejected and inserted");
sb.AppendLine(modePage.LockState ? "\t" + Localization.Drive_is_locked__media_cannot_be_ejected_or_inserted
: "\t" + Localization.Drive_is_not_locked__media_can_be_ejected_and_inserted);
}
else
sb.AppendLine(modePage.LockState
? "\tDrive is locked, media cannot be ejected, but if empty, can be inserted"
: "\tDrive is not locked, media can be ejected and inserted");
? "\t" + Localization.
Drive_is_locked__media_cannot_be_ejected__but_if_empty__can_be_inserted
: "\t" + Localization.Drive_is_not_locked__media_can_be_ejected_and_inserted);
if(modePage.Eject)
sb.AppendLine("\tDrive can eject media");
sb.AppendLine("\t" + Localization.Drive_can_eject_media);
if(modePage.SeparateChannelMute)
sb.AppendLine("\tEach channel can be muted independently");
sb.AppendLine("\t" + Localization.Each_channel_can_be_muted_independently);
if(modePage.SeparateChannelVolume)
sb.AppendLine("\tEach channel's volume can be controlled independently");
sb.AppendLine("\t" + Localization.Each_channel_s_volume_can_be_controlled_independently);
if(modePage.SupportedVolumeLevels > 0)
sb.AppendFormat("\tDrive supports {0} volume levels", modePage.SupportedVolumeLevels).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_supports_0_volume_levels, modePage.SupportedVolumeLevels).
AppendLine();
if(modePage.BufferSize > 0)
sb.AppendFormat("\tDrive has {0} Kbyte of buffer", modePage.BufferSize).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_has_0_Kbyte_of_buffer, modePage.BufferSize).AppendLine();
if(modePage.MaximumSpeed > 0)
sb.AppendFormat("\tDrive's maximum reading speed is {0} Kbyte/sec.", modePage.MaximumSpeed).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_maximum_reading_speed_is_0_Kbyte_sec, modePage.MaximumSpeed).
AppendLine();
if(modePage.CurrentSpeed > 0)
sb.AppendFormat("\tDrive's current reading speed is {0} Kbyte/sec.", modePage.CurrentSpeed).AppendLine();
sb.AppendFormat("\t" + Localization.Drive_current_reading_speed_is_0_Kbyte_sec, modePage.CurrentSpeed).
AppendLine();
if(modePage.ReadCDR)
{
sb.AppendLine(modePage.WriteCDR ? "\tDrive can read and write CD-R" : "\tDrive can read CD-R");
sb.AppendLine(modePage.WriteCDR ? "\t" + Localization.Drive_can_read_and_write_CD_R
: "\t" + Localization.Drive_can_read_CD_R);
if(modePage.Method2)
sb.AppendLine("\tDrive supports reading CD-R packet media");
sb.AppendLine("\t" + Localization.Drive_supports_reading_CD_R_packet_media);
}
if(modePage.ReadCDRW)
sb.AppendLine(modePage.WriteCDRW ? "\tDrive can read and write CD-RW" : "\tDrive can read CD-RW");
sb.AppendLine(modePage.WriteCDRW ? "\t" + Localization.Drive_can_read_and_write_CD_RW
: "\t" + Localization.Drive_can_read_CD_RW);
if(modePage.ReadDVDROM)
sb.AppendLine("\tDrive can read DVD-ROM");
sb.AppendLine("\t" + Localization.Drive_can_read_DVD_ROM);
if(modePage.ReadDVDR)
sb.AppendLine(modePage.WriteDVDR ? "\tDrive can read and write DVD-R" : "\tDrive can read DVD-R");
sb.AppendLine(modePage.WriteDVDR ? "\t" + Localization.Drive_can_read_and_write_DVD_R
: "\t" + Localization.Drive_can_read_DVD_R);
if(modePage.ReadDVDRAM)
sb.AppendLine(modePage.WriteDVDRAM ? "\tDrive can read and write DVD-RAM" : "\tDrive can read DVD-RAM");
sb.AppendLine(modePage.WriteDVDRAM ? "\t" + Localization.Drive_can_read_and_write_DVD_RAM
: "\t" + Localization.Drive_can_read_DVD_RAM);
if(modePage.Composite)
sb.AppendLine("\tDrive can deliver a composite audio and video data stream");
sb.AppendLine("\t" + Localization.Drive_can_deliver_a_composite_audio_and_video_data_stream);
if(modePage.DigitalPort1)
sb.AppendLine("\tDrive supports IEC-958 digital output on port 1");
sb.AppendLine("\t" + Localization.Drive_supports_IEC_958_digital_output_on_port_1);
if(modePage.DigitalPort2)
sb.AppendLine("\tDrive supports IEC-958 digital output on port 2");
sb.AppendLine("\t" + Localization.Drive_supports_IEC_958_digital_output_on_port_2);
if(modePage.SDP)
sb.AppendLine("\tDrive contains a changer that can report the exact contents of the slots");
sb.AppendLine("\t" + Localization.Drive_contains_a_changer_that_can_report_the_exact_contents_of_the_slots);
if(modePage.CurrentWriteSpeedSelected > 0)
switch(modePage.RotationControlSelected)
{
case 0:
sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec. in CLV mode",
sb.AppendFormat("\t" + Localization.Drive_current_writing_speed_is_0_Kbyte_sec_in_CLV_mode,
modePage.CurrentWriteSpeedSelected).AppendLine();
break;
case 1:
sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec. in pure CAV mode",
sb.AppendFormat("\t" + Localization.Drive_current_writing_speed_is_0_Kbyte_sec_in_pure_CAV_mode,
modePage.CurrentWriteSpeedSelected).AppendLine();
break;
@@ -204,12 +212,12 @@ public static partial class Modes
else
{
if(modePage.MaxWriteSpeed > 0)
sb.AppendFormat("\tDrive's maximum writing speed is {0} Kbyte/sec.", modePage.MaxWriteSpeed).
sb.AppendFormat("\t" + Localization.Drive_maximum_writing_speed_is_0_Kbyte_sec, modePage.MaxWriteSpeed).
AppendLine();
if(modePage.CurrentWriteSpeed > 0)
sb.AppendFormat("\tDrive's current writing speed is {0} Kbyte/sec.", modePage.CurrentWriteSpeed).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_current_writing_speed_is_0_Kbyte_sec,
modePage.CurrentWriteSpeed).AppendLine();
}
if(modePage.WriteSpeedPerformanceDescriptors != null)
@@ -218,34 +226,34 @@ public static partial class Modes
switch(descriptor.RotationControl)
{
case 0:
sb.AppendFormat("\tDrive supports writing at {0} Kbyte/sec. in CLV mode",
sb.AppendFormat("\t" + Localization.Drive_supports_writing_at_0_Kbyte_sec_in_CLV_mode,
descriptor.WriteSpeed).AppendLine();
break;
case 1:
sb.AppendFormat("\tDrive supports writing at is {0} Kbyte/sec. in pure CAV mode",
sb.AppendFormat("\t" + Localization.Drive_supports_writing_at_is_0_Kbyte_sec_in_pure_CAV_mode,
descriptor.WriteSpeed).AppendLine();
break;
}
if(modePage.TestWrite)
sb.AppendLine("\tDrive supports test writing");
sb.AppendLine("\t" + Localization.Drive_supports_test_writing);
if(modePage.ReadBarcode)
sb.AppendLine("\tDrive can read barcode");
sb.AppendLine("\t" + Localization.Drive_can_read_barcode);
if(modePage.SCC)
sb.AppendLine("\tDrive can read both sides of a disc");
sb.AppendLine("\t" + Localization.Drive_can_read_both_sides_of_a_disc);
if(modePage.LeadInPW)
sb.AppendLine("\tDrive an read raw R-W subchannel from the Lead-In");
sb.AppendLine("\t" + Localization.Drive_an_read_raw_R_W_subchannel_from_the_Lead_In);
if(modePage.CMRSupported == 1)
sb.AppendLine("\tDrive supports DVD CSS and/or DVD CPPM");
sb.AppendLine("\t" + Localization.Drive_supports_DVD_CSS_and_or_DVD_CPPM);
if(modePage.BUF)
sb.AppendLine("\tDrive supports buffer under-run free recording");
sb.AppendLine("\t" + Localization.Drive_supports_buffer_under_run_free_recording);
return sb.ToString();
}

View File

@@ -98,23 +98,23 @@ public static partial class Modes
IBM_ModePage_2F page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("IBM Behaviour Configuration Mode Page:");
sb.AppendLine(Localization.IBM_Behaviour_Configuration_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.FenceBehaviour)
{
case 0:
sb.AppendLine("\tFence behaviour is normal");
sb.AppendLine("\t" + Localization.Fence_behaviour_is_normal);
break;
case 1:
sb.AppendLine("\tPanic fence behaviour is enabled");
sb.AppendLine("\t" + Localization.Panic_fence_behaviour_is_enabled);
break;
default:
sb.AppendFormat("\tUnknown fence behaviour code {0}", page.FenceBehaviour).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_fence_behaviour_code_0, page.FenceBehaviour).AppendLine();
break;
}
@@ -122,15 +122,16 @@ public static partial class Modes
switch(page.CleanBehaviour)
{
case 0:
sb.AppendLine("\tCleaning behaviour is normal");
sb.AppendLine("\t" + Localization.Cleaning_behaviour_is_normal);
break;
case 1:
sb.AppendLine("\tDrive will periodically request cleaning");
sb.AppendLine("\t" + Localization.Drive_will_periodically_request_cleaning);
break;
default:
sb.AppendFormat("\tUnknown cleaning behaviour code {0}", page.CleanBehaviour).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_cleaning_behaviour_code_0, page.CleanBehaviour).
AppendLine();
break;
}
@@ -138,15 +139,15 @@ public static partial class Modes
switch(page.WORMEmulation)
{
case 0:
sb.AppendLine("\tWORM emulation is disabled");
sb.AppendLine("\t" + Localization.WORM_emulation_is_disabled);
break;
case 1:
sb.AppendLine("\tWORM emulation is enabled");
sb.AppendLine("\t" + Localization.WORM_emulation_is_enabled);
break;
default:
sb.AppendFormat("\tUnknown WORM emulation code {0}", page.WORMEmulation).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_WORM_emulation_code_0, page.WORMEmulation).AppendLine();
break;
}
@@ -154,39 +155,40 @@ public static partial class Modes
switch(page.SenseDataBehaviour)
{
case 0:
sb.AppendLine("\tUses 35-bytes sense data");
sb.AppendLine("\t" + Localization.Uses_35_bytes_sense_data);
break;
case 1:
sb.AppendLine("\tUses 96-bytes sense data");
sb.AppendLine("\t" + Localization.Uses_96_bytes_sense_data);
break;
default:
sb.AppendFormat("\tUnknown sense data behaviour code {0}", page.WORMEmulation).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_sense_data_behaviour_code_0, page.WORMEmulation).
AppendLine();
break;
}
if(page.CLNCHK)
sb.AppendLine("\tDrive will set Check Condition when cleaning is needed");
sb.AppendLine("\t" + Localization.Drive_will_set_Check_Condition_when_cleaning_is_needed);
if(page.DDEOR)
sb.AppendLine("\tNo deferred error will be reported to a rewind command");
sb.AppendLine("\t" + Localization.No_deferred_error_will_be_reported_to_a_rewind_command);
if(page.CCDM)
sb.AppendLine("\tDrive will set Check Condition when the criteria for Dead Media is met");
sb.AppendLine("\t" + Localization.Drive_will_set_Check_Condition_when_the_criteria_for_Dead_Media_is_met);
if(page.FirmwareUpdateBehaviour > 0)
sb.AppendLine("\tDrive will not accept downlevel firmware via an FMR tape");
sb.AppendLine("\t" + Localization.Drive_will_not_accept_downlevel_firmware_via_an_FMR_tape);
if(page.UOE_C == 1)
sb.AppendLine("\tDrive will eject cleaning cartridges on error");
sb.AppendLine("\t" + Localization.Drive_will_eject_cleaning_cartridges_on_error);
if(page.UOE_F == 1)
sb.AppendLine("\tDrive will eject firmware cartridges on error");
sb.AppendLine("\t" + Localization.Drive_will_eject_firmware_cartridges_on_error);
if(page.UOE_D == 1)
sb.AppendLine("\tDrive will eject data cartridges on error");
sb.AppendLine("\t" + Localization.Drive_will_eject_data_cartridges_on_error);
return sb.ToString();
}

View File

@@ -85,24 +85,24 @@ public static partial class Modes
HP_ModePage_3B page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("HP Serial Number Override Mode Page:");
sb.AppendLine(Localization.HP_Serial_Number_Override_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.MSN)
{
case 1:
sb.AppendLine("\tSerial number is the manufacturer's default value");
sb.AppendLine("\t" + Localization.Serial_number_is_the_manufacturer_default_value);
break;
case 3:
sb.AppendLine("\tSerial number is not the manufacturer's default value");
sb.AppendLine("\t" + Localization.Serial_number_is_not_the_manufacturer_default_value);
break;
}
sb.AppendFormat("\tSerial number: {0}", StringHandlers.CToString(page.SerialNumber)).AppendLine();
sb.AppendFormat("\t" + Localization.Serial_number_0, StringHandlers.CToString(page.SerialNumber)).AppendLine();
return sb.ToString();
}

View File

@@ -112,36 +112,36 @@ public static partial class Modes
HP_ModePage_3C page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("HP Device Time Mode Page:");
sb.AppendLine(Localization.HP_Device_Time_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.PT)
{
sb.AppendFormat("\tDrive has been powered up {0} times", page.CurrentPowerOn);
sb.AppendFormat("\t" + Localization.Drive_has_been_powered_up_0_times, page.CurrentPowerOn);
sb.AppendFormat("\tDrive has been powered up since {0} this time", TimeSpan.FromSeconds(page.PowerOnTime)).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_has_been_powered_up_since_0_seconds_ago_this_time,
TimeSpan.FromSeconds(page.PowerOnTime)).AppendLine();
sb.AppendFormat("\tDrive has been powered up a total of {0}", TimeSpan.FromSeconds(page.CumulativePowerOn)).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_has_been_powered_up_a_total_of_0_seconds,
TimeSpan.FromSeconds(page.CumulativePowerOn)).AppendLine();
}
if(page.WT)
{
sb.AppendFormat("\tDrive's date/time is: {0}", DateHandlers.UnixUnsignedToDateTime(page.WorldTime)).
AppendLine();
sb.AppendFormat("\t" + Localization.Drive_date_time_is_0,
DateHandlers.UnixUnsignedToDateTime(page.WorldTime)).AppendLine();
if(page.UTC)
sb.AppendLine("\tDrive's time is UTC");
sb.AppendLine("\t" + Localization.Drive_time_is_UTC);
if(page.NTP)
sb.AppendLine("\tDrive's time is synchronized with a NTP source");
sb.AppendLine("\t" + Localization.Drive_time_is_synchronized_with_a_NTP_source);
}
if(page.LT)
sb.AppendFormat("\tLibrary time is {0}",
sb.AppendFormat("\t" + Localization.Library_time_is_0,
new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, page.LibraryHours,
page.LibraryMinutes, page.LibrarySeconds)).AppendLine();

View File

@@ -80,23 +80,23 @@ public static partial class Modes
HP_ModePage_3D page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("HP Extended Reset Mode Page:");
sb.AppendLine(Localization.HP_Extended_Reset_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
switch(page.ResetBehaviour)
{
case 0:
sb.AppendLine("\tNormal reset behaviour");
sb.AppendLine("\t" + Localization.Normal_reset_behaviour);
break;
case 1:
sb.AppendLine("\tDrive will flush and position itself on a LUN or target reset");
sb.AppendLine("\t" + Localization.Drive_will_flush_and_position_itself_on_a_LUN_or_target_reset);
break;
case 2:
sb.AppendLine("\tDrive will maintain position on a LUN or target reset");
sb.AppendLine("\t" + Localization.Drive_will_maintain_position_on_a_LUN_or_target_reset);
break;
}

View File

@@ -80,12 +80,12 @@ public static partial class Modes
IBM_ModePage_3D page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("IBM LEOT Mode Page:");
sb.AppendLine(Localization.IBM_LEOT_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendFormat("\t{0} wraps", page.NumberOfWraps).AppendLine();
sb.AppendFormat("\t" + Localization._0_wraps, page.NumberOfWraps).AppendLine();
return sb.ToString();
}

View File

@@ -112,35 +112,35 @@ public static partial class Modes
Fujitsu_ModePage_3E page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("Fujitsu Verify Control Page:");
sb.AppendLine(Localization.Fujitsu_Verify_Control_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
if(page.audioVisualMode)
sb.AppendLine("\tAudio/Visual data support mode is applied");
sb.AppendLine("\t" + Localization.Audio_Visual_data_support_mode_is_applied);
if(page.streamingMode)
sb.AppendLine("\tTest write operation is restricted during read or write operations.");
sb.AppendLine("\t" + Localization.Test_write_operation_is_restricted_during_read_or_write_operations);
switch(page.verifyMode)
{
case Fujitsu_VerifyModes.Always:
sb.AppendLine("\tAlways apply the verify operation");
sb.AppendLine("\t" + Localization.Always_apply_the_verify_operation);
break;
case Fujitsu_VerifyModes.Never:
sb.AppendLine("\tNever apply the verify operation");
sb.AppendLine("\t" + Localization.Never_apply_the_verify_operation);
break;
case Fujitsu_VerifyModes.Depends:
sb.AppendLine("\tApply the verify operation depending on the condition");
sb.AppendLine("\t" + Localization.Apply_the_verify_operation_depending_on_the_condition);
break;
}
sb.AppendFormat("\tThe device type that would be provided in the INQUIRY response is {0}", page.devType).
AppendLine();
sb.AppendFormat("\t" + Localization.The_device_type_that_would_be_provided_in_the_INQUIRY_response_is_0,
page.devType).AppendLine();
return sb.ToString();
}

View File

@@ -82,15 +82,16 @@ public static partial class Modes
HP_ModePage_3E page = modePage.Value;
var sb = new StringBuilder();
sb.AppendLine("HP CD-ROM Emulation/Disaster Recovery Mode Page:");
sb.AppendLine(Localization.HP_CD_ROM_Emulation_Disaster_Recovery_Mode_Page);
if(page.PS)
sb.AppendLine("\tParameters can be saved");
sb.AppendLine("\t" + Localization.Parameters_can_be_saved);
sb.AppendLine(page.CDmode ? "\tDrive is emulating a CD-ROM drive" : "\tDrive is not emulating a CD-ROM drive");
sb.AppendLine(page.CDmode ? "\t" + Localization.Drive_is_emulating_a_CD_ROM_drive
: "\t" + Localization.Drive_is_not_emulating_a_CD_ROM_drive);
if(page.NonAuto)
sb.AppendLine("\tDrive will not exit emulation automatically");
sb.AppendLine("\t" + Localization.Drive_will_not_exit_emulation_automatically);
return sb.ToString();
}

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Aaru.Localization;
namespace Aaru.Decoders.SCSI.SSC;
@@ -61,19 +62,19 @@ public static class BlockLimits
var sb = new StringBuilder();
if(decoded.Value.maxBlockLen == decoded.Value.minBlockLen)
sb.AppendFormat("Device's block size is fixed at {0} bytes", decoded.Value.minBlockLen).AppendLine();
sb.AppendFormat(Core.Device_block_size_is_fixed_at_0_bytes, decoded.Value.minBlockLen).AppendLine();
else
{
if(decoded.Value.maxBlockLen > 0)
sb.AppendFormat("Device's maximum block size is {0} bytes", decoded.Value.maxBlockLen).AppendLine();
sb.AppendFormat(Core.Device_maximum_block_size_is_0_bytes, decoded.Value.maxBlockLen).AppendLine();
else
sb.AppendLine("Device does not specify a maximum block size");
sb.AppendLine(Core.Device_does_not_specify_a_maximum_block_size);
sb.AppendFormat("Device's minimum block size is {0} bytes", decoded.Value.minBlockLen).AppendLine();
sb.AppendFormat(Core.Device_minimum_block_size_is_0_bytes, decoded.Value.minBlockLen).AppendLine();
if(decoded.Value.granularity > 0)
sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes",
decoded.Value.granularity, Math.Pow(2, decoded.Value.granularity)).AppendLine();
sb.AppendFormat(Core.Device_needs_a_block_size_granularity_of_pow_0_1_bytes, decoded.Value.granularity,
Math.Pow(2, decoded.Value.granularity)).AppendLine();
}
return sb.ToString();

View File

@@ -112,28 +112,29 @@ public static class DensitySupport
foreach(DensitySupportDescriptor descriptor in decoded.descriptors)
{
sb.AppendFormat("Density \"{0}\" defined by \"{1}\".", descriptor.name, descriptor.organization).
AppendLine();
sb.AppendFormat(Localization.Density_0_defined_by_1, descriptor.name, descriptor.organization).AppendLine();
sb.AppendFormat("\tPrimary code: {0:X2}h", descriptor.primaryCode).AppendLine();
sb.AppendFormat("\t" + Localization.Primary_code_0, descriptor.primaryCode).AppendLine();
if(descriptor.primaryCode != descriptor.secondaryCode)
sb.AppendFormat("\tSecondary code: {0:X2}h", descriptor.secondaryCode).AppendLine();
sb.AppendFormat("\t" + Localization.Secondary_code_0, descriptor.secondaryCode).AppendLine();
if(descriptor.writable)
sb.AppendLine("\tDrive can write this density");
sb.AppendLine("\t" + Localization.Drive_can_write_this_density);
if(descriptor.duplicate)
sb.AppendLine("\tThis descriptor is duplicated");
sb.AppendLine("\t" + Localization.This_descriptor_is_duplicated);
if(descriptor.defaultDensity)
sb.AppendLine("\tThis is the default density on the drive");
sb.AppendLine("\t" + Localization.This_is_the_default_density_on_the_drive);
sb.AppendFormat("\tDensity has {0} bits per mm, with {1} tracks in a {2} mm width tape", descriptor.bpmm,
descriptor.tracks, descriptor.width / (double)10).AppendLine();
sb.AppendFormat("\t" + Localization.Density_has_0_bits_per_mm__with_1_tracks_in_a_2_mm_width_tape,
descriptor.bpmm, descriptor.tracks, descriptor.width / (double)10).AppendLine();
sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine();
sb.AppendFormat("\tDensity description: {0}", descriptor.description).AppendLine();
sb.AppendFormat("\t" + Localization.Density_maximum_capacity_is_0_megabytes, descriptor.capacity).
AppendLine();
sb.AppendFormat("\t" + Localization.Density_description_0, descriptor.description).AppendLine();
sb.AppendLine();
}
@@ -209,14 +210,14 @@ public static class DensitySupport
foreach(MediaTypeSupportDescriptor descriptor in decoded.descriptors)
{
sb.AppendFormat("Medium type \"{0}\" defined by \"{1}\".", descriptor.name, descriptor.organization).
sb.AppendFormat(Localization.Medium_type_0_defined_by_1, descriptor.name, descriptor.organization).
AppendLine();
sb.AppendFormat("\tMedium type code: {0:X2}h", descriptor.mediumType).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_type_code_0, descriptor.mediumType).AppendLine();
if(descriptor.numberOfCodes > 0)
{
sb.AppendFormat("\tMedium supports following density codes:");
sb.AppendFormat("\t" + Localization.Medium_supports_following_density_codes);
for(int i = 0; i < descriptor.numberOfCodes; i++)
sb.AppendFormat(" {0:X2}h", descriptor.densityCodes[i]);
@@ -224,10 +225,10 @@ public static class DensitySupport
sb.AppendLine();
}
sb.AppendFormat("\tMedium has a nominal length of {0} m in a {1} mm width tape", descriptor.length,
descriptor.width / (double)10).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_has_a_nominal_length_of_0_m_in_a_1_mm_width_tape,
descriptor.length, descriptor.width / (double)10).AppendLine();
sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine();
sb.AppendFormat("\t" + Localization.Medium_description_0, descriptor.description).AppendLine();
sb.AppendLine();
}

View File

@@ -362,8 +362,10 @@ public static class Sense
return null;
return sense.Value.AddressValid
? $"Error class {sense.Value.ErrorClass} type {sense.Value.ErrorType} happened on block {
sense.Value.LBA}\n" : $"Error class {sense.Value.ErrorClass} type {sense.Value.ErrorType}\n";
? string.Format(Localization.Error_class_0_type_1_happened_on_block_2 + "\n", sense.Value.ErrorClass,
sense.Value.ErrorType, sense.Value.LBA)
: string.Format(Localization.Error_class_0_type_1 + "\n", sense.Value.ErrorClass,
sense.Value.ErrorType);
}
public static string PrettifySense(FixedSense? sense)
@@ -375,22 +377,22 @@ public static class Sense
var sb = new StringBuilder();
sb.AppendFormat("SCSI SENSE: {0}", GetSenseKey(decoded.SenseKey)).AppendLine();
sb.AppendFormat(Localization.SCSI_SENSE_0, GetSenseKey(decoded.SenseKey)).AppendLine();
if(decoded.SegmentNumber > 0)
sb.AppendFormat("On segment {0}", decoded.SegmentNumber).AppendLine();
sb.AppendFormat(Localization.On_segment_0, decoded.SegmentNumber).AppendLine();
if(decoded.Filemark)
sb.AppendLine("Filemark or setmark found");
sb.AppendLine(Localization.Filemark_or_setmark_found);
if(decoded.EOM)
sb.AppendLine("End-of-medium/partition found");
sb.AppendLine(Localization.End_of_medium_partition_found);
if(decoded.ILI)
sb.AppendLine("Incorrect length indicator");
sb.AppendLine(Localization.Incorrect_length_indicator);
if(decoded.InformationValid)
sb.AppendFormat("On logical block {0}", decoded.Information).AppendLine();
sb.AppendFormat(Localization.On_logical_block_0, decoded.Information).AppendLine();
if(decoded.AdditionalLength < 6)
return sb.ToString();
@@ -407,28 +409,28 @@ public static class Sense
{
case SenseKeys.IllegalRequest:
{
sb.AppendLine((decoded.SenseKeySpecific & 0x400000) == 0x400000 ? "Illegal field in CDB"
: "Illegal field in data parameters");
sb.AppendLine((decoded.SenseKeySpecific & 0x400000) == 0x400000 ? Localization.Illegal_field_in_CDB
: Localization.Illegal_field_in_data_parameters);
if((decoded.SenseKeySpecific & 0x200000) == 0x200000)
sb.AppendFormat("Invalid value in bit {0} in field {1} of CDB",
sb.AppendFormat(Localization.Invalid_value_in_bit_0_in_field_1_of_CDB,
(decoded.SenseKeySpecific & 0x70000) >> 16, decoded.SenseKeySpecific & 0xFFFF).
AppendLine();
else
sb.AppendFormat("Invalid value in field {0} of CDB", decoded.SenseKeySpecific & 0xFFFF).
sb.AppendFormat(Localization.Invalid_value_in_field_0_of_CDB, decoded.SenseKeySpecific & 0xFFFF).
AppendLine();
}
break;
case SenseKeys.NotReady:
sb.AppendFormat("Format progress {0:P}", (double)(decoded.SenseKeySpecific & 0xFFFF) / 65536).
sb.AppendFormat(Localization.Format_progress_0, (double)(decoded.SenseKeySpecific & 0xFFFF) / 65536).
AppendLine();
break;
case SenseKeys.RecoveredError:
case SenseKeys.HardwareError:
case SenseKeys.MediumError:
sb.AppendFormat("Actual retry count is {0}", decoded.SenseKeySpecific & 0xFFFF).AppendLine();
sb.AppendFormat(Localization.Actual_retry_count_is_0, decoded.SenseKeySpecific & 0xFFFF).AppendLine();
break;
}
@@ -445,7 +447,7 @@ public static class Sense
var sb = new StringBuilder();
sb.AppendFormat("SCSI SENSE: {0}", GetSenseKey(decoded.SenseKey)).AppendLine();
sb.AppendFormat(Localization.SCSI_SENSE_0, GetSenseKey(decoded.SenseKey)).AppendLine();
sb.AppendLine(GetSenseDescription(decoded.ASC, decoded.ASCQ));
if(decoded.Descriptors == null ||
@@ -588,7 +590,8 @@ public static class Sense
public static void DecodeDescriptor0D(byte[] descriptor) => throw new NotImplementedException("Check SBC-3");
public static string PrettifyDescriptor00(ulong information) => $"On logical block {information}\n";
public static string PrettifyDescriptor00(ulong information) =>
string.Format(Localization.Sense_PrettifyDescriptor00_On_logical_block_0 + "\n", information);
public static string PrettifyDescriptor00(byte[] descriptor) =>
PrettifyDescriptor00(DecodeDescriptor00(descriptor));
@@ -1991,10 +1994,11 @@ public static class Sense
}
return ASC >= 0x80
? ASCQ >= 0x80 ? $"VENDOR-SPECIFIC ASC {ASC:X2}h WITH VENDOR-SPECIFIC ASCQ {ASCQ:X2}h"
: $"VENDOR-SPECIFIC ASC {ASC:X2}h WITH ASCQ {ASCQ:X2}h"
? ASCQ >= 0x80
? string.Format(Localization.VENDOR_SPECIFIC_ASC_0_WITH_VENDOR_SPECIFIC_ASCQ_1, ASC, ASCQ)
: string.Format(Localization.VENDOR_SPECIFIC_ASC_0_WITH_ASCQ_1, ASC, ASCQ)
: ASCQ >= 0x80
? $"ASC {ASC:X2}h WITH VENDOR-SPECIFIC ASCQ {ASCQ:X2}h"
: $"ASC {ASC:X2}h WITH ASCQ {ASCQ:X2}h";
? string.Format(Localization.ASC_0_WITH_VENDOR_SPECIFIC_ASCQ_1, ASC, ASCQ)
: string.Format(Localization.ASC_0_WITH_ASCQ_1, ASC, ASCQ);
}
}

View File

@@ -104,20 +104,20 @@ public static partial class Decoders
var sb = new StringBuilder();
sb.AppendLine("SecureDigital Device Identification Register:");
sb.AppendFormat("\tManufacturer: {0}", VendorString.Prettify(cid.Manufacturer)).AppendLine();
sb.AppendFormat("\tApplication ID: {0}", cid.ApplicationID).AppendLine();
sb.AppendFormat("\tProduct name: {0}", cid.ProductName).AppendLine();
sb.AppendLine(Localization.SecureDigital_Device_Identification_Register);
sb.AppendFormat(Localization.Manufacturer_0, VendorString.Prettify(cid.Manufacturer)).AppendLine();
sb.AppendFormat(Localization.Application_ID_0, cid.ApplicationID).AppendLine();
sb.AppendFormat(Localization.Product_name_0, cid.ProductName).AppendLine();
sb.AppendFormat("\tProduct revision: {0:X2}.{1:X2}", (cid.ProductRevision & 0xF0) >> 4,
sb.AppendFormat(Localization.Product_revision_0_1, (cid.ProductRevision & 0xF0) >> 4,
cid.ProductRevision & 0x0F).AppendLine();
sb.AppendFormat("\tProduct serial number: {0}", cid.ProductSerialNumber).AppendLine();
sb.AppendFormat(Localization.Product_serial_number_0, cid.ProductSerialNumber).AppendLine();
sb.AppendFormat("\tDevice manufactured month {0} of {1}", (cid.ManufacturingDate & 0xF00) >> 8,
(cid.ManufacturingDate & 0xFF) + 2000).AppendLine();
sb.AppendFormat(Localization.Device_manufactured_month_0_of_1, (cid.ManufacturingDate & 0xF00) >> 8,
(cid.ManufacturingDate & 0xFF) + 2000).AppendLine();
sb.AppendFormat("\tCID CRC: 0x{0:X2}", cid.CRC).AppendLine();
sb.AppendFormat(Localization.CID_CRC_0, cid.CRC).AppendLine();
return sb.ToString();
}

View File

@@ -151,16 +151,16 @@ public static partial class Decoders
string unit = "";
var sb = new StringBuilder();
sb.AppendLine("SecureDigital Device Specific Data Register:");
sb.AppendLine(Localization.SecureDigital_Device_Specific_Data_Register);
switch(csd.Structure)
{
case 0:
sb.AppendLine("\tRegister version 1.0");
sb.AppendLine("\t" + Localization.Register_version_1_0);
break;
case 1:
sb.AppendLine("\tRegister version 2.0");
sb.AppendLine("\t" + Localization.Register_version_2_0);
break;
}
@@ -168,42 +168,42 @@ public static partial class Decoders
switch(csd.TAAC & 0x07)
{
case 0:
unit = "ns";
unit = Localization.unit_ns;
unitFactor = 1;
break;
case 1:
unit = "ns";
unit = Localization.unit_ns;
unitFactor = 10;
break;
case 2:
unit = "ns";
unit = Localization.unit_ns;
unitFactor = 100;
break;
case 3:
unit = "μs";
unit = Localization.unit_μs;
unitFactor = 1;
break;
case 4:
unit = "μs";
unit = Localization.unit_μs;
unitFactor = 10;
break;
case 5:
unit = "μs";
unit = Localization.unit_μs;
unitFactor = 100;
break;
case 6:
unit = "ms";
unit = Localization.unit_ms;
unitFactor = 1;
break;
case 7:
unit = "ms";
unit = Localization.unit_ms;
unitFactor = 10;
break;
@@ -231,11 +231,12 @@ public static partial class Decoders
};
double result = unitFactor * multiplier;
sb.AppendFormat("\tAsynchronous data access time is {0}{1}", result, unit).AppendLine();
sb.AppendFormat("\t" + Localization.Asynchronous_data_access_time_is_0_1, result, unit).AppendLine();
sb.AppendFormat("\tClock dependent part of data access is {0} clock cycles", csd.NSAC * 100).AppendLine();
sb.AppendFormat("\t" + Localization.Clock_dependent_part_of_data_access_is_0_clock_cycles, csd.NSAC * 100).
AppendLine();
unit = "MBit/s";
unit = Localization.MBit_s;
switch(csd.Speed & 0x07)
{
@@ -256,7 +257,7 @@ public static partial class Decoders
break;
default:
unit = "unknown";
unit = Localization.unit_unknown;
unitFactor = 0;
break;
@@ -284,7 +285,7 @@ public static partial class Decoders
};
result = unitFactor * multiplier;
sb.AppendFormat("\tDevice's transfer speed: {0}{1}", result, unit).AppendLine();
sb.AppendFormat("\t" + Localization.Device_transfer_speed_0_1, result, unit).AppendLine();
unit = "";
@@ -292,73 +293,75 @@ public static partial class Decoders
if((csd.Classes & mask) == mask)
unit += $" {cl}";
sb.AppendFormat("\tDevice support command classes {0}", unit).AppendLine();
sb.AppendFormat("\tRead block length is {0} bytes", Math.Pow(2, csd.ReadBlockLength)).AppendLine();
sb.AppendFormat("\t" + Localization.Device_support_command_classes_0, unit).AppendLine();
sb.AppendFormat("\t" + Localization.Read_block_length_is_0_bytes, Math.Pow(2, csd.ReadBlockLength)).
AppendLine();
if(csd.ReadsPartialBlocks)
sb.AppendLine("\tDevice allows reading partial blocks");
sb.AppendLine("\t" + Localization.Device_allows_reading_partial_blocks);
if(csd.WriteMisalignment)
sb.AppendLine("\tWrite commands can cross physical block boundaries");
sb.AppendLine("\t" + Localization.Write_commands_can_cross_physical_block_boundaries);
if(csd.ReadMisalignment)
sb.AppendLine("\tRead commands can cross physical block boundaries");
sb.AppendLine("\t" + Localization.Read_commands_can_cross_physical_block_boundaries);
if(csd.DSRImplemented)
sb.AppendLine("\tDevice implements configurable driver stage");
sb.AppendLine("\t" + Localization.Device_implements_configurable_driver_stage);
if(csd.Structure == 0)
{
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2);
sb.AppendFormat("\tDevice has {0} blocks", (int)result).AppendLine();
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2);
sb.AppendFormat("\t" + Localization.Device_has_0_blocks, (int)result).AppendLine();
result = (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2) * Math.Pow(2, csd.ReadBlockLength);
switch(result)
{
case > 1073741824:
sb.AppendFormat("\tDevice has {0} GiB", result / 1073741824.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_GiB, result / 1073741824.0).AppendLine();
break;
case > 1048576:
sb.AppendFormat("\tDevice has {0} MiB", result / 1048576.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_MiB, result / 1048576.0).AppendLine();
break;
case > 1024:
sb.AppendFormat("\tDevice has {0} KiB", result / 1024.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_KiB, result / 1024.0).AppendLine();
break;
default:
sb.AppendFormat("\tDevice has {0} bytes", result).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_bytes, result).AppendLine();
break;
}
}
else
{
sb.AppendFormat("\tDevice has {0} blocks", (csd.Size + 1) * 1024).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_blocks, (csd.Size + 1) * 1024).AppendLine();
result = ((ulong)csd.Size + 1) * 1024 * 512;
switch(result)
{
case > 1099511627776:
sb.AppendFormat("\tDevice has {0} TiB", result / 1099511627776.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_TiB, result / 1099511627776.0).AppendLine();
break;
case > 1073741824:
sb.AppendFormat("\tDevice has {0} GiB", result / 1073741824.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_GiB, result / 1073741824.0).AppendLine();
break;
case > 1048576:
sb.AppendFormat("\tDevice has {0} MiB", result / 1048576.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_MiB, result / 1048576.0).AppendLine();
break;
case > 1024:
sb.AppendFormat("\tDevice has {0} KiB", result / 1024.0).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_KiB, result / 1024.0).AppendLine();
break;
default:
sb.AppendFormat("\tDevice has {0} bytes", result).AppendLine();
sb.AppendFormat("\t" + Localization.Device_has_0_bytes, result).AppendLine();
break;
}
@@ -369,35 +372,35 @@ public static partial class Decoders
switch(csd.ReadCurrentAtVddMin & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 0.5mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_0_5mA_for_reading_at_minimum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 1mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_reading_at_minimum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 5mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_reading_at_minimum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 10mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_reading_at_minimum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 25mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_reading_at_minimum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 35mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_reading_at_minimum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 60mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_60mA_for_reading_at_minimum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 100mA for reading at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_100mA_for_reading_at_minimum_voltage);
break;
}
@@ -405,35 +408,35 @@ public static partial class Decoders
switch(csd.ReadCurrentAtVddMax & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 1mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_reading_at_maximum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 5mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_reading_at_maximum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 10mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_reading_at_maximum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 25mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_reading_at_maximum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 35mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_reading_at_maximum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 45mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_45mA_for_reading_at_maximum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 80mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_80mA_for_reading_at_maximum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 200mA for reading at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_200mA_for_reading_at_maximum_voltage);
break;
}
@@ -441,35 +444,35 @@ public static partial class Decoders
switch(csd.WriteCurrentAtVddMin & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 0.5mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_0_5mA_for_writing_at_minimum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 1mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_writing_at_minimum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 5mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_writing_at_minimum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 10mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_writing_at_minimum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 25mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_writing_at_minimum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 35mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_writing_at_minimum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 60mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_60mA_for_writing_at_minimum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 100mA for writing at minimum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_100mA_for_writing_at_minimum_voltage);
break;
}
@@ -477,101 +480,104 @@ public static partial class Decoders
switch(csd.WriteCurrentAtVddMax & 0x07)
{
case 0:
sb.AppendLine("\tDevice uses a maximum of 1mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_1mA_for_writing_at_maximum_voltage);
break;
case 1:
sb.AppendLine("\tDevice uses a maximum of 5mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_5mA_for_writing_at_maximum_voltage);
break;
case 2:
sb.AppendLine("\tDevice uses a maximum of 10mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_10mA_for_writing_at_maximum_voltage);
break;
case 3:
sb.AppendLine("\tDevice uses a maximum of 25mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_25mA_for_writing_at_maximum_voltage);
break;
case 4:
sb.AppendLine("\tDevice uses a maximum of 35mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_35mA_for_writing_at_maximum_voltage);
break;
case 5:
sb.AppendLine("\tDevice uses a maximum of 45mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_45mA_for_writing_at_maximum_voltage);
break;
case 6:
sb.AppendLine("\tDevice uses a maximum of 80mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_80mA_for_writing_at_maximum_voltage);
break;
case 7:
sb.AppendLine("\tDevice uses a maximum of 200mA for writing at maximum voltage");
sb.AppendLine("\t" + Localization.Device_uses_a_maximum_of_200mA_for_writing_at_maximum_voltage);
break;
}
if(csd.EraseBlockEnable)
sb.AppendLine("\tDevice can erase multiple blocks");
sb.AppendLine("\t" + Localization.Device_can_erase_multiple_blocks);
// TODO: Check specification
sb.AppendFormat("\tDevice must erase a minimum of {0} blocks at a time",
sb.AppendFormat("\t" + Localization.Device_must_erase_a_minimum_of_0_blocks_at_a_time,
Convert.ToUInt32(csd.EraseSectorSize) + 1).AppendLine();
if(csd.WriteProtectGroupEnable)
{
sb.AppendLine("\tDevice can write protect regions");
sb.AppendLine("\t" + Localization.Device_can_write_protect_regions);
// TODO: Check specification
// unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize);
sb.AppendFormat("\tDevice can write protect a minimum of {0} blocks at a time", (int)(result + 1)).
AppendLine();
sb.AppendFormat("\t" + Localization.Device_can_write_protect_a_minimum_of_0_blocks_at_a_time,
(int)(result + 1)).AppendLine();
}
else
sb.AppendLine("\tDevice can't write protect regions");
sb.AppendLine("\t" + Localization.Device_cant_write_protect_regions);
}
sb.AppendFormat("\tWriting is {0} times slower than reading", Math.Pow(2, csd.WriteSpeedFactor)).AppendLine();
sb.AppendFormat("\t" + Localization.Writing_is_0_times_slower_than_reading, Math.Pow(2, csd.WriteSpeedFactor)).
AppendLine();
sb.AppendFormat("\tWrite block length is {0} bytes", Math.Pow(2, csd.WriteBlockLength)).AppendLine();
sb.AppendFormat("\t" + Localization.Write_block_length_is_0_bytes, Math.Pow(2, csd.WriteBlockLength)).
AppendLine();
if(csd.WritesPartialBlocks)
sb.AppendLine("\tDevice allows writing partial blocks");
sb.AppendLine("\t" + Localization.Device_allows_writing_partial_blocks);
if(!csd.Copy)
sb.AppendLine("\tDevice contents are original");
sb.AppendLine("\t" + Localization.Device_contents_are_original);
if(csd.PermanentWriteProtect)
sb.AppendLine("\tDevice is permanently write protected");
sb.AppendLine("\t" + Localization.Device_is_permanently_write_protected);
if(csd.TemporaryWriteProtect)
sb.AppendLine("\tDevice is temporarily write protected");
sb.AppendLine("\t" + Localization.Device_is_temporarily_write_protected);
if(!csd.FileFormatGroup)
switch(csd.FileFormat)
{
case 0:
sb.AppendLine("\tDevice is formatted like a hard disk");
sb.AppendLine("\t" + Localization.Device_is_formatted_like_a_hard_disk);
break;
case 1:
sb.AppendLine("\tDevice is formatted like a floppy disk using Microsoft FAT");
sb.AppendLine("\t" + Localization.Device_is_formatted_like_a_floppy_disk_using_Microsoft_FAT);
break;
case 2:
sb.AppendLine("\tDevice uses Universal File Format");
sb.AppendLine("\t" + Localization.Device_uses_Universal_File_Format);
break;
default:
sb.AppendFormat("\tDevice uses unknown file format code {0}", csd.FileFormat).AppendLine();
sb.AppendFormat("\t" + Localization.Device_uses_unknown_file_format_code_0, csd.FileFormat).
AppendLine();
break;
}
else
sb.AppendFormat("\tDevice uses unknown file format code {0} and file format group 1", csd.FileFormat).
AppendLine();
sb.AppendFormat("\t" + Localization.Device_uses_unknown_file_format_code_0_and_file_format_group_1,
csd.FileFormat).AppendLine();
sb.AppendFormat("\tCSD CRC: 0x{0:X2}", csd.CRC).AppendLine();
sb.AppendFormat("\t" + Localization.CSD_CRC_0, csd.CRC).AppendLine();
return sb.ToString();
}

View File

@@ -93,46 +93,46 @@ public static partial class Decoders
return null;
var sb = new StringBuilder();
sb.AppendLine("SecureDigital Operation Conditions Register:");
sb.AppendLine(Localization.SecureDigital_Operation_Conditions_Register);
if(!ocr.PowerUp)
sb.AppendLine("\tDevice is powering up");
sb.AppendLine("\t" + Localization.Device_is_powering_up);
if(ocr.CCS)
sb.AppendLine("\tDevice is SDHC, SDXC or higher");
sb.AppendLine("\t" + Localization.Device_is_SDHC_SDXC_or_higher);
if(ocr.UHS)
sb.AppendLine("\tDevice is UHS-II or higher");
sb.AppendLine("\t" + Localization.Device_is_UHS_II_or_higher);
if(ocr.ThreeFive)
sb.AppendLine("\tDevice can work with supply 3.5~3.6V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_5_3_6V);
if(ocr.ThreeFour)
sb.AppendLine("\tDevice can work with supply 3.4~3.5V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_4_3_5V);
if(ocr.ThreeThree)
sb.AppendLine("\tDevice can work with supply 3.3~3.4V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_3_3_4V);
if(ocr.ThreeTwo)
sb.AppendLine("\tDevice can work with supply 3.2~3.3V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_2_3_3V);
if(ocr.ThreeOne)
sb.AppendLine("\tDevice can work with supply 3.1~3.2V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_3_1_3_2V);
if(ocr.TwoNine)
sb.AppendLine("\tDevice can work with supply 2.9~3.0V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_9_3_0V);
if(ocr.TwoEight)
sb.AppendLine("\tDevice can work with supply 2.8~2.9V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_8_2_9V);
if(ocr.TwoSeven)
sb.AppendLine("\tDevice can work with supply 2.7~2.8V");
sb.AppendLine("\t" + Localization.Device_can_work_with_supply_2_7_2_8V);
if(ocr.OneEight)
sb.AppendLine("\tDevice can switch to work with 1.8V supply");
sb.AppendLine("\t" + Localization.Device_can_switch_to_work_with_1_8V_supply);
if(ocr.LowPower)
sb.AppendLine("\tDevice is in low power mode");
sb.AppendLine("\t" + Localization.Device_is_in_low_power_mode);
return sb.ToString();
}

View File

@@ -115,50 +115,59 @@ public static partial class Decoders
return null;
var sb = new StringBuilder();
sb.AppendLine("SecureDigital Device Configuration Register:");
sb.AppendLine(Localization.SecureDigital_Device_Configuration_Register);
if(scr.Structure != 0)
sb.AppendFormat("\tUnknown register version {0}", scr.Structure).AppendLine();
sb.AppendFormat("\t" + Localization.Unknown_register_version_0, scr.Structure).AppendLine();
switch(scr.Spec)
{
case 0 when scr.Spec3 == false && scr.Spec4 == false && scr.SpecX == 0:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 1.0x");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_1_0x);
break;
case 1 when scr.Spec3 == false && scr.Spec4 == false && scr.SpecX == 0:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 1.10");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_1_10);
break;
case 2 when scr.Spec3 == false && scr.Spec4 == false && scr.SpecX == 0:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 2.00");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_2_00);
break;
case 2 when scr.Spec3 && scr.Spec4 == false && scr.SpecX == 0:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 3.0x");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_3_0x);
break;
case 2 when scr.Spec3 && scr.Spec4 && scr.SpecX == 0:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 4.xx");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_4_xx);
break;
case 2 when scr.Spec3:
switch(scr.SpecX)
{
case 1:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 5.xx");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_5_xx);
break;
case 2:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 6.xx");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_6_xx);
break;
case 3:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 7.xx");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_7_xx);
break;
case 4:
sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 8.xx");
sb.AppendLine("\t" + Localization.
Device_follows_SecureDigital_Physical_Layer_Specification_version_8_xx);
break;
}
@@ -166,7 +175,7 @@ public static partial class Decoders
break;
default:
sb.
AppendFormat("\tDevice follows SecureDigital Physical Layer Specification with unknown version {0}.{1}.{2}.{3}",
AppendFormat("\t" + Localization.Device_follows_SecureDigital_Physical_Layer_Specification_with_unknown_version_0_1_2_3,
scr.Spec, scr.Spec3, scr.Spec4, scr.SpecX).AppendLine();
break;
@@ -175,51 +184,52 @@ public static partial class Decoders
switch(scr.Security)
{
case 0:
sb.AppendLine("\tDevice does not support CPRM");
sb.AppendLine("\t" + Localization.Device_does_not_support_CPRM);
break;
case 1:
sb.AppendLine("\tDevice does not use CPRM");
sb.AppendLine("\t" + Localization.Device_does_not_use_CPRM);
break;
case 2:
sb.AppendLine("\tDevice uses CPRM according to specification version 1.01");
sb.AppendLine("\t" + Localization.Device_uses_CPRM_according_to_specification_version_1_01);
break;
case 3:
sb.AppendLine("\tDevice uses CPRM according to specification version 2.00");
sb.AppendLine("\t" + Localization.Device_uses_CPRM_according_to_specification_version_2_00);
break;
case 4:
sb.AppendLine("\tDevice uses CPRM according to specification version 3.xx");
sb.AppendLine("\t" + Localization.Device_uses_CPRM_according_to_specification_version_3_xx);
break;
default:
sb.AppendFormat("\tDevice uses unknown CPRM specification with code {0}", scr.Security).AppendLine();
sb.AppendFormat("\t" + Localization.Device_uses_unknown_CPRM_specification_with_code_0, scr.Security).
AppendLine();
break;
}
if(scr.BusWidth.HasFlag(BusWidth.OneBit))
sb.AppendLine("\tDevice supports 1-bit data bus");
sb.AppendLine("\t" + Localization.Device_supports_1_bit_data_bus);
if(scr.BusWidth.HasFlag(BusWidth.FourBit))
sb.AppendLine("\tDevice supports 4-bit data bus");
sb.AppendLine("\t" + Localization.Device_supports_4_bit_data_bus);
if(scr.ExtendedSecurity != 0)
sb.AppendLine("\tDevice supports extended security");
sb.AppendLine("\t" + Localization.Device_supports_extended_security);
if(scr.CommandSupport.HasFlag(CommandSupport.ExtensionRegisterMultiBlock))
sb.AppendLine("\tDevice supports extension register multi-block commands");
sb.AppendLine("\t" + Localization.Device_supports_extension_register_multi_block_commands);
if(scr.CommandSupport.HasFlag(CommandSupport.ExtensionRegisterSingleBlock))
sb.AppendLine("\tDevice supports extension register single-block commands");
sb.AppendLine("\t" + Localization.Device_supports_extension_register_single_block_commands);
if(scr.CommandSupport.HasFlag(CommandSupport.SetBlockCount))
sb.AppendLine("\tDevice supports set block count command");
sb.AppendLine("\t" + Localization.Device_supports_set_block_count_command);
if(scr.CommandSupport.HasFlag(CommandSupport.SpeedClassControl))
sb.AppendLine("\tDevice supports speed class control command");
sb.AppendLine("\t" + Localization.Device_supports_speed_class_control_command);
return sb.ToString();
}

View File

@@ -45,6 +45,6 @@ public static class VendorString
0x03 => "Sandisk",
0x27 => "CnMemory",
0xAA => "QEMU",
_ => $"Unknown manufacturer ID 0x{sdVendorId:X2}"
_ => string.Format(Localization.Unknown_manufacturer_ID_0, sdVendorId)
};
}

View File

@@ -36,6 +36,7 @@ using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using Aaru.Console;
using Aaru.Localization;
using Marshal = Aaru.Helpers.Marshal;
namespace Aaru.Decoders.Sega;
@@ -132,7 +133,7 @@ public static class CD
var IPBinInformation = new StringBuilder();
IPBinInformation.AppendLine("--------------------------------");
IPBinInformation.AppendLine("SEGA IP.BIN INFORMATION:");
IPBinInformation.AppendLine(Localization.SEGA_IP_BIN_INFORMATION);
IPBinInformation.AppendLine("--------------------------------");
// Decoding all data
@@ -172,119 +173,124 @@ public static class CD
}
*/
IPBinInformation.AppendFormat("Volume name: {0}", Encoding.ASCII.GetString(ipbin.volume_name)).AppendLine();
IPBinInformation.AppendFormat(Core.Volume_name_0, Encoding.ASCII.GetString(ipbin.volume_name)).AppendLine();
//IPBinInformation.AppendFormat("Volume version: {0}", Encoding.ASCII.GetString(ipbin.volume_version)).AppendLine();
//IPBinInformation.AppendFormat("{0}", Encoding.ASCII.GetString(ipbin.volume_type)).AppendLine();
IPBinInformation.AppendFormat("System name: {0}", Encoding.ASCII.GetString(ipbin.system_name)).AppendLine();
IPBinInformation.AppendFormat(Localization.System_name_0, Encoding.ASCII.GetString(ipbin.system_name)).
AppendLine();
//IPBinInformation.AppendFormat("System version: {0}", Encoding.ASCII.GetString(ipbin.system_version)).AppendLine();
IPBinInformation.AppendFormat("Initial program address: 0x{0:X8}", ipbin.ip_address).AppendLine();
IPBinInformation.AppendFormat("Initial program load size: {0} bytes", ipbin.ip_loadsize).AppendLine();
IPBinInformation.AppendFormat(Localization.Initial_program_address_0, ipbin.ip_address).AppendLine();
IPBinInformation.AppendFormat(Localization.Initial_program_load_size_0, ipbin.ip_loadsize).AppendLine();
IPBinInformation.AppendFormat("Initial program entry address: 0x{0:X8}", ipbin.ip_entry_address).AppendLine();
IPBinInformation.AppendFormat(Localization.Initial_program_entry_address_0, ipbin.ip_entry_address).
AppendLine();
IPBinInformation.AppendFormat("Initial program work RAM: {0} bytes", ipbin.ip_work_ram_size).AppendLine();
IPBinInformation.AppendFormat("System program address: 0x{0:X8}", ipbin.sp_address).AppendLine();
IPBinInformation.AppendFormat("System program load size: {0} bytes", ipbin.sp_loadsize).AppendLine();
IPBinInformation.AppendFormat(Localization.Initial_program_work_RAM_0, ipbin.ip_work_ram_size).AppendLine();
IPBinInformation.AppendFormat(Localization.System_program_address_0, ipbin.sp_address).AppendLine();
IPBinInformation.AppendFormat(Localization.System_program_load_size_0, ipbin.sp_loadsize).AppendLine();
IPBinInformation.AppendFormat("System program entry address: 0x{0:X8}", ipbin.sp_entry_address).AppendLine();
IPBinInformation.AppendFormat(Localization.System_program_entry_address_0, ipbin.sp_entry_address).AppendLine();
IPBinInformation.AppendFormat("System program work RAM: {0} bytes", ipbin.sp_work_ram_size).AppendLine();
IPBinInformation.AppendFormat(Localization.System_program_work_RAM_0, ipbin.sp_work_ram_size).AppendLine();
if(ipbindate != DateTime.MinValue)
IPBinInformation.AppendFormat("Release date: {0}", ipbindate).AppendLine();
IPBinInformation.AppendFormat(Localization.Release_date_0, ipbindate).AppendLine();
//IPBinInformation.AppendFormat("Release date (other format): {0}", Encoding.ASCII.GetString(release_date2)).AppendLine();
IPBinInformation.AppendFormat("Hardware ID: {0}", Encoding.ASCII.GetString(ipbin.hardware_id)).AppendLine();
IPBinInformation.AppendFormat("Developer code: {0}", Encoding.ASCII.GetString(ipbin.developer_code)).
IPBinInformation.AppendFormat(Localization.Hardware_ID_0, Encoding.ASCII.GetString(ipbin.hardware_id)).
AppendLine();
IPBinInformation.AppendFormat("Domestic title: {0}", Encoding.ASCII.GetString(ipbin.domestic_title)).
IPBinInformation.AppendFormat(Localization.Developer_code_0, Encoding.ASCII.GetString(ipbin.developer_code)).
AppendLine();
IPBinInformation.AppendFormat("Overseas title: {0}", Encoding.ASCII.GetString(ipbin.overseas_title)).
IPBinInformation.AppendFormat(Localization.Domestic_title_0, Encoding.ASCII.GetString(ipbin.domestic_title)).
AppendLine();
IPBinInformation.AppendFormat("Product code: {0}", Encoding.ASCII.GetString(ipbin.product_code)).AppendLine();
IPBinInformation.AppendFormat(Localization.Overseas_title_0, Encoding.ASCII.GetString(ipbin.overseas_title)).
AppendLine();
IPBinInformation.AppendFormat("Peripherals:").AppendLine();
IPBinInformation.AppendFormat(Localization.Product_code_0, Encoding.ASCII.GetString(ipbin.product_code)).
AppendLine();
IPBinInformation.AppendFormat(Localization.Peripherals).AppendLine();
foreach(byte peripheral in ipbin.peripherals)
switch((char)peripheral)
{
case 'A':
IPBinInformation.AppendLine("Game supports analog controller.");
IPBinInformation.AppendLine(Localization.Game_supports_analog_controller);
break;
case 'B':
IPBinInformation.AppendLine("Game supports trackball.");
IPBinInformation.AppendLine(Localization.Game_supports_trackball);
break;
case 'G':
IPBinInformation.AppendLine("Game supports light gun.");
IPBinInformation.AppendLine(Localization.Game_supports_light_gun);
break;
case 'J':
IPBinInformation.AppendLine("Game supports JoyPad.");
IPBinInformation.AppendLine(Localization.Game_supports_JoyPad);
break;
case 'K':
IPBinInformation.AppendLine("Game supports keyboard.");
IPBinInformation.AppendLine(Localization.Game_supports_keyboard);
break;
case 'M':
IPBinInformation.AppendLine("Game supports mouse.");
IPBinInformation.AppendLine(Localization.Game_supports_mouse);
break;
case 'O':
IPBinInformation.AppendLine("Game supports Master System's JoyPad.");
IPBinInformation.AppendLine(Localization.Game_supports_Master_System_JoyPad);
break;
case 'P':
IPBinInformation.AppendLine("Game supports printer interface.");
IPBinInformation.AppendLine(Localization.Game_supports_printer_interface);
break;
case 'R':
IPBinInformation.AppendLine("Game supports serial (RS-232C) interface.");
IPBinInformation.AppendLine(Localization.Game_supports_serial_RS_232C_interface);
break;
case 'T':
IPBinInformation.AppendLine("Game supports tablet interface.");
IPBinInformation.AppendLine(Localization.Game_supports_tablet_interface);
break;
case 'V':
IPBinInformation.AppendLine("Game supports paddle controller.");
IPBinInformation.AppendLine(Localization.Game_supports_paddle_controller);
break;
case ' ': break;
default:
IPBinInformation.AppendFormat("Game supports unknown peripheral {0}.", peripheral).AppendLine();
IPBinInformation.AppendFormat(Localization.Game_supports_unknown_peripheral_0, peripheral).
AppendLine();
break;
}
IPBinInformation.AppendLine("Regions supported:");
IPBinInformation.AppendLine(Localization.Regions_supported);
foreach(byte region in ipbin.region_codes)
switch((char)region)
{
case 'J':
IPBinInformation.AppendLine("Japanese NTSC.");
IPBinInformation.AppendLine(Localization.Japanese_NTSC);
break;
case 'U':
IPBinInformation.AppendLine("USA NTSC.");
IPBinInformation.AppendLine(Localization.USA_NTSC);
break;
case 'E':
IPBinInformation.AppendLine("Europe PAL.");
IPBinInformation.AppendLine(Localization.Europe_PAL);
break;
case ' ': break;
default:
IPBinInformation.AppendFormat("Game supports unknown region {0}.", region).AppendLine();
IPBinInformation.AppendFormat(Localization.Game_supports_unknown_region_0, region).AppendLine();
break;
}

View File

@@ -121,65 +121,67 @@ public static class Dreamcast
var IPBinInformation = new StringBuilder();
IPBinInformation.AppendLine("--------------------------------");
IPBinInformation.AppendLine("SEGA IP.BIN INFORMATION:");
IPBinInformation.AppendLine(Localization.SEGA_IP_BIN_INFORMATION);
IPBinInformation.AppendLine("--------------------------------");
// Decoding all data
CultureInfo provider = CultureInfo.InvariantCulture;
var ipbindate = DateTime.ParseExact(Encoding.ASCII.GetString(ipbin.release_date), "yyyyMMdd", provider);
IPBinInformation.AppendFormat("Product name: {0}", Encoding.ASCII.GetString(ipbin.product_name)).AppendLine();
IPBinInformation.AppendFormat("Product version: {0}", Encoding.ASCII.GetString(ipbin.product_version)).
IPBinInformation.AppendFormat(Localization.Product_name_0, Encoding.ASCII.GetString(ipbin.product_name)).
AppendLine();
IPBinInformation.AppendFormat("Product CRC: 0x{0:X8}", ipbin.dreamcast_crc).AppendLine();
IPBinInformation.AppendFormat("Producer: {0}", Encoding.ASCII.GetString(ipbin.producer)).AppendLine();
IPBinInformation.AppendFormat("Disc media: {0}", Encoding.ASCII.GetString(ipbin.dreamcast_media)).AppendLine();
IPBinInformation.AppendFormat("Disc number {0} of {1}", (char)ipbin.disc_no, (char)ipbin.disc_total_nos).
IPBinInformation.AppendFormat(Localization.Product_version_0, Encoding.ASCII.GetString(ipbin.product_version)).
AppendLine();
IPBinInformation.AppendFormat("Release date: {0}", ipbindate).AppendLine();
IPBinInformation.AppendFormat(Localization.Product_CRC_0, ipbin.dreamcast_crc).AppendLine();
IPBinInformation.AppendFormat(Localization.Producer_0, Encoding.ASCII.GetString(ipbin.producer)).AppendLine();
IPBinInformation.AppendFormat(Localization.Disc_media_0, Encoding.ASCII.GetString(ipbin.dreamcast_media)).
AppendLine();
IPBinInformation.AppendFormat(Localization.Disc_number_0_of_1, (char)ipbin.disc_no, (char)ipbin.disc_total_nos).
AppendLine();
IPBinInformation.AppendFormat(Localization.Release_date_0, ipbindate).AppendLine();
switch(Encoding.ASCII.GetString(ipbin.boot_filename))
{
case "1ST_READ.BIN":
IPBinInformation.AppendLine("Disc boots natively.");
IPBinInformation.AppendLine(Localization.Disc_boots_natively);
break;
case "0WINCE.BIN ":
IPBinInformation.AppendLine("Disc boots using Windows CE.");
IPBinInformation.AppendLine(Localization.Disc_boots_using_Windows_CE);
break;
default:
IPBinInformation.AppendFormat("Disc boots using unknown loader: {0}.",
IPBinInformation.AppendFormat(Localization.Disc_boots_using_unknown_loader_0,
Encoding.ASCII.GetString(ipbin.boot_filename)).AppendLine();
break;
}
IPBinInformation.AppendLine("Regions supported:");
IPBinInformation.AppendLine(Localization.Regions_supported);
foreach(byte region in ipbin.region_codes)
switch((char)region)
{
case 'J':
IPBinInformation.AppendLine("Japanese NTSC.");
IPBinInformation.AppendLine(Localization.Japanese_NTSC);
break;
case 'U':
IPBinInformation.AppendLine("North America NTSC.");
IPBinInformation.AppendLine(Localization.North_America_NTSC);
break;
case 'E':
IPBinInformation.AppendLine("Europe PAL.");
IPBinInformation.AppendLine(Localization.Europe_PAL);
break;
case ' ': break;
default:
IPBinInformation.AppendFormat("Game supports unknown region {0}.", region).AppendLine();
IPBinInformation.AppendFormat(Localization.Game_supports_unknown_region_0, region).AppendLine();
break;
}
@@ -187,75 +189,75 @@ public static class Dreamcast
int iPeripherals = int.Parse(Encoding.ASCII.GetString(ipbin.peripherals), NumberStyles.HexNumber);
if((iPeripherals & 0x00000001) == 0x00000001)
IPBinInformation.AppendLine("Game uses Windows CE.");
IPBinInformation.AppendLine(Localization.Game_uses_Windows_CE);
IPBinInformation.AppendFormat("Peripherals:").AppendLine();
IPBinInformation.AppendFormat(Localization.Peripherals).AppendLine();
if((iPeripherals & 0x00000010) == 0x00000010)
IPBinInformation.AppendLine("Game supports the VGA Box.");
IPBinInformation.AppendLine(Localization.Game_supports_the_VGA_Box);
if((iPeripherals & 0x00000100) == 0x00000100)
IPBinInformation.AppendLine("Game supports other expansion.");
IPBinInformation.AppendLine(Localization.Game_supports_other_expansion);
if((iPeripherals & 0x00000200) == 0x00000200)
IPBinInformation.AppendLine("Game supports Puru Puru pack.");
IPBinInformation.AppendLine(Localization.Game_supports_Puru_Puru_pack);
if((iPeripherals & 0x00000400) == 0x00000400)
IPBinInformation.AppendLine("Game supports Mike Device.");
IPBinInformation.AppendLine(Localization.Game_supports_Mike_Device);
if((iPeripherals & 0x00000800) == 0x00000800)
IPBinInformation.AppendLine("Game supports Memory Card.");
IPBinInformation.AppendLine(Localization.Game_supports_Memory_Card);
if((iPeripherals & 0x00001000) == 0x00001000)
IPBinInformation.AppendLine("Game requires A + B + Start buttons and D-Pad.");
IPBinInformation.AppendLine(Localization.Game_requires_A_B_Start_buttons_and_D_Pad);
if((iPeripherals & 0x00002000) == 0x00002000)
IPBinInformation.AppendLine("Game requires C button.");
IPBinInformation.AppendLine(Localization.Game_requires_C_button);
if((iPeripherals & 0x00004000) == 0x00004000)
IPBinInformation.AppendLine("Game requires D button.");
IPBinInformation.AppendLine(Localization.Game_requires_D_button);
if((iPeripherals & 0x00008000) == 0x00008000)
IPBinInformation.AppendLine("Game requires X button.");
IPBinInformation.AppendLine(Localization.Game_requires_X_button);
if((iPeripherals & 0x00010000) == 0x00010000)
IPBinInformation.AppendLine("Game requires Y button.");
IPBinInformation.AppendLine(Localization.Game_requires_Y_button);
if((iPeripherals & 0x00020000) == 0x00020000)
IPBinInformation.AppendLine("Game requires Z button.");
IPBinInformation.AppendLine(Localization.Game_requires_Z_button);
if((iPeripherals & 0x00040000) == 0x00040000)
IPBinInformation.AppendLine("Game requires expanded direction buttons.");
IPBinInformation.AppendLine(Localization.Game_requires_expanded_direction_buttons);
if((iPeripherals & 0x00080000) == 0x00080000)
IPBinInformation.AppendLine("Game requires analog R trigger.");
IPBinInformation.AppendLine(Localization.Game_requires_analog_R_trigger);
if((iPeripherals & 0x00100000) == 0x00100000)
IPBinInformation.AppendLine("Game requires analog L trigger.");
IPBinInformation.AppendLine(Localization.Game_requires_analog_L_trigger);
if((iPeripherals & 0x00200000) == 0x00200000)
IPBinInformation.AppendLine("Game requires analog horizontal controller.");
IPBinInformation.AppendLine(Localization.Game_requires_analog_horizontal_controller);
if((iPeripherals & 0x00400000) == 0x00400000)
IPBinInformation.AppendLine("Game requires analog vertical controller.");
IPBinInformation.AppendLine(Localization.Game_requires_analog_vertical_controller);
if((iPeripherals & 0x00800000) == 0x00800000)
IPBinInformation.AppendLine("Game requires expanded analog horizontal controller.");
IPBinInformation.AppendLine(Localization.Game_requires_expanded_analog_horizontal_controller);
if((iPeripherals & 0x01000000) == 0x01000000)
IPBinInformation.AppendLine("Game requires expanded analog vertical controller.");
IPBinInformation.AppendLine(Localization.Game_requires_expanded_analog_vertical_controller);
if((iPeripherals & 0x02000000) == 0x02000000)
IPBinInformation.AppendLine("Game supports Gun.");
IPBinInformation.AppendLine(Localization.Game_supports_Gun);
if((iPeripherals & 0x04000000) == 0x04000000)
IPBinInformation.AppendLine("Game supports Keyboard.");
IPBinInformation.AppendLine(Localization.Game_supports_keyboard);
if((iPeripherals & 0x08000000) == 0x08000000)
IPBinInformation.AppendLine("Game supports Mouse.");
IPBinInformation.AppendLine(Localization.Game_supports_mouse);
if((iPeripherals & 0xEE) != 0)
IPBinInformation.AppendFormat("Game supports unknown peripherals mask {0:X2}", iPeripherals & 0xEE);
IPBinInformation.AppendFormat(Localization.Game_supports_unknown_peripherals_mask_0, iPeripherals & 0xEE);
return IPBinInformation.ToString();
}

View File

@@ -112,85 +112,87 @@ public static class Saturn
var IPBinInformation = new StringBuilder();
IPBinInformation.AppendLine("--------------------------------");
IPBinInformation.AppendLine("SEGA IP.BIN INFORMATION:");
IPBinInformation.AppendLine(Localization.SEGA_IP_BIN_INFORMATION);
IPBinInformation.AppendLine("--------------------------------");
// Decoding all data
CultureInfo provider = CultureInfo.InvariantCulture;
var ipbindate = DateTime.ParseExact(Encoding.ASCII.GetString(ipbin.release_date), "yyyyMMdd", provider);
IPBinInformation.AppendFormat("Product name: {0}", Encoding.ASCII.GetString(ipbin.product_name)).AppendLine();
IPBinInformation.AppendFormat(Localization.Product_name_0, Encoding.ASCII.GetString(ipbin.product_name)).
AppendLine();
IPBinInformation.AppendFormat("Product number: {0}", Encoding.ASCII.GetString(ipbin.product_no)).AppendLine();
IPBinInformation.AppendFormat("Product version: {0}", Encoding.ASCII.GetString(ipbin.product_version)).
IPBinInformation.AppendFormat(Localization.Product_version_0, Encoding.ASCII.GetString(ipbin.product_version)).
AppendLine();
IPBinInformation.AppendFormat("Release date: {0}", ipbindate).AppendLine();
IPBinInformation.AppendFormat(Localization.Release_date_0, ipbindate).AppendLine();
IPBinInformation.AppendFormat("Disc number {0} of {1}", (char)ipbin.disc_no, (char)ipbin.disc_total_nos).
IPBinInformation.AppendFormat(Localization.Disc_number_0_of_1, (char)ipbin.disc_no, (char)ipbin.disc_total_nos).
AppendLine();
IPBinInformation.AppendFormat("Peripherals:").AppendLine();
IPBinInformation.AppendFormat(Localization.Peripherals).AppendLine();
foreach(byte peripheral in ipbin.peripherals)
switch((char)peripheral)
{
case 'A':
IPBinInformation.AppendLine("Game supports analog controller.");
IPBinInformation.AppendLine(Localization.Game_supports_analog_controller);
break;
case 'J':
IPBinInformation.AppendLine("Game supports JoyPad.");
IPBinInformation.AppendLine(Localization.Game_supports_JoyPad);
break;
case 'K':
IPBinInformation.AppendLine("Game supports keyboard.");
IPBinInformation.AppendLine(Localization.Game_supports_keyboard);
break;
case 'M':
IPBinInformation.AppendLine("Game supports mouse.");
IPBinInformation.AppendLine(Localization.Game_supports_mouse);
break;
case 'S':
IPBinInformation.AppendLine("Game supports analog steering controller.");
IPBinInformation.AppendLine(Localization.Game_supports_analog_steering_controller);
break;
case 'T':
IPBinInformation.AppendLine("Game supports multitap.");
IPBinInformation.AppendLine(Localization.Game_supports_multitap);
break;
case ' ': break;
default:
IPBinInformation.AppendFormat("Game supports unknown peripheral {0}.", peripheral).AppendLine();
IPBinInformation.AppendFormat(Localization.Game_supports_unknown_peripheral_0, peripheral).
AppendLine();
break;
}
IPBinInformation.AppendLine("Regions supported:");
IPBinInformation.AppendLine(Localization.Regions_supported);
foreach(byte region in ipbin.region_codes)
switch((char)region)
{
case 'J':
IPBinInformation.AppendLine("Japanese NTSC.");
IPBinInformation.AppendLine(Localization.Japanese_NTSC);
break;
case 'U':
IPBinInformation.AppendLine("North America NTSC.");
IPBinInformation.AppendLine(Localization.North_America_NTSC);
break;
case 'E':
IPBinInformation.AppendLine("Europe PAL.");
IPBinInformation.AppendLine(Localization.Europe_PAL);
break;
case 'T':
IPBinInformation.AppendLine("Asia NTSC.");
IPBinInformation.AppendLine(Localization.Asia_NTSC);
break;
case ' ': break;
default:
IPBinInformation.AppendFormat("Game supports unknown region {0}.", region).AppendLine();
IPBinInformation.AppendFormat(Localization.Game_supports_unknown_region_0, region).AppendLine();
break;
}

View File

@@ -138,7 +138,7 @@ public static class DMI
XboxDMI decoded = dmi.Value;
var sb = new StringBuilder();
sb.Append("Catalogue number: ");
sb.Append(Localization.Catalogue_number);
for(int i = 0; i < 2; i++)
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
@@ -152,7 +152,7 @@ public static class DMI
sb.AppendFormat("{0}", decoded.CatalogNumber[7]);
sb.AppendLine();
sb.AppendFormat("Timestamp: {0}", DateTime.FromFileTimeUtc(decoded.Timestamp)).AppendLine();
sb.AppendFormat(Localization.Timestamp_0, DateTime.FromFileTimeUtc(decoded.Timestamp)).AppendLine();
return sb.ToString();
}
@@ -165,7 +165,7 @@ public static class DMI
Xbox360DMI decoded = dmi.Value;
var sb = new StringBuilder();
sb.Append("Catalogue number: ");
sb.Append(Localization.Catalogue_number);
for(int i = 0; i < 2; i++)
sb.AppendFormat("{0}", decoded.CatalogNumber[i]);
@@ -218,7 +218,7 @@ public static class DMI
sb.AppendLine();
sb.Append("Media ID: ");
sb.Append(Localization.Media_ID);
for(int i = 0; i < 12; i++)
sb.AppendFormat("{0:X2}", decoded.MediaID[i]);
@@ -230,7 +230,7 @@ public static class DMI
sb.AppendLine();
sb.AppendFormat("Timestamp: {0}", DateTime.FromFileTimeUtc(decoded.Timestamp)).AppendLine();
sb.AppendFormat(Localization.Timestamp_0, DateTime.FromFileTimeUtc(decoded.Timestamp)).AppendLine();
return sb.ToString();
}

View File

@@ -140,25 +140,28 @@ public static class SS
string sizeString = decoded.DiscSize switch
{
DVDSize.Eighty => "80mm",
DVDSize.OneTwenty => "120mm",
_ => $"unknown size identifier {decoded.DiscSize}"
DVDSize.Eighty => Localization._80mm,
DVDSize.OneTwenty => Localization._120mm,
_ => string.Format(Localization.unknown_size_identifier_0, decoded.DiscSize)
};
const string categorySentence = "Disc is a {0} {1} version {2}";
string categorySentence = Localization.Disc_is_a_0_1_version_2;
switch(decoded.DiskCategory)
{
case DiskCategory.DVDPRWDL:
sb.AppendFormat(categorySentence, sizeString, "Xbox Game Disc", decoded.PartVersion).AppendLine();
sb.AppendFormat(categorySentence, sizeString, Localization.Xbox_Game_Disc, decoded.PartVersion).
AppendLine();
break;
case DiskCategory.DVDPRDL:
sb.AppendFormat(categorySentence, sizeString, "Xbox 360 Game Disc", decoded.PartVersion).AppendLine();
sb.AppendFormat(categorySentence, sizeString, Localization.Xbox_360_Game_Disc, decoded.PartVersion).
AppendLine();
break;
default:
sb.AppendFormat(categorySentence, sizeString, "unknown disc type", decoded.PartVersion).AppendLine();
sb.AppendFormat(categorySentence, sizeString, Localization.unknown_disc_type, decoded.PartVersion).
AppendLine();
break;
}
@@ -166,46 +169,46 @@ public static class SS
switch(decoded.MaximumRate)
{
case MaximumRateField.TwoMbps:
sb.AppendLine("Disc maximum transfer rate is 2,52 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_2_52_Mbit_sec);
break;
case MaximumRateField.FiveMbps:
sb.AppendLine("Disc maximum transfer rate is 5,04 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_5_04_Mbit_sec);
break;
case MaximumRateField.TenMbps:
sb.AppendLine("Disc maximum transfer rate is 10,08 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_10_08_Mbit_sec);
break;
case MaximumRateField.TwentyMbps:
sb.AppendLine("Disc maximum transfer rate is 20,16 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_20_16_Mbit_sec);
break;
case MaximumRateField.ThirtyMbps:
sb.AppendLine("Disc maximum transfer rate is 30,24 Mbit/sec.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_30_24_Mbit_sec);
break;
case MaximumRateField.Unspecified:
sb.AppendLine("Disc maximum transfer rate is unspecified.");
sb.AppendLine(Localization.Disc_maximum_transfer_rate_is_unspecified);
break;
default:
sb.AppendFormat("Disc maximum transfer rate is specified by unknown key {0}", decoded.MaximumRate).
AppendLine();
sb.AppendFormat(Localization.Disc_maximum_transfer_rate_is_specified_by_unknown_key_0,
decoded.MaximumRate).AppendLine();
break;
}
sb.AppendFormat("Disc has {0} layers", decoded.Layers + 1).AppendLine();
sb.AppendFormat(Localization.Disc_has_0_layers, decoded.Layers + 1).AppendLine();
switch(decoded.TrackPath)
{
case true when decoded.Layers == 1:
sb.AppendLine("Layers are in parallel track path");
sb.AppendLine(Localization.Layers_are_in_parallel_track_path);
break;
case false when decoded.Layers == 1:
sb.AppendLine("Layers are in opposite track path");
sb.AppendLine(Localization.Layers_are_in_opposite_track_path);
break;
}
@@ -213,35 +216,35 @@ public static class SS
switch(decoded.LinearDensity)
{
case LinearDensityField.TwoSix:
sb.AppendLine("Pitch size is 0,267 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_267_μm_bit);
break;
case LinearDensityField.TwoNine:
sb.AppendLine("Pitch size is 0,147 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_147_μm_bit);
break;
case LinearDensityField.FourZero:
sb.AppendLine("Pitch size is between 0,409 μm/bit and 0,435 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_between_0_409_μm_bit_and_0_435_μm_bit);
break;
case LinearDensityField.TwoEight:
sb.AppendLine("Pitch size is between 0,140 μm/bit and 0,148 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_between_0_140_μm_bit_and_0_148_μm_bit);
break;
case LinearDensityField.OneFive:
sb.AppendLine("Pitch size is 0,153 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_153_μm_bit);
break;
case LinearDensityField.OneThree:
sb.AppendLine("Pitch size is between 0,130 μm/bit and 0,140 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_between_0_130_μm_bit_and_0_140_μm_bit);
break;
case LinearDensityField.ThreeFive:
sb.AppendLine("Pitch size is 0,353 μm/bit");
sb.AppendLine(Localization.Pitch_size_is_0_353_μm_bit);
break;
default:
sb.AppendFormat("Unknown pitch size key {0}", decoded.LinearDensity).AppendLine();
sb.AppendFormat(Localization.Unknown_pitch_size_key_0, decoded.LinearDensity).AppendLine();
break;
}
@@ -249,27 +252,27 @@ public static class SS
switch(decoded.TrackDensity)
{
case TrackDensityField.Seven:
sb.AppendLine("Track size is 0,74 μm");
sb.AppendLine(Localization.Track_size_is_0_74_μm);
break;
case TrackDensityField.Eight:
sb.AppendLine("Track size is 0,80 μm");
sb.AppendLine(Localization.Track_size_is_0_80_μm);
break;
case TrackDensityField.Six:
sb.AppendLine("Track size is 0,615 μm");
sb.AppendLine(Localization.Track_size_is_0_615_μm);
break;
case TrackDensityField.Four:
sb.AppendLine("Track size is 0,40 μm");
sb.AppendLine(Localization.Track_size_is_0_40_μm);
break;
case TrackDensityField.Three:
sb.AppendLine("Track size is 0,34 μm");
sb.AppendLine(Localization.Track_size_is_0_34_μm);
break;
default:
sb.AppendFormat("Unknown track size key {0}", decoded.LinearDensity).AppendLine();
sb.AppendFormat(Localization.Unknown_track_size_key__0_, decoded.LinearDensity).AppendLine();
break;
}
@@ -277,30 +280,30 @@ public static class SS
if(decoded.DataAreaStartPSN > 0)
if(decoded.DataAreaEndPSN > 0)
{
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();
sb.AppendFormat(Localization.Data_area_starts_at_PSN_0, decoded.DataAreaStartPSN).AppendLine();
sb.AppendFormat(Localization.Data_area_ends_at_PSN_0, decoded.DataAreaEndPSN).AppendLine();
if(decoded is { Layers: 1, TrackPath: false })
sb.AppendFormat("Layer 0 ends at PSN {0:X}h", decoded.Layer0EndPSN).AppendLine();
sb.AppendFormat(Localization.Layer_zero_ends_at_PSN_0, decoded.Layer0EndPSN).AppendLine();
}
else
sb.AppendLine("Disc is empty");
sb.AppendLine(Localization.Disc_is_empty);
else
sb.AppendLine("Disc is empty");
sb.AppendLine(Localization.Disc_is_empty);
sb.AppendLine("Challenges:");
foreach(ChallengeEntry entry in decoded.ChallengeEntries)
{
sb.AppendFormat("\tChallenge ID: {0}", entry.ChallengeId).AppendLine();
sb.AppendFormat("\tChallenge level: {0}", entry.Level).AppendLine();
sb.AppendFormat("\tChallenge value: 0x{0:X8}", entry.ChallengeValue).AppendLine();
sb.AppendFormat("\tResponse modifier: {0}", entry.ResponseModifier).AppendLine();
sb.AppendFormat("\tResponse value: 0x{0:X8}", entry.ResponseValue).AppendLine();
sb.AppendFormat("\t" + Localization.Challenge_ID_0, entry.ChallengeId).AppendLine();
sb.AppendFormat("\t" + Localization.Challenge_level_0, entry.Level).AppendLine();
sb.AppendFormat("\t" + Localization.Challenge_value_0, entry.ChallengeValue).AppendLine();
sb.AppendFormat("\t" + Localization.Response_modifier_0, entry.ResponseModifier).AppendLine();
sb.AppendFormat("\t" + Localization.Response_value_0, entry.ResponseValue).AppendLine();
}
for(int i = 0; i < 16; i++)
sb.AppendFormat("Extent starts at PSN {0:X6}h and ends at PSN {1:X6}h", decoded.Extents[i].StartPSN,
sb.AppendFormat(Localization.Extent_starts_at_PSN_0_and_ends_at_PSN_1, decoded.Extents[i].StartPSN,
decoded.Extents[i].EndPSN).AppendLine();
return sb.ToString();