mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Redo Reformat and cleanup.
Rider EAP was having a bug interpreting .editorconfig that didn't generate the code style as we wanted. This is now done with Rider-stable.
This commit is contained in:
@@ -138,13 +138,19 @@ public class AtariLynx : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".lnx" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".lnx"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[] { MediaType.AtariLynxCard };
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[]
|
||||
{
|
||||
MediaType.AtariLynxCard
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions =>
|
||||
|
||||
@@ -149,13 +149,19 @@ public class GameBoy : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".gb", ".gbc", ".sgb" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".gb", ".gbc", ".sgb"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[] { MediaType.GameBoyGamePak };
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[]
|
||||
{
|
||||
MediaType.GameBoyGamePak
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions =>
|
||||
|
||||
@@ -127,13 +127,19 @@ public class GameBoyAdvance : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".gba" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".gba"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[] { MediaType.GameBoyAdvanceGamePak };
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[]
|
||||
{
|
||||
MediaType.GameBoyAdvanceGamePak
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions =>
|
||||
|
||||
@@ -145,8 +145,10 @@ public class MasterSystem : IByteAddressableImage
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
int productCode = (header.ProductCode[0] & 0xF) + (header.ProductCode[0] & 0xF0) * 10 +
|
||||
(header.ProductCode[1] & 0xF) * 100 + (header.ProductCode[1] & 0xF0) * 1000 +
|
||||
int productCode = (header.ProductCode[0] & 0xF) +
|
||||
(header.ProductCode[0] & 0xF0) * 10 +
|
||||
(header.ProductCode[1] & 0xF) * 100 +
|
||||
(header.ProductCode[1] & 0xF0) * 1000 +
|
||||
((header.VersionAndProduct & 0xF0) >> 4) * 10000;
|
||||
|
||||
sb.AppendFormat(Localization.Product_code_0, productCode).AppendLine();
|
||||
@@ -229,7 +231,10 @@ public class MasterSystem : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".sms", ".gg" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".sms", ".gg"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
@@ -279,13 +279,19 @@ public class Nes : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".nes" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".nes"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[] { MediaType.NESGamePak, MediaType.FamicomGamePak };
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[]
|
||||
{
|
||||
MediaType.NESGamePak, MediaType.FamicomGamePak
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions =>
|
||||
@@ -424,8 +430,7 @@ public class Nes : IByteAddressableImage
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
|
||||
if(mediaType != MediaType.FamicomGamePak &&
|
||||
mediaType != MediaType.NESGamePak)
|
||||
if(mediaType != MediaType.FamicomGamePak && mediaType != MediaType.NESGamePak)
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
|
||||
@@ -69,11 +69,7 @@ public class Nintendo64 : IByteAddressableImage
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Format => !_opened
|
||||
? "Nintendo 64 cartridge dump"
|
||||
: _interleaved
|
||||
? "Doctor V64"
|
||||
: "Mr. Backup Z64";
|
||||
public string Format => !_opened ? "Nintendo 64 cartridge dump" : _interleaved ? "Doctor V64" : "Mr. Backup Z64";
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("EF1B4319-48A0-4EEC-B8E8-D0EA36F8CC92");
|
||||
@@ -806,13 +802,19 @@ public class Nintendo64 : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".n64", ".v64", ".z64" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".n64", ".v64", ".z64"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[] { MediaType.N64GamePak };
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[]
|
||||
{
|
||||
MediaType.N64GamePak
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions =>
|
||||
|
||||
@@ -69,13 +69,9 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
public List<DumpHardware> DumpHardware => null;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Format => !_opened
|
||||
? "Mega Drive cartridge dump"
|
||||
: _smd
|
||||
? "Super Magic Drive"
|
||||
: _interleaved
|
||||
? "Multi Game Doctor 2"
|
||||
: "Magicom";
|
||||
public string Format => !_opened ? "Mega Drive cartridge dump" :
|
||||
_smd ? "Super Magic Drive" :
|
||||
_interleaved ? "Multi Game Doctor 2" : "Magicom";
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid Id => new("7B1CE2E7-3BC4-4283-BFA4-F292D646DF15");
|
||||
@@ -105,22 +101,17 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
stream.EnsureRead(buffer, 0, 4);
|
||||
|
||||
// SEGA
|
||||
if(buffer[0] == 0x53 &&
|
||||
buffer[1] == 0x45 &&
|
||||
buffer[2] == 0x47 &&
|
||||
buffer[3] == 0x41)
|
||||
if(buffer[0] == 0x53 && buffer[1] == 0x45 && buffer[2] == 0x47 && buffer[3] == 0x41)
|
||||
return true;
|
||||
|
||||
// EA
|
||||
if(buffer[0] == 0x45 &&
|
||||
buffer[1] == 0x41)
|
||||
if(buffer[0] == 0x45 && buffer[1] == 0x41)
|
||||
{
|
||||
stream.Position = stream.Length / 2 + 256;
|
||||
stream.EnsureRead(buffer, 0, 2);
|
||||
|
||||
// SG
|
||||
if(buffer[0] == 0x53 &&
|
||||
buffer[1] == 0x47)
|
||||
if(buffer[0] == 0x53 && buffer[1] == 0x47)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,8 +119,7 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
stream.EnsureRead(buffer, 0, 4);
|
||||
|
||||
// EA
|
||||
if(buffer[0] != 0x45 ||
|
||||
buffer[1] != 0x41)
|
||||
if(buffer[0] != 0x45 || buffer[1] != 0x41)
|
||||
return false;
|
||||
|
||||
stream.Position = 8832;
|
||||
@@ -160,15 +150,13 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
bool found = buffer[0] == 0x53 && buffer[1] == 0x45 && buffer[2] == 0x47 && buffer[3] == 0x41;
|
||||
|
||||
// EA
|
||||
if(buffer[0] == 0x45 &&
|
||||
buffer[1] == 0x41)
|
||||
if(buffer[0] == 0x45 && buffer[1] == 0x41)
|
||||
{
|
||||
stream.Position = stream.Length / 2 + 256;
|
||||
stream.EnsureRead(buffer, 0, 2);
|
||||
|
||||
// SG
|
||||
if(buffer[0] == 0x53 &&
|
||||
buffer[1] == 0x47)
|
||||
if(buffer[0] == 0x53 && buffer[1] == 0x47)
|
||||
{
|
||||
_interleaved = true;
|
||||
found = true;
|
||||
@@ -179,15 +167,13 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
stream.EnsureRead(buffer, 0, 4);
|
||||
|
||||
// EA
|
||||
if(buffer[0] == 0x45 &&
|
||||
buffer[1] == 0x41)
|
||||
if(buffer[0] == 0x45 && buffer[1] == 0x41)
|
||||
{
|
||||
stream.Position = 8832;
|
||||
stream.EnsureRead(buffer, 0, 2);
|
||||
|
||||
// SG
|
||||
if(buffer[0] == 0x53 &&
|
||||
buffer[1] == 0x47)
|
||||
if(buffer[0] == 0x53 && buffer[1] == 0x47)
|
||||
{
|
||||
_smd = true;
|
||||
found = true;
|
||||
@@ -257,30 +243,36 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Copyright_string_0,
|
||||
StringHandlers.SpacePaddedToString(header.Copyright, encoding)).AppendLine();
|
||||
StringHandlers.SpacePaddedToString(header.Copyright, encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Domestic_title_0,
|
||||
StringHandlers.SpacePaddedToString(header.DomesticTitle, encoding)).AppendLine();
|
||||
StringHandlers.SpacePaddedToString(header.DomesticTitle, encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Overseas_title_0,
|
||||
StringHandlers.SpacePaddedToString(header.OverseasTitle, encoding)).AppendLine();
|
||||
StringHandlers.SpacePaddedToString(header.OverseasTitle, encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Serial_number_0,
|
||||
StringHandlers.SpacePaddedToString(header.SerialNumber, encoding)).AppendLine();
|
||||
StringHandlers.SpacePaddedToString(header.SerialNumber, encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Checksum_0_X4, header.Checksum).AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.Devices_supported_0,
|
||||
StringHandlers.SpacePaddedToString(header.DeviceSupport, encoding)).AppendLine();
|
||||
StringHandlers.SpacePaddedToString(header.DeviceSupport, encoding)).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.ROM_starts_at_0_and_ends_at_1_2_bytes, header.RomStart, header.RomEnd,
|
||||
header.RomEnd - header.RomStart + 1).AppendLine();
|
||||
header.RomEnd - header.RomStart + 1).
|
||||
AppendLine();
|
||||
|
||||
sb.AppendFormat(Localization.RAM_starts_at_0_and_ends_at_1_2_bytes, header.RamStart, header.RamEnd,
|
||||
header.RamEnd - header.RamStart + 1).AppendLine();
|
||||
header.RamEnd - header.RamStart + 1).
|
||||
AppendLine();
|
||||
|
||||
if(header.ExtraRamPresent[0] == 0x52 &&
|
||||
header.ExtraRamPresent[1] == 0x41)
|
||||
if(header.ExtraRamPresent[0] == 0x52 && header.ExtraRamPresent[1] == 0x41)
|
||||
{
|
||||
sb.AppendLine(Localization.Extra_RAM_present);
|
||||
|
||||
@@ -321,7 +313,8 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
header.ExtraRamEnd,
|
||||
(header.ExtraRamType & 0x10) == 0x10
|
||||
? (header.ExtraRamEnd - header.ExtraRamStart + 2) / 2
|
||||
: header.ExtraRamEnd - header.ExtraRamStart + 1).AppendLine();
|
||||
: header.ExtraRamEnd - header.ExtraRamStart + 1).
|
||||
AppendLine();
|
||||
}
|
||||
else
|
||||
sb.AppendLine(Localization.Extra_RAM_not_present);
|
||||
@@ -363,7 +356,10 @@ public class SegaMegaDrive : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".smd", ".md", ".32x" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".smd", ".md", ".32x"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
@@ -72,8 +72,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
stream.EnsureRead(headerBytes, 0, 48);
|
||||
header = Marshal.ByteArrayToStructureLittleEndian<Header>(headerBytes);
|
||||
|
||||
if((header.Mode & 0xF) == 0x5 ||
|
||||
(header.Mode & 0xF) == 0xA)
|
||||
if((header.Mode & 0xF) == 0x5 || (header.Mode & 0xF) == 0xA)
|
||||
return true;
|
||||
|
||||
break;
|
||||
@@ -85,8 +84,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
stream.EnsureRead(headerBytes, 0, 48);
|
||||
header = Marshal.ByteArrayToStructureLittleEndian<Header>(headerBytes);
|
||||
|
||||
if((header.Mode & 0xF) == 0x1 ||
|
||||
(header.Mode & 0xF) == 0xA)
|
||||
if((header.Mode & 0xF) == 0x1 || (header.Mode & 0xF) == 0xA)
|
||||
return true;
|
||||
|
||||
break;
|
||||
@@ -127,8 +125,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
stream.EnsureRead(headerBytes, 0, 48);
|
||||
_header = Marshal.ByteArrayToStructureLittleEndian<Header>(headerBytes);
|
||||
|
||||
if((_header.Mode & 0xF) == 0x5 ||
|
||||
(_header.Mode & 0xF) == 0xA)
|
||||
if((_header.Mode & 0xF) == 0x5 || (_header.Mode & 0xF) == 0xA)
|
||||
found = true;
|
||||
|
||||
break;
|
||||
@@ -140,8 +137,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
stream.EnsureRead(headerBytes, 0, 48);
|
||||
_header = Marshal.ByteArrayToStructureLittleEndian<Header>(headerBytes);
|
||||
|
||||
if((_header.Mode & 0xF) == 0x1 ||
|
||||
(_header.Mode & 0xF) == 0xA)
|
||||
if((_header.Mode & 0xF) == 0x1 || (_header.Mode & 0xF) == 0xA)
|
||||
found = true;
|
||||
|
||||
break;
|
||||
@@ -153,9 +149,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
stream.EnsureRead(headerBytes, 0, 48);
|
||||
_header = Marshal.ByteArrayToStructureLittleEndian<Header>(headerBytes);
|
||||
|
||||
if((_header.Mode & 0xF) == 0x0 ||
|
||||
(_header.Mode & 0xF) == 0x2 ||
|
||||
(_header.Mode & 0xF) == 0x3)
|
||||
if((_header.Mode & 0xF) == 0x0 || (_header.Mode & 0xF) == 0x2 || (_header.Mode & 0xF) == 0x3)
|
||||
found = true;
|
||||
|
||||
break;
|
||||
@@ -261,13 +255,19 @@ public class SuperNintendo : IByteAddressableImage
|
||||
public bool IsWriting { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> KnownExtensions => new[] { ".sfc" };
|
||||
public IEnumerable<string> KnownExtensions => new[]
|
||||
{
|
||||
".sfc"
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaTagType> SupportedMediaTags => Array.Empty<MediaTagType>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[] { MediaType.SNESGamePak, MediaType.SNESGamePakUS };
|
||||
public IEnumerable<MediaType> SupportedMediaTypes => new[]
|
||||
{
|
||||
MediaType.SNESGamePak, MediaType.SNESGamePakUS
|
||||
};
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions =>
|
||||
@@ -329,8 +329,7 @@ public class SuperNintendo : IByteAddressableImage
|
||||
return ErrorNumber.InvalidArgument;
|
||||
}
|
||||
|
||||
if(mediaType != MediaType.SNESGamePak &&
|
||||
mediaType != MediaType.SNESGamePakUS)
|
||||
if(mediaType != MediaType.SNESGamePak && mediaType != MediaType.SNESGamePakUS)
|
||||
{
|
||||
ErrorMessage = string.Format(Localization.Unsupported_media_format_0, mediaType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user