diff --git a/.editorconfig b/.editorconfig index 71a0517..103a5d9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -83,7 +83,7 @@ resharper_braces_for_ifelse resharper_braces_for_while = required_for_multiline resharper_builtin_type_apply_to_native_integer = false resharper_constructor_or_destructor_body = expression_body -resharper_csharp_align_first_arg_by_paren = false +resharper_csharp_align_first_arg_by_paren = true resharper_csharp_empty_block_style = together_same_line resharper_csharp_place_comments_at_first_column = true resharper_csharp_prefer_qualified_reference = false @@ -108,6 +108,7 @@ resharper_int_align_enum_initializers resharper_int_align_eq = true resharper_keep_existing_embedded_arrangement = false resharper_keep_existing_initializer_arrangement = false +resharper_keep_existing_linebreaks = false resharper_keep_existing_list_patterns_arrangement = false resharper_keep_existing_property_patterns_arrangement = false resharper_keep_existing_switch_expression_arrangement = false @@ -125,6 +126,7 @@ resharper_outdent_statement_labels resharper_parentheses_redundancy_style = remove resharper_place_attribute_on_same_line = false resharper_place_simple_embedded_statement_on_same_line = false +resharper_place_simple_initializer_on_single_line = false resharper_qualified_using_at_nested_scope = true resharper_show_autodetect_configure_formatting_tip = false resharper_simple_block_style = on_single_line @@ -146,6 +148,8 @@ resharper_use_indent_from_vs resharper_wrap_after_dot_in_method_calls = true resharper_wrap_base_clause_style = chop_if_long resharper_wrap_braced_init_list_style = chop_if_long +resharper_wrap_chained_binary_expressions = chop_if_long +resharper_wrap_chained_method_calls = chop_if_long resharper_wrap_ctor_initializer_style = chop_if_long resharper_wrap_lines = true resharper_xmldoc_attribute_indent = align_by_first_attribute diff --git a/ATA/Identify.cs b/ATA/Identify.cs index ca5bfa4..7514b4c 100644 --- a/ATA/Identify.cs +++ b/ATA/Identify.cs @@ -134,8 +134,7 @@ public static class Identify acs3 = false, acs4 = false; - if((ushort)ATAID.MajorVersion == 0x0000 || - (ushort)ATAID.MajorVersion == 0xFFFF) + if((ushort)ATAID.MajorVersion == 0x0000 || (ushort)ATAID.MajorVersion == 0xFFFF) { // Obsolete in ATA-2, if present, device supports ATA-1 ata1 |= @@ -149,10 +148,7 @@ public static class Identify ata2 |= ATAID.ExtendedIdentify.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.ExtendedIdentifyBit. Words64to70Valid); - if(!ata1 && - !ata2 && - !atapi && - !cfa) + if(!ata1 && !ata2 && !atapi && !cfa) ata2 = true; ata4 |= atapi; @@ -629,7 +625,8 @@ public static class Identify break; default: sb.AppendFormat(Localization.ATAPI_Unknown_device_type_field_value_0, - ((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8).AppendLine(); + ((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8). + AppendLine(); break; } @@ -651,7 +648,8 @@ public static class Identify break; default: sb.AppendFormat(Localization.Unknown_ATAPI_DRQ_behaviour_code_0, - ((ushort)ATAID.GeneralConfiguration & 0x60) >> 5).AppendLine(); + ((ushort)ATAID.GeneralConfiguration & 0x60) >> 5). + AppendLine(); break; } @@ -669,7 +667,8 @@ public static class Identify break; default: sb.AppendFormat(Localization.Unknown_ATAPI_packet_size_code_0, - (ushort)ATAID.GeneralConfiguration & 0x03).AppendLine(); + (ushort)ATAID.GeneralConfiguration & 0x03). + AppendLine(); break; } @@ -750,8 +749,7 @@ public static class Identify } } - if(ATAID.NominalRotationRate != 0x0000 && - ATAID.NominalRotationRate != 0xFFFF) + if(ATAID.NominalRotationRate != 0x0000 && ATAID.NominalRotationRate != 0xFFFF) { if(ATAID.NominalRotationRate == 0x0001) sb.AppendLine(Localization.Device_does_not_rotate); @@ -765,13 +763,11 @@ public static class Identify { uint physicalSectorSize; - if((ATAID.PhysLogSectorSize & 0x8000) == 0x0000 && - (ATAID.PhysLogSectorSize & 0x4000) == 0x4000) + if((ATAID.PhysLogSectorSize & 0x8000) == 0x0000 && (ATAID.PhysLogSectorSize & 0x4000) == 0x4000) { if((ATAID.PhysLogSectorSize & 0x1000) == 0x1000) { - if(ATAID.LogicalSectorWords <= 255 || - ATAID.LogicalAlignment == 0xFFFF) + if(ATAID.LogicalSectorWords <= 255 || ATAID.LogicalAlignment == 0xFFFF) logicalSectorSize = 512; else logicalSectorSize = ATAID.LogicalSectorWords * 2; @@ -798,13 +794,13 @@ public static class Identify (ATAID.LogicalAlignment & 0x4000) == 0x4000) { sb.AppendFormat(Localization.Logical_sector_starts_at_offset_0_from_physical_sector, - ATAID.LogicalAlignment & 0x3FFF).AppendLine(); + ATAID.LogicalAlignment & 0x3FFF). + AppendLine(); } if(minatalevel <= 5) { - if(ATAID.CurrentCylinders > 0 && - ATAID is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 }) + if(ATAID.CurrentCylinders > 0 && ATAID is { CurrentHeads: > 0, CurrentSectorsPerTrack: > 0 }) { sb.AppendFormat(Localization.Cylinders_0_max_1_current, ATAID.Cylinders, ATAID.CurrentCylinders). AppendLine(); @@ -812,7 +808,8 @@ public static class Identify sb.AppendFormat(Localization.Heads_0_max_1_current, ATAID.Heads, ATAID.CurrentHeads).AppendLine(); sb.AppendFormat(Localization.Sectors_per_track_0_max_1_current, ATAID.SectorsPerTrack, - ATAID.CurrentSectorsPerTrack).AppendLine(); + ATAID.CurrentSectorsPerTrack). + AppendLine(); sb.AppendFormat(Localization.Sectors_addressable_in_CHS_mode_0_max_1_current, ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack, ATAID.CurrentSectors). @@ -825,7 +822,8 @@ public static class Identify sb.AppendFormat(Localization.Sectors_per_track_0, ATAID.SectorsPerTrack).AppendLine(); sb.AppendFormat(Localization.Sectors_addressable_in_CHS_mode_0, - ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack).AppendLine(); + ATAID.Cylinders * ATAID.Heads * ATAID.SectorsPerTrack). + AppendLine(); } } @@ -842,7 +840,8 @@ public static class Identify sb.AppendFormat(Localization.Device_size_in_CHS_mode_0_bytes_1_Mb_2_MiB, (ulong)ATAID.CurrentSectors * logicalSectorSize, (ulong)ATAID.CurrentSectors * logicalSectorSize / 1000 / 1000, - (ulong)ATAID.CurrentSectors * 512 / 1024 / 1024).AppendLine(); + (ulong)ATAID.CurrentSectors * 512 / 1024 / 1024). + AppendLine(); } else { @@ -851,7 +850,8 @@ public static class Identify sb.AppendFormat(Localization.Device_size_in_CHS_mode_0_bytes_1_Mb_2_MiB, currentSectors * logicalSectorSize, currentSectors * logicalSectorSize / 1000 / 1000, - currentSectors * 512 / 1024 / 1024).AppendLine(); + currentSectors * 512 / 1024 / 1024). + AppendLine(); } } @@ -861,23 +861,26 @@ public static class Identify { case > 1000000: sb.AppendFormat(Localization.Device_size_in_28_bit_LBA_mode_0_bytes_1_Tb_2_TiB, - (ulong)ATAID.LBASectors * logicalSectorSize, + (ulong)ATAID.LBASectors * logicalSectorSize, (ulong)ATAID.LBASectors * logicalSectorSize / 1000 / 1000 / 1000 / 1000, - (ulong)ATAID.LBASectors * 512 / 1024 / 1024 / 1024 / 1024).AppendLine(); + (ulong)ATAID.LBASectors * 512 / 1024 / 1024 / 1024 / 1024). + AppendLine(); break; case > 1000: sb.AppendFormat(Localization.Device_size_in_28_bit_LBA_mode_0_bytes_1_Gb_2_GiB, (ulong)ATAID.LBASectors * logicalSectorSize, (ulong)ATAID.LBASectors * logicalSectorSize / 1000 / 1000 / 1000, - (ulong)ATAID.LBASectors * 512 / 1024 / 1024 / 1024).AppendLine(); + (ulong)ATAID.LBASectors * 512 / 1024 / 1024 / 1024). + AppendLine(); break; default: sb.AppendFormat(Localization.Device_size_in_28_bit_LBA_mode_0_bytes_1_Mb_2_MiB, (ulong)ATAID.LBASectors * logicalSectorSize, (ulong)ATAID.LBASectors * logicalSectorSize / 1000 / 1000, - (ulong)ATAID.LBASectors * 512 / 1024 / 1024).AppendLine(); + (ulong)ATAID.LBASectors * 512 / 1024 / 1024). + AppendLine(); break; } @@ -909,7 +912,8 @@ public static class Identify sb.AppendFormat(Localization.Device_size_in_48_bit_LBA_mode_0_bytes_1_Mb_2_MiB, ATAID.ExtendedUserSectors * logicalSectorSize, ATAID.ExtendedUserSectors * logicalSectorSize / 1000 / 1000, - ATAID.ExtendedUserSectors * logicalSectorSize / 1024 / 1024).AppendLine(); + ATAID.ExtendedUserSectors * logicalSectorSize / 1024 / 1024). + AppendLine(); break; } @@ -930,14 +934,16 @@ public static class Identify sb.AppendFormat(Localization.Device_size_in_48_bit_LBA_mode_0_bytes_1_Gb_2_GiB, ATAID.LBA48Sectors * logicalSectorSize, ATAID.LBA48Sectors * logicalSectorSize / 1000 / 1000 / 1000, - ATAID.LBA48Sectors * logicalSectorSize / 1024 / 1024 / 1024).AppendLine(); + ATAID.LBA48Sectors * logicalSectorSize / 1024 / 1024 / 1024). + AppendLine(); break; default: sb.AppendFormat(Localization.Device_size_in_48_bit_LBA_mode_0_bytes_1_Mb_2_MiB, ATAID.LBA48Sectors * logicalSectorSize, ATAID.LBA48Sectors * logicalSectorSize / 1000 / 1000, - ATAID.LBA48Sectors * logicalSectorSize / 1024 / 1024).AppendLine(); + ATAID.LBA48Sectors * logicalSectorSize / 1024 / 1024). + AppendLine(); break; } @@ -957,8 +963,7 @@ public static class Identify } } - if((ushort)ATAID.SpecificConfiguration != 0x0000 && - (ushort)ATAID.SpecificConfiguration != 0xFFFF) + if((ushort)ATAID.SpecificConfiguration != 0x0000 && (ushort)ATAID.SpecificConfiguration != 0xFFFF) { switch(ATAID.SpecificConfiguration) { @@ -985,7 +990,8 @@ public static class Identify break; default: sb.AppendFormat(Localization.Unknown_device_specific_configuration_0, - (ushort)ATAID.SpecificConfiguration).AppendLine(); + (ushort)ATAID.SpecificConfiguration). + AppendLine(); break; } @@ -1001,29 +1007,32 @@ public static class Identify { case 1: sb.AppendFormat(Localization._0_KiB_of_single_ported_single_sector_buffer, - ATAID.BufferSize * 512 / 1024).AppendLine(); + ATAID.BufferSize * 512 / 1024). + AppendLine(); break; case 2: sb.AppendFormat(Localization._0_KiB_of_dual_ported_multi_sector_buffer, - ATAID.BufferSize * 512 / 1024).AppendLine(); + ATAID.BufferSize * 512 / 1024). + AppendLine(); break; case 3: sb.AppendFormat(Localization._0_KiB_of_dual_ported_multi_sector_buffer_with_read_caching, - ATAID.BufferSize * 512 / 1024).AppendLine(); + ATAID.BufferSize * 512 / 1024). + AppendLine(); break; default: sb.AppendFormat(Localization._0_KiB_of_unknown_type_1_buffer, ATAID.BufferSize * 512 / 1024, - ATAID.BufferType).AppendLine(); + ATAID.BufferType). + AppendLine(); break; } } - if(ATAID.EccBytes != 0x0000 && - ATAID.EccBytes != 0xFFFF) + if(ATAID.EccBytes != 0x0000 && ATAID.EccBytes != 0xFFFF) sb.AppendFormat(Localization.READ_WRITE_LONG_has_0_extra_bytes, ATAID.EccBytes).AppendLine(); sb.AppendLine(); @@ -1059,15 +1068,15 @@ public static class Identify AppendFormat(Localization.A_maximum_of_0_sectors_can_be_transferred_per_interrupt_on_READ_WRITE_MULTIPLE, ATAID.MultipleSectorNumber); - sb.AppendLine().AppendFormat(Localization.Device_supports_setting_a_maximum_of_0_sectors, - ATAID.MultipleMaxSectors); + sb.AppendLine(). + AppendFormat(Localization.Device_supports_setting_a_maximum_of_0_sectors, ATAID.MultipleMaxSectors); } if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.PhysicalAlignment1) || ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.PhysicalAlignment0)) { - sb.AppendLine().AppendFormat(Localization.Long_Physical_Alignment_setting_is_0, - (ushort)ATAID.Capabilities & 0x03); + sb.AppendLine(). + AppendFormat(Localization.Long_Physical_Alignment_setting_is_0, (ushort)ATAID.Capabilities & 0x03); } if(ata1) @@ -1125,8 +1134,7 @@ public static class Identify if(ATAID.APIOSupported.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.TransferMode.Mode7)) sb.Append("PIO7 "); - if(minatalevel <= 3 && - !atapi) + if(minatalevel <= 3 && !atapi) { sb.AppendLine().Append(Localization.Single_word_DMA); @@ -1327,8 +1335,7 @@ public static class Identify sb.Append(Localization._active_); } - if(ATAID.MinMDMACycleTime != 0 && - ATAID.RecMDMACycleTime != 0) + if(ATAID.MinMDMACycleTime != 0 && ATAID.RecMDMACycleTime != 0) { sb.AppendLine(). AppendFormat(Localization.At_minimum_0_ns_transfer_cycle_time_per_word_in_MDMA_1_ns_recommended, @@ -1356,19 +1363,20 @@ public static class Identify { if(ATAID.PacketBusRelease != 0) { - sb.AppendLine().AppendFormat(Localization._0_ns_typical_to_release_bus_from_receipt_of_PACKET, - ATAID.PacketBusRelease); + sb.AppendLine(). + AppendFormat(Localization._0_ns_typical_to_release_bus_from_receipt_of_PACKET, + ATAID.PacketBusRelease); } if(ATAID.ServiceBusyClear != 0) { - sb.AppendLine().AppendFormat(Localization._0_ns_typical_to_clear_BSY_bit_from_receipt_of_SERVICE, - ATAID.ServiceBusyClear); + sb.AppendLine(). + AppendFormat(Localization._0_ns_typical_to_clear_BSY_bit_from_receipt_of_SERVICE, + ATAID.ServiceBusyClear); } } - if((ATAID.TransportMajorVersion & 0xF000) >> 12 == 0x1 || - (ATAID.TransportMajorVersion & 0xF000) >> 12 == 0xE) + if((ATAID.TransportMajorVersion & 0xF000) >> 12 == 0x1 || (ATAID.TransportMajorVersion & 0xF000) >> 12 == 0xE) { if(!ATAID.SATACapabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit.Clear)) { @@ -1456,15 +1464,14 @@ public static class Identify } } - if(ATAID.InterseekDelay != 0x0000 && - ATAID.InterseekDelay != 0xFFFF) + if(ATAID.InterseekDelay != 0x0000 && ATAID.InterseekDelay != 0xFFFF) { - sb.AppendLine().AppendFormat(Localization._0_microseconds_of_interseek_delay_for_ISO_7779_acoustic_testing, - ATAID.InterseekDelay); + sb.AppendLine(). + AppendFormat(Localization._0_microseconds_of_interseek_delay_for_ISO_7779_acoustic_testing, + ATAID.InterseekDelay); } - if((ushort)ATAID.DeviceFormFactor != 0x0000 && - (ushort)ATAID.DeviceFormFactor != 0xFFFF) + if((ushort)ATAID.DeviceFormFactor != 0x0000 && (ushort)ATAID.DeviceFormFactor != 0xFFFF) { switch(ATAID.DeviceFormFactor) { @@ -1489,8 +1496,8 @@ public static class Identify break; default: - sb.AppendLine().AppendFormat(Localization.Device_nominal_size_field_value_0_is_unknown, - ATAID.DeviceFormFactor); + sb.AppendLine(). + AppendFormat(Localization.Device_nominal_size_field_value_0_is_unknown, ATAID.DeviceFormFactor); break; } @@ -1514,8 +1521,8 @@ public static class Identify if((ATAID.CFAPowerMode & 0x1000) == 0x1000) sb.AppendLine().Append(Localization.CompactFlash_power_mode_1_is_disabled); - sb.AppendLine().AppendFormat(Localization.CompactFlash_device_uses_a_maximum_of_0_mA, - ATAID.CFAPowerMode & 0x0FFF); + sb.AppendLine(). + AppendFormat(Localization.CompactFlash_device_uses_a_maximum_of_0_mA, ATAID.CFAPowerMode & 0x0FFF); } } @@ -1643,8 +1650,7 @@ public static class Identify sb.AppendLine(). Append(ATAID.EnabledCommandSet2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit2. LBA48) - ? Localization. - _48_bit_LBA_is_supported_and_enabled + ? Localization._48_bit_LBA_is_supported_and_enabled : Localization._48_bit_LBA_is_supported); } @@ -1653,8 +1659,7 @@ public static class Identify sb.AppendLine(). Append(ATAID.EnabledCommandSet2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit2. FlushCache) - ? Localization. - FLUSH_CACHE_is_supported_and_enabled + ? Localization.FLUSH_CACHE_is_supported_and_enabled : Localization.FLUSH_CACHE_is_supported); } @@ -1680,10 +1685,8 @@ public static class Identify if(ATAID.EnabledCommandSet2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit2.AAM)) { sb.AppendLine(). - AppendFormat( - Localization. - Automatic_Acoustic_Management_is_supported_and_enabled_with_value_0_vendor_recommends_1, - ATAID.CurrentAAM, ATAID.RecommendedAAM); + AppendFormat(Localization.Automatic_Acoustic_Management_is_supported_and_enabled_with_value_0_vendor_recommends_1, + ATAID.CurrentAAM, ATAID.RecommendedAAM); } else sb.AppendLine().Append(Localization.Automatic_Acoustic_Management_is_supported); @@ -1694,8 +1697,7 @@ public static class Identify sb.AppendLine(). Append(ATAID.EnabledCommandSet2.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit2. SetMax) - ? Localization. - SET_MAX_security_extension_is_supported_and_enabled + ? Localization.SET_MAX_security_extension_is_supported_and_enabled : Localization.SET_MAX_security_extension_is_supported); } @@ -1798,8 +1800,7 @@ public static class Identify sb.AppendLine(). Append(ATAID.EnabledCommandSet3.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit3. SMARTLog) - ? Localization. - SMART_error_logging_is_supported_and_enabled + ? Localization.SMART_error_logging_is_supported_and_enabled : Localization.SMART_error_logging_is_supported); } @@ -1944,8 +1945,7 @@ public static class Identify sb.AppendLine(). Append(ATAID.EnabledCommandSet4.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit4. WriteUnc) - ? Localization. - WRITE_UNCORRECTABLE_is_supported_and_enabled + ? Localization.WRITE_UNCORRECTABLE_is_supported_and_enabled : Localization.WRITE_UNCORRECTABLE_is_supported); } @@ -1956,11 +1956,11 @@ public static class Identify ? Localization.Write_Read_Verify_is_supported_and_enabled : Localization.Write_Read_Verify_is_supported); - sb.AppendLine().AppendFormat(Localization._0_sectors_for_Write_Read_Verify_mode_two, - ATAID.WRVSectorCountMode2); + sb.AppendLine(). + AppendFormat(Localization._0_sectors_for_Write_Read_Verify_mode_two, ATAID.WRVSectorCountMode2); - sb.AppendLine().AppendFormat(Localization._0_sectors_for_Write_Read_Verify_mode_three, - ATAID.WRVSectorCountMode3); + sb.AppendLine(). + AppendFormat(Localization._0_sectors_for_Write_Read_Verify_mode_three, ATAID.WRVSectorCountMode3); if(ATAID.EnabledCommandSet4.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit4.WRV)) sb.AppendLine().AppendFormat(Localization.Current_Write_Read_Verify_mode_0, ATAID.WRVMode); @@ -1971,8 +1971,7 @@ public static class Identify sb.AppendLine(). Append(ATAID.EnabledCommandSet4.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit4. DT1825) - ? Localization. - DT1825_is_supported_and_enabled + ? Localization.DT1825_is_supported_and_enabled : Localization.DT1825_is_supported); } } @@ -1988,8 +1987,8 @@ public static class Identify if(ATAID.CommandSet5.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit5.DeviceConfDMA)) { - sb.AppendLine().Append(Localization. - DEVICE_CONFIGURATION_IDENTIFY_DMA_and_DEVICE_CONFIGURATION_SET_DMA_are_supported); + sb.AppendLine(). + Append(Localization.DEVICE_CONFIGURATION_IDENTIFY_DMA_and_DEVICE_CONFIGURATION_SET_DMA_are_supported); } if(ATAID.CommandSet5.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit5.ReadBufferDMA)) @@ -2049,8 +2048,7 @@ public static class Identify sb.AppendLine().Append(Localization.SANITIZE_ANTIFREEZE_LOCK_EXT_is_supported); } - if(!ata1 && - maxatalevel >= 8) + if(!ata1 && maxatalevel >= 8) { if(ATAID.TrustedComputing.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.TrustedComputingBit.Set) && !ATAID.TrustedComputing.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.TrustedComputingBit.Clear) && @@ -2059,8 +2057,7 @@ public static class Identify sb.AppendLine().Append(Localization.Trusted_Computing_feature_set_is_supported); } - if((ATAID.TransportMajorVersion & 0xF000) >> 12 == 0x1 || - (ATAID.TransportMajorVersion & 0xF000) >> 12 == 0xE) + if((ATAID.TransportMajorVersion & 0xF000) >> 12 == 0x1 || (ATAID.TransportMajorVersion & 0xF000) >> 12 == 0xE) { if(!ATAID.SATACapabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATACapabilitiesBit.Clear)) { @@ -2082,8 +2079,8 @@ public static class Identify NonZeroBufferOffset)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.NonZeroBufferOffset) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.NonZeroBufferOffset) ? Localization.Non_zero_buffer_offsets_are_supported_and_enabled : Localization.Non_zero_buffer_offsets_are_supported); } @@ -2091,8 +2088,8 @@ public static class Identify if(ATAID.SATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.DMASetup)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.DMASetup) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.DMASetup) ? Localization.DMA_Setup_auto_activation_is_supported_and_enabled : Localization.DMA_Setup_auto_activation_is_supported); } @@ -2100,8 +2097,8 @@ public static class Identify if(ATAID.SATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.InitPowerMgmt)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.InitPowerMgmt) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.InitPowerMgmt) ? Localization.Device_initiated_power_management_is_supported_and_enabled : Localization.Device_initiated_power_management_is_supported); } @@ -2109,8 +2106,8 @@ public static class Identify if(ATAID.SATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.InOrderData)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.InOrderData) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.InOrderData) ? Localization.In_order_data_delivery_is_supported_and_enabled : Localization.In_order_data_delivery_is_supported); } @@ -2123,9 +2120,8 @@ public static class Identify HardwareFeatureControl)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit. - HardwareFeatureControl) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.HardwareFeatureControl) ? Localization.Hardware_Feature_Control_is_supported_and_enabled : Localization.Hardware_Feature_Control_is_supported); } @@ -2138,8 +2134,8 @@ public static class Identify AsyncNotification)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.AsyncNotification) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.AsyncNotification) ? Localization.Asynchronous_notification_is_supported_and_enabled : Localization.Asynchronous_notification_is_supported); } @@ -2152,8 +2148,8 @@ public static class Identify SettingsPreserve)) { sb.AppendLine(). - Append(ATAID.EnabledSATAFeatures.HasFlag( - CommonTypes.Structs.Devices.ATA.Identify.SATAFeaturesBit.SettingsPreserve) + Append(ATAID.EnabledSATAFeatures.HasFlag(CommonTypes.Structs.Devices.ATA.Identify. + SATAFeaturesBit.SettingsPreserve) ? Localization.Software_Settings_Preservation_is_supported_and_enabled : Localization.Software_Settings_Preservation_is_supported); } @@ -2170,8 +2166,7 @@ public static class Identify if((ATAID.RemovableStatusSet & 0x03) > 0) sb.AppendLine().Append(Localization.Removable_Media_Status_Notification_feature_set_is_supported); - if(ATAID.FreeFallSensitivity != 0x00 && - ATAID.FreeFallSensitivity != 0xFF) + if(ATAID.FreeFallSensitivity != 0x00 && ATAID.FreeFallSensitivity != 0xFF) sb.AppendLine().AppendFormat(Localization.Free_fall_sensitivity_set_to_0, ATAID.FreeFallSensitivity); if(ATAID.DataSetMgmt.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.DataSetMgmtBit.Trim)) @@ -2206,8 +2201,7 @@ public static class Identify sb.AppendLine(ATAID.SecurityStatus.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SecurityStatusBit. Expired) - ? Localization. - Security_count_has_expired + ? Localization.Security_count_has_expired : Localization.Security_count_has_not_expired); sb.AppendLine(ATAID.SecurityStatus.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SecurityStatusBit. @@ -2226,7 +2220,8 @@ public static class Identify if(ATAID.SecurityStatus.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.SecurityStatusBit.Enhanced)) { sb.AppendFormat(Localization._0_minutes_to_complete_enhanced_secure_erase, - ATAID.EnhancedSecurityEraseTime * 2).AppendLine(); + ATAID.EnhancedSecurityEraseTime * 2). + AppendLine(); } sb.AppendFormat(Localization.Master_password_revision_code_0, ATAID.MasterPasswordRevisionCode). @@ -2294,102 +2289,81 @@ public static class Identify #if DEBUG sb.AppendLine(); - if(ATAID.VendorWord9 != 0x0000 && - ATAID.VendorWord9 != 0xFFFF) + if(ATAID.VendorWord9 != 0x0000 && ATAID.VendorWord9 != 0xFFFF) sb.AppendFormat(Localization.Word_nine_0, ATAID.VendorWord9).AppendLine(); - if((ATAID.VendorWord47 & 0x7F) != 0x7F && - (ATAID.VendorWord47 & 0x7F) != 0x00) + if((ATAID.VendorWord47 & 0x7F) != 0x7F && (ATAID.VendorWord47 & 0x7F) != 0x00) sb.AppendFormat(Localization.Word_47_bits_15_to_8_0, ATAID.VendorWord47).AppendLine(); - if(ATAID.VendorWord51 != 0x00 && - ATAID.VendorWord51 != 0xFF) + if(ATAID.VendorWord51 != 0x00 && ATAID.VendorWord51 != 0xFF) sb.AppendFormat(Localization.Word_51_bits_7_to_0_0, ATAID.VendorWord51).AppendLine(); - if(ATAID.VendorWord52 != 0x00 && - ATAID.VendorWord52 != 0xFF) + if(ATAID.VendorWord52 != 0x00 && ATAID.VendorWord52 != 0xFF) sb.AppendFormat(Localization.Word_52_bits_7_to_0_0, ATAID.VendorWord52).AppendLine(); - if(ATAID.ReservedWord64 != 0x00 && - ATAID.ReservedWord64 != 0xFF) + if(ATAID.ReservedWord64 != 0x00 && ATAID.ReservedWord64 != 0xFF) sb.AppendFormat(Localization.Word_64_bits_15_to_8_0, ATAID.ReservedWord64).AppendLine(); - if(ATAID.ReservedWord70 != 0x0000 && - ATAID.ReservedWord70 != 0xFFFF) + if(ATAID.ReservedWord70 != 0x0000 && ATAID.ReservedWord70 != 0xFFFF) sb.AppendFormat(Localization.Word_70_0, ATAID.ReservedWord70).AppendLine(); - if(ATAID.ReservedWord73 != 0x0000 && - ATAID.ReservedWord73 != 0xFFFF) + if(ATAID.ReservedWord73 != 0x0000 && ATAID.ReservedWord73 != 0xFFFF) sb.AppendFormat(Localization.Word_73_0, ATAID.ReservedWord73).AppendLine(); - if(ATAID.ReservedWord74 != 0x0000 && - ATAID.ReservedWord74 != 0xFFFF) + if(ATAID.ReservedWord74 != 0x0000 && ATAID.ReservedWord74 != 0xFFFF) sb.AppendFormat(Localization.Word_74_0, ATAID.ReservedWord74).AppendLine(); - if(ATAID.ReservedWord116 != 0x0000 && - ATAID.ReservedWord116 != 0xFFFF) + if(ATAID.ReservedWord116 != 0x0000 && ATAID.ReservedWord116 != 0xFFFF) sb.AppendFormat(Localization.Word_116_0, ATAID.ReservedWord116).AppendLine(); for(var i = 0; i < ATAID.ReservedWords121.Length; i++) { - if(ATAID.ReservedWords121[i] != 0x0000 && - ATAID.ReservedWords121[i] != 0xFFFF) + if(ATAID.ReservedWords121[i] != 0x0000 && ATAID.ReservedWords121[i] != 0xFFFF) sb.AppendFormat(Localization.Word_1_0, ATAID.ReservedWords121[i], 121 + i).AppendLine(); } for(var i = 0; i < ATAID.ReservedWords129.Length; i++) { - if(ATAID.ReservedWords129[i] != 0x0000 && - ATAID.ReservedWords129[i] != 0xFFFF) + if(ATAID.ReservedWords129[i] != 0x0000 && ATAID.ReservedWords129[i] != 0xFFFF) sb.AppendFormat(Localization.Word_1_0, ATAID.ReservedWords129[i], 129 + i).AppendLine(); } for(var i = 0; i < ATAID.ReservedCFA.Length; i++) { - if(ATAID.ReservedCFA[i] != 0x0000 && - ATAID.ReservedCFA[i] != 0xFFFF) + if(ATAID.ReservedCFA[i] != 0x0000 && ATAID.ReservedCFA[i] != 0xFFFF) sb.AppendFormat(Localization.Word_1_CFA_0, ATAID.ReservedCFA[i], 161 + i).AppendLine(); } - if(ATAID.ReservedWord174 != 0x0000 && - ATAID.ReservedWord174 != 0xFFFF) + if(ATAID.ReservedWord174 != 0x0000 && ATAID.ReservedWord174 != 0xFFFF) sb.AppendFormat(Localization.Word_174_0, ATAID.ReservedWord174).AppendLine(); - if(ATAID.ReservedWord175 != 0x0000 && - ATAID.ReservedWord175 != 0xFFFF) + if(ATAID.ReservedWord175 != 0x0000 && ATAID.ReservedWord175 != 0xFFFF) sb.AppendFormat(Localization.Word_175_0, ATAID.ReservedWord175).AppendLine(); - if(ATAID.ReservedCEATAWord207 != 0x0000 && - ATAID.ReservedCEATAWord207 != 0xFFFF) + if(ATAID.ReservedCEATAWord207 != 0x0000 && ATAID.ReservedCEATAWord207 != 0xFFFF) sb.AppendFormat(Localization.Word_207_CE_ATA_0, ATAID.ReservedCEATAWord207).AppendLine(); - if(ATAID.ReservedCEATAWord208 != 0x0000 && - ATAID.ReservedCEATAWord208 != 0xFFFF) + if(ATAID.ReservedCEATAWord208 != 0x0000 && ATAID.ReservedCEATAWord208 != 0xFFFF) sb.AppendFormat(Localization.Word_208_CE_ATA_0, ATAID.ReservedCEATAWord208).AppendLine(); - if(ATAID.NVReserved != 0x00 && - ATAID.NVReserved != 0xFF) + if(ATAID.NVReserved != 0x00 && ATAID.NVReserved != 0xFF) sb.AppendFormat(Localization.Word_219_bits_15_to_8_0, ATAID.NVReserved).AppendLine(); - if(ATAID.WRVReserved != 0x00 && - ATAID.WRVReserved != 0xFF) + if(ATAID.WRVReserved != 0x00 && ATAID.WRVReserved != 0xFF) sb.AppendFormat(Localization.Word_220_bits_15_to_8_0, ATAID.WRVReserved).AppendLine(); - if(ATAID.ReservedWord221 != 0x0000 && - ATAID.ReservedWord221 != 0xFFFF) + if(ATAID.ReservedWord221 != 0x0000 && ATAID.ReservedWord221 != 0xFFFF) sb.AppendFormat(Localization.Word_221_0, ATAID.ReservedWord221).AppendLine(); for(var i = 0; i < ATAID.ReservedCEATA224.Length; i++) { - if(ATAID.ReservedCEATA224[i] != 0x0000 && - ATAID.ReservedCEATA224[i] != 0xFFFF) + if(ATAID.ReservedCEATA224[i] != 0x0000 && ATAID.ReservedCEATA224[i] != 0xFFFF) sb.AppendFormat(Localization.Word_1_CE_ATA_0, ATAID.ReservedCEATA224[i], 224 + i).AppendLine(); } for(var i = 0; i < ATAID.ReservedWords.Length; i++) { - if(ATAID.ReservedWords[i] != 0x0000 && - ATAID.ReservedWords[i] != 0xFFFF) + if(ATAID.ReservedWords[i] != 0x0000 && ATAID.ReservedWords[i] != 0xFFFF) sb.AppendFormat(Localization.Word_1_0, ATAID.ReservedWords[i], 236 + i).AppendLine(); } #endif diff --git a/Bluray/Cartridge.cs b/Bluray/Cartridge.cs index b44450d..6aaf805 100644 --- a/Bluray/Cartridge.cs +++ b/Bluray/Cartridge.cs @@ -103,8 +103,7 @@ public static class Cartridge if(CSResponse.Length != 8) { - AaruConsole.DebugWriteLine(MODULE_NAME, - Localization.Found_incorrect_Blu_ray_Cartridge_Status_size_0_bytes, + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_incorrect_Blu_ray_Cartridge_Status_size_0_bytes, CSResponse.Length); return null; diff --git a/Bluray/DDS.cs b/Bluray/DDS.cs index 16fd500..dc93462 100644 --- a/Bluray/DDS.cs +++ b/Bluray/DDS.cs @@ -144,8 +144,7 @@ public static class DDS if(decoded.Signature != DDSIdentifier) { - AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_incorrect_DDS_signature_0, - decoded.Signature); + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_incorrect_DDS_signature_0, decoded.Signature); return null; } diff --git a/Bluray/DI.cs b/Bluray/DI.cs index 5d4f796..7cbdbb3 100644 --- a/Bluray/DI.cs +++ b/Bluray/DI.cs @@ -119,8 +119,7 @@ public static class DI if(DIResponse.Length != 4100) { - AaruConsole.DebugWriteLine(MODULE_NAME, - Localization.Found_incorrect_Blu_ray_Disc_Information_size_0_bytes, + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_incorrect_Blu_ray_Disc_Information_size_0_bytes, DIResponse.Length); return null; @@ -171,15 +170,21 @@ public static class DI unit.Bca = (byte)(DIResponse[16 + offset] & 0x0F); unit.MaxTransfer = DIResponse[17 + offset]; - unit.LastPsn = (uint)((DIResponse[20 + offset] << 24) + (DIResponse[21 + offset] << 16) + - (DIResponse[22 + offset] << 8) + DIResponse[23 + offset]); + unit.LastPsn = (uint)((DIResponse[20 + offset] << 24) + + (DIResponse[21 + offset] << 16) + + (DIResponse[22 + offset] << 8) + + DIResponse[23 + offset]); // TODO: In -R/-RE how does this relate to layer size??? - unit.FirstAun = (uint)((DIResponse[24 + offset] << 24) + (DIResponse[25 + offset] << 16) + - (DIResponse[26 + offset] << 8) + DIResponse[27 + offset]); + unit.FirstAun = (uint)((DIResponse[24 + offset] << 24) + + (DIResponse[25 + offset] << 16) + + (DIResponse[26 + offset] << 8) + + DIResponse[27 + offset]); - unit.LastAun = (uint)((DIResponse[28 + offset] << 24) + (DIResponse[29 + offset] << 16) + - (DIResponse[30 + offset] << 8) + DIResponse[31 + offset]); + unit.LastAun = (uint)((DIResponse[28 + offset] << 24) + + (DIResponse[29 + offset] << 16) + + (DIResponse[30 + offset] << 8) + + DIResponse[31 + offset]); switch(Encoding.ASCII.GetString(unit.DiscTypeIdentifier)) { @@ -210,8 +215,7 @@ public static class DI default: { - AaruConsole.DebugWriteLine(MODULE_NAME, - Localization.Found_unknown_disc_type_identifier_0, + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Found_unknown_disc_type_identifier_0, Encoding.ASCII.GetString(unit.DiscTypeIdentifier)); break; @@ -334,7 +338,8 @@ public static class DI break; default: sb.AppendFormat(Localization.Disc_uses_unknown_channel_length_with_code_0, - (byte)unit.ChannelLength).AppendLine(); + (byte)unit.ChannelLength). + AppendLine(); break; } @@ -371,7 +376,8 @@ public static class DI break; default: sb.AppendFormat(Localization.Disc_uses_unknown_recorded_reflectivity_polarity_with_code_0, - unit.RecordedPolarity).AppendLine(); + unit.RecordedPolarity). + AppendLine(); break; } diff --git a/CD/ATIP.cs b/CD/ATIP.cs index f187172..749ed2e 100644 --- a/CD/ATIP.cs +++ b/CD/ATIP.cs @@ -66,8 +66,7 @@ public static class ATIP var decoded = new CDATIP(); - if(CDATIPResponse.Length != 32 && - CDATIPResponse.Length != 28) + if(CDATIPResponse.Length != 32 && CDATIPResponse.Length != 28) { AaruConsole.DebugWriteLine(MODULE_NAME, Localization. @@ -156,12 +155,16 @@ public static class ATIP } sb.AppendFormat(Localization.ATIP_Start_time_of_Lead_in_0, - (response.LeadInStartMin << 16) + (response.LeadInStartSec << 8) + - response.LeadInStartFrame).AppendLine(); + (response.LeadInStartMin << 16) + + (response.LeadInStartSec << 8) + + response.LeadInStartFrame). + AppendLine(); sb.AppendFormat(Localization.ATIP_Last_possible_start_time_of_Lead_out_0, - (response.LeadOutStartMin << 16) + (response.LeadOutStartSec << 8) + - response.LeadOutStartFrame).AppendLine(); + (response.LeadOutStartMin << 16) + + (response.LeadOutStartSec << 8) + + response.LeadOutStartFrame). + AppendLine(); sb.AppendFormat(Localization.S4_value_0, (response.S4Values[0] << 16) + (response.S4Values[1] << 8) + response.S4Values[2]). @@ -274,10 +277,12 @@ public static class ATIP sb.AppendLine(response.URU ? Localization.Disc_use_is_unrestricted : Localization.Disc_use_is_restricted); sb.AppendFormat(Localization.ATIP_Start_time_of_Lead_in_0_1_2, response.LeadInStartMin, - response.LeadInStartSec, response.LeadInStartFrame).AppendLine(); + response.LeadInStartSec, response.LeadInStartFrame). + AppendLine(); sb.AppendFormat(Localization.ATIP_Last_possible_start_time_of_Lead_out_0_1_2, response.LeadOutStartMin, - response.LeadOutStartSec, response.LeadOutStartFrame).AppendLine(); + response.LeadOutStartSec, response.LeadOutStartFrame). + AppendLine(); if(response.A1Valid) { diff --git a/CD/CDTextOnLeadIn.cs b/CD/CDTextOnLeadIn.cs index b0c1944..520b750 100644 --- a/CD/CDTextOnLeadIn.cs +++ b/CD/CDTextOnLeadIn.cs @@ -193,7 +193,8 @@ public static class CDTextOnLeadIn else { sb.AppendFormat(Localization.CD_Text_pack_contains_performer_for_track_0, - descriptor.HeaderID2).AppendLine(); + descriptor.HeaderID2). + AppendLine(); } break; @@ -206,7 +207,8 @@ public static class CDTextOnLeadIn else { sb.AppendFormat(Localization.CD_Text_pack_contains_songwriter_for_track_0, - descriptor.HeaderID2).AppendLine(); + descriptor.HeaderID2). + AppendLine(); } break; @@ -229,7 +231,8 @@ public static class CDTextOnLeadIn else { sb.AppendFormat(Localization.CD_Text_pack_contains_arranger_for_track_0, - descriptor.HeaderID2).AppendLine(); + descriptor.HeaderID2). + AppendLine(); } break; @@ -242,7 +245,8 @@ public static class CDTextOnLeadIn else { sb.AppendFormat(Localization.CD_Text_pack_contains_content_provider_message_for_track_0, - descriptor.HeaderID2).AppendLine(); + descriptor.HeaderID2). + AppendLine(); } break; @@ -330,7 +334,8 @@ public static class CDTextOnLeadIn sb.AppendFormat(Localization.Text_field_0, StringHandlers.CToString(descriptor.TextDataField, - Encoding.GetEncoding("iso-8859-1"))).AppendLine(); + Encoding.GetEncoding("iso-8859-1"))). + AppendLine(); break; } @@ -338,7 +343,8 @@ public static class CDTextOnLeadIn default: { sb.AppendFormat(Localization.Binary_contents_0, - PrintHex.ByteArrayToHexArrayString(descriptor.TextDataField, 28)).AppendLine(); + PrintHex.ByteArrayToHexArrayString(descriptor.TextDataField, 28)). + AppendLine(); break; } diff --git a/CD/FullTOC.cs b/CD/FullTOC.cs index 0e19713..c342b15 100644 --- a/CD/FullTOC.cs +++ b/CD/FullTOC.cs @@ -292,12 +292,14 @@ public static class FullTOC if(descriptor.PHOUR > 0) { sb.AppendFormat(Localization.Lead_out_start_position_3_0_1_2, descriptor.PMIN, - descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR).AppendLine(); + descriptor.PSEC, descriptor.PFRAME, descriptor.PHOUR). + AppendLine(); } else { sb.AppendFormat(Localization.Lead_out_start_position_0_1_2, descriptor.PMIN, - descriptor.PSEC, descriptor.PFRAME).AppendLine(); + 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(); @@ -330,12 +332,14 @@ public static class FullTOC if(descriptor.PHOUR > 0) { sb.AppendFormat(Localization.Absolute_time_3_0_1_2, descriptor.Min, descriptor.Sec, - descriptor.Frame, descriptor.HOUR).AppendLine(); + descriptor.Frame, descriptor.HOUR). + AppendLine(); } else { sb.AppendFormat(Localization.Absolute_time_0_1_2, descriptor.Min, descriptor.Sec, - descriptor.Frame).AppendLine(); + descriptor.Frame). + AppendLine(); } break; @@ -359,22 +363,16 @@ public static class FullTOC if(descriptor.PHOUR > 0) { - 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); + 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); } else { - 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); + 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); } switch((TocControl)(descriptor.CONTROL & 0x0D)) @@ -441,32 +439,27 @@ public static class FullTOC if(descriptor.PHOUR > 0) { sb. - 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). + 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( - 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(); + 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( - Localization. - Start_of_next_possible_program_in_the_recordable_area_of_the_disc_0_1_2, - descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine(); + 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( - Localization. - Maximum_start_of_outermost_Lead_out_in_the_recordable_area_of_the_disc_0_1_2, - descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine(); + 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(); } break; @@ -505,15 +498,16 @@ public static class FullTOC if(descriptor.PHOUR > 0) { sb. - 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(); + 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(Localization.Start_time_of_the_first_Lead_in_area_in_the_disc_0_1_2, - descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine(); + descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME). + AppendLine(); } break; @@ -539,7 +533,8 @@ public static class FullTOC { sb.AppendFormat(Localization.Start_position_of_outer_part_lead_in_area_3_0_1_2, descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, - descriptor.PHOUR).AppendLine(); + descriptor.PHOUR). + AppendLine(); sb.AppendFormat(Localization.Stop_position_of_inner_part_lead_out_area_3_0_1_2, descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR). @@ -548,10 +543,12 @@ public static class FullTOC else { sb.AppendFormat(Localization.Start_position_of_outer_part_lead_in_area_0_1_2, - descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine(); + descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME). + AppendLine(); sb.AppendFormat(Localization.Stop_position_of_inner_part_lead_out_area_0_1_2, - descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine(); + descriptor.Min, descriptor.Sec, descriptor.Frame). + AppendLine(); } break; @@ -562,10 +559,12 @@ public static class FullTOC if(descriptor.POINT is >= 0x01 and <= 0x40) { sb.AppendFormat(Localization.Start_time_for_interval_that_should_be_skipped_0_1_2, - descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME).AppendLine(); + descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME). + AppendLine(); sb.AppendFormat(Localization.Ending_time_for_interval_that_should_be_skipped_0_1_2, - descriptor.Min, descriptor.Sec, descriptor.Frame).AppendLine(); + descriptor.Min, descriptor.Sec, descriptor.Frame). + AppendLine(); } else { @@ -638,9 +637,8 @@ public static class FullTOC toc.LastCompleteSession = (byte)track.Session; } - sessionEndingTrack.TryAdd(toc.LastCompleteSession, (byte)tracks. - Where(t => t.Session == toc.LastCompleteSession). - Max(t => t.Sequence)); + sessionEndingTrack.TryAdd(toc.LastCompleteSession, + (byte)tracks.Where(t => t.Session == toc.LastCompleteSession).Max(t => t.Sequence)); byte currentSession = 0; @@ -648,13 +646,11 @@ public static class FullTOC { trackFlags.TryGetValue((byte)track.Sequence, out byte trackControl); - if(trackControl == 0 && - track.Type != TrackType.Audio) + if(trackControl == 0 && track.Type != TrackType.Audio) trackControl = (byte)CdFlags.DataTrack; // Lead-Out - if(track.Session > currentSession && - currentSession != 0) + if(track.Session > currentSession && currentSession != 0) { (byte minute, byte second, byte frame) leadoutAmsf = LbaToMsf(track.StartSector - 150); diff --git a/CD/PMA.cs b/CD/PMA.cs index c332fff..e00645b 100644 --- a/CD/PMA.cs +++ b/CD/PMA.cs @@ -141,126 +141,102 @@ public static class PMA case TocControl.TwoChanNoPreEmph: 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); + 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); + 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: 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); + 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); + 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: 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); + 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); + 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: 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); + 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); + 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: 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); + 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); + 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: 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); + 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); + 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; @@ -330,40 +306,32 @@ public static class PMA case 5: if(descriptor.PHOUR > 0) { - 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); + 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( - 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); + 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: if(descriptor.PHOUR > 0) { - 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); + 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( - 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); + 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; diff --git a/CD/Sector.cs b/CD/Sector.cs index dedb470..880ff69 100644 --- a/CD/Sector.cs +++ b/CD/Sector.cs @@ -179,12 +179,14 @@ public static class Sector 0x1C, 0x43, 0x49, 0xF1, 0xF6, 0xC4, 0x46, 0xD3, 0x72, 0xDD, 0xE5, 0x99 }; - public static readonly byte[] SyncMark = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 }; + public static readonly byte[] SyncMark = + { + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 + }; public static byte[] Scramble(byte[] sector) { - if(sector == null || - sector.Length < 2352) + if(sector == null || sector.Length < 2352) return sector; var sync = new byte[12]; @@ -212,9 +214,18 @@ public static class Sector { switch(data.Length) { - case 2352 when data[0] != 0x00 || data[1] != 0xFF || data[2] != 0xFF || data[3] != 0xFF || - data[4] != 0xFF || data[5] != 0xFF || data[6] != 0xFF || data[7] != 0xFF || - data[8] != 0xFF || data[9] != 0xFF || data[10] != 0xFF || data[11] != 0x00: + case 2352 when data[0] != 0x00 || + data[1] != 0xFF || + data[2] != 0xFF || + data[3] != 0xFF || + data[4] != 0xFF || + data[5] != 0xFF || + data[6] != 0xFF || + data[7] != 0xFF || + data[8] != 0xFF || + data[9] != 0xFF || + data[10] != 0xFF || + data[11] != 0x00: return data; case 2352: switch(data[15]) @@ -241,8 +252,7 @@ public static class Sector [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte[] GetUserDataFromMode2(byte[] data, bool interleaved = false, byte fileNumber = 0) { - if(data.Length != 2352 && - data.Length != 2336) + if(data.Length != 2352 && data.Length != 2336) return data; var pos = 0; @@ -282,8 +292,7 @@ public static class Sector public static string Prettify(byte[] buffer) { - if(buffer is null || - buffer.Length <= 0) + if(buffer is null || buffer.Length <= 0) return null; if(buffer[0] != 0x00 || diff --git a/CD/Session.cs b/CD/Session.cs index 2572417..8ce0268 100644 --- a/CD/Session.cs +++ b/CD/Session.cs @@ -115,7 +115,8 @@ public static class Session 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(); + (descriptor.TrackStartAddress & 0xFF000000) >> 24). + AppendLine(); switch((TocAdr)descriptor.ADR) { diff --git a/CD/Subchannel.cs b/CD/Subchannel.cs index 168da48..2758532 100644 --- a/CD/Subchannel.cs +++ b/CD/Subchannel.cs @@ -50,8 +50,7 @@ public static class Subchannel public static void BinaryToBcdQ(byte[] q) { - if((q[0] & 0xF) == 1 || - (q[0] & 0xF) == 5) + if((q[0] & 0xF) == 1 || (q[0] & 0xF) == 5) { q[1] = (byte)((q[1] / 10 << 4) + q[1] % 10); q[2] = (byte)((q[2] / 10 << 4) + q[2] % 10); @@ -68,8 +67,7 @@ public static class Subchannel public static void BcdToBinaryQ(byte[] q) { - if((q[0] & 0xF) == 1 || - (q[0] & 0xF) == 5) + if((q[0] & 0xF) == 1 || (q[0] & 0xF) == 5) { q[1] = (byte)(q[1] / 16 * 10 + (q[1] & 0x0F)); q[2] = (byte)(q[2] / 16 * 10 + (q[2] & 0x0F)); @@ -378,24 +376,21 @@ public static class Subchannel case 1 when subBuf[2] < 0xA0: 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); + 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 @@ -408,129 +403,106 @@ public static class Subchannel 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); + 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 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); + 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 - ? 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); + ? 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 - 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); + 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 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); + 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]) @@ -538,133 +510,109 @@ public static class Subchannel case <= 0x40: 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); + 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 - ? 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); + ? 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 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); + 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) + if(subBuf[2] != 0xB2 && subBuf[2] != 0xB3 && subBuf[2] != 0xB4) { 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.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); } var skipTracks = $"{subBuf[3]:X2}"; @@ -685,19 +633,17 @@ public static class Subchannel skipTracks += $", {subBuf[4]:X2}"; 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); + 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 @@ -708,62 +654,66 @@ public static class Subchannel { 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), + 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), + 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_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) + 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) }; } diff --git a/CD/TOC.cs b/CD/TOC.cs index 16a2d00..3fc6106 100644 --- a/CD/TOC.cs +++ b/CD/TOC.cs @@ -120,7 +120,8 @@ public static class TOC 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(); + (descriptor.TrackStartAddress & 0xFF000000) >> 24). + AppendLine(); switch((TocAdr)descriptor.ADR) { diff --git a/DVD/DDS.cs b/DVD/DDS.cs index b906abf..0936f09 100644 --- a/DVD/DDS.cs +++ b/DVD/DDS.cs @@ -120,7 +120,8 @@ public static class DDS for(var i = 0; i < dds.Zones; i++) { dds.StartLSNForZone[i] = (uint)((response[260 + i * 4 + 1] << 16) + - (response[260 + i * 4 + 2] << 8) + response[260 + i * 4 + 3]); + (response[260 + i * 4 + 2] << 8) + + response[260 + i * 4 + 3]); } } @@ -181,7 +182,8 @@ public static class DDS sb.AppendFormat(Localization.Disc_has_0_zones, decoded.Zones).AppendLine(); sb.AppendFormat(Localization.Primary_Spare_Area_stats_at_PSN_0_and_ends_at_PSN_1_inclusively, - decoded.SpareAreaFirstPSN, decoded.SpareAreaLastPSN).AppendLine(); + decoded.SpareAreaFirstPSN, decoded.SpareAreaLastPSN). + AppendLine(); sb.AppendFormat(Localization.LSN_zero_is_at_PSN_0, decoded.LSN0Location).AppendLine(); diff --git a/DVD/PFI.cs b/DVD/PFI.cs index 0a23974..7ea437f 100644 --- a/DVD/PFI.cs +++ b/DVD/PFI.cs @@ -582,12 +582,14 @@ public static class PFI if(decoded.DiscSize == DVDSize.OneTwenty) { sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, Localization._60mm, "UMD", - decoded.PartVersion).AppendLine(); + decoded.PartVersion). + AppendLine(); } else { sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, Localization.invalid_size, "UMD", - decoded.PartVersion).AppendLine(); + decoded.PartVersion). + AppendLine(); } switch(decoded.PartVersion) @@ -695,7 +697,8 @@ public static class PFI break; default: sb.AppendFormat(Localization.Disc_is_a_0_1_version_2, sizeString, Localization.unknown_disc_type, - decoded.PartVersion).AppendLine(); + decoded.PartVersion). + AppendLine(); break; } @@ -797,7 +800,8 @@ public static class PFI break; default: sb.AppendFormat(Localization.Disc_maximum_transfer_rate_is_specified_by_unknown_key_0, - decoded.MaximumRate).AppendLine(); + decoded.MaximumRate). + AppendLine(); break; } @@ -925,10 +929,12 @@ public static class PFI if(decoded.PartVersion == 6) { sb.AppendFormat(Localization.Disc_manufacturer_is_0, - ManufacturerFromDVDRAM(decoded.DiskManufacturer)).AppendLine(); + ManufacturerFromDVDRAM(decoded.DiskManufacturer)). + AppendLine(); sb.AppendFormat(Localization.Disc_manufacturer_supplementary_information_is_0, - decoded.DiskManufacturerSupplementary).AppendLine(); + decoded.DiskManufacturerSupplementary). + AppendLine(); } break; @@ -951,7 +957,8 @@ public static class PFI sb.AppendFormat(Localization.Disc_application_code_0, decoded.ApplicationCode).AppendLine(); sb.AppendFormat(Localization.Disc_manufacturer_is_0, - ManufacturerFromDVDPlusID(decoded.DiskManufacturerID)).AppendLine(); + ManufacturerFromDVDPlusID(decoded.DiskManufacturerID)). + AppendLine(); sb.AppendFormat(Localization.Disc_media_type_is_0, decoded.MediaTypeID).AppendLine(); sb.AppendFormat(Localization.Disc_product_revision_is_0, decoded.ProductRevision).AppendLine(); @@ -964,7 +971,8 @@ public static class PFI return sb.ToString(); sb.AppendFormat(Localization.Current_RMD_in_extra_Border_zone_starts_at_PSN_0, - decoded.CurrentRMDExtraBorderPSN).AppendLine(); + decoded.CurrentRMDExtraBorderPSN). + AppendLine(); sb.AppendFormat(Localization.PFI_in_extra_Border_zone_starts_at_PSN_0, decoded.PFIExtraBorderPSN).AppendLine(); @@ -984,8 +992,8 @@ public static class PFI public static string ManufacturerFromDVDRAM(string manufacturerId) => manufacturerId switch { - _ => ManufacturerFromDVDPlusID( - manufacturerId) + _ => + ManufacturerFromDVDPlusID(manufacturerId) }; [SuppressMessage("ReSharper", "StringLiteralTypo")] diff --git a/DVD/PRI.cs b/DVD/PRI.cs index 0a4ad4d..8285d1c 100644 --- a/DVD/PRI.cs +++ b/DVD/PRI.cs @@ -76,11 +76,7 @@ public static class PRI FieldId5 = response[36] }; - if(pri.FieldId1 != 1 || - pri.FieldId2 != 2 || - pri.FieldId3 != 3 || - pri.FieldId4 != 4 || - pri.FieldId5 != 5) + if(pri.FieldId1 != 1 || pri.FieldId2 != 2 || pri.FieldId3 != 3 || pri.FieldId4 != 4 || pri.FieldId5 != 5) return null; pri.DiscApplicationCode = response[5]; @@ -115,9 +111,7 @@ public static class PRI Array.Copy(response, 29, tmp, 6, 6); // If RW or has part version or has extension code, 3rd manufacturer ID is a write strategy code - if((pri.DiscPhysicalCode & 0x2) > 0 || - pri.PartVersion > 0 || - pri.ExtensionCode > 0) + if((pri.DiscPhysicalCode & 0x2) > 0 || pri.PartVersion > 0 || pri.ExtensionCode > 0) { pri.WriteStrategyCode2 = (uint)((response[37] << 24) + (response[38] << 16) + (response[39] << 8) + response[40]); @@ -157,7 +151,8 @@ public static class PRI if((decoded.DiscApplicationCode & 0x3F) > 0) { sb.AppendFormat(Localization.Disc_for_use_in_special_drives_according_with_purpose_value_0, - decoded.DiscApplicationCode & 0x3F).AppendLine(); + decoded.DiscApplicationCode & 0x3F). + AppendLine(); } else sb.AppendLine(Localization.General_purpose_disc_for_use_in_general_purpose_drives); diff --git a/DVD/Sector.cs b/DVD/Sector.cs index ca7cfc9..5bc32af 100644 --- a/DVD/Sector.cs +++ b/DVD/Sector.cs @@ -42,8 +42,8 @@ public sealed class Sector { static readonly ushort[] _ecma267InitialValues = { - 0x0001, 0x5500, 0x0002, 0x2A00, 0x0004, 0x5400, 0x0008, 0x2800, 0x0010, 0x5000, 0x0020, 0x2001, 0x0040, - 0x4002, 0x0080, 0x0005 + 0x0001, 0x5500, 0x0002, 0x2A00, 0x0004, 0x5400, 0x0008, 0x2800, 0x0010, 0x5000, 0x0020, 0x2001, 0x0040, 0x4002, + 0x0080, 0x0005 }; static readonly uint[] _edcTable = @@ -228,8 +228,7 @@ public sealed class Sector { var scrambled = new byte[sector.Length]; - if(sector.Length % 2064 != 0 || - sector.Length / 2064 != transferLength) + if(sector.Length % 2064 != 0 || sector.Length / 2064 != transferLength) return sector; for(uint i = 0; i < transferLength; i++) diff --git a/Floppy/Apple2.cs b/Floppy/Apple2.cs index 5c74582..b758b8e 100644 --- a/Floppy/Apple2.cs +++ b/Floppy/Apple2.cs @@ -234,8 +234,7 @@ public static class Apple2 public static byte[] DecodeSector(RawSector sector) { - if(sector.addressField.prologue[0] != 0xD5 || - sector.addressField.prologue[1] != 0xAA) + if(sector.addressField.prologue[0] != 0xD5 || sector.addressField.prologue[1] != 0xAA) return null; // Pre DOS 3.3 @@ -257,8 +256,7 @@ public static class Apple2 endOffset = offset; // Not an Apple ][ GCR sector - if(data == null || - data.Length < 363) + if(data == null || data.Length < 363) return null; int position = offset; @@ -268,44 +266,64 @@ public static class Apple2 while(position < data.Length) { // Prologue found - if(data[position] == 0xD5 && - data[position + 1] == 0xAA) + if(data[position] == 0xD5 && data[position + 1] == 0xAA) { AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Prologue_found_at_0, position); // Epilogue not in correct position - if(data[position + 11] != 0xDE || - data[position + 12] != 0xAA) + if(data[position + 11] != 0xDE || data[position + 12] != 0xAA) return null; var sector = new RawSector { addressField = new RawAddressField { - prologue = new[] { data[position], data[position + 1], data[position + 2] }, - volume = new[] { data[position + 3], data[position + 4] }, - track = new[] { data[position + 5], data[position + 6] }, - sector = new[] { data[position + 7], data[position + 8] }, - checksum = new[] { data[position + 9], data[position + 10] }, - epilogue = new[] { data[position + 11], data[position + 12], data[position + 13] } + prologue = new[] + { + data[position], data[position + 1], data[position + 2] + }, + volume = new[] + { + data[position + 3], data[position + 4] + }, + track = new[] + { + data[position + 5], data[position + 6] + }, + sector = new[] + { + data[position + 7], data[position + 8] + }, + checksum = new[] + { + data[position + 9], data[position + 10] + }, + epilogue = new[] + { + data[position + 11], data[position + 12], data[position + 13] + } } }; AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Volume_0, ((sector.addressField.volume[0] & 0x55) << 1 | - sector.addressField.volume[1] & 0x55) & 0xFF); + sector.addressField.volume[1] & 0x55) & + 0xFF); AaruConsole.DebugWriteLine(MODULE_NAME, Core.Track_0, ((sector.addressField.track[0] & 0x55) << 1 | - sector.addressField.track[1] & 0x55) & 0xFF); + sector.addressField.track[1] & 0x55) & + 0xFF); AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Sector_0, ((sector.addressField.sector[0] & 0x55) << 1 | - sector.addressField.sector[1] & 0x55) & 0xFF); + sector.addressField.sector[1] & 0x55) & + 0xFF); AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Checksum_0, ((sector.addressField.checksum[0] & 0x55) << 1 | - sector.addressField.checksum[1] & 0x55) & 0xFF); + sector.addressField.checksum[1] & 0x55) & + 0xFF); AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Epilogue_0_1_2, sector.addressField.epilogue[0], sector.addressField.epilogue[1], @@ -329,15 +347,13 @@ public static class Apple2 return null; // Prologue not found - if(data[position] != 0xD5 || - data[position + 1] != 0xAA) + if(data[position] != 0xD5 || data[position + 1] != 0xAA) return null; sector.innerGap = gaps.ToArray(); sector.dataField = new RawDataField(); - AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Inner_gap_has_0_bytes, - sector.innerGap.Length); + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Inner_gap_has_0_bytes, sector.innerGap.Length); AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Prologue_found_at_0, position); sector.dataField.prologue = new byte[3]; @@ -349,8 +365,7 @@ public static class Apple2 gaps = new MemoryStream(); // Read data until epilogue is found - while(data[position + 1] != 0xDE || - data[position + 2] != 0xAA) + while(data[position + 1] != 0xDE || data[position + 2] != 0xAA) { gaps.WriteByte(data[position]); position++; @@ -375,8 +390,7 @@ public static class Apple2 gaps = new MemoryStream(); // Read gap, if any - while(position < data.Length && - data[position] == 0xFF) + while(position < data.Length && data[position] == 0xFF) { gaps.WriteByte(data[position]); position++; @@ -394,8 +408,7 @@ public static class Apple2 // Return current position to be able to read separate sectors endOffset = position; - AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Got_0_bytes_of_gap, - sector.gap.Length); + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Got_0_bytes_of_gap, sector.gap.Length); AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Finished_sector_at_0, position); @@ -469,8 +482,7 @@ public static class Apple2 var trackNumber = new byte[2]; endOffset = offset; - while(position < data.Length && - data[position] == 0xFF) + while(position < data.Length && data[position] == 0xFF) { gaps.WriteByte(data[position]); count++; @@ -499,8 +511,7 @@ public static class Apple2 firstSector = false; } - if(sector.addressField.track[0] != trackNumber[0] || - sector.addressField.track[1] != trackNumber[1]) + if(sector.addressField.track[0] != trackNumber[0] || sector.addressField.track[1] != trackNumber[1]) { position = oldPosition; @@ -509,9 +520,11 @@ public static class Apple2 AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Adding_sector_0_of_track_1, ((sector.addressField.sector[0] & 0x55) << 1 | - sector.addressField.sector[1] & 0x55) & 0xFF, + sector.addressField.sector[1] & 0x55) & + 0xFF, ((sector.addressField.track[0] & 0x55) << 1 | - sector.addressField.track[1] & 0x55) & 0xFF); + sector.addressField.track[1] & 0x55) & + 0xFF); sectors.Add(sector); } diff --git a/Floppy/AppleSony.cs b/Floppy/AppleSony.cs index faba7e3..1917589 100644 --- a/Floppy/AppleSony.cs +++ b/Floppy/AppleSony.cs @@ -141,8 +141,7 @@ public static class AppleSony endOffset = offset; // Not an Apple ][ GCR sector - if(data == null || - data.Length < 363) + if(data == null || data.Length < 363) return null; int position = offset; @@ -152,26 +151,29 @@ public static class AppleSony while(position < data.Length) { // Prologue found - if(data[position] == 0xD5 && - data[position + 1] == 0xAA && - data[position + 2] == 0x96) + if(data[position] == 0xD5 && data[position + 1] == 0xAA && data[position + 2] == 0x96) { // Epilogue not in correct position - if(data[position + 8] != 0xDE || - data[position + 9] != 0xAA) + if(data[position + 8] != 0xDE || data[position + 9] != 0xAA) return null; var sector = new RawSector { addressField = new RawAddressField { - prologue = new[] { data[position], data[position + 1], data[position + 2] }, + prologue = new[] + { + data[position], data[position + 1], data[position + 2] + }, track = data[position + 3], sector = data[position + 4], side = data[position + 5], format = (AppleEncodedFormat)data[position + 6], checksum = data[position + 7], - epilogue = new[] { data[position + 8], data[position + 9] } + epilogue = new[] + { + data[position + 8], data[position + 9] + } } }; @@ -193,17 +195,18 @@ public static class AppleSony return null; // Prologue not found - if(data[position] != 0xDE || - data[position + 1] != 0xAA || - data[position + 2] != 0xAD) + if(data[position] != 0xDE || data[position + 1] != 0xAA || data[position + 2] != 0xAD) return null; sector.innerGap = gaps.ToArray(); sector.dataField = new RawDataField { - prologue = new[] { data[position], data[position + 1], data[position + 2] }, - spare = data[position + 3] + prologue = new[] + { + data[position], data[position + 1], data[position + 2] + }, + spare = data[position + 3] }; position += 4; @@ -211,8 +214,7 @@ public static class AppleSony gaps = new MemoryStream(); // Read data until epilogue is found - while(data[position + 4] != 0xD5 || - data[position + 5] != 0xAA) + while(data[position + 4] != 0xD5 || data[position + 5] != 0xAA) { gaps.WriteByte(data[position]); position++; @@ -236,8 +238,7 @@ public static class AppleSony gaps = new MemoryStream(); // Read gap, if any - while(position < data.Length && - data[position] == 0xFF) + while(position < data.Length && data[position] == 0xFF) { gaps.WriteByte(data[position]); position++; @@ -327,8 +328,7 @@ public static class AppleSony byte sideNumber = 0; endOffset = offset; - while(position < data.Length && - data[position] == 0xFF) + while(position < data.Length && data[position] == 0xFF) { gaps.WriteByte(data[position]); count++; @@ -357,8 +357,7 @@ public static class AppleSony firstSector = false; } - if(sector.addressField.track != trackNumber || - sector.addressField.side != sideNumber) + if(sector.addressField.track != trackNumber || sector.addressField.side != sideNumber) { position = oldPosition; diff --git a/MMC/CID.cs b/MMC/CID.cs index 1cd388b..8ae2cb3 100644 --- a/MMC/CID.cs +++ b/MMC/CID.cs @@ -129,7 +129,8 @@ public static partial class Decoders sb.AppendFormat("\t" + Localization.Product_name_0, cid.ProductName).AppendLine(); sb.AppendFormat("\t" + Localization.Product_revision_0_1, (cid.ProductRevision & 0xF0) >> 4, - cid.ProductRevision & 0x0F).AppendLine(); + cid.ProductRevision & 0x0F). + AppendLine(); sb.AppendFormat("\t" + Localization.Product_serial_number_0, cid.ProductSerialNumber).AppendLine(); @@ -155,7 +156,8 @@ public static partial class Decoders }; sb.AppendFormat("\t" + Localization.Device_manufactured_month_0_of_1, (cid.ManufacturingDate & 0xF0) >> 4, - year).AppendLine(); + year). + AppendLine(); sb.AppendFormat("\t" + Localization.CID_CRC_0, cid.CRC).AppendLine(); diff --git a/MMC/CSD.cs b/MMC/CSD.cs index aa2308a..f47f5c2 100644 --- a/MMC/CSD.cs +++ b/MMC/CSD.cs @@ -171,8 +171,8 @@ public static partial class Decoders break; case 3: - sb.AppendLine("\t" + Localization. - Register_version_is_defined_in_Extended_Device_Specific_Data_Register); + sb.AppendLine("\t" + + Localization.Register_version_is_defined_in_Extended_Device_Specific_Data_Register); break; } @@ -331,7 +331,8 @@ public static partial class Decoders if(csd.Size == 0xFFF) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_may_be_bigger_than_2GiB_and_have_its_real_size_defined_in_the_extended_CSD); } @@ -518,7 +519,8 @@ public static partial class Decoders // unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize); sb.AppendFormat("\t" + Localization.Device_can_write_protect_a_minimum_of_0_blocks_at_a_time, - (int)(result + 1)).AppendLine(); + (int)(result + 1)). + AppendLine(); } else sb.AppendLine("\t" + Localization.Device_cant_write_protect_regions); @@ -592,7 +594,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_uses_unknown_file_format_code_0_and_file_format_group_1, - csd.FileFormat).AppendLine(); + csd.FileFormat). + AppendLine(); } switch(csd.ECC) diff --git a/MMC/ExtendedCSD.cs b/MMC/ExtendedCSD.cs index 190d6ba..09cb7dc 100644 --- a/MMC/ExtendedCSD.cs +++ b/MMC/ExtendedCSD.cs @@ -411,7 +411,8 @@ public static partial class Decoders sb.AppendLine("\t" + Localization.Device_supports_background_operations); sb.AppendFormat("\t" + Localization.Device_supports_a_maximum_of_0_packed_reads_and_1_packed_writes, - csd.MaxPackedReadCommands, csd.MaxPackedWriteCommands).AppendLine(); + csd.MaxPackedReadCommands, csd.MaxPackedWriteCommands). + AppendLine(); if(csd.DataTagSupport.HasFlag(DataTagSupport.Supported)) { @@ -428,7 +429,8 @@ public static partial class Decoders sb.AppendFormat("\t" + Localization.Max_context_ID_is_0, csd.ContextManagementCaps & 0xF).AppendLine(); sb.AppendFormat("\t" + Localization.Large_unit_maximum_multiplier_is_0, - ((csd.ContextManagementCaps & 0x70) >> 4) + 1).AppendLine(); + ((csd.ContextManagementCaps & 0x70) >> 4) + 1). + AppendLine(); } sb.AppendFormat("\t" + Localization.Large_unit_size_is_0_MiB, csd.LargeUnitSize + 1).AppendLine(); @@ -456,26 +458,23 @@ public static partial class Decoders { case > 1000000: sb. - AppendFormat( - "\t" + Localization. - Maximum_timeout_for_switch_command_when_setting_a_value_to_the_mode_operation_codes_field_is_0_s, - unit / 1000000).AppendLine(); + AppendFormat("\t" + Localization.Maximum_timeout_for_switch_command_when_setting_a_value_to_the_mode_operation_codes_field_is_0_s, + unit / 1000000). + AppendLine(); break; case > 1000: sb. - AppendFormat( - "\t" + Localization. - Maximum_timeout_for_switch_command_when_setting_a_value_to_the_mode_operation_codes_field_is_0_ms, - unit / 1000).AppendLine(); + AppendFormat("\t" + Localization.Maximum_timeout_for_switch_command_when_setting_a_value_to_the_mode_operation_codes_field_is_0_ms, + unit / 1000). + AppendLine(); break; default: sb. - AppendFormat( - "\t" + Localization. - Maximum_timeout_for_switch_command_when_setting_a_value_to_the_mode_operation_codes_field_is_0_µs, - unit).AppendLine(); + AppendFormat("\t" + Localization.Maximum_timeout_for_switch_command_when_setting_a_value_to_the_mode_operation_codes_field_is_0_µs, + unit). + AppendLine(); break; } @@ -492,11 +491,13 @@ public static partial class Decoders if(csd.CMDQueuingSupport.HasFlag(CMDQueuingSupport.Supported)) { sb.AppendFormat("\t" + Localization.Device_supports_command_queuing_with_a_depth_of_0, - csd.CMDQueuingDepth + 1).AppendLine(); + csd.CMDQueuingDepth + 1). + AppendLine(); } sb.AppendFormat("\t" + Localization._0_firmware_sectors_correctly_programmed, - csd.NumberOfFWSectorsCorrectlyProgrammed).AppendLine(); + csd.NumberOfFWSectorsCorrectlyProgrammed). + AppendLine(); switch(csd.DeviceLifeEstimationTypeB) { @@ -625,7 +626,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Optimal_trim_size_is_0_KiB, - 4 * Math.Pow(2, csd.OptimalTrimUnitSize - 1)).AppendLine(); + 4 * Math.Pow(2, csd.OptimalTrimUnitSize - 1)). + AppendLine(); } sb.AppendFormat("\t" + Localization.Device_version_0, csd.DeviceVersion).AppendLine(); @@ -639,16 +641,16 @@ public static partial class Decoders if(csd.GenericCMD6Timeout > 0) { sb.AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_by_default_for_a_SWITCH_command, - csd.GenericCMD6Timeout * 10).AppendLine(); + csd.GenericCMD6Timeout * 10). + AppendLine(); } if(csd.PowerOffNotificationTimeout > 0) { sb. - AppendFormat( - "\t" + Localization. - Device_takes_a_maximum_of_0_by_default_to_power_off_from_a_SWITCH_command_notification, - csd.PowerOffNotificationTimeout * 10).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_by_default_to_power_off_from_a_SWITCH_command_notification, + csd.PowerOffNotificationTimeout * 10). + AppendLine(); } switch(csd.BackgroundOperationsStatus & 0x03) @@ -672,12 +674,14 @@ public static partial class Decoders } sb.AppendFormat("\t" + Localization.Last_WRITE_MULTIPLE_command_correctly_programmed_0_sectors, - csd.CorrectlyProgrammedSectors).AppendLine(); + csd.CorrectlyProgrammedSectors). + AppendLine(); if(csd.InitializationTimeAfterPartition > 0) { sb.AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_for_initialization_after_partition, - csd.InitializationTimeAfterPartition * 100).AppendLine(); + csd.InitializationTimeAfterPartition * 100). + AppendLine(); } if(csd.CacheFlushingPolicy.HasFlag(CacheFlushingPolicy.FIFO)) @@ -686,7 +690,8 @@ public static partial class Decoders if(csd.TRIMMultiplier > 0) { sb.AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_for_trimming_a_single_erase_group, - csd.TRIMMultiplier * 300).AppendLine(); + csd.TRIMMultiplier * 300). + AppendLine(); } if(csd.SecureFeatureSupport.HasFlag(SecureFeatureSupport.Sanitize)) @@ -704,17 +709,17 @@ public static partial class Decoders if(csd.SecureEraseMultiplier > 0) { sb. - AppendFormat( - "\t" + Localization.Device_takes_a_maximum_of_0_ms_for_securely_erasing_a_single_erase_group, - csd.SecureEraseMultiplier * 300).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_for_securely_erasing_a_single_erase_group, + csd.SecureEraseMultiplier * 300). + AppendLine(); } if(csd.SecureTRIMMultiplier > 0) { sb. - AppendFormat( - "\t" + Localization.Device_takes_a_maximum_of_0_ms_for_securely_trimming_a_single_erase_group, - csd.SecureTRIMMultiplier * 300).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_for_securely_trimming_a_single_erase_group, + csd.SecureTRIMMultiplier * 300). + AppendLine(); } if(csd.BootInformation.HasFlag(BootInformation.HighSpeed)) @@ -735,7 +740,8 @@ public static partial class Decoders if((csd.AccessSize & 0x0F) > 0) { sb.AppendFormat("\t" + Localization.Device_has_a_page_size_of_0_KiB, - 512 * Math.Pow(2, (csd.AccessSize & 0x0F) - 1) / 1024.0).AppendLine(); + 512 * Math.Pow(2, (csd.AccessSize & 0x0F) - 1) / 1024.0). + AppendLine(); } if(csd.HighCapacityEraseUnitSize > 0) @@ -747,13 +753,15 @@ public static partial class Decoders if(csd.HighCapacityEraseTimeout > 0) { sb.AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_for_erasing_a_single_erase_group, - csd.HighCapacityEraseTimeout * 300).AppendLine(); + csd.HighCapacityEraseTimeout * 300). + AppendLine(); } if(csd.HighCapacityWriteProtectGroupSize > 0) { sb.AppendFormat("\t" + Localization.Device_smallest_write_protect_group_is_made_of_0_erase_groups, - csd.HighCapacityWriteProtectGroupSize).AppendLine(); + csd.HighCapacityWriteProtectGroupSize). + AppendLine(); } if(csd.SleepCurrentVcc > 0) @@ -784,23 +792,23 @@ public static partial class Decoders { case > 1000000: sb. - AppendFormat( - "\t" + Localization.Device_takes_a_maximum_of_0_s_to_switch_production_state_awareness, - unit / 1000000).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_s_to_switch_production_state_awareness, + unit / 1000000). + AppendLine(); break; case > 1000: sb. - AppendFormat( - "\t" + Localization.Device_takes_a_maximum_of_0_ms_to_switch_production_state_awareness, - unit / 1000).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_to_switch_production_state_awareness, + unit / 1000). + AppendLine(); break; default: sb. - AppendFormat( - "\t" + Localization.Device_takes_a_maximum_of_0_μs_to_switch_production_state_awareness, - unit).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_μs_to_switch_production_state_awareness, + unit). + AppendLine(); break; } @@ -814,26 +822,23 @@ public static partial class Decoders { case > 1000000: sb. - AppendFormat( - "\t" + Localization. - Device_takes_a_maximum_of_0_ms_to_transition_between_sleep_and_standby_states, - unit / 1000000).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_to_transition_between_sleep_and_standby_states, + unit / 1000000). + AppendLine(); break; case > 1000: sb. - AppendFormat( - "\t" + Localization. - Device_takes_a_maximum_of_0_μs_to_transition_between_sleep_and_standby_states, - unit / 1000).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_μs_to_transition_between_sleep_and_standby_states, + unit / 1000). + AppendLine(); break; default: sb. - AppendFormat( - "\t" + Localization. - Device_takes_a_maximum_of_0_ns_to_transition_between_sleep_and_standby_states, - unit).AppendLine(); + AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ns_to_transition_between_sleep_and_standby_states, + unit). + AppendLine(); break; } @@ -847,12 +852,14 @@ public static partial class Decoders { case > 1000000: sb.AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_s_to_move_to_sleep_state, - unit / 1000000).AppendLine(); + unit / 1000000). + AppendLine(); break; case > 1000: sb.AppendFormat("\t" + Localization.Device_takes_a_maximum_of_0_ms_to_move_to_sleep_state, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); break; default: @@ -880,7 +887,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_reading_in_SDR_26Mhz_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumReadPerformance26_4 * 300; @@ -890,7 +898,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_reading_in_SDR_26Mhz_4_bit_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumReadPerformance52 * 300; @@ -900,7 +909,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_reading_in_SDR_52Mhz_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumReadPerformanceDDR52 * 600; @@ -910,7 +920,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_reading_in_DDR_52Mhz_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumWritePerformance26 * 300; @@ -920,7 +931,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_writing_in_SDR_26Mhz_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumWritePerformance26_4 * 300; @@ -930,7 +942,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_writing_in_SDR_26Mhz_4_bit_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumWritePerformance52 * 300; @@ -940,7 +953,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_writing_in_SDR_52Mhz_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } unit = csd.MinimumWritePerformanceDDR52 * 600; @@ -950,19 +964,22 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_can_achieve_a_minimum_of_0_MB_s_writing_in_DDR_52Mhz_mode, - unit / 1000).AppendLine(); + unit / 1000). + AppendLine(); } if(csd.PartitionSwitchingTime > 0) { sb.AppendFormat("\t" + Localization.Device_can_take_a_maximum_of_0_ms_when_switching_partitions, - csd.PartitionSwitchingTime * 10).AppendLine(); + csd.PartitionSwitchingTime * 10). + AppendLine(); } if(csd.OutOfInterruptBusyTiming > 0) { sb.AppendFormat("\t" + Localization.Device_can_take_a_maximum_of_0_ms_when_releasing_from_an_interrupt, - csd.OutOfInterruptBusyTiming * 10).AppendLine(); + csd.OutOfInterruptBusyTiming * 10). + AppendLine(); } if(csd.DriverStrength.HasFlag(DriverStrength.Type0)) @@ -1021,9 +1038,9 @@ public static partial class Decoders break; default: sb. - AppendFormat( - "\t" + Localization.Device_follows_standard_MMC_command_set_with_unknown_version_code_0, - csd.CommandSetRevision).AppendLine(); + AppendFormat("\t" + Localization.Device_follows_standard_MMC_command_set_with_unknown_version_code_0, + csd.CommandSetRevision). + AppendLine(); break; } @@ -1031,7 +1048,8 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.Device_follows_unknown_MMC_command_set_code_0_with_revision_code_1, - csd.CommandSet, csd.CommandSetRevision).AppendLine(); + csd.CommandSet, csd.CommandSetRevision). + AppendLine(); break; } @@ -1054,13 +1072,15 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.Device_has_unknown_timing_mode_0, - csd.HighSpeedInterfaceTiming & 0x0F).AppendLine(); + csd.HighSpeedInterfaceTiming & 0x0F). + AppendLine(); break; } sb.AppendFormat("\t" + Localization.Selected_driver_strength_is_type_0, - (csd.HighSpeedInterfaceTiming & 0xF0) >> 4).AppendLine(); + (csd.HighSpeedInterfaceTiming & 0xF0) >> 4). + AppendLine(); if((csd.StrobeSupport & 0x01) == 0x01) { @@ -1138,7 +1158,8 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.Unknown_enabled_boot_partition_code_0, - (csd.PartitionConfiguration & 0x38) >> 3).AppendLine(); + (csd.PartitionConfiguration & 0x38) >> 3). + AppendLine(); break; } @@ -1163,7 +1184,8 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.There_is_access_to_general_purpose_partition_0, - (csd.PartitionConfiguration & 0x07) - 3).AppendLine(); + (csd.PartitionConfiguration & 0x07) - 3). + AppendLine(); break; } @@ -1172,7 +1194,8 @@ public static partial class Decoders sb.AppendLine("\t" + Localization.Change_of_the_boot_configuration_register_bits_is_permanently_disabled); else if(csd.BootConfigProtection.HasFlag(BootConfigProtection.PowerCycle)) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Change_of_the_boot_configuration_register_bits_is_disabled_until_the_next_power_cycle); } @@ -1198,19 +1221,19 @@ public static partial class Decoders sb.AppendLine((csd.BootBusConditions & 4) == 4 ? "\t" + Localization.Device_will_retain_boot_conditions_after_boot_operation - : "\t" + Localization. - Device_will_reset_boot_conditions_to_compatibility_mode_after_boot_operation); + : "\t" + + Localization.Device_will_reset_boot_conditions_to_compatibility_mode_after_boot_operation); switch((csd.BootBusConditions & 0x24) >> 3) { case 0: - sb.AppendLine("\t" + Localization. - Device_will_use_single_data_rate_with_compatible_timings_in_boot_operation); + sb.AppendLine("\t" + + Localization.Device_will_use_single_data_rate_with_compatible_timings_in_boot_operation); break; case 1: - sb.AppendLine("\t" + Localization. - Device_will_use_single_data_rate_with_high_speed_timings_in_boot_operation); + sb.AppendLine("\t" + + Localization.Device_will_use_single_data_rate_with_high_speed_timings_in_boot_operation); break; case 2: @@ -1225,7 +1248,8 @@ public static partial class Decoders if(csd.HighCapacityEraseGroupDefinition.HasFlag(HighCapacityEraseGroupDefinition.Enabled)) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_will_use_high_capacity_erase_unit_size__timeout_and_write_protect_group_size_definitions); } @@ -1324,7 +1348,8 @@ public static partial class Decoders if(csd.PartitioningSupport.HasFlag(PartitioningSupport.Enhanced)) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_can_have_enhanced_technological_features_in_partitions_and_user_data_area); } @@ -1344,7 +1369,8 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.Device_natively_uses_unknown_sector_size_indicated_by_code_0, - csd.NativeSectorSize).AppendLine(); + csd.NativeSectorSize). + AppendLine(); break; } @@ -1361,7 +1387,8 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.Device_emulates_unknown_sector_size_indicated_by_code_0, - csd.NativeSectorSize).AppendLine(); + csd.NativeSectorSize). + AppendLine(); break; } @@ -1378,7 +1405,8 @@ public static partial class Decoders break; default: sb.AppendFormat("\t" + Localization.Device_currently_addresses_unknown_sector_size_indicated_by_code_0, - csd.NativeSectorSize).AppendLine(); + csd.NativeSectorSize). + AppendLine(); break; } diff --git a/MMC/VendorString.cs b/MMC/VendorString.cs index 3d4e166..8508dcb 100644 --- a/MMC/VendorString.cs +++ b/MMC/VendorString.cs @@ -46,7 +46,7 @@ public static class VendorString 0x07 => "Nokia", 0x15 => "Samsung", 0x2C => "extreMEmory", - _ => string.Format( - Localization.Unknown_manufacturer_ID_0, mmcVendorId) + _ => string.Format(Localization.Unknown_manufacturer_ID_0, + mmcVendorId) }; } \ No newline at end of file diff --git a/PCMCIA/CIS.cs b/PCMCIA/CIS.cs index fdab2ae..86ae7a7 100644 --- a/PCMCIA/CIS.cs +++ b/PCMCIA/CIS.cs @@ -83,8 +83,7 @@ public static class CIS if(tuple == null) return null; - if(tuple.Code != TupleCodes.CISTPL_DEVICEGEO && - tuple.Code != TupleCodes.CISTPL_DEVICEGEO_A) + if(tuple.Code != TupleCodes.CISTPL_DEVICEGEO && tuple.Code != TupleCodes.CISTPL_DEVICEGEO_A) return null; return tuple.Data == null ? null : DecodeDeviceGeometryTuple(tuple.Data); @@ -125,8 +124,7 @@ public static class CIS if(tuple == null) return null; - if(tuple.Code != TupleCodes.CISTPL_DEVICEGEO && - tuple.Code != TupleCodes.CISTPL_DEVICEGEO_A) + if(tuple.Code != TupleCodes.CISTPL_DEVICEGEO && tuple.Code != TupleCodes.CISTPL_DEVICEGEO_A) return null; var sb = new StringBuilder(); @@ -140,17 +138,22 @@ public static class CIS AppendLine(); sb.AppendFormat("\t\t" + Localization.Erase_block_0_bytes, - (1 << geometry.EraseBlockSize - 1) * (1 << geometry.Interleaving - 1)).AppendLine(); + (1 << geometry.EraseBlockSize - 1) * (1 << geometry.Interleaving - 1)). + AppendLine(); sb.AppendFormat("\t\t" + Localization.Read_block_0_bytes, - (1 << geometry.ReadBlockSize - 1) * (1 << geometry.Interleaving - 1)).AppendLine(); + (1 << geometry.ReadBlockSize - 1) * (1 << geometry.Interleaving - 1)). + AppendLine(); sb.AppendFormat("\t\t" + Localization.Write_block_0_bytes, - (1 << geometry.WriteBlockSize - 1) * (1 << geometry.Interleaving - 1)).AppendLine(); + (1 << geometry.WriteBlockSize - 1) * (1 << geometry.Interleaving - 1)). + AppendLine(); sb.AppendFormat("\t\t" + Localization.Partition_alignment_0_bytes, - (1 << geometry.EraseBlockSize - 1) * (1 << geometry.Interleaving - 1) * - (1 << geometry.Partitions - 1)).AppendLine(); + (1 << geometry.EraseBlockSize - 1) * + (1 << geometry.Interleaving - 1) * + (1 << geometry.Partitions - 1)). + AppendLine(); } return sb.ToString(); @@ -286,7 +289,8 @@ public static class CIS sb.AppendLine(Localization.PCMCIA_Level_1_Version_Product_Information_Tuple); sb.AppendFormat("\t" + Localization.Card_indicates_compliance_with_PC_Card_Standard_Release_0_1, - tuple.MajorVersion, tuple.MinorVersion).AppendLine(); + tuple.MajorVersion, tuple.MinorVersion). + AppendLine(); if(string.IsNullOrEmpty(tuple.Manufacturer)) sb.AppendLine("\t" + Localization.No_manufacturer_information_string); @@ -298,8 +302,7 @@ public static class CIS else sb.AppendFormat(Localization.Product_name_0, tuple.Product).AppendLine(); - if(tuple.AdditionalInformation == null || - tuple.AdditionalInformation.Length == 0) + if(tuple.AdditionalInformation == null || tuple.AdditionalInformation.Length == 0) sb.AppendLine("\t" + Localization.No_additional_information); else { diff --git a/SCSI/EVPD.cs b/SCSI/EVPD.cs index 9781a2d..c1c6365 100644 --- a/SCSI/EVPD.cs +++ b/SCSI/EVPD.cs @@ -75,8 +75,7 @@ public static class EVPD if(page == null) return null; - if(page[1] == 0 || - page[1] > 0x7F) + if(page[1] == 0 || page[1] > 0x7F) return null; if(page.Length != page[3] + 4) @@ -480,13 +479,15 @@ public static class EVPD break; case IdentificationAssociation.TargetDevice: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Identifier_belongs_to_target_device_that_contains_the_addressed_logical_unit); break; default: sb.AppendFormat("\t" + Localization.Identifier_has_unknown_association_with_code_0, - (byte)descriptor.Association).AppendLine(); + (byte)descriptor.Association). + AppendLine(); break; } @@ -528,13 +529,15 @@ public static class EVPD break; case IdentificationCodeSet.Binary: sb.AppendFormat("\t" + Localization.Vendor_descriptor_contains_binary_data_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)).AppendLine(); + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendLine(); break; default: sb.AppendFormat("\t" + Localization.Vendor_descriptor_contains_unknown_kind_1_of_data_hex_0, PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), - (byte)descriptor.CodeSet).AppendLine(); + (byte)descriptor.CodeSet). + AppendLine(); break; } @@ -551,15 +554,16 @@ public static class EVPD break; case IdentificationCodeSet.Binary: sb.AppendFormat("\t" + Localization.Inquiry_descriptor_contains_binary_data_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)).AppendLine(); + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendLine(); break; default: sb. - AppendFormat( - "\t" + Localization.Inquiry_descriptor_contains_unknown_kind_1_of_data_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), - (byte)descriptor.CodeSet).AppendLine(); + AppendFormat("\t" + Localization.Inquiry_descriptor_contains_unknown_kind_1_of_data_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), + (byte)descriptor.CodeSet). + AppendLine(); break; } @@ -602,7 +606,8 @@ public static class EVPD else { sb.AppendFormat("\t" + Localization.Relative_target_port_identifier_0, - (descriptor.Binary[2] << 8) + descriptor.Binary[3]).AppendLine(); + (descriptor.Binary[2] << 8) + descriptor.Binary[3]). + AppendLine(); } break; @@ -612,7 +617,8 @@ public static class EVPD else { sb.AppendFormat("\t" + Localization.Target_group_identifier_0, - (descriptor.Binary[2] << 8) + descriptor.Binary[3]).AppendLine(); + (descriptor.Binary[2] << 8) + descriptor.Binary[3]). + AppendLine(); } break; @@ -625,7 +631,8 @@ public static class EVPD else { sb.AppendFormat("\t" + Localization.Logical_unit_group_identifier_0, - (descriptor.Binary[2] << 8) + descriptor.Binary[3]).AppendLine(); + (descriptor.Binary[2] << 8) + descriptor.Binary[3]). + AppendLine(); } break; @@ -655,7 +662,8 @@ public static class EVPD else { sb.AppendFormat("\t" + Localization.SCSI_name_string_identifier_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)).AppendLine(); + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendLine(); } break; @@ -667,121 +675,99 @@ public static class EVPD { case ProtocolIdentifiers.ADT: sb. - AppendFormat( - "\t" + Localization. - Protocol_Automation_Drive_Interface_Transport_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_Automation_Drive_Interface_Transport_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.ATA: sb. - AppendFormat( - "\t" + Localization. - Protocol_ATA_ATAPI_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_ATA_ATAPI_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.FibreChannel: sb. - AppendFormat( - "\t" + Localization. - Protocol_Fibre_Channel_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_Fibre_Channel_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.Firewire: sb. - AppendFormat( - "\t" + Localization. - Protocol_IEEE_1394_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_IEEE_1394_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.iSCSI: sb. - AppendFormat( - "\t" + Localization. - Protocol_Internet_SCSI_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_Internet_SCSI_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.NoProtocol: sb. - AppendFormat( - "\t" + Localization. - Protocol_unknown_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_unknown_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.PCIe: sb. - AppendFormat( - "\t" + Localization. - Protocol_PCI_Express_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_PCI_Express_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.RDMAP: sb. - AppendFormat( - "\t" + Localization. - Protocol_SCSI_Remote_Direct_Memory_Access_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_SCSI_Remote_Direct_Memory_Access_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.SAS: sb. - AppendFormat( - "\t" + Localization. - Protocol_Serial_Attachment_SCSI_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_Serial_Attachment_SCSI_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.SCSI: sb. - AppendFormat( - "\t" + Localization. - Protocol_Parallel_SCSI_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_Parallel_SCSI_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.SSA: sb. - AppendFormat( - "\t" + Localization.Protocol_SSA_specific_descriptor_with_unknown_format_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_SSA_specific_descriptor_with_unknown_format_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; case ProtocolIdentifiers.SCSIe: sb.AppendFormat("\t" + Localization.Protocol_SCSIe_specific_descriptor_Routing_ID_is_0, - (descriptor.Binary[0] << 8) + descriptor.Binary[1]).AppendLine(); + (descriptor.Binary[0] << 8) + descriptor.Binary[1]). + AppendLine(); break; case ProtocolIdentifiers.UAS: sb. - AppendFormat( - "\t" + Localization.Protocol_UAS_specific_descriptor_USB_address_0_interface_1, - descriptor.Binary[0] & 0x7F, descriptor.Binary[2]).AppendLine(); + AppendFormat("\t" + Localization.Protocol_UAS_specific_descriptor_USB_address_0_interface_1, + descriptor.Binary[0] & 0x7F, descriptor.Binary[2]). + AppendLine(); break; default: sb. - AppendFormat( - "\t" + Localization. - Protocol_unknown_code_0_specific_descriptor_with_unknown_format_hex_1, - (byte)descriptor.ProtocolIdentifier, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). + AppendFormat("\t" + Localization.Protocol_unknown_code_0_specific_descriptor_with_unknown_format_hex_1, + (byte)descriptor.ProtocolIdentifier, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)). AppendLine(); break; @@ -796,21 +782,23 @@ public static class EVPD case IdentificationCodeSet.ASCII: case IdentificationCodeSet.UTF8: sb.AppendFormat("\t" + Localization.Unknown_descriptor_type_1_contains_0, descriptor.ASCII, - (byte)descriptor.Type).AppendLine(); + (byte)descriptor.Type). + AppendLine(); break; case IdentificationCodeSet.Binary: sb.AppendFormat("\t" + Localization.Unknown_descriptor_type_1_contains_binary_data_hex_0, PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), - (byte)descriptor.Type).AppendLine(); + (byte)descriptor.Type). + AppendLine(); break; default: sb. - AppendFormat( - Localization.Inquiry_descriptor_type_2_contains_unknown_kind_1_of_data_hex_0, - PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), - (byte)descriptor.CodeSet, (byte)descriptor.Type).AppendLine(); + AppendFormat(Localization.Inquiry_descriptor_type_2_contains_unknown_kind_1_of_data_hex_0, + PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40), + (byte)descriptor.CodeSet, (byte)descriptor.Type). + AppendLine(); break; } @@ -1034,13 +1022,15 @@ public static class EVPD break; case IdentificationAssociation.TargetDevice: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Identifier_belongs_to_target_device_that_contains_the_addressed_logical_unit); break; default: sb.AppendFormat("\t" + Localization.Identifier_has_unknown_association_with_code_0, - (byte)descriptor.Association).AppendLine(); + (byte)descriptor.Association). + AppendLine(); break; } @@ -1049,12 +1039,14 @@ public static class EVPD { case NetworkServiceTypes.CodeDownload: sb.AppendFormat(Localization.Address_for_code_download_0, - StringHandlers.CToString(descriptor.Address)).AppendLine(); + StringHandlers.CToString(descriptor.Address)). + AppendLine(); break; case NetworkServiceTypes.Diagnostics: sb.AppendFormat(Localization.Address_for_diagnostics_0, - StringHandlers.CToString(descriptor.Address)).AppendLine(); + StringHandlers.CToString(descriptor.Address)). + AppendLine(); break; case NetworkServiceTypes.Logging: @@ -1069,7 +1061,8 @@ public static class EVPD break; case NetworkServiceTypes.StorageConf: sb.AppendFormat(Localization.Address_for_storage_configuration_service_0, - StringHandlers.CToString(descriptor.Address)).AppendLine(); + StringHandlers.CToString(descriptor.Address)). + AppendLine(); break; case NetworkServiceTypes.Unspecified: @@ -1079,17 +1072,20 @@ public static class EVPD break; case NetworkServiceTypes.CopyService: sb.AppendFormat(Localization.Address_for_copy_service_0, - StringHandlers.CToString(descriptor.Address)).AppendLine(); + StringHandlers.CToString(descriptor.Address)). + AppendLine(); break; case NetworkServiceTypes.Administrative: sb.AppendFormat(Localization.Address_for_administrative_configuration_service_0, - StringHandlers.CToString(descriptor.Address)).AppendLine(); + StringHandlers.CToString(descriptor.Address)). + AppendLine(); break; default: sb.AppendFormat(Localization.Address_of_unknown_type_1_0, - StringHandlers.CToString(descriptor.Address), (byte)descriptor.Type).AppendLine(); + StringHandlers.CToString(descriptor.Address), (byte)descriptor.Type). + AppendLine(); break; } @@ -1263,7 +1259,8 @@ public static class EVPD break; default: sb.AppendFormat(Localization.Logical_unit_supports_unknown_protection_defined_by_code_0, - page.SPT).AppendLine(); + page.SPT). + AppendLine(); break; } @@ -1347,7 +1344,8 @@ public static class EVPD if(page.ExtendedTestMinutes > 0) { sb.AppendFormat(Localization.Extended_self_test_takes_0_to_complete, - TimeSpan.FromMinutes(page.ExtendedTestMinutes)).AppendLine(); + TimeSpan.FromMinutes(page.ExtendedTestMinutes)). + AppendLine(); } if(page.MaximumSenseLength > 0) @@ -1435,13 +1433,16 @@ public static class EVPD sb.AppendLine(Localization.SCSI_to_ATA_Translation_Layer_Data); sb.AppendFormat("\t" + Localization.Translation_layer_vendor_0, - VendorString.Prettify(StringHandlers.CToString(page.VendorIdentification).Trim())).AppendLine(); + VendorString.Prettify(StringHandlers.CToString(page.VendorIdentification).Trim())). + AppendLine(); sb.AppendFormat("\t" + Localization.Translation_layer_name_0, - StringHandlers.CToString(page.ProductIdentification).Trim()).AppendLine(); + StringHandlers.CToString(page.ProductIdentification).Trim()). + AppendLine(); sb.AppendFormat("\t" + Localization.Translation_layer_release_level_0, - StringHandlers.CToString(page.ProductRevisionLevel).Trim()).AppendLine(); + StringHandlers.CToString(page.ProductRevisionLevel).Trim()). + AppendLine(); switch(page.CommandCode) { @@ -1532,8 +1533,10 @@ public static class EVPD PageLength = (byte)(pageResponse[3] + 4), ServoFirmwareChecksum = (ushort)((pageResponse[4] << 8) + pageResponse[5]), ServoEEPROMChecksum = (ushort)((pageResponse[6] << 8) + pageResponse[7]), - ReadWriteFirmwareChecksum = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + - (pageResponse[10] << 8) + pageResponse[11]), + ReadWriteFirmwareChecksum = (uint)((pageResponse[8] << 24) + + (pageResponse[9] << 16) + + (pageResponse[10] << 8) + + pageResponse[11]), ReadWriteFirmwareBuildData = new byte[24] }; @@ -1562,7 +1565,8 @@ public static class EVPD AppendLine(); sb.AppendFormat("\t" + Localization.Quantum_Read_write_firmware_build_date_0, - StringHandlers.CToString(page.ReadWriteFirmwareBuildData)).AppendLine(); + StringHandlers.CToString(page.ReadWriteFirmwareBuildData)). + AppendLine(); return sb.ToString(); } @@ -1593,8 +1597,7 @@ public static class EVPD if(pageResponse == null) return null; - if(pageResponse[1] != 0xC0 && - pageResponse[1] != 0xC1) + if(pageResponse[1] != 0xC0 && pageResponse[1] != 0xC1) return null; if(pageResponse[3] != 92) @@ -1711,27 +1714,32 @@ public static class EVPD { case 0xC2: sb.AppendFormat("\t" + Localization.Certance_Head_Assembly_Serial_Number_0, - StringHandlers.CToString(page.SerialNumber)).AppendLine(); + StringHandlers.CToString(page.SerialNumber)). + AppendLine(); break; case 0xC3: sb.AppendFormat("\t" + Localization.Certance_Reel_Motor_1_Serial_Number_0, - StringHandlers.CToString(page.SerialNumber)).AppendLine(); + StringHandlers.CToString(page.SerialNumber)). + AppendLine(); break; case 0xC4: sb.AppendFormat("\t" + Localization.Certance_Reel_Motor_2_Serial_Number_0, - StringHandlers.CToString(page.SerialNumber)).AppendLine(); + StringHandlers.CToString(page.SerialNumber)). + AppendLine(); break; case 0xC5: sb.AppendFormat("\t" + Localization.Certance_Board_Serial_Number_0, - StringHandlers.CToString(page.SerialNumber)).AppendLine(); + StringHandlers.CToString(page.SerialNumber)). + AppendLine(); break; case 0xC6: sb.AppendFormat("\t" + Localization.Certance_Base_Mechanical_Serial_Number_0, - StringHandlers.CToString(page.SerialNumber)).AppendLine(); + StringHandlers.CToString(page.SerialNumber)). + AppendLine(); break; } @@ -1817,7 +1825,9 @@ public static class EVPD CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4), PortATransportType = pageResponse[12], PortASelectionID = pageResponse[15], - OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) + + OperatingHours = (uint)((pageResponse[20] << 24) + + (pageResponse[21] << 16) + + (pageResponse[22] << 8) + pageResponse[23]), CartridgeSerialNumber = new byte[32] }; @@ -1980,10 +1990,12 @@ public static class EVPD } sb.AppendFormat("\t" + Localization.Cartridge_has_an_uncompressed_capability_of_0_gigabytes, - page.CartridgeCapacity).AppendLine(); + page.CartridgeCapacity). + AppendLine(); sb.AppendFormat("\t" + Localization.Cartridge_serial_number_0, - StringHandlers.SpacePaddedToString(page.CartridgeSerialNumber)).AppendLine(); + StringHandlers.SpacePaddedToString(page.CartridgeSerialNumber)). + AppendLine(); } else sb.AppendLine("\t" + Localization.There_is_no_cartridge_inserted); @@ -2114,7 +2126,8 @@ public static class EVPD sb.AppendLine(Localization.IBM_Drive_Serial_Numbers_page); sb.AppendFormat("\t" + Localization.Manufacturing_serial_number_0, - StringHandlers.CToString(page.ManufacturingSerial)).AppendLine(); + StringHandlers.CToString(page.ManufacturingSerial)). + AppendLine(); sb.AppendFormat("\t" + Localization.Reported_serial_number_0, StringHandlers.CToString(page.ReportedSerial)). AppendLine(); @@ -2231,8 +2244,7 @@ public static class EVPD PageCode = pageResponse[1] }; - if(pageResponse[3] == 92 && - pageResponse.Length >= 96) + if(pageResponse[3] == 92 && pageResponse.Length >= 96) { decoded.Component = new byte[26]; decoded.Version = new byte[19]; @@ -2423,7 +2435,8 @@ public static class EVPD sb.AppendLine(Localization.Seagate_Firmware_Numbers_page); sb.AppendFormat("\t" + Localization.Controller_firmware_version_0, - StringHandlers.CToString(page.ControllerFirmware)).AppendLine(); + StringHandlers.CToString(page.ControllerFirmware)). + AppendLine(); sb.AppendFormat("\t" + Localization.Boot_firmware_version_0, StringHandlers.CToString(page.BootFirmware)). AppendLine(); diff --git a/SCSI/Inquiry.cs b/SCSI/Inquiry.cs index 766a0d9..9ce7e2d 100644 --- a/SCSI/Inquiry.cs +++ b/SCSI/Inquiry.cs @@ -71,7 +71,8 @@ public static class Inquiry AppendLine(); sb.AppendFormat(Localization.Device_release_level_0, - StringHandlers.CToString(response.ProductRevisionLevel).Trim()).AppendLine(); + StringHandlers.CToString(response.ProductRevisionLevel).Trim()). + AppendLine(); switch((PeripheralQualifiers)response.PeripheralQualifier) { @@ -93,7 +94,8 @@ public static class Inquiry break; default: sb.AppendFormat(Localization.Vendor_value_0_set_in_Peripheral_Qualifier_field, - response.PeripheralQualifier).AppendLine(); + response.PeripheralQualifier). + AppendLine(); break; } @@ -231,7 +233,8 @@ public static class Inquiry break; default: sb.AppendFormat(Localization.Device_claims_to_comply_with_unknown_SCSI_ANSI_standard_value_0, - response.ANSIVersion).AppendLine(); + response.ANSIVersion). + AppendLine(); break; } @@ -248,7 +251,8 @@ public static class Inquiry break; default: sb.AppendFormat(Localization.Device_claims_to_comply_with_unknown_SCSI_ECMA_standard_value_0, - response.ECMAVersion).AppendLine(); + response.ECMAVersion). + AppendLine(); break; } @@ -265,7 +269,8 @@ public static class Inquiry break; default: sb.AppendFormat(Localization.Device_claims_to_comply_with_unknown_SCSI_ISO_IEC_standard_value_0, - response.ISOVersion).AppendLine(); + response.ISOVersion). + AppendLine(); break; } @@ -2343,10 +2348,12 @@ public static class Inquiry sb.AppendFormat(Localization.Release_firmware_0, response.Qt_ReleasedFirmware).AppendLine(); sb.AppendFormat(Localization.Firmware_version_0_1, response.Qt_FirmwareMajorVersion, - response.Qt_FirmwareMinorVersion).AppendLine(); + response.Qt_FirmwareMinorVersion). + AppendLine(); sb.AppendFormat(Localization.EEPROM_format_version_0_1, response.Qt_EEPROMFormatMajorVersion, - response.Qt_EEPROMFormatMinorVersion).AppendLine(); + response.Qt_EEPROMFormatMinorVersion). + AppendLine(); sb.AppendFormat(Localization.Firmware_personality_0, response.Qt_FirmwarePersonality).AppendLine(); sb.AppendFormat(Localization.Firmware_sub_personality_0, response.Qt_FirmwareSubPersonality).AppendLine(); @@ -2429,7 +2436,8 @@ public static class Inquiry if(response.SeagatePresent) { sb.AppendFormat(Core.Drive_serial_number_0, - StringHandlers.CToString(response.Seagate_DriveSerialNumber)).AppendLine(); + StringHandlers.CToString(response.Seagate_DriveSerialNumber)). + AppendLine(); } if(response.Seagate2Present) @@ -2441,7 +2449,8 @@ public static class Inquiry if(response.Seagate3Present) { sb.AppendFormat(Localization.Drive_servo_part_number_0, - PrintHex.ByteArrayToHexArrayString(response.Seagate_ServoPROMPartNo, 40)).AppendLine(); + PrintHex.ByteArrayToHexArrayString(response.Seagate_ServoPROMPartNo, 40)). + AppendLine(); } } @@ -2452,7 +2461,8 @@ public static class Inquiry if(response.KreonPresent) { sb.AppendFormat(Localization.Drive_is_flashed_with_Kreon_firmware_0, - StringHandlers.CToString(response.KreonVersion)).AppendLine(); + StringHandlers.CToString(response.KreonVersion)). + AppendLine(); } #endregion Kreon vendor prettifying diff --git a/SCSI/MMC/CPRM.cs b/SCSI/MMC/CPRM.cs index efa032e..7fa9cef 100644 --- a/SCSI/MMC/CPRM.cs +++ b/SCSI/MMC/CPRM.cs @@ -88,7 +88,8 @@ public static class CPRM sb.AppendFormat(Localization.Reserved_equals_0_X2, response.Reserved).AppendLine(); #endif sb.AppendFormat(Localization.Total_number_of_CPRM_Media_Key_Blocks_available_to_transfer_0, - response.TotalPacks).AppendLine(); + response.TotalPacks). + AppendLine(); sb.AppendFormat(Localization.CPRM_Media_Key_Blocks_in_hex_follows); sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MKBPackData, 80)); diff --git a/SCSI/MMC/DiscInformation.cs b/SCSI/MMC/DiscInformation.cs index 12df944..2de6914 100644 --- a/SCSI/MMC/DiscInformation.cs +++ b/SCSI/MMC/DiscInformation.cs @@ -108,8 +108,7 @@ public static class DiscInformation decoded.DiscApplicationCode = response[32]; decoded.OPCTablesNumber = response[33]; - if(decoded.OPCTablesNumber <= 0 || - response.Length != decoded.OPCTablesNumber * 8 + 34) + if(decoded.OPCTablesNumber <= 0 || response.Length != decoded.OPCTablesNumber * 8 + 34) return decoded; decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber]; @@ -228,13 +227,15 @@ public static class DiscInformation information.Value.LastSessionLeadInStartLBA, (information.Value.LastSessionLeadInStartLBA & 0xFF0000) >> 16, (information.Value.LastSessionLeadInStartLBA & 0xFF00) >> 8, - information.Value.LastSessionLeadInStartLBA & 0xFF).AppendLine(); + information.Value.LastSessionLeadInStartLBA & 0xFF). + AppendLine(); 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(); + information.Value.LastPossibleLeadOutStartLBA & 0xFF). + AppendLine(); sb.AppendLine(information.Value.URU ? Localization.Disc_is_defined_for_unrestricted_use @@ -256,7 +257,8 @@ public static class DiscInformation { 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(); + table.OPCValues[5]). + AppendLine(); } return sb.ToString(); @@ -298,7 +300,8 @@ public static class DiscInformation sb.AppendFormat(Localization._0_assigned_tracks_on_the_disc, information.Value.AssignedTracks).AppendLine(); sb.AppendFormat(Localization._0_maximum_possible_appendable_tracks_on_the_disc, - information.Value.AppendableTracks).AppendLine(); + information.Value.AppendableTracks). + AppendLine(); sb.AppendFormat(Localization._0_current_appendable_tracks_on_the_disc, information.Value.MaxAppendableTracks). AppendLine(); @@ -347,7 +350,8 @@ public static class DiscInformation AppendLine(); sb.AppendFormat(Localization._0_remaining_POW_reallocation_map_entries, - information.Value.RemainingPOWReallocation).AppendLine(); + information.Value.RemainingPOWReallocation). + AppendLine(); sb.AppendFormat(Localization._0_remaining_POW_updates, information.Value.RemainingPOWUpdates).AppendLine(); diff --git a/SCSI/MMC/Features.cs b/SCSI/MMC/Features.cs index 44549ae..68f86f7 100644 --- a/SCSI/MMC/Features.cs +++ b/SCSI/MMC/Features.cs @@ -1427,12 +1427,10 @@ public static class Features decoded.PhysicalInterfaceStandard = (PhysicalInterfaces)((feature[4] << 24) + (feature[5] << 16) + (feature[6] << 8) + feature[7]); - if(decoded.Version >= 1 && - feature.Length >= 12) + if(decoded.Version >= 1 && feature.Length >= 12) decoded.DBE |= (feature[8] & 0x01) == 0x01; - if(decoded.Version >= 2 && - feature.Length >= 12) + if(decoded.Version >= 2 && feature.Length >= 12) decoded.INQ2 |= (feature[8] & 0x02) == 0x02; return decoded; @@ -1650,16 +1648,14 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(decoded.Version >= 2 && - feature.Length >= 8) + if(decoded.Version >= 2 && feature.Length >= 8) { decoded.MULTI110 |= (feature[4] & 0x01) == 0x01; decoded.DualR |= (feature[6] & 0x01) == 0x01; } // TODO: Check this - if(decoded.Version >= 2 && - feature.Length >= 8) + if(decoded.Version >= 2 && feature.Length >= 8) decoded.DualRW |= (feature[6] & 0x02) == 0x02; return decoded; @@ -1788,8 +1784,7 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(decoded.Version >= 1 && - feature.Length >= 12) + if(decoded.Version >= 1 && feature.Length >= 12) { decoded.RENoSA |= (feature[4] & 0x08) == 0x08; decoded.Expand |= (feature[4] & 0x04) == 0x04; @@ -1798,8 +1793,7 @@ public static class Features decoded.RRM |= (feature[8] & 0x01) == 0x01; } - if(decoded.Version >= 2 && - feature.Length >= 12) + if(decoded.Version >= 2 && feature.Length >= 12) decoded.FRF |= (feature[4] & 0x80) == 0x80; return decoded; @@ -1827,8 +1821,7 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(decoded.Version >= 1 && - feature.Length >= 8) + if(decoded.Version >= 1 && feature.Length >= 8) decoded.SSA |= (feature[4] & 0x80) == 0x80; return decoded; @@ -2274,8 +2267,7 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(feature[7] <= 0 || - feature.Length <= feature[7] + 8) + if(feature[7] <= 0 || feature.Length <= feature[7] + 8) return decoded; decoded.LinkSizes = new byte[feature[7]]; @@ -2732,8 +2724,7 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(decoded.Version >= 1 && - feature.Length >= 8) + if(decoded.Version >= 1 && feature.Length >= 8) decoded.M5 |= (feature[4] & 0x01) == 0x01; return decoded; @@ -2761,8 +2752,7 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(decoded.Version < 1 || - feature.Length < 8) + if(decoded.Version < 1 || feature.Length < 8) return decoded; decoded.Group3 |= (feature[4] & 0x01) == 0x01; @@ -2820,8 +2810,7 @@ public static class Features decoded.Persistent |= (feature[2] & 0x02) == 0x02; decoded.Version = (byte)((feature[2] & 0x3C) >> 2); - if(decoded.Version >= 3 && - feature.Length >= 8) + if(decoded.Version >= 3 && feature.Length >= 8) { decoded.RBCB |= (feature[4] & 0x10) == 0x10; decoded.SCS |= (feature[4] & 0x08) == 0x08; @@ -2830,8 +2819,7 @@ public static class Features decoded.SW |= (feature[4] & 0x01) == 0x01; } - if(decoded.Version < 5 || - feature.Length < 8) + if(decoded.Version < 5 || feature.Length < 8) return decoded; decoded.SMP |= (feature[4] & 0x20) == 0x20; @@ -2920,8 +2908,10 @@ public static class Features for(var i = 0; i < decoded.DCBs.Length; i++) { - decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + (feature[1 + 4 + i * 4] << 16) + - (feature[2 + 4 + i * 4] << 8) + feature[3 + 4 + i * 4]); + decoded.DCBs[i] = (uint)((feature[0 + 4 + i * 4] << 24) + + (feature[1 + 4 + i * 4] << 16) + + (feature[2 + 4 + i * 4] << 8) + + feature[3 + 4 + i * 4]); } return decoded; @@ -3381,7 +3371,8 @@ public static class Features break; default: sb.AppendFormat(Localization.Drive_uses_an_unknown_interface_with_code_0, - (uint)ftr.PhysicalInterfaceStandard).AppendLine(); + (uint)ftr.PhysicalInterfaceStandard). + AppendLine(); break; } @@ -3391,7 +3382,8 @@ public static class Features if(ftr.INQ2) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_supports_EVPD_Page_Code_and_16_bit_Allocation_Length_as_described_in_SPC_3); } @@ -3443,7 +3435,8 @@ public static class Features break; case 4: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Features_Prettify_0003_Drive_is_a_changer_with_individually_changeable_discs); break; @@ -3453,7 +3446,8 @@ public static class Features break; default: sb.AppendFormat("\t" + Localization.Features_Prettify_0003_Drive_uses_unknown_loading_mechanism_type_0, - ftr.LoadingMechanismType).AppendLine(); + ftr.LoadingMechanismType). + AppendLine(); break; } @@ -3472,7 +3466,8 @@ public static class Features if(ftr.DBML) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Features_Prettify_0003_Drive_reports_Device_Busy_Class_events_during_medium_loading_unloading); } @@ -3491,8 +3486,8 @@ public static class Features if(ftr.DWP) { - sb.AppendLine("\t" + Localization. - Drive_supports_reading_writing_the_Disc_Write_Protect_PAC_on_BD_R_RE_media); + sb.AppendLine("\t" + + Localization.Drive_supports_reading_writing_the_Disc_Write_Protect_PAC_on_BD_R_RE_media); } if(ftr.WDCB) @@ -3812,8 +3807,7 @@ public static class Features Feature_0028 ftr = feature.Value; var sb = new StringBuilder(); - if(ftr.Write && - ftr is { DVDPRead: true, DVDPWrite: true }) + if(ftr.Write && ftr is { DVDPRead: true, DVDPWrite: true }) sb.Append(Localization.Drive_can_read_and_write_CD_MRW_and_DVD_MRW); else if(ftr is { DVDPRead: true, DVDPWrite: true }) sb.Append(Localization.Drive_can_read_and_write_DVD_MRW); @@ -3954,8 +3948,8 @@ public static class Features if(ftr.Intermediate) { - sb.AppendLine("\t" + Localization. - Drive_supports_writing_on_an_intermediate_state_session_and_quick_formatting); + sb.AppendLine("\t" + + Localization.Drive_supports_writing_on_an_intermediate_state_session_and_quick_formatting); } if(ftr.DSDR) @@ -4097,7 +4091,8 @@ public static class Features if(ftr.MaxCueSheet > 0) { sb.AppendFormat("\t" + Localization.Drive_supports_a_maximum_of_0_bytes_in_a_single_cue_sheet, - ftr.MaxCueSheet).AppendLine(); + ftr.MaxCueSheet). + AppendLine(); } return sb.ToString(); @@ -4469,7 +4464,8 @@ public static class Features if(ftr.RI) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_is_able_to_maintain_the_online_format_layer_through_reset_and_power_cycling); } @@ -4593,7 +4589,8 @@ public static class Features if(ftr.Current) { sb.AppendFormat(Localization.Drive_supports_DVD_CSS_CPPM_version_0_and_current_disc_is_encrypted, - ftr.CSSVersion).AppendLine(); + ftr.CSSVersion). + AppendLine(); } else sb.AppendFormat(Localization.Drive_supports_DVD_CSS_CPPM_version_0, ftr.CSSVersion).AppendLine(); @@ -4622,13 +4619,15 @@ public static class Features if(ftr.MP2A) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_supports_the_Write_Speed_Performance_Descriptor_Blocks_in_the_MMC_mode_page_2Ah); } if(ftr.WSPD) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_supports_the_Write_Speed_data_of_GET_PERFORMANCE_and_the_WRC_field_of_SET_STREAMING); } @@ -4682,7 +4681,8 @@ public static class Features if(ftr.Current) { sb.AppendFormat(Localization.Drive_supports_DVD_CPRM_version_0_and_current_disc_is_or_can_be_encrypted, - ftr.CPRMVersion).AppendLine(); + ftr.CPRMVersion). + AppendLine(); } else sb.AppendFormat(Localization.Drive_supports_DVD_CPRM_version_0, ftr.CPRMVersion).AppendLine(); @@ -4777,7 +4777,8 @@ public static class Features if(ftr.BindNonceBlocks > 0) { sb.AppendFormat("\t" + Localization._0_media_blocks_are_required_for_the_binding_nonce, - ftr.BindNonceBlocks).AppendLine(); + ftr.BindNonceBlocks). + AppendLine(); } } diff --git a/SCSI/Modes/01.cs b/SCSI/Modes/01.cs index 1102369..57c370f 100644 --- a/SCSI/Modes/01.cs +++ b/SCSI/Modes/01.cs @@ -195,13 +195,15 @@ public static partial class Modes if(page.TB) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Data_not_recovered_within_limits_shall_be_transferred_back_before_a_CHECK_CONDITION); } if(page.RC) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_transfer_the_entire_requested_length_without_delaying_to_perform_error_recovery); } @@ -232,7 +234,8 @@ public static partial class Modes if(page.RecoveryTimeLimit > 0) { sb.AppendFormat("\t" + Localization.Drive_will_employ_a_maximum_of_0_ms_to_recover_data, - page.RecoveryTimeLimit).AppendLine(); + page.RecoveryTimeLimit). + AppendLine(); } if(page.LBPERE) diff --git a/SCSI/Modes/01_MMC.cs b/SCSI/Modes/01_MMC.cs index fa5ab3f..6bc9d83 100644 --- a/SCSI/Modes/01_MMC.cs +++ b/SCSI/Modes/01_MMC.cs @@ -139,8 +139,8 @@ public static partial class Modes string RecoveredNotReported = "\t" + Localization.Recovered_errors_will_not_be_reported + "\n"; string RecoveredReported = "\t" + Localization.Recovered_errors_will_be_reported + "\n"; - string RecoveredAbort = "\t" + Localization.Recovered_errors_will_be_reported_and_aborted_with_CHECK_CONDITION + - "\n"; + string RecoveredAbort = + "\t" + Localization.Recovered_errors_will_be_reported_and_aborted_with_CHECK_CONDITION + "\n"; string UnrecECCAbort = "\t" + Localization.Unrecovered_ECC_errors_will_return_CHECK_CONDITION; string UnrecCIRCAbort = "\t" + Localization.Unrecovered_CIRC_errors_will_return_CHECK_CONDITION; @@ -242,7 +242,8 @@ public static partial class Modes if(page.RecoveryTimeLimit > 0) { sb.AppendFormat("\t" + Localization.Drive_will_employ_a_maximum_of_0_ms_to_recover_data, - page.RecoveryTimeLimit).AppendLine(); + page.RecoveryTimeLimit). + AppendLine(); } return sb.ToString(); diff --git a/SCSI/Modes/02.cs b/SCSI/Modes/02.cs index b86ddcf..e39c983 100644 --- a/SCSI/Modes/02.cs +++ b/SCSI/Modes/02.cs @@ -132,59 +132,60 @@ public static partial class Modes if(page.BufferFullRatio > 0) { sb.AppendFormat("\t" + Localization._0_ratio_of_buffer_that_shall_be_full_prior_to_attempting_a_reselection, - page.BufferFullRatio).AppendLine(); + page.BufferFullRatio). + AppendLine(); } if(page.BufferEmptyRatio > 0) { sb. - AppendFormat( - "\t" + Localization._0_ratio_of_buffer_that_shall_be_empty_prior_to_attempting_a_reselection, - page.BufferEmptyRatio).AppendLine(); + 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" + Localization._0_µs_maximum_permitted_to_assert_BSY_without_a_REQ_ACK_handshake, - page.BusInactivityLimit * 100).AppendLine(); + page.BusInactivityLimit * 100). + AppendLine(); } if(page.DisconnectTimeLimit > 0) { sb. - AppendFormat( - "\t" + Localization. - _0_µs_maximum_permitted_wait_after_releasing_the_bus_before_attempting_reselection, - page.DisconnectTimeLimit * 100).AppendLine(); + 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" + Localization. - _0_µs_allowed_to_use_the_bus_before_disconnecting_if_granted_the_privilege_and_not_restricted, - page.ConnectTimeLimit * 100).AppendLine(); + 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" + Localization._0_bytes_maximum_can_be_transferred_before_disconnecting, - page.MaxBurstSize * 512).AppendLine(); + page.MaxBurstSize * 512). + AppendLine(); } if(page.FirstBurstSize > 0) { sb. - AppendFormat( - "\t" + Localization. - _0_bytes_maximum_can_be_transferred_for_a_command_along_with_the_disconnect_command, - page.FirstBurstSize * 512).AppendLine(); + 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("\t" + Localization. + sb.AppendLine("\t" + + Localization. Target_shall_not_transfer_data_for_a_command_during_the_same_interconnect_tenancy); } @@ -198,12 +199,14 @@ public static partial class Modes break; case 1: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. All_data_for_a_command_shall_be_transferred_within_a_single_interconnect_tenancy); break; case 3: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. All_data_and_the_response_for_a_command_shall_be_transferred_within_a_single_interconnect_tenancy); break; diff --git a/SCSI/Modes/03.cs b/SCSI/Modes/03.cs index 6a3b5ad..c9cf387 100644 --- a/SCSI/Modes/03.cs +++ b/SCSI/Modes/03.cs @@ -129,29 +129,33 @@ public static partial class Modes sb.AppendLine("\t" + Localization.Parameters_can_be_saved); sb. - AppendFormat( - "\t" + Localization. - _0_tracks_per_zone_to_use_in_dividing_the_capacity_for_the_purpose_of_allocating_alternate_sectors, - page.TracksPerZone).AppendLine(); + 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" + Localization._0_sectors_per_zone_that_shall_be_reserved_for_defect_handling, - page.AltSectorsPerZone).AppendLine(); + page.AltSectorsPerZone). + AppendLine(); sb.AppendFormat("\t" + Localization._0_tracks_per_zone_that_shall_be_reserved_for_defect_handling, - page.AltTracksPerZone).AppendLine(); + page.AltTracksPerZone). + AppendLine(); sb.AppendFormat("\t" + Localization._0_tracks_per_LUN_that_shall_be_reserved_for_defect_handling, - page.AltTracksPerLun).AppendLine(); + page.AltTracksPerLun). + 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" + Localization._0_sectors_between_last_block_of_one_track_and_first_block_of_the_next, - page.TrackSkew).AppendLine(); + page.TrackSkew). + AppendLine(); sb.AppendFormat("\t" + Localization._0_sectors_between_last_block_of_a_cylinder_and_first_block_of_the_next_one, - page.CylinderSkew).AppendLine(); + page.CylinderSkew). + AppendLine(); if(page.SSEC) sb.AppendLine("\t" + Localization.Drive_supports_soft_sectoring_format); @@ -163,9 +167,11 @@ public static partial class Modes sb.AppendLine("\t" + Localization.Drive_media_is_removable); sb.AppendLine(page.SURF - ? "\t" + Localization. + ? "\t" + + Localization. Sector_addressing_is_progressively_incremented_in_one_surface_before_going_to_the_next - : "\t" + Localization. + : "\t" + + Localization. Sector_addressing_is_progressively_incremented_in_one_cylinder_before_going_to_the_next); return sb.ToString(); diff --git a/SCSI/Modes/05.cs b/SCSI/Modes/05.cs index 2c0c291..0534a0d 100644 --- a/SCSI/Modes/05.cs +++ b/SCSI/Modes/05.cs @@ -194,27 +194,24 @@ public static partial class Modes if(!page.TRDY) { sb. - AppendFormat( - "\t" + Localization. - Target_shall_wait_0_seconds_before_attempting_to_access_the_medium_after_motor_on_is_asserted, - (double)page.MotorOnDelay * 10).AppendLine(); + 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( - "\t" + Localization. - Target_shall_wait_0_seconds_after_drive_is_ready_before_aborting_medium_access_attempts, - (double)page.MotorOnDelay * 10).AppendLine(); + 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( - "\t" + Localization. - Target_shall_wait_0_seconds_before_releasing_the_motor_on_signal_after_becoming_idle, - (double)page.MotorOffDelay * 10).AppendLine(); + 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("\t" + Localization.Target_shall_never_release_the_motor_on_signal); @@ -249,23 +246,22 @@ public static partial class Modes break; case 1: - 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)); + 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("\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)); + 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( - "\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); + 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; } @@ -277,29 +273,29 @@ public static partial class Modes break; case 1: - 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)); + 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("\t" + ((page.Pin4 & 0x08) == 0x08 - ? Localization.Pin_4_indicates_eject_when_active_high - : Localization.Pin_4_indicates_eject_when_active_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("\t" + ((page.Pin4 & 0x08) == 0x08 - ? Localization.Pin_4_indicates_head_load_when_active_high - : Localization.Pin_4_indicates_head_load_when_active_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( - "\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); + 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; } @@ -311,11 +307,8 @@ public static partial class Modes break; default: - 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); + 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; } @@ -327,17 +320,15 @@ public static partial class Modes break; case 1: - 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)); + 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( - "\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); + 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; } diff --git a/SCSI/Modes/07.cs b/SCSI/Modes/07.cs index 450617c..7cc13f2 100644 --- a/SCSI/Modes/07.cs +++ b/SCSI/Modes/07.cs @@ -130,7 +130,8 @@ public static partial class Modes if(page.RecoveryTimeLimit > 0) { sb.AppendFormat("\t" + Localization.Drive_will_employ_a_maximum_of_0_ms_to_recover_data, - page.RecoveryTimeLimit).AppendLine(); + page.RecoveryTimeLimit). + AppendLine(); } return sb.ToString(); diff --git a/SCSI/Modes/07_MMC.cs b/SCSI/Modes/07_MMC.cs index 3a5c877..037af10 100644 --- a/SCSI/Modes/07_MMC.cs +++ b/SCSI/Modes/07_MMC.cs @@ -104,8 +104,8 @@ public static partial class Modes string RecoveredNotReported = "\t" + Localization.Recovered_errors_will_not_be_reported + "\n"; string RecoveredReported = "\t" + Localization.Recovered_errors_will_be_reported + "\n"; - string RecoveredAbort = "\t" + Localization.Recovered_errors_will_be_reported_and_aborted_with_CHECK_CONDITION + - "\n"; + string RecoveredAbort = + "\t" + Localization.Recovered_errors_will_be_reported_and_aborted_with_CHECK_CONDITION + "\n"; string UnrecECCAbort = "\t" + Localization.Unrecovered_ECC_errors_will_return_CHECK_CONDITION; string UnrecCIRCAbort = "\t" + Localization.Unrecovered_CIRC_errors_will_return_CHECK_CONDITION; diff --git a/SCSI/Modes/08.cs b/SCSI/Modes/08.cs index 5bd808e..2346c9d 100644 --- a/SCSI/Modes/08.cs +++ b/SCSI/Modes/08.cs @@ -171,18 +171,21 @@ public static partial class Modes break; case 1: - sb.AppendLine("\t" + Localization. + 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("\t" + Localization. + 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("\t" + Localization.Unknown_demand_read_retention_priority_value_0, - page.DemandReadRetentionPrio).AppendLine(); + page.DemandReadRetentionPrio). + AppendLine(); break; } @@ -194,18 +197,21 @@ public static partial class Modes break; case 1: - sb.AppendLine("\t" + Localization. + 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("\t" + Localization. + 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("\t" + Localization.Unknown_demand_write_retention_priority_value_0, - page.DemandReadRetentionPrio).AppendLine(); + page.DemandReadRetentionPrio). + AppendLine(); break; } @@ -222,7 +228,8 @@ public static partial class Modes else { sb.AppendFormat("\t" + Localization.Pre_fetch_will_be_done_for_READ_commands_of_0_blocks_or_less, - page.DisablePreFetch).AppendLine(); + page.DisablePreFetch). + AppendLine(); if(page.MinimumPreFetch > 0) { @@ -233,21 +240,22 @@ public static partial class Modes if(page.MaximumPreFetch > 0) { sb.AppendFormat("\t" + Localization.A_maximum_of_0_blocks_will_be_pre_fetched, - page.MaximumPreFetch).AppendLine(); + page.MaximumPreFetch). + AppendLine(); } if(page.MaximumPreFetchCeiling > 0) { sb. - AppendFormat( - "\t" + Localization. - A_maximum_of_0_blocks_will_be_pre_fetched_even_if_it_is_commanded_to_pre_fetch_more, - page.MaximumPreFetchCeiling).AppendLine(); + 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("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_should_use_number_of_cache_segments_or_cache_segment_size_for_caching); } @@ -259,7 +267,8 @@ public static partial class Modes if(page.Disc) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Pre_fetch_can_continue_across_discontinuities_such_as_cylinders_or_tracks); } } @@ -275,12 +284,14 @@ public static partial class Modes if(page.LBCSS) { sb.AppendFormat("\t" + Localization.Drive_cache_segments_should_be_0_blocks_long, - page.CacheSegmentSize).AppendLine(); + page.CacheSegmentSize). + AppendLine(); } else { sb.AppendFormat("\t" + Localization.Drive_cache_segments_should_be_0_bytes_long, - page.CacheSegmentSize).AppendLine(); + page.CacheSegmentSize). + AppendLine(); } } } @@ -296,10 +307,9 @@ public static partial class Modes if(page.NonCacheSegmentSize > 0) { sb. - AppendFormat( - "\t" + Localization. - Drive_shall_allocate_0_bytes_to_buffer_even_when_all_cached_data_cannot_be_evicted, - page.NonCacheSegmentSize).AppendLine(); + 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) diff --git a/SCSI/Modes/0A.cs b/SCSI/Modes/0A.cs index ea2c905..2dd7158 100644 --- a/SCSI/Modes/0A.cs +++ b/SCSI/Modes/0A.cs @@ -201,20 +201,22 @@ public static partial class Modes if(page.RAENP) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Target_may_issue_an_asynchronous_event_notification_upon_completing_its_initialization); } if(page.UAAENP) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Target_may_issue_an_asynchronous_event_notification_instead_of_a_unit_attention_condition); } if(page.EAENP) { - sb.AppendLine("\t" + Localization. - Target_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) @@ -228,19 +230,22 @@ public static partial class Modes if(page.TAS) { - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Tasks_aborted_by_other_initiator_s_actions_should_be_terminated_with_TASK_ABORTED); } if(page.TMF_ONLY) { - sb.AppendLine("\t" + Localization. + 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("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_shall_return_descriptor_format_sense_data_when_returning_sense_data_in_the_same_transactions_as_a_CHECK_CONDITION); } @@ -298,17 +303,20 @@ public static partial class Modes switch(page.QErr) { case 0: - sb.AppendLine("\t" + Localization. + 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("\t" + Localization. + 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("\t" + Localization. + sb.AppendLine("\t" + + Localization. Affected_commands_in_the_task_set_belonging_with_the_CHECK_CONDITION_nexus_shall_be_aborted); break; @@ -325,12 +333,13 @@ public static partial class Modes break; case 2: - sb.AppendLine("\t" + Localization. - LUN_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("\t" + Localization. + 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; @@ -347,8 +356,8 @@ public static partial class Modes break; case 1: - sb.AppendLine("\t" + Localization. - On_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: @@ -364,9 +373,9 @@ public static partial class Modes if(page.ReadyAENHoldOffPeriod > 0) { sb. - AppendFormat( - "\t" + Localization._0_ms_before_attempting_asynchronous_event_notifications_after_initialization, - page.ReadyAENHoldOffPeriod).AppendLine(); + AppendFormat("\t" + Localization._0_ms_before_attempting_asynchronous_event_notifications_after_initialization, + page.ReadyAENHoldOffPeriod). + AppendLine(); } if(page.BusyTimeoutPeriod > 0) @@ -376,7 +385,8 @@ public static partial class Modes else { sb.AppendFormat("\t" + Localization.A_maximum_of_0_ms_are_allowed_to_remain_busy, - page.BusyTimeoutPeriod * 100).AppendLine(); + page.BusyTimeoutPeriod * 100). + AppendLine(); } } @@ -463,13 +473,14 @@ public static partial class Modes { if(page.SCSIP) { - sb.AppendLine("\t" + Localization. + 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); + sb.AppendLine("\t" + + Localization.Timestamp_can_be_initialized_by_methods_outside_of_the_SCSI_standards); } } diff --git a/SCSI/Modes/0D.cs b/SCSI/Modes/0D.cs index 0a955d0..e1dd5b0 100644 --- a/SCSI/Modes/0D.cs +++ b/SCSI/Modes/0D.cs @@ -98,7 +98,8 @@ public static partial class Modes switch(page.InactivityTimerMultiplier) { case 0: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_track_hold_state_a_vendor_specified_time_after_a_seek_or_read); break; @@ -131,13 +132,13 @@ public static partial class Modes break; case 8: - sb.AppendLine("\t" + Localization. - Drive_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("\t" + Localization. - Drive_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: @@ -157,13 +158,13 @@ public static partial class Modes break; case 14: - sb.AppendLine("\t" + Localization. - Drive_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("\t" + Localization. - Drive_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; } diff --git a/SCSI/Modes/0F.cs b/SCSI/Modes/0F.cs index d692ac2..20d8cab 100644 --- a/SCSI/Modes/0F.cs +++ b/SCSI/Modes/0F.cs @@ -84,10 +84,12 @@ public static partial class Modes decoded.DDE |= (pageResponse[3] & 0x80) == 0x80; decoded.RED = (byte)((pageResponse[3] & 0x60) >> 5); - decoded.CompressionAlgo = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + - pageResponse[7]); + decoded.CompressionAlgo = + (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + pageResponse[7]); - decoded.DecompressionAlgo = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + + decoded.DecompressionAlgo = (uint)((pageResponse[8] << 24) + + (pageResponse[9] << 16) + + (pageResponse[10] << 8) + pageResponse[11]); return decoded; diff --git a/SCSI/Modes/10.cs b/SCSI/Modes/10.cs index b6410ba..64f1a12 100644 --- a/SCSI/Modes/10.cs +++ b/SCSI/Modes/10.cs @@ -79,13 +79,17 @@ public static partial class Modes decoded.XORDIS |= (pageResponse[2] & 0x02) == 0x02; - decoded.MaxXorWrite = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + - pageResponse[7]); + decoded.MaxXorWrite = + (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + pageResponse[7]); - decoded.MaxRegenSize = (uint)((pageResponse[12] << 24) + (pageResponse[13] << 16) + (pageResponse[14] << 8) + + decoded.MaxRegenSize = (uint)((pageResponse[12] << 24) + + (pageResponse[13] << 16) + + (pageResponse[14] << 8) + pageResponse[15]); - decoded.MaxRebuildRead = (uint)((pageResponse[16] << 24) + (pageResponse[17] << 16) + (pageResponse[18] << 8) + + decoded.MaxRebuildRead = (uint)((pageResponse[16] << 24) + + (pageResponse[17] << 16) + + (pageResponse[18] << 8) + pageResponse[19]); decoded.RebuildDelay = (ushort)((pageResponse[22] << 8) + pageResponse[23]); @@ -116,27 +120,30 @@ public static partial class Modes if(page.MaxXorWrite > 0) { sb.AppendFormat("\t" + Localization.Drive_accepts_a_maximum_of_0_blocks_in_a_single_XOR_WRITE_command, - page.MaxXorWrite).AppendLine(); + page.MaxXorWrite). + AppendLine(); } if(page.MaxRegenSize > 0) { sb.AppendFormat("\t" + Localization.Drive_accepts_a_maximum_of_0_blocks_in_a_REGENERATE_command, - page.MaxRegenSize).AppendLine(); + page.MaxRegenSize). + AppendLine(); } if(page.MaxRebuildRead > 0) { sb. - AppendFormat( - "\t" + Localization.Drive_accepts_a_maximum_of_0_blocks_in_a_READ_command_during_rebuild, - page.MaxRebuildRead).AppendLine(); + 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("\t" + Localization.Drive_needs_a_minimum_of_0_ms_between_READ_commands_during_rebuild, - page.RebuildDelay).AppendLine(); + page.RebuildDelay). + AppendLine(); } } diff --git a/SCSI/Modes/10_SSC.cs b/SCSI/Modes/10_SSC.cs index e49bb11..8eac209 100644 --- a/SCSI/Modes/10_SSC.cs +++ b/SCSI/Modes/10_SSC.cs @@ -181,18 +181,18 @@ public static partial class Modes sb.AppendFormat("\t" + Localization.Active_partition_0, page.ActivePartition).AppendLine(); sb.AppendFormat("\t" + Localization.Write_buffer_shall_have_a_full_ratio_of_0_before_being_flushed_to_medium, - page.WriteBufferFullRatio).AppendLine(); + page.WriteBufferFullRatio). + AppendLine(); sb. - AppendFormat( - "\t" + Localization.Read_buffer_shall_have_an_empty_ratio_of_0_before_more_data_is_read_from_medium, - page.ReadBufferEmptyRatio).AppendLine(); + AppendFormat("\t" + Localization.Read_buffer_shall_have_an_empty_ratio_of_0_before_more_data_is_read_from_medium, + page.ReadBufferEmptyRatio). + AppendLine(); sb. - 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(); + 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) { @@ -260,7 +260,8 @@ public static partial class Modes case 14: case 15: sb.AppendFormat("\t" + Localization.Inter_block_gap_is_0_times_the_device_defined_gap_size, - page.GapSize).AppendLine(); + page.GapSize). + AppendLine(); break; default: diff --git a/SCSI/Modes/11.cs b/SCSI/Modes/11.cs index e856b86..7d1e73a 100644 --- a/SCSI/Modes/11.cs +++ b/SCSI/Modes/11.cs @@ -161,8 +161,8 @@ public static partial class Modes if(page.SDP) { - sb.AppendLine("\t" + Localization. - Number_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) @@ -170,15 +170,16 @@ public static partial class Modes if(page.POFM) { - sb.AppendLine("\t" + Localization. + 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("\t" + Localization. - Device_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: @@ -190,7 +191,8 @@ public static partial class Modes break; default: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_shall_erase_all_partitions_differing_on_size_on_MODE_SELECT_for_partitioning); break; @@ -217,7 +219,8 @@ public static partial class Modes break; case PartitionSizeUnitOfMeasures.Exponential: sb.AppendFormat("\t" + Localization.Partitions_are_defined_in_units_of_0_bytes, - Math.Pow(10, page.PartitionUnits)).AppendLine(); + Math.Pow(10, page.PartitionUnits)). + AppendLine(); measure = string.Format(Localization.units_of_0_bytes, Math.Pow(10, page.PartitionUnits)); @@ -244,13 +247,14 @@ public static partial class Modes break; case MediumFormatRecognitionValues.Incapable: - sb.AppendLine("\t" + Localization. - Device_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("\t" + Localization.Unknown_medium_recognition_code_0, - (byte)page.MediumFormatRecognition).AppendLine(); + (byte)page.MediumFormatRecognition). + AppendLine(); break; } diff --git a/SCSI/Modes/12_13_14.cs b/SCSI/Modes/12_13_14.cs index 205728f..b982121 100644 --- a/SCSI/Modes/12_13_14.cs +++ b/SCSI/Modes/12_13_14.cs @@ -59,9 +59,7 @@ public static partial class Modes if((pageResponse[0] & 0x40) == 0x40) return null; - if((pageResponse[0] & 0x3F) != 0x12 && - (pageResponse[0] & 0x3F) != 0x13 && - (pageResponse[0] & 0x3F) != 0x14) + if((pageResponse[0] & 0x3F) != 0x12 && (pageResponse[0] & 0x3F) != 0x13 && (pageResponse[0] & 0x3F) != 0x14) return null; if(pageResponse[1] + 2 != pageResponse.Length) diff --git a/SCSI/Modes/1A.cs b/SCSI/Modes/1A.cs index de8e6b4..fff1985 100644 --- a/SCSI/Modes/1A.cs +++ b/SCSI/Modes/1A.cs @@ -96,10 +96,14 @@ public static partial class Modes decoded.Standby |= (pageResponse[3] & 0x01) == 0x01; decoded.Idle |= (pageResponse[3] & 0x02) == 0x02; - decoded.IdleTimer = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + + decoded.IdleTimer = (uint)((pageResponse[4] << 24) + + (pageResponse[5] << 16) + + (pageResponse[6] << 8) + pageResponse[7]); - decoded.StandbyTimer = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + + decoded.StandbyTimer = (uint)((pageResponse[8] << 24) + + (pageResponse[9] << 16) + + (pageResponse[10] << 8) + pageResponse[11]); if(pageResponse.Length < 40) @@ -110,13 +114,19 @@ public static partial class Modes decoded.Idle_B |= (pageResponse[3] & 0x04) == 0x04; decoded.Idle_C |= (pageResponse[3] & 0x08) == 0x08; - decoded.IdleTimer_B = (uint)((pageResponse[12] << 24) + (pageResponse[13] << 16) + (pageResponse[14] << 8) + + decoded.IdleTimer_B = (uint)((pageResponse[12] << 24) + + (pageResponse[13] << 16) + + (pageResponse[14] << 8) + pageResponse[15]); - decoded.IdleTimer_C = (uint)((pageResponse[16] << 24) + (pageResponse[17] << 16) + (pageResponse[18] << 8) + + decoded.IdleTimer_C = (uint)((pageResponse[16] << 24) + + (pageResponse[17] << 16) + + (pageResponse[18] << 8) + pageResponse[19]); - decoded.StandbyTimer_Y = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) + + decoded.StandbyTimer_Y = (uint)((pageResponse[20] << 24) + + (pageResponse[21] << 16) + + (pageResponse[22] << 8) + pageResponse[23]); decoded.CCF_Idle = (byte)((pageResponse[39] & 0xC0) >> 6); @@ -142,8 +152,7 @@ public static partial class Modes if(page.PS) 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 } || page is { Standby_Y: true, StandbyTimer_Y: > 0 }) { if(page is { Standby: true, StandbyTimer: > 0 }) sb.AppendFormat("\t" + "Standby timer Z is set to {0} ms", page.StandbyTimer * 100).AppendLine(); @@ -250,10 +259,9 @@ public static partial class Modes { case 0: sb. - AppendFormat( - "\t" + Localization. - Device_power_consumption_is_dictated_by_identifier_0_of_Power_Consumption_VPD, - page.PowerConsumptionIdentifier).AppendLine(); + AppendFormat("\t" + Localization.Device_power_consumption_is_dictated_by_identifier_0_of_Power_Consumption_VPD, + page.PowerConsumptionIdentifier). + AppendLine(); break; case 1: diff --git a/SCSI/Modes/1C.cs b/SCSI/Modes/1C.cs index 449bfe4..c60ea35 100644 --- a/SCSI/Modes/1C.cs +++ b/SCSI/Modes/1C.cs @@ -96,8 +96,8 @@ public static partial class Modes decoded.MRIE = (byte)(pageResponse[3] & 0x0F); - decoded.IntervalTimer = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + - pageResponse[7]); + decoded.IntervalTimer = + (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + pageResponse[7]); decoded.EBF |= (pageResponse[2] & 0x20) == 0x20; decoded.EWasc |= (pageResponse[2] & 0x10) == 0x10; @@ -106,7 +106,9 @@ public static partial class Modes if(pageResponse.Length >= 12) { - decoded.ReportCount = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + + decoded.ReportCount = (uint)((pageResponse[8] << 24) + + (pageResponse[9] << 16) + + (pageResponse[10] << 8) + pageResponse[11]); } @@ -150,13 +152,13 @@ public static partial class Modes break; case 3: - sb.AppendLine("\t" + Localization. - Conditionally_generate_recovered_error_on_informational_exceptions); + sb.AppendLine("\t" + + Localization.Conditionally_generate_recovered_error_on_informational_exceptions); break; case 4: - sb.AppendLine("\t" + Localization. - Unconditionally_generate_recovered_error_on_informational_exceptions); + sb.AppendLine("\t" + + Localization.Unconditionally_generate_recovered_error_on_informational_exceptions); break; case 5: @@ -175,8 +177,8 @@ public static partial class Modes if(page.Perf) { - sb.AppendLine("\t" + Localization. - Informational_exceptions_reporting_should_not_affect_drive_performance); + sb.AppendLine("\t" + + Localization.Informational_exceptions_reporting_should_not_affect_drive_performance); } if(page.Test) @@ -195,9 +197,8 @@ public static partial class Modes if(page.ReportCount > 0) { - sb.AppendFormat( - "\t" + Localization.Informational_exception_conditions_will_be_reported_a_maximum_of_0_times, - page.ReportCount); + sb.AppendFormat("\t" + Localization.Informational_exception_conditions_will_be_reported_a_maximum_of_0_times, + page.ReportCount); } } @@ -305,34 +306,32 @@ public static partial class Modes if(page.BackgroundScanInterval > 0) { sb. - AppendFormat( - "\t" + Localization. - _0__hours_shall_be_between_the_start_of_a_background_scan_operation_and_the_next, - page.BackgroundScanInterval).AppendLine(); + 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("\t" + Localization.Background_pre_scan_operations_can_take_a_maximum_of_0_hours, - page.BackgroundPrescanTimeLimit).AppendLine(); + page.BackgroundPrescanTimeLimit). + AppendLine(); } if(page.MinIdleBeforeBgScan > 0) { sb. - AppendFormat( - "\t" + Localization. - At_least_0_ms_must_be_idle_before_resuming_a_suspended_background_scan_operation, - page.MinIdleBeforeBgScan).AppendLine(); + 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( - "\t" + Localization. - At_most_0_ms_must_be_before_suspending_a_background_scan_operation_and_processing_received_commands, - page.MaxTimeSuspendBgScan).AppendLine(); + 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(); diff --git a/SCSI/Modes/1C_SFF.cs b/SCSI/Modes/1C_SFF.cs index 48319f7..71b2028 100644 --- a/SCSI/Modes/1C_SFF.cs +++ b/SCSI/Modes/1C_SFF.cs @@ -105,82 +105,98 @@ public static partial class Modes switch(page.InactivityTimeMultiplier) { case 0: - sb.AppendLine("\t" + Localization. + 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("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_125_ms_after_a_seek_read_or_write_operation); break; case 2: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_250_ms_after_a_seek_read_or_write_operation); break; case 3: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_500_ms_after_a_seek_read_or_write_operation); break; case 4: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_1_second_after_a_seek_read_or_write_operation); break; case 5: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_2_seconds_after_a_seek_read_or_write_operation); break; case 6: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_4_seconds_after_a_seek_read_or_write_operation); break; case 7: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_8_seconds_after_a_seek_read_or_write_operation); break; case 8: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_16_seconds_after_a_seek_read_or_write_operation); break; case 9: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_32_seconds_after_a_seek_read_or_write_operation); break; case 10: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_1_minute_after_a_seek_read_or_write_operation); break; case 11: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_2_minutes_after_a_seek_read_or_write_operation); break; case 12: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_4_minutes_after_a_seek_read_or_write_operation); break; case 13: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_8_minutes_after_a_seek_read_or_write_operation); break; case 14: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_16_minutes_after_a_seek_read_or_write_operation); break; case 15: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Drive_will_remain_in_same_status_32_minutes_after_a_seek_read_or_write_operation); break; diff --git a/SCSI/Modes/1D.cs b/SCSI/Modes/1D.cs index e889449..a66c1be 100644 --- a/SCSI/Modes/1D.cs +++ b/SCSI/Modes/1D.cs @@ -110,7 +110,8 @@ public static partial class Modes break; default: sb.AppendFormat("\t" + Localization.Unknown_WORM_mode_label_restrictions_code_0, - page.WormModeLabelRestrictions).AppendLine(); + page.WormModeLabelRestrictions). + AppendLine(); break; } @@ -129,7 +130,8 @@ public static partial class Modes break; default: sb.AppendFormat("\t" + "Unknown WORM mode filemark restrictions code {0}", - page.WormModeLabelRestrictions).AppendLine(); + page.WormModeLabelRestrictions). + AppendLine(); break; } diff --git a/SCSI/Modes/21_Certance.cs b/SCSI/Modes/21_Certance.cs index a2398a5..36a689b 100644 --- a/SCSI/Modes/21_Certance.cs +++ b/SCSI/Modes/21_Certance.cs @@ -109,7 +109,8 @@ public static partial class Modes break; default: sb.AppendFormat("\t" + Localization.Operating_systems_support_is_unknown_code_0, - page.OperatingSystemsSupport).AppendLine(); + page.OperatingSystemsSupport). + AppendLine(); break; } @@ -179,7 +180,8 @@ public static partial class Modes if(page.HostUnloadOverride) sb.AppendLine("\t" + Localization.SCSI_UNLOAD_command_will_not_eject_the_cartridge); - sb.Append("\t" + Localization. + sb.Append("\t" + + Localization. How_should_tapes_be_unloaded_in_a_power_cycle_tape_incompatibility_firmware_download_or_cleaning_end); switch(page.AutoUnloadMode) diff --git a/SCSI/Modes/2A.cs b/SCSI/Modes/2A.cs index c2f6389..90612a1 100644 --- a/SCSI/Modes/2A.cs +++ b/SCSI/Modes/2A.cs @@ -117,7 +117,8 @@ public static partial class Modes break; default: sb.AppendFormat("\t" + Localization.Drive_uses_unknown_loading_mechanism_type__0_, - modePage.LoadingMechanism).AppendLine(); + modePage.LoadingMechanism). + AppendLine(); break; } @@ -136,8 +137,8 @@ public static partial class Modes else { sb.AppendLine(modePage.LockState - ? "\t" + Localization. - Drive_is_locked__media_cannot_be_ejected__but_if_empty__can_be_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); } @@ -223,12 +224,14 @@ public static partial class Modes { case 0: sb.AppendFormat("\t" + Localization.Drive_current_writing_speed_is_0_Kbyte_sec_in_CLV_mode, - modePage.CurrentWriteSpeedSelected).AppendLine(); + modePage.CurrentWriteSpeedSelected). + AppendLine(); break; case 1: sb.AppendFormat("\t" + Localization.Drive_current_writing_speed_is_0_Kbyte_sec_in_pure_CAV_mode, - modePage.CurrentWriteSpeedSelected).AppendLine(); + modePage.CurrentWriteSpeedSelected). + AppendLine(); break; } @@ -244,25 +247,28 @@ public static partial class Modes if(modePage.CurrentWriteSpeed > 0) { sb.AppendFormat("\t" + Localization.Drive_current_writing_speed_is_0_Kbyte_sec, - modePage.CurrentWriteSpeed).AppendLine(); + modePage.CurrentWriteSpeed). + AppendLine(); } } if(modePage.WriteSpeedPerformanceDescriptors != null) { foreach(ModePage_2A_WriteDescriptor descriptor in - modePage.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0)) + modePage.WriteSpeedPerformanceDescriptors.Where(descriptor => descriptor.WriteSpeed > 0)) { switch(descriptor.RotationControl) { case 0: sb.AppendFormat("\t" + Localization.Drive_supports_writing_at_0_Kbyte_sec_in_CLV_mode, - descriptor.WriteSpeed).AppendLine(); + descriptor.WriteSpeed). + AppendLine(); break; case 1: sb.AppendFormat("\t" + Localization.Drive_supports_writing_at_is_0_Kbyte_sec_in_pure_CAV_mode, - descriptor.WriteSpeed).AppendLine(); + descriptor.WriteSpeed). + AppendLine(); break; } diff --git a/SCSI/Modes/3C_HP.cs b/SCSI/Modes/3C_HP.cs index 8458c58..58a0f30 100644 --- a/SCSI/Modes/3C_HP.cs +++ b/SCSI/Modes/3C_HP.cs @@ -84,21 +84,27 @@ public static partial class Modes decoded.PT |= (pageResponse[2] & 0x01) == 0x01; decoded.CurrentPowerOn = (ushort)((pageResponse[6] << 8) + pageResponse[7]); - decoded.PowerOnTime = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + + decoded.PowerOnTime = (uint)((pageResponse[8] << 24) + + (pageResponse[9] << 16) + + (pageResponse[10] << 8) + pageResponse[11]); decoded.UTC |= (pageResponse[14] & 0x02) == 0x02; decoded.NTP |= (pageResponse[14] & 0x01) == 0x01; - decoded.WorldTime = (uint)((pageResponse[16] << 24) + (pageResponse[17] << 16) + (pageResponse[18] << 8) + + decoded.WorldTime = (uint)((pageResponse[16] << 24) + + (pageResponse[17] << 16) + + (pageResponse[18] << 8) + pageResponse[19]); decoded.LibraryHours = pageResponse[23]; decoded.LibraryMinutes = pageResponse[24]; decoded.LibrarySeconds = pageResponse[25]; - decoded.CumulativePowerOn = (uint)((pageResponse[32] << 24) + (pageResponse[33] << 16) + - (pageResponse[34] << 8) + pageResponse[35]); + decoded.CumulativePowerOn = (uint)((pageResponse[32] << 24) + + (pageResponse[33] << 16) + + (pageResponse[34] << 8) + + pageResponse[35]); return decoded; } @@ -124,16 +130,19 @@ public static partial class Modes sb.AppendFormat("\t" + Localization.Drive_has_been_powered_up_0_times, page.CurrentPowerOn); sb.AppendFormat("\t" + Localization.Drive_has_been_powered_up_since_0_seconds_ago_this_time, - TimeSpan.FromSeconds(page.PowerOnTime)).AppendLine(); + TimeSpan.FromSeconds(page.PowerOnTime)). + AppendLine(); sb.AppendFormat("\t" + Localization.Drive_has_been_powered_up_a_total_of_0_seconds, - TimeSpan.FromSeconds(page.CumulativePowerOn)).AppendLine(); + TimeSpan.FromSeconds(page.CumulativePowerOn)). + AppendLine(); } if(page.WT) { sb.AppendFormat("\t" + Localization.Drive_date_time_is_0, - DateHandlers.UnixUnsignedToDateTime(page.WorldTime)).AppendLine(); + DateHandlers.UnixUnsignedToDateTime(page.WorldTime)). + AppendLine(); if(page.UTC) sb.AppendLine("\t" + Localization.Drive_time_is_UTC); @@ -146,7 +155,8 @@ public static partial class Modes { 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(); + page.LibraryMinutes, page.LibrarySeconds)). + AppendLine(); } return sb.ToString(); diff --git a/SCSI/Modes/3E_Fujitsu.cs b/SCSI/Modes/3E_Fujitsu.cs index 5001b57..29eeb59 100644 --- a/SCSI/Modes/3E_Fujitsu.cs +++ b/SCSI/Modes/3E_Fujitsu.cs @@ -144,7 +144,8 @@ public static partial class Modes } sb.AppendFormat("\t" + Localization.The_device_type_that_would_be_provided_in_the_INQUIRY_response_is_0, - page.devType).AppendLine(); + page.devType). + AppendLine(); return sb.ToString(); } diff --git a/SCSI/Modes/Headers.cs b/SCSI/Modes/Headers.cs index 2aa73ae..090a5ab 100644 --- a/SCSI/Modes/Headers.cs +++ b/SCSI/Modes/Headers.cs @@ -98,9 +98,9 @@ public static partial class Modes GetMediumTypeDescription_DOW, MediumTypes.HiMD => Localization. GetMediumTypeDescription_HiMD, - _ => string.Format( - Localization.Unknown_medium_type_0, - (byte)type) + _ => string. + Format(Localization.Unknown_medium_type_0, + (byte)type) }; public static string PrettifyModeHeader(ModeHeader? header, PeripheralDeviceTypes deviceType) @@ -164,23 +164,27 @@ public static partial class Modes if(descriptor.Blocks == 0) { sb.AppendFormat("\t" + Localization.All_remaining_blocks_have_0_and_are_1_bytes_each, - density, descriptor.BlockLength).AppendLine(); + density, descriptor.BlockLength). + AppendLine(); } else { sb.AppendFormat("\t" + Localization._0_blocks_have_1_and_are_2_bytes_each, - descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); + descriptor.Blocks, density, descriptor.BlockLength). + AppendLine(); } } else if(descriptor.Blocks == 0) { sb.AppendFormat("\t" + Localization.All_remaining_blocks_are_0_bytes_each, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } else { sb.AppendFormat("\t" + Localization._0_blocks_are_1_bytes_each, descriptor.Blocks, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } } } @@ -205,8 +209,8 @@ public static partial class Modes break; case 2: - sb.AppendLine("\t" + Localization. - Device_uses_a_write_cache_but_doesn_t_return_until_cache_is_flushed); + sb.AppendLine("\t" + + Localization.Device_uses_a_write_cache_but_doesn_t_return_until_cache_is_flushed); break; default: @@ -1221,28 +1225,29 @@ public static partial class Modes if(descriptor.BlockLength == 0) { sb. - AppendFormat( - "\t" + Localization. - All_remaining_blocks_conform_to_0_and_have_a_variable_length, - density).AppendLine(); + AppendFormat("\t" + Localization.All_remaining_blocks_conform_to_0_and_have_a_variable_length, + density). + AppendLine(); } else { sb. - AppendFormat( - "\t" + Localization.All_remaining_blocks_conform_to_0_and_are_1_bytes_each, - density, descriptor.BlockLength).AppendLine(); + AppendFormat("\t" + Localization.All_remaining_blocks_conform_to_0_and_are_1_bytes_each, + density, descriptor.BlockLength). + AppendLine(); } } else if(descriptor.BlockLength == 0) { sb.AppendFormat("\t" + Localization._0_blocks_conform_to_1_and_have_a_variable_length, - descriptor.Blocks, density).AppendLine(); + descriptor.Blocks, density). + AppendLine(); } else { sb.AppendFormat("\t" + Localization._0_blocks_conform_to_1_and_are_2_bytes_each, - descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); + descriptor.Blocks, density, descriptor.BlockLength). + AppendLine(); } } else if(descriptor.Blocks == 0) @@ -1255,7 +1260,8 @@ public static partial class Modes else { sb.AppendFormat("\t" + Localization.All_remaining_blocks_are_0_bytes_each, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } } else if(descriptor.BlockLength == 0) @@ -1266,7 +1272,8 @@ public static partial class Modes else { sb.AppendFormat("\t" + Localization._0_blocks_are_1_bytes_each, descriptor.Blocks, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } } } @@ -1416,25 +1423,28 @@ public static partial class Modes if(descriptor.BlockLength == 0) { sb. - AppendFormat( - "\t" + Localization.All_remaining_blocks_are_0_and_have_a_variable_length, - density).AppendLine(); + AppendFormat("\t" + Localization.All_remaining_blocks_are_0_and_have_a_variable_length, + density). + AppendLine(); } else { sb.AppendFormat("\t" + Localization.All_remaining_blocks_are_0_and_are_1_bytes_each, - density, descriptor.BlockLength).AppendLine(); + density, descriptor.BlockLength). + AppendLine(); } } else if(descriptor.BlockLength == 0) { sb.AppendFormat("\t" + Localization._0_blocks_are_1_and_have_a_variable_length, - descriptor.Blocks, density).AppendLine(); + descriptor.Blocks, density). + AppendLine(); } else { sb.AppendFormat("\t" + Localization._0_blocks_are_1_and_are_2_bytes_each, - descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); + descriptor.Blocks, density, descriptor.BlockLength). + AppendLine(); } } else if(descriptor.Blocks == 0) @@ -1447,7 +1457,8 @@ public static partial class Modes else { sb.AppendFormat("\t" + Localization.All_remaining_blocks_are_0_bytes_each, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } } else if(descriptor.BlockLength == 0) @@ -1458,7 +1469,8 @@ public static partial class Modes else { sb.AppendFormat("\t" + Localization._0_blocks_are_1_bytes_each, descriptor.Blocks, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } } } @@ -1686,23 +1698,27 @@ public static partial class Modes if(descriptor.Blocks == 0) { sb.AppendFormat("\t" + Localization.All_remaining_blocks_have_0_and_are_1_bytes_each, - density, descriptor.BlockLength).AppendLine(); + density, descriptor.BlockLength). + AppendLine(); } else { sb.AppendFormat("\t" + Localization._0_blocks_have_1_and_are_2_bytes_each, - descriptor.Blocks, density, descriptor.BlockLength).AppendLine(); + descriptor.Blocks, density, descriptor.BlockLength). + AppendLine(); } } else if(descriptor.Blocks == 0) { sb.AppendFormat("\t" + Localization.All_remaining_blocks_are_0_bytes_each, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } else { sb.AppendFormat("\t" + Localization._0_blocks_are_1_bytes_each, descriptor.Blocks, - descriptor.BlockLength).AppendLine(); + descriptor.BlockLength). + AppendLine(); } } } diff --git a/SCSI/Modes/Mode10.cs b/SCSI/Modes/Mode10.cs index 7821ca6..32eca11 100644 --- a/SCSI/Modes/Mode10.cs +++ b/SCSI/Modes/Mode10.cs @@ -45,8 +45,7 @@ public static partial class Modes { public static ModeHeader? DecodeModeHeader10(byte[] modeResponse, PeripheralDeviceTypes deviceType) { - if(modeResponse == null || - modeResponse.Length < 8) + if(modeResponse == null || modeResponse.Length < 8) return null; var modeLength = (ushort)((modeResponse[0] << 8) + modeResponse[1]); diff --git a/SCSI/Modes/Mode6.cs b/SCSI/Modes/Mode6.cs index 39951f2..33e4773 100644 --- a/SCSI/Modes/Mode6.cs +++ b/SCSI/Modes/Mode6.cs @@ -45,9 +45,7 @@ public static partial class Modes { public static ModeHeader? DecodeModeHeader6(byte[] modeResponse, PeripheralDeviceTypes deviceType) { - if(modeResponse == null || - modeResponse.Length < 4 || - modeResponse.Length < modeResponse[0] + 1) + if(modeResponse == null || modeResponse.Length < 4 || modeResponse.Length < modeResponse[0] + 1) return null; var header = new ModeHeader diff --git a/SCSI/SSC/BlockLimits.cs b/SCSI/SSC/BlockLimits.cs index 0bf0fbf..9e8c68f 100644 --- a/SCSI/SSC/BlockLimits.cs +++ b/SCSI/SSC/BlockLimits.cs @@ -76,7 +76,8 @@ public static class BlockLimits if(decoded.Value.granularity > 0) { sb.AppendFormat(Core.Device_needs_a_block_size_granularity_of_pow_0_1_bytes, decoded.Value.granularity, - Math.Pow(2, decoded.Value.granularity)).AppendLine(); + Math.Pow(2, decoded.Value.granularity)). + AppendLine(); } } diff --git a/SCSI/SSC/DensitySupport.cs b/SCSI/SSC/DensitySupport.cs index 494886f..f4d10f1 100644 --- a/SCSI/SSC/DensitySupport.cs +++ b/SCSI/SSC/DensitySupport.cs @@ -72,8 +72,10 @@ public static class DensitySupport bpmm = (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]), width = (ushort)((response[offset + 8] << 8) + response[offset + 9]), tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]), - capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) + - (response[offset + 14] << 8) + response[offset + 15]) + capacity = (uint)((response[offset + 12] << 24) + + (response[offset + 13] << 16) + + (response[offset + 14] << 8) + + response[offset + 15]) }; var tmp = new byte[8]; @@ -131,7 +133,8 @@ public static class DensitySupport sb.AppendLine("\t" + Localization.This_is_the_default_density_on_the_drive); 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(); + descriptor.bpmm, descriptor.tracks, descriptor.width / (double)10). + AppendLine(); sb.AppendFormat("\t" + Localization.Density_maximum_capacity_is_0_megabytes, descriptor.capacity). AppendLine(); @@ -228,7 +231,8 @@ public static class DensitySupport } 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(); + descriptor.length, descriptor.width / (double)10). + AppendLine(); sb.AppendFormat("\t" + Localization.Medium_description_0, descriptor.description).AppendLine(); sb.AppendLine(); diff --git a/SCSI/Sense.cs b/SCSI/Sense.cs index 44f5c9f..16b7657 100644 --- a/SCSI/Sense.cs +++ b/SCSI/Sense.cs @@ -248,12 +248,10 @@ public static class Sense { senseDescription = null; - if(sense is null || - sense.Length == 0) + if(sense is null || sense.Length == 0) return null; - if((sense[0] & 0x7F) != 0x70 && - (sense[0] & 0x7F) != 0x71) + if((sense[0] & 0x7F) != 0x70 && (sense[0] & 0x7F) != 0x71) return null; if(sense.Length < 8) @@ -309,8 +307,7 @@ public static class Sense return null; // Fixed sense - if((sense[0] & 0x7F) == 0x70 || - (sense[0] & 0x7F) == 0x71) + if((sense[0] & 0x7F) == 0x70 || (sense[0] & 0x7F) == 0x71) return null; var decoded = new DescriptorSense @@ -469,8 +466,7 @@ public static class Sense sb.AppendFormat(Localization.SCSI_SENSE_0, GetSenseKey(decoded.SenseKey)).AppendLine(); sb.AppendLine(GetSenseDescription(decoded.ASC, decoded.ASCQ)); - if(decoded.Descriptors == null || - decoded.Descriptors.Count == 0) + if(decoded.Descriptors == null || decoded.Descriptors.Count == 0) return sb.ToString(); foreach(KeyValuePair kvp in decoded.Descriptors) @@ -492,8 +488,7 @@ public static class Sense /// Descriptor. public static ulong DecodeDescriptor00(byte[] descriptor) { - if(descriptor.Length != 12 || - descriptor[0] != 0x00) + if(descriptor.Length != 12 || descriptor[0] != 0x00) return 0; var temp = new byte[8]; @@ -515,8 +510,7 @@ public static class Sense /// Descriptor. public static ulong DecodeDescriptor01(byte[] descriptor) { - if(descriptor.Length != 12 || - descriptor[0] != 0x01) + if(descriptor.Length != 12 || descriptor[0] != 0x01) return 0; var temp = new byte[8]; @@ -538,8 +532,7 @@ public static class Sense /// Descriptor. public static byte[] DecodeDescriptor02(byte[] descriptor) { - if(descriptor.Length != 8 || - descriptor[0] != 0x02) + if(descriptor.Length != 8 || descriptor[0] != 0x02) return null; var temp = new byte[3]; @@ -553,8 +546,7 @@ public static class Sense /// Descriptor. public static byte DecodeDescriptor03(byte[] descriptor) { - if(descriptor.Length != 4 || - descriptor[0] != 0x03) + if(descriptor.Length != 4 || descriptor[0] != 0x03) return 0; return descriptor[3]; @@ -565,8 +557,7 @@ public static class Sense /// Descriptor. public static AnotherProgressIndicationSenseDescriptor? DecodeDescriptor0A(byte[] descriptor) { - if(descriptor.Length != 8 || - descriptor[0] != 0x0A) + if(descriptor.Length != 8 || descriptor[0] != 0x0A) return null; return new AnotherProgressIndicationSenseDescriptor @@ -2737,9 +2728,10 @@ public static class Sense } return ASC >= 0x80 - ? 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 + ? 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 ? string.Format(Localization.ASC_0_WITH_VENDOR_SPECIFIC_ASCQ_1, ASC, ASCQ) : string.Format(Localization.ASC_0_WITH_ASCQ_1, ASC, ASCQ); diff --git a/SecureDigital/CID.cs b/SecureDigital/CID.cs index 47bad59..258a6e0 100644 --- a/SecureDigital/CID.cs +++ b/SecureDigital/CID.cs @@ -112,12 +112,14 @@ public static partial class Decoders sb.AppendFormat(Localization.Product_name_0, cid.ProductName).AppendLine(); sb.AppendFormat(Localization.Product_revision_0_1, (cid.ProductRevision & 0xF0) >> 4, - cid.ProductRevision & 0x0F).AppendLine(); + cid.ProductRevision & 0x0F). + AppendLine(); sb.AppendFormat(Localization.Product_serial_number_0, cid.ProductSerialNumber).AppendLine(); sb.AppendFormat(Localization.Device_manufactured_month_0_of_1, (cid.ManufacturingDate & 0xF00) >> 8, - (cid.ManufacturingDate & 0xFF) + 2000).AppendLine(); + (cid.ManufacturingDate & 0xFF) + 2000). + AppendLine(); sb.AppendFormat(Localization.CID_CRC_0, cid.CRC).AppendLine(); diff --git a/SecureDigital/CSD.cs b/SecureDigital/CSD.cs index a9208b9..0230b2c 100644 --- a/SecureDigital/CSD.cs +++ b/SecureDigital/CSD.cs @@ -522,7 +522,8 @@ public static partial class Decoders // TODO: Check specification sb.AppendFormat("\t" + Localization.Device_must_erase_a_minimum_of_0_blocks_at_a_time, - Convert.ToUInt32(csd.EraseSectorSize) + 1).AppendLine(); + Convert.ToUInt32(csd.EraseSectorSize) + 1). + AppendLine(); if(csd.WriteProtectGroupEnable) { @@ -532,7 +533,8 @@ public static partial class Decoders // unitFactor = Convert.ToDouble(csd.WriteProtectGroupSize); sb.AppendFormat("\t" + Localization.Device_can_write_protect_a_minimum_of_0_blocks_at_a_time, - (int)(result + 1)).AppendLine(); + (int)(result + 1)). + AppendLine(); } else sb.AppendLine("\t" + Localization.Device_cant_write_protect_regions); @@ -582,7 +584,8 @@ public static partial class Decoders else { sb.AppendFormat("\t" + Localization.Device_uses_unknown_file_format_code_0_and_file_format_group_1, - csd.FileFormat).AppendLine(); + csd.FileFormat). + AppendLine(); } sb.AppendFormat("\t" + Localization.CSD_CRC_0, csd.CRC).AppendLine(); diff --git a/SecureDigital/SCR.cs b/SecureDigital/SCR.cs index d2a30cc..816e633 100644 --- a/SecureDigital/SCR.cs +++ b/SecureDigital/SCR.cs @@ -129,50 +129,54 @@ public static partial class Decoders switch(scr.Spec) { case 0 when scr.Spec3 == false && scr.Spec4 == false && scr.SpecX == 0: - sb.AppendLine("\t" + Localization. - Device_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("\t" + Localization. - Device_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("\t" + Localization. - Device_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("\t" + Localization. - Device_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("\t" + Localization. - Device_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("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_follows_SecureDigital_Physical_Layer_Specification_version_5_xx); break; case 2: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_follows_SecureDigital_Physical_Layer_Specification_version_6_xx); break; case 3: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_follows_SecureDigital_Physical_Layer_Specification_version_7_xx); break; case 4: - sb.AppendLine("\t" + Localization. + sb.AppendLine("\t" + + Localization. Device_follows_SecureDigital_Physical_Layer_Specification_version_8_xx); break; @@ -181,10 +185,9 @@ public static partial class Decoders break; default: sb. - 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(); + 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; } diff --git a/SecureDigital/VendorString.cs b/SecureDigital/VendorString.cs index 7feaa3b..70faf68 100644 --- a/SecureDigital/VendorString.cs +++ b/SecureDigital/VendorString.cs @@ -45,7 +45,7 @@ public static class VendorString 0x03 => "Sandisk", 0x27 => "CnMemory", 0xAA => "QEMU", - _ => string.Format( - Localization.Unknown_manufacturer_ID_0, sdVendorId) + _ => string.Format(Localization.Unknown_manufacturer_ID_0, + sdVendorId) }; } \ No newline at end of file diff --git a/Sega/CD.cs b/Sega/CD.cs index a4fa913..f64c76a 100644 --- a/Sega/CD.cs +++ b/Sega/CD.cs @@ -68,31 +68,25 @@ public static class CD AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.system_name = \"{0}\"", Encoding.ASCII.GetString(ipbin.system_name)); - AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.volume_version = \"{0:X}\"", - ipbin.volume_version); + AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.volume_version = \"{0:X}\"", ipbin.volume_version); AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.volume_type = 0x{0:X8}", ipbin.volume_type); - AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.system_version = 0x{0:X8}", - ipbin.system_version); + AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.system_version = 0x{0:X8}", ipbin.system_version); AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.ip_address = 0x{0:X8}", ipbin.ip_address); AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.ip_loadsize = {0}", ipbin.ip_loadsize); - AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.ip_entry_address = 0x{0:X8}", - ipbin.ip_entry_address); + AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.ip_entry_address = 0x{0:X8}", ipbin.ip_entry_address); - AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.ip_work_ram_size = {0}", - ipbin.ip_work_ram_size); + AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.ip_work_ram_size = {0}", ipbin.ip_work_ram_size); AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.sp_address = 0x{0:X8}", ipbin.sp_address); AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.sp_loadsize = {0}", ipbin.sp_loadsize); - AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.sp_entry_address = 0x{0:X8}", - ipbin.sp_entry_address); + AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.sp_entry_address = 0x{0:X8}", ipbin.sp_entry_address); - AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.sp_work_ram_size = {0}", - ipbin.sp_work_ram_size); + AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.sp_work_ram_size = {0}", ipbin.sp_work_ram_size); AaruConsole.DebugWriteLine(MODULE_NAME, "segacd_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(ipbin.release_date)); diff --git a/Sega/Dreamcast.cs b/Sega/Dreamcast.cs index c76b82f..2ae6abd 100644 --- a/Sega/Dreamcast.cs +++ b/Sega/Dreamcast.cs @@ -64,8 +64,7 @@ public static class Dreamcast AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.maker_id = \"{0}\"", Encoding.ASCII.GetString(ipbin.maker_id)); - AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.spare_space1 = \"{0}\"", - (char)ipbin.spare_space1); + AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.spare_space1 = \"{0}\"", (char)ipbin.spare_space1); AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.dreamcast_media = \"{0}\"", Encoding.ASCII.GetString(ipbin.dreamcast_media)); @@ -75,8 +74,7 @@ public static class Dreamcast AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.disc_no_separator = \"{0}\"", (char)ipbin.disc_no_separator); - AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.disc_total_nos = \"{0}\"", - (char)ipbin.disc_total_nos); + AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.disc_total_nos = \"{0}\"", (char)ipbin.disc_total_nos); AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.spare_space2 = \"{0}\"", Encoding.ASCII.GetString(ipbin.spare_space2)); @@ -96,8 +94,7 @@ public static class Dreamcast AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(ipbin.release_date)); - AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.spare_space3 = \"{0}\"", - (char)ipbin.spare_space3); + AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.spare_space3 = \"{0}\"", (char)ipbin.spare_space3); AaruConsole.DebugWriteLine(MODULE_NAME, "dreamcast_ipbin.boot_filename = \"{0}\"", Encoding.ASCII.GetString(ipbin.boot_filename)); @@ -160,7 +157,8 @@ public static class Dreamcast break; default: IPBinInformation.AppendFormat(Localization.Disc_boots_using_unknown_loader_0, - Encoding.ASCII.GetString(ipbin.boot_filename)).AppendLine(); + Encoding.ASCII.GetString(ipbin.boot_filename)). + AppendLine(); break; } diff --git a/Sega/Saturn.cs b/Sega/Saturn.cs index 75dfd1f..31225ef 100644 --- a/Sega/Saturn.cs +++ b/Sega/Saturn.cs @@ -81,8 +81,7 @@ public static class Saturn AaruConsole.DebugWriteLine(MODULE_NAME, "saturn_ipbin.disc_no_separator = \"{0}\"", (char)ipbin.disc_no_separator); - AaruConsole.DebugWriteLine(MODULE_NAME, "saturn_ipbin.disc_total_nos = {0}", - (char)ipbin.disc_total_nos); + AaruConsole.DebugWriteLine(MODULE_NAME, "saturn_ipbin.disc_total_nos = {0}", (char)ipbin.disc_total_nos); AaruConsole.DebugWriteLine(MODULE_NAME, "saturn_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(ipbin.release_date)); diff --git a/Xbox/DMI.cs b/Xbox/DMI.cs index f482ab9..262fa13 100644 --- a/Xbox/DMI.cs +++ b/Xbox/DMI.cs @@ -55,20 +55,17 @@ public static class DMI // Catalogue number is two letters, five numbers, one letter for(var i = 12; i < 14; i++) { - if(dmi[i] < 0x41 || - dmi[i] > 0x5A) + if(dmi[i] < 0x41 || dmi[i] > 0x5A) return false; } for(var i = 14; i < 19; i++) { - if(dmi[i] < 0x30 || - dmi[i] > 0x39) + if(dmi[i] < 0x30 || dmi[i] > 0x39) return false; } - if(dmi[19] < 0x41 || - dmi[19] > 0x5A) + if(dmi[19] < 0x41 || dmi[19] > 0x5A) return false; var timestamp = BitConverter.ToInt64(dmi, 20); diff --git a/Xbox/SS.cs b/Xbox/SS.cs index 6449e23..539e784 100644 --- a/Xbox/SS.cs +++ b/Xbox/SS.cs @@ -95,11 +95,15 @@ public static class SS { Level = response[770 + i * 11 + 0], ChallengeId = response[770 + i * 11 + 1], - ChallengeValue = (uint)((response[770 + i * 11 + 2] << 24) + (response[770 + i * 11 + 3] << 16) + - (response[770 + i * 11 + 4] << 8) + response[770 + i * 11 + 5]), + ChallengeValue = (uint)((response[770 + i * 11 + 2] << 24) + + (response[770 + i * 11 + 3] << 16) + + (response[770 + i * 11 + 4] << 8) + + response[770 + i * 11 + 5]), ResponseModifier = response[770 + i * 11 + 6], - ResponseValue = (uint)((response[770 + i * 11 + 7] << 24) + (response[770 + i * 11 + 8] << 16) + - (response[770 + i * 11 + 9] << 8) + response[770 + i * 11 + 10]) + ResponseValue = (uint)((response[770 + i * 11 + 7] << 24) + + (response[770 + i * 11 + 8] << 16) + + (response[770 + i * 11 + 9] << 8) + + response[770 + i * 11 + 10]) }; } @@ -113,11 +117,14 @@ public static class SS { ss.Extents[i] = new SecuritySectorExtent { - Unknown = (uint)((response[1633 + i * 9 + 0] << 16) + (response[1633 + i * 9 + 1] << 8) + + Unknown = (uint)((response[1633 + i * 9 + 0] << 16) + + (response[1633 + i * 9 + 1] << 8) + response[1633 + i * 9 + 2]), - StartPSN = (uint)((response[1633 + i * 9 + 3] << 16) + (response[1633 + i * 9 + 4] << 8) + + StartPSN = (uint)((response[1633 + i * 9 + 3] << 16) + + (response[1633 + i * 9 + 4] << 8) + response[1633 + i * 9 + 5]), - EndPSN = (uint)((response[1633 + i * 9 + 6] << 16) + (response[1633 + i * 9 + 7] << 8) + + EndPSN = (uint)((response[1633 + i * 9 + 6] << 16) + + (response[1633 + i * 9 + 7] << 8) + response[1633 + i * 9 + 8]) }; } @@ -126,11 +133,14 @@ public static class SS { ss.ExtentsCopy[i] = new SecuritySectorExtent { - Unknown = (uint)((response[1840 + i * 9 + 0] << 16) + (response[1840 + i * 9 + 1] << 8) + + Unknown = (uint)((response[1840 + i * 9 + 0] << 16) + + (response[1840 + i * 9 + 1] << 8) + response[1840 + i * 9 + 2]), - StartPSN = (uint)((response[1840 + i * 9 + 3] << 16) + (response[1840 + i * 9 + 4] << 8) + + StartPSN = (uint)((response[1840 + i * 9 + 3] << 16) + + (response[1840 + i * 9 + 4] << 8) + response[1840 + i * 9 + 5]), - EndPSN = (uint)((response[1840 + i * 9 + 6] << 16) + (response[1840 + i * 9 + 7] << 8) + + EndPSN = (uint)((response[1840 + i * 9 + 6] << 16) + + (response[1840 + i * 9 + 7] << 8) + response[1840 + i * 9 + 8]) }; } @@ -202,7 +212,8 @@ public static class SS break; default: sb.AppendFormat(Localization.Disc_maximum_transfer_rate_is_specified_by_unknown_key_0, - decoded.MaximumRate).AppendLine(); + decoded.MaximumRate). + AppendLine(); break; } @@ -315,7 +326,8 @@ public static class SS for(var i = 0; i < 16; i++) { sb.AppendFormat(Localization.Extent_starts_at_PSN_0_and_ends_at_PSN_1, decoded.Extents[i].StartPSN, - decoded.Extents[i].EndPSN).AppendLine(); + decoded.Extents[i].EndPSN). + AppendLine(); } return sb.ToString();