mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Refactor] Use collection expressions.
This commit is contained in:
@@ -66,30 +66,24 @@ public static class MMC
|
||||
const string MODULE_NAME = "Media detection";
|
||||
|
||||
static readonly byte[] _ps3Id =
|
||||
{
|
||||
[
|
||||
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x33, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
];
|
||||
|
||||
static readonly byte[] _ps4Id =
|
||||
{
|
||||
[
|
||||
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x34, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
];
|
||||
|
||||
static readonly byte[] _ps5Id =
|
||||
{
|
||||
[
|
||||
0x50, 0x6C, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x35, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
];
|
||||
|
||||
static readonly byte[] _operaId =
|
||||
{
|
||||
0x01, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x01
|
||||
};
|
||||
static readonly byte[] _operaId = [0x01, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x01];
|
||||
|
||||
// Only present on bootable CDs, but those make more than 99% of all available
|
||||
static readonly byte[] _fmTownsBootId =
|
||||
{
|
||||
0x49, 0x50, 0x4C, 0x34, 0xEB, 0x55, 0x06
|
||||
};
|
||||
static readonly byte[] _fmTownsBootId = [0x49, 0x50, 0x4C, 0x34, 0xEB, 0x55, 0x06];
|
||||
|
||||
/// <summary>Present on first two seconds of second track, says "COPYRIGHT BANDAI"</summary>
|
||||
static readonly byte[] _playdiaCopyright = "COPYRIGHT BANDAI"u8.ToArray();
|
||||
@@ -100,7 +94,7 @@ public static class MMC
|
||||
|
||||
/// <summary>This is some kind of header. Every 10 bytes there's an audio byte.</summary>
|
||||
static readonly byte[] _videoNowColorFrameMarker =
|
||||
{
|
||||
[
|
||||
0x81, 0xE3, 0xE3, 0xC7, 0xC7, 0x81, 0x81, 0xE3, 0xC7, 0x00, 0x81, 0xE3, 0xE3, 0xC7, 0xC7, 0x81, 0x81, 0xE3,
|
||||
0xC7, 0x00, 0x81, 0xE3, 0xE3, 0xC7, 0xC7, 0x81, 0x81, 0xE3, 0xC7, 0x00, 0x81, 0xE3, 0xE3, 0xC7, 0xC7, 0x81,
|
||||
0x81, 0xE3, 0xC7, 0x00, 0x81, 0xE3, 0xE3, 0xC7, 0xC7, 0x81, 0x81, 0xE3, 0xC7, 0x00, 0x81, 0xE3, 0xE3, 0xC7,
|
||||
@@ -124,16 +118,13 @@ public static class MMC
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0x00
|
||||
};
|
||||
];
|
||||
|
||||
static bool IsData(byte[] sector)
|
||||
{
|
||||
if(sector?.Length != 2352) return false;
|
||||
|
||||
byte[] syncMark =
|
||||
{
|
||||
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
|
||||
};
|
||||
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
||||
|
||||
var testMark = new byte[12];
|
||||
Array.Copy(sector, 0, testMark, 0, 12);
|
||||
@@ -147,10 +138,7 @@ public static class MMC
|
||||
|
||||
if(sector?.Length != 2352) return false;
|
||||
|
||||
byte[] syncMark =
|
||||
{
|
||||
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
|
||||
};
|
||||
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
||||
|
||||
var testMark = new byte[12];
|
||||
|
||||
@@ -205,10 +193,7 @@ public static class MMC
|
||||
{
|
||||
if(sector16?.Length != 2352) return false;
|
||||
|
||||
byte[] cdiMark =
|
||||
{
|
||||
0x01, 0x43, 0x44, 0x2D
|
||||
};
|
||||
byte[] cdiMark = [0x01, 0x43, 0x44, 0x2D];
|
||||
|
||||
bool isData = IsData(sector0);
|
||||
|
||||
@@ -2264,7 +2249,7 @@ public static class MMC
|
||||
|
||||
if(isoSector.Length < 2048) return;
|
||||
|
||||
List<string> rootEntries = new();
|
||||
List<string> rootEntries = [];
|
||||
uint ngcdIplStart = 0;
|
||||
uint ngcdIplLength = 0;
|
||||
uint vcdStart = 0;
|
||||
|
||||
Reference in New Issue
Block a user