mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-03 21:30:35 +00:00
Clean up some formatting things
This commit is contained in:
@@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Test.CrossModel
|
||||
Data.Models.ArchiveDotOrg.Files files = Build();
|
||||
|
||||
// Serialize to generic model
|
||||
SabreTools.Data.Models.Metadata.MetadataFile? metadata = serializer.Serialize(files);
|
||||
Data.Models.Metadata.MetadataFile? metadata = serializer.Serialize(files);
|
||||
Assert.NotNull(metadata);
|
||||
|
||||
// Serialize back to original model
|
||||
|
||||
@@ -219,6 +219,7 @@ namespace SabreTools.Serialization.Test.CrossModel
|
||||
/// </summary>
|
||||
private static Data.Models.Hashfile.Hashfile Build(HashType hashType)
|
||||
{
|
||||
#pragma warning disable IDE0072
|
||||
return hashType switch
|
||||
{
|
||||
HashType.CRC32 => new Data.Models.Hashfile.Hashfile { SFV = [new Data.Models.Hashfile.SFV { File = "XXXXXX", Hash = "XXXXXX" }] },
|
||||
@@ -230,8 +231,9 @@ namespace SabreTools.Serialization.Test.CrossModel
|
||||
HashType.SHA384 => new Data.Models.Hashfile.Hashfile { SHA384 = [new Data.Models.Hashfile.SHA384 { Hash = "XXXXXX", File = "XXXXXX" }] },
|
||||
HashType.SHA512 => new Data.Models.Hashfile.Hashfile { SHA512 = [new Data.Models.Hashfile.SHA512 { Hash = "XXXXXX", File = "XXXXXX" }] },
|
||||
HashType.SpamSum => new Data.Models.Hashfile.Hashfile { SpamSum = [new Data.Models.Hashfile.SpamSum { Hash = "XXXXXX", File = "XXXXXX" }] },
|
||||
_ => throw new ArgumentOutOfRangeException(),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(hashType)),
|
||||
};
|
||||
#pragma warning restore IDE0072
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,6 +3,7 @@ using SabreTools.Data.Extensions;
|
||||
using SabreTools.Data.Models.ASN1;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable IDE0230 // Use UTF-8 string literal
|
||||
namespace SabreTools.Serialization.Test.Extensions
|
||||
{
|
||||
public class TypeLengthValueTests
|
||||
@@ -31,7 +32,7 @@ namespace SabreTools.Serialization.Test.Extensions
|
||||
public void Format_InvalidConstructed()
|
||||
{
|
||||
string expected = "Type: V_ASN1_OBJECT, V_ASN1_CONSTRUCTED, Length: 1, Value: [INVALID DATA TYPE]";
|
||||
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT | ASN1Type.V_ASN1_CONSTRUCTED, Length = 1, Value = (object?)false };
|
||||
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT | ASN1Type.V_ASN1_CONSTRUCTED, Length = 1, Value = false };
|
||||
string actual = tlv.Format();
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
@@ -50,7 +51,7 @@ namespace SabreTools.Serialization.Test.Extensions
|
||||
public void Format_InvalidDataType()
|
||||
{
|
||||
string expected = "Type: V_ASN1_OBJECT, Length: 1, Value: [INVALID DATA TYPE]";
|
||||
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT, Length = 1, Value = (object?)false };
|
||||
var tlv = new Data.Models.ASN1.TypeLengthValue { Type = ASN1Type.V_ASN1_OBJECT, Length = 1, Value = false };
|
||||
string actual = tlv.Format();
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
@@ -1,73 +1,73 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using SabreTools.Serialization.Readers;
|
||||
using Xunit;
|
||||
|
||||
namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
public class AppPkgHeaderTests
|
||||
{
|
||||
[Fact]
|
||||
public void NullArray_Null()
|
||||
{
|
||||
byte[]? data = null;
|
||||
int offset = 0;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data, offset);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyArray_Null()
|
||||
{
|
||||
byte[]? data = [];
|
||||
int offset = 0;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data, offset);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InvalidArray_Null()
|
||||
{
|
||||
byte[]? data = [.. Enumerable.Repeat<byte>(0xFF, 1024)];
|
||||
int offset = 0;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data, offset);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NullStream_Null()
|
||||
{
|
||||
Stream? data = null;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyStream_Null()
|
||||
{
|
||||
Stream? data = new MemoryStream([]);
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InvalidStream_Null()
|
||||
{
|
||||
Stream? data = new MemoryStream([.. Enumerable.Repeat<byte>(0xFF, 1024)]);
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using SabreTools.Serialization.Readers;
|
||||
using Xunit;
|
||||
|
||||
namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
public class AppPkgHeaderTests
|
||||
{
|
||||
[Fact]
|
||||
public void NullArray_Null()
|
||||
{
|
||||
byte[]? data = null;
|
||||
int offset = 0;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data, offset);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyArray_Null()
|
||||
{
|
||||
byte[]? data = [];
|
||||
int offset = 0;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data, offset);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InvalidArray_Null()
|
||||
{
|
||||
byte[]? data = [.. Enumerable.Repeat<byte>(0xFF, 1024)];
|
||||
int offset = 0;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data, offset);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NullStream_Null()
|
||||
{
|
||||
Stream? data = null;
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EmptyStream_Null()
|
||||
{
|
||||
Stream? data = new MemoryStream([]);
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InvalidStream_Null()
|
||||
{
|
||||
Stream? data = new MemoryStream([.. Enumerable.Repeat<byte>(0xFF, 1024)]);
|
||||
var deserializer = new AppPkgHeader();
|
||||
|
||||
var actual = deserializer.Deserialize(data);
|
||||
Assert.Null(actual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new ArchiveDotOrg();
|
||||
var serializer = new SabreTools.Serialization.Writers.ArchiveDotOrg();
|
||||
var serializer = new Serialization.Writers.ArchiveDotOrg();
|
||||
|
||||
// Build the data
|
||||
Data.Models.ArchiveDotOrg.Files files = Build();
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new AttractMode();
|
||||
var serializer = new SabreTools.Serialization.Writers.AttractMode();
|
||||
var serializer = new Serialization.Writers.AttractMode();
|
||||
|
||||
// Build the data
|
||||
Data.Models.AttractMode.MetadataFile mf = Build();
|
||||
@@ -101,7 +101,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new AttractMode();
|
||||
var serializer = new SabreTools.Serialization.Writers.AttractMode();
|
||||
var serializer = new Serialization.Writers.AttractMode();
|
||||
|
||||
// Build the data
|
||||
Data.Models.AttractMode.MetadataFile mf = Build();
|
||||
@@ -168,9 +168,9 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
Assert.NotNull(header);
|
||||
if (longHeader)
|
||||
Assert.True(SabreTools.Serialization.Writers.AttractMode.HeaderArrayWithRomname.SequenceEqual(header));
|
||||
Assert.True(Serialization.Writers.AttractMode.HeaderArrayWithRomname.SequenceEqual(header));
|
||||
else
|
||||
Assert.True(SabreTools.Serialization.Writers.AttractMode.HeaderArrayWithoutRomname.SequenceEqual(header));
|
||||
Assert.True(Serialization.Writers.AttractMode.HeaderArrayWithoutRomname.SequenceEqual(header));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new ClrMamePro();
|
||||
var serializer = new SabreTools.Serialization.Writers.ClrMamePro();
|
||||
var serializer = new Serialization.Writers.ClrMamePro();
|
||||
|
||||
// Build the data
|
||||
Data.Models.ClrMamePro.MetadataFile mf = Build(game: true);
|
||||
@@ -101,7 +101,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new ClrMamePro();
|
||||
var serializer = new SabreTools.Serialization.Writers.ClrMamePro();
|
||||
var serializer = new Serialization.Writers.ClrMamePro();
|
||||
|
||||
// Build the data
|
||||
Data.Models.ClrMamePro.MetadataFile mf = Build(game: true);
|
||||
@@ -127,7 +127,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new ClrMamePro();
|
||||
var serializer = new SabreTools.Serialization.Writers.ClrMamePro();
|
||||
var serializer = new Serialization.Writers.ClrMamePro();
|
||||
|
||||
// Build the data
|
||||
Data.Models.ClrMamePro.MetadataFile mf = Build(game: false);
|
||||
@@ -152,7 +152,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new ClrMamePro();
|
||||
var serializer = new SabreTools.Serialization.Writers.ClrMamePro();
|
||||
var serializer = new Serialization.Writers.ClrMamePro();
|
||||
|
||||
// Build the data
|
||||
Data.Models.ClrMamePro.MetadataFile mf = Build(game: false);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new DosCenter();
|
||||
var serializer = new SabreTools.Serialization.Writers.DosCenter();
|
||||
var serializer = new Serialization.Writers.DosCenter();
|
||||
|
||||
// Build the data
|
||||
Data.Models.DosCenter.MetadataFile mf = Build();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new EverdriveSMDB();
|
||||
var serializer = new SabreTools.Serialization.Writers.EverdriveSMDB();
|
||||
var serializer = new Serialization.Writers.EverdriveSMDB();
|
||||
|
||||
// Build the data
|
||||
Data.Models.EverdriveSMDB.MetadataFile mf = Build();
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.CRC32);
|
||||
@@ -101,7 +101,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.MD2);
|
||||
@@ -125,7 +125,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.MD4);
|
||||
@@ -149,7 +149,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.MD5);
|
||||
@@ -173,7 +173,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.SHA1);
|
||||
@@ -197,7 +197,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.SHA256);
|
||||
@@ -221,7 +221,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.SHA384);
|
||||
@@ -245,7 +245,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.SHA512);
|
||||
@@ -269,7 +269,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Hashfile();
|
||||
var serializer = new SabreTools.Serialization.Writers.Hashfile();
|
||||
var serializer = new Serialization.Writers.Hashfile();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Hashfile.Hashfile hf = Build(HashType.SpamSum);
|
||||
@@ -293,6 +293,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
/// </summary>
|
||||
private static Data.Models.Hashfile.Hashfile Build(HashType hashType)
|
||||
{
|
||||
#pragma warning disable IDE0072
|
||||
return hashType switch
|
||||
{
|
||||
HashType.CRC32 => new Data.Models.Hashfile.Hashfile { SFV = [new Data.Models.Hashfile.SFV { File = "XXXXXX", Hash = "XXXXXX" }] },
|
||||
@@ -304,8 +305,9 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
HashType.SHA384 => new Data.Models.Hashfile.Hashfile { SHA384 = [new Data.Models.Hashfile.SHA384 { Hash = "XXXXXX", File = "XXXXXX" }] },
|
||||
HashType.SHA512 => new Data.Models.Hashfile.Hashfile { SHA512 = [new Data.Models.Hashfile.SHA512 { Hash = "XXXXXX", File = "XXXXXX" }] },
|
||||
HashType.SpamSum => new Data.Models.Hashfile.Hashfile { SpamSum = [new Data.Models.Hashfile.SpamSum { Hash = "XXXXXX", File = "XXXXXX" }] },
|
||||
_ => throw new ArgumentOutOfRangeException(),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(hashType)),
|
||||
};
|
||||
#pragma warning restore IDE0072
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Listrom();
|
||||
var serializer = new SabreTools.Serialization.Writers.Listrom();
|
||||
var serializer = new Serialization.Writers.Listrom();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listrom.MetadataFile mf = Build();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Listxml();
|
||||
var serializer = new SabreTools.Serialization.Writers.Listxml();
|
||||
var serializer = new Serialization.Writers.Listxml();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listxml.Mame mame = Build(game: true);
|
||||
@@ -103,7 +103,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Listxml();
|
||||
var serializer = new SabreTools.Serialization.Writers.Listxml();
|
||||
var serializer = new Serialization.Writers.Listxml();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listxml.Mame mame = Build(game: false);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Logiqx();
|
||||
var serializer = new SabreTools.Serialization.Writers.Logiqx();
|
||||
var serializer = new Serialization.Writers.Logiqx();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Logiqx.Datafile df = Build(game: true);
|
||||
@@ -107,7 +107,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Logiqx();
|
||||
var serializer = new SabreTools.Serialization.Writers.Logiqx();
|
||||
var serializer = new Serialization.Writers.Logiqx();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Logiqx.Datafile df = Build(game: false);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new M1();
|
||||
var serializer = new SabreTools.Serialization.Writers.M1();
|
||||
var serializer = new Serialization.Writers.M1();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listxml.M1 m1 = Build(game: true);
|
||||
@@ -101,7 +101,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new M1();
|
||||
var serializer = new SabreTools.Serialization.Writers.M1();
|
||||
var serializer = new Serialization.Writers.M1();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listxml.M1 m1 = Build(game: false);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Mess();
|
||||
var serializer = new SabreTools.Serialization.Writers.Mess();
|
||||
var serializer = new Serialization.Writers.Mess();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listxml.Mess m1 = Build(game: true);
|
||||
@@ -101,7 +101,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new Mess();
|
||||
var serializer = new SabreTools.Serialization.Writers.Mess();
|
||||
var serializer = new Serialization.Writers.Mess();
|
||||
|
||||
// Build the data
|
||||
Data.Models.Listxml.Mess m1 = Build(game: false);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new OfflineList();
|
||||
var serializer = new SabreTools.Serialization.Writers.OfflineList();
|
||||
var serializer = new Serialization.Writers.OfflineList();
|
||||
|
||||
// Build the data
|
||||
Data.Models.OfflineList.Dat dat = Build();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new OpenMSX();
|
||||
var serializer = new SabreTools.Serialization.Writers.OpenMSX();
|
||||
var serializer = new Serialization.Writers.OpenMSX();
|
||||
|
||||
// Build the data
|
||||
Data.Models.OpenMSX.SoftwareDb sdb = Build();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new RomCenter();
|
||||
var serializer = new SabreTools.Serialization.Writers.RomCenter();
|
||||
var serializer = new Serialization.Writers.RomCenter();
|
||||
|
||||
// Build the data
|
||||
Data.Models.RomCenter.MetadataFile mf = Build();
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new SeparatedValue();
|
||||
var serializer = new SabreTools.Serialization.Writers.SeparatedValue();
|
||||
var serializer = new Serialization.Writers.SeparatedValue();
|
||||
|
||||
// Build the data
|
||||
Data.Models.SeparatedValue.MetadataFile mf = Build();
|
||||
@@ -104,7 +104,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new SeparatedValue();
|
||||
var serializer = new SabreTools.Serialization.Writers.SeparatedValue();
|
||||
var serializer = new Serialization.Writers.SeparatedValue();
|
||||
|
||||
// Build the data
|
||||
Data.Models.SeparatedValue.MetadataFile mf = Build();
|
||||
@@ -197,9 +197,9 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
Assert.NotNull(header);
|
||||
if (longHeader)
|
||||
Assert.True(SabreTools.Serialization.Writers.SeparatedValue.HeaderArrayExtended.SequenceEqual(header));
|
||||
Assert.True(Serialization.Writers.SeparatedValue.HeaderArrayExtended.SequenceEqual(header));
|
||||
else
|
||||
Assert.True(SabreTools.Serialization.Writers.SeparatedValue.HeaderArrayStandard.SequenceEqual(header));
|
||||
Assert.True(Serialization.Writers.SeparatedValue.HeaderArrayStandard.SequenceEqual(header));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -233,6 +233,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
Assert.Null(row.SHA512);
|
||||
Assert.Null(row.SpamSum);
|
||||
}
|
||||
|
||||
Assert.Equal("XXXXXX", row.Status);
|
||||
}
|
||||
|
||||
@@ -267,6 +268,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
Assert.Null(row.SHA512);
|
||||
Assert.Null(row.SpamSum);
|
||||
}
|
||||
|
||||
Assert.NotNull(row.Status); Assert.Empty(row.Status);
|
||||
}
|
||||
|
||||
@@ -302,6 +304,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
Assert.Null(row.SHA512);
|
||||
Assert.Null(row.SpamSum);
|
||||
}
|
||||
|
||||
Assert.Equal("XXXXXX", row.Status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Test.Readers
|
||||
{
|
||||
// Get the serializer and deserializer
|
||||
var deserializer = new SoftwareList();
|
||||
var serializer = new SabreTools.Serialization.Writers.SoftwareList();
|
||||
var serializer = new Serialization.Writers.SoftwareList();
|
||||
|
||||
// Build the data
|
||||
Data.Models.SoftwareList.SoftwareList sl = Build();
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class BZip2Tests
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class LDSCRYPTTests
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class RARTests
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class RealArcadeInstallerTests
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class RealArcadeMezzanineTests
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class SevenZipTests
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using SabreTools.Serialization.Wrappers;
|
||||
using Xunit;
|
||||
|
||||
#pragma warning disable xUnit1004 // Test methods should not be skipped
|
||||
namespace SabreTools.Serialization.Test.Wrappers
|
||||
{
|
||||
public class XZTests
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using SabreTools.Data.Models.ClrMamePro;
|
||||
|
||||
#pragma warning disable CA1822 // Mark members as static
|
||||
namespace SabreTools.Serialization.CrossModel
|
||||
{
|
||||
public partial class ClrMamePro : BaseMetadataSerializer<MetadataFile>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using SabreTools.Data.Models.Hashfile;
|
||||
using SabreTools.Hashing;
|
||||
|
||||
#pragma warning disable CA1822 // Mark members as static
|
||||
namespace SabreTools.Serialization.CrossModel
|
||||
{
|
||||
public partial class Hashfile : BaseMetadataSerializer<Data.Models.Hashfile.Hashfile>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using SabreTools.Data.Models.Logiqx;
|
||||
|
||||
#pragma warning disable CA1822 // Mark members as static
|
||||
namespace SabreTools.Serialization.CrossModel
|
||||
{
|
||||
public partial class Logiqx : BaseMetadataSerializer<Datafile>
|
||||
|
||||
@@ -1,312 +1,312 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using SabreTools.Data.Models.CDROM;
|
||||
using SabreTools.IO.Extensions;
|
||||
|
||||
namespace SabreTools.Data.Extensions
|
||||
{
|
||||
public static class CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the sector mode for a CD-ROM stream
|
||||
/// </summary>
|
||||
/// <param name="stream">Stream to derive the sector mode from</param>
|
||||
/// <returns>Sector mode from the stream on success, <see cref="SectorMode.UNKNOWN"/> on error</returns>
|
||||
public static SectorMode GetSectorMode(this Stream stream)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte modeByte = stream.ReadByteValue();
|
||||
if (modeByte == 0)
|
||||
{
|
||||
return SectorMode.MODE0;
|
||||
}
|
||||
else if (modeByte == 1)
|
||||
{
|
||||
return SectorMode.MODE1;
|
||||
}
|
||||
else if (modeByte == 2)
|
||||
{
|
||||
stream.SeekIfPossible(2, SeekOrigin.Current);
|
||||
byte submode = stream.ReadByteValue();
|
||||
if ((submode & 0x20) == 0x20)
|
||||
return SectorMode.MODE2_FORM2;
|
||||
else
|
||||
return SectorMode.MODE2_FORM1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SectorMode.UNKNOWN;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore the actual error
|
||||
return SectorMode.UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user data size for a sector mode
|
||||
/// </summary>
|
||||
/// <param name="mode">Sector mode to get a value for</param>
|
||||
/// <returns>User data size, if possible</returns>
|
||||
public static long GetUserDataSize(this SectorMode mode)
|
||||
{
|
||||
return mode switch
|
||||
{
|
||||
SectorMode.UNKNOWN => Constants.Mode0DataSize,
|
||||
SectorMode.MODE0 => Constants.Mode0DataSize,
|
||||
SectorMode.MODE1 => Constants.Mode1DataSize,
|
||||
SectorMode.MODE2 => Constants.Mode0DataSize,
|
||||
SectorMode.MODE2_FORM1 => Constants.Mode2Form1DataSize,
|
||||
SectorMode.MODE2_FORM2 => Constants.Mode2Form2DataSize,
|
||||
_ => Constants.Mode0DataSize,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user data end offset for a sector mode
|
||||
/// </summary>
|
||||
/// <param name="mode">Sector mode to get a value for</param>
|
||||
/// <returns>User data end offset, if possible</returns>
|
||||
public static long GetUserDataEnd(this SectorMode mode)
|
||||
{
|
||||
return mode switch
|
||||
{
|
||||
SectorMode.UNKNOWN => Constants.Mode0UserDataEnd,
|
||||
SectorMode.MODE0 => Constants.Mode0UserDataEnd, // TODO: Support flexible sector length (2352)
|
||||
SectorMode.MODE1 => Constants.Mode1UserDataEnd,
|
||||
SectorMode.MODE2 => Constants.Mode0UserDataEnd, // TODO: Support flexible sector length (2352)
|
||||
SectorMode.MODE2_FORM1 => Constants.Mode2Form1UserDataEnd,
|
||||
SectorMode.MODE2_FORM2 => Constants.Mode2Form2UserDataEnd, // TODO: Support flexible sector length (2348)
|
||||
_ => Constants.Mode0UserDataEnd,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user data start offset for a sector mode
|
||||
/// </summary>
|
||||
/// <param name="mode">Sector mode to get a value for</param>
|
||||
/// <returns>User data start offset, if possible</returns>
|
||||
public static long GetUserDataStart(this SectorMode mode)
|
||||
{
|
||||
return mode switch
|
||||
{
|
||||
SectorMode.UNKNOWN => Constants.Mode0UserDataStart,
|
||||
SectorMode.MODE0 => Constants.Mode0UserDataStart,
|
||||
SectorMode.MODE1 => Constants.Mode1UserDataStart,
|
||||
SectorMode.MODE2 => Constants.Mode0UserDataStart,
|
||||
SectorMode.MODE2_FORM1 => Constants.Mode2Form1UserDataStart,
|
||||
SectorMode.MODE2_FORM2 => Constants.Mode2Form2UserDataStart,
|
||||
_ => Constants.Mode0UserDataStart,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a stream that provides only the user data of a CDROM stream
|
||||
/// </summary>
|
||||
public class ISO9660Stream : Stream
|
||||
{
|
||||
// Base CDROM stream (2352-byte sector)
|
||||
private readonly Stream _baseStream;
|
||||
|
||||
// State variables
|
||||
private long _position = 0;
|
||||
private SectorMode _currentMode = SectorMode.UNKNOWN;
|
||||
private long _userDataStart = Constants.Mode1UserDataStart;
|
||||
private long _userDataEnd = Constants.Mode1UserDataEnd;
|
||||
#pragma warning disable IDE0044
|
||||
private long _isoSectorSize = Constants.Mode1DataSize;
|
||||
#pragma warning restore IDE0044
|
||||
|
||||
public ISO9660Stream(Stream inputStream)
|
||||
{
|
||||
if (!inputStream.CanSeek || !inputStream.CanRead)
|
||||
throw new ArgumentException("Stream must be readable and seekable.", nameof(inputStream));
|
||||
|
||||
_baseStream = inputStream;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool CanRead => _baseStream.CanRead;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool CanSeek => _baseStream.CanSeek;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool CanWrite => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Flush() => _baseStream.Flush();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override long Length
|
||||
=> _baseStream.Length / Constants.CDROMSectorSize * _isoSectorSize;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void SetLength(long value)
|
||||
=> throw new NotSupportedException("Setting the length of this stream is not supported.");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
=> throw new NotSupportedException("Writing to this stream is not supported.");
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
_baseStream.Dispose();
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override long Position
|
||||
{
|
||||
// Get the position of the underlying ISO9660 stream
|
||||
get
|
||||
{
|
||||
// Get the user data location based on the current sector mode
|
||||
SetState(_position);
|
||||
|
||||
// Get the number of ISO sectors before current position
|
||||
long isoPosition = _position / Constants.CDROMSectorSize * _isoSectorSize;
|
||||
|
||||
// Add the within-sector position
|
||||
long remainder = _position % Constants.CDROMSectorSize;
|
||||
if (remainder > _userDataEnd)
|
||||
isoPosition += _isoSectorSize;
|
||||
else if (remainder > _userDataStart)
|
||||
isoPosition += remainder - _userDataStart;
|
||||
|
||||
return isoPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
// Seek to the underlying ISO9660 position
|
||||
Seek(value, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
int totalRead = 0;
|
||||
int remaining = count;
|
||||
|
||||
while (remaining > 0 && _position < _baseStream.Length)
|
||||
{
|
||||
// Determine location of current sector
|
||||
long baseStreamOffset = _position - (_position % Constants.CDROMSectorSize);
|
||||
|
||||
// Set the current sector's mode and user data location
|
||||
SetState(baseStreamOffset);
|
||||
|
||||
// Deal with case where base position is not in ISO stream
|
||||
long remainder = _position % Constants.CDROMSectorSize;
|
||||
long sectorOffset = remainder - _userDataStart;
|
||||
if (remainder < _userDataStart)
|
||||
{
|
||||
baseStreamOffset += _userDataStart;
|
||||
sectorOffset = 0;
|
||||
_position += _userDataStart;
|
||||
}
|
||||
else if (remainder >= _userDataEnd)
|
||||
{
|
||||
baseStreamOffset += Constants.CDROMSectorSize;
|
||||
sectorOffset = 0;
|
||||
_position += Constants.CDROMSectorSize - _userDataEnd + _userDataStart;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseStreamOffset += remainder;
|
||||
}
|
||||
|
||||
// Sanity check on read location before seeking
|
||||
if (baseStreamOffset < 0 || baseStreamOffset > _baseStream.Length)
|
||||
throw new ArgumentOutOfRangeException(nameof(offset), "Attempted to seek outside the stream boundaries.");
|
||||
|
||||
// Seek to target position in base CDROM stream
|
||||
_baseStream.SeekIfPossible(baseStreamOffset, SeekOrigin.Begin);
|
||||
|
||||
// Read the remaining bytes, up to max of one ISO sector (2048 bytes)
|
||||
int bytesToRead = (int)Math.Min(remaining, _isoSectorSize - sectorOffset);
|
||||
|
||||
// Don't overshoot end of stream
|
||||
bytesToRead = (int)Math.Min(bytesToRead, _baseStream.Length - _position);
|
||||
|
||||
// Finish reading if no more bytes to be read
|
||||
if (bytesToRead <= 0)
|
||||
break;
|
||||
|
||||
// Read up to 2048 bytes from base CDROM stream
|
||||
int bytesRead = _baseStream.Read(buffer, offset + totalRead, bytesToRead);
|
||||
|
||||
// Update state for base stream
|
||||
_position = _baseStream.Position;
|
||||
if (bytesToRead == (_isoSectorSize - sectorOffset))
|
||||
_position += Constants.CDROMSectorSize - _userDataEnd + _userDataStart;
|
||||
|
||||
// Update state for ISO stream
|
||||
totalRead += bytesRead;
|
||||
remaining -= bytesRead;
|
||||
|
||||
if (bytesRead == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
// Get the intended position for the ISO9660 stream
|
||||
long targetPosition = origin switch
|
||||
{
|
||||
SeekOrigin.Begin => offset,
|
||||
SeekOrigin.Current => Position + offset,
|
||||
SeekOrigin.End => Length + offset,
|
||||
_ => throw new ArgumentException("Invalid SeekOrigin.", nameof(origin)),
|
||||
};
|
||||
|
||||
// Get the number of ISO sectors before current position
|
||||
long newPosition = targetPosition / _isoSectorSize * Constants.CDROMSectorSize;
|
||||
|
||||
// Set the current sector's mode and user data location
|
||||
SetState(newPosition);
|
||||
|
||||
// Add the within-sector position
|
||||
newPosition += _userDataStart + (targetPosition % _isoSectorSize);
|
||||
if (newPosition < 0 || newPosition > _baseStream.Length)
|
||||
throw new ArgumentOutOfRangeException(nameof(offset), "Attempted to seek outside the stream boundaries.");
|
||||
|
||||
_position = _baseStream.SeekIfPossible(newPosition, SeekOrigin.Begin);
|
||||
return Position;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the current stream state based on the location
|
||||
/// </summary>
|
||||
/// <param name="sectorLocation">Sector location to update from</param>
|
||||
private void SetState(long sectorLocation)
|
||||
{
|
||||
long current = _baseStream.Position;
|
||||
long modePosition = sectorLocation - (sectorLocation % Constants.CDROMSectorSize) + 15;
|
||||
|
||||
// Get the current sector mode
|
||||
_baseStream.SeekIfPossible(modePosition, SeekOrigin.Begin);
|
||||
_currentMode = _baseStream.GetSectorMode();
|
||||
|
||||
// Set the user data location variables
|
||||
_userDataStart = _currentMode.GetUserDataStart();
|
||||
_userDataEnd = _currentMode.GetUserDataEnd();
|
||||
// _isoSectorSize = _currentMode.GetUserDataSize();
|
||||
|
||||
// Reset the stream position
|
||||
_baseStream.SeekIfPossible(current, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.IO;
|
||||
using SabreTools.Data.Models.CDROM;
|
||||
using SabreTools.IO.Extensions;
|
||||
|
||||
namespace SabreTools.Data.Extensions
|
||||
{
|
||||
public static class CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the sector mode for a CD-ROM stream
|
||||
/// </summary>
|
||||
/// <param name="stream">Stream to derive the sector mode from</param>
|
||||
/// <returns>Sector mode from the stream on success, <see cref="SectorMode.UNKNOWN"/> on error</returns>
|
||||
public static SectorMode GetSectorMode(this Stream stream)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte modeByte = stream.ReadByteValue();
|
||||
if (modeByte == 0)
|
||||
{
|
||||
return SectorMode.MODE0;
|
||||
}
|
||||
else if (modeByte == 1)
|
||||
{
|
||||
return SectorMode.MODE1;
|
||||
}
|
||||
else if (modeByte == 2)
|
||||
{
|
||||
stream.SeekIfPossible(2, SeekOrigin.Current);
|
||||
byte submode = stream.ReadByteValue();
|
||||
if ((submode & 0x20) == 0x20)
|
||||
return SectorMode.MODE2_FORM2;
|
||||
else
|
||||
return SectorMode.MODE2_FORM1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SectorMode.UNKNOWN;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore the actual error
|
||||
return SectorMode.UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user data size for a sector mode
|
||||
/// </summary>
|
||||
/// <param name="mode">Sector mode to get a value for</param>
|
||||
/// <returns>User data size, if possible</returns>
|
||||
public static long GetUserDataSize(this SectorMode mode)
|
||||
{
|
||||
return mode switch
|
||||
{
|
||||
SectorMode.UNKNOWN => Constants.Mode0DataSize,
|
||||
SectorMode.MODE0 => Constants.Mode0DataSize,
|
||||
SectorMode.MODE1 => Constants.Mode1DataSize,
|
||||
SectorMode.MODE2 => Constants.Mode0DataSize,
|
||||
SectorMode.MODE2_FORM1 => Constants.Mode2Form1DataSize,
|
||||
SectorMode.MODE2_FORM2 => Constants.Mode2Form2DataSize,
|
||||
_ => Constants.Mode0DataSize,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user data end offset for a sector mode
|
||||
/// </summary>
|
||||
/// <param name="mode">Sector mode to get a value for</param>
|
||||
/// <returns>User data end offset, if possible</returns>
|
||||
public static long GetUserDataEnd(this SectorMode mode)
|
||||
{
|
||||
return mode switch
|
||||
{
|
||||
SectorMode.UNKNOWN => Constants.Mode0UserDataEnd,
|
||||
SectorMode.MODE0 => Constants.Mode0UserDataEnd, // TODO: Support flexible sector length (2352)
|
||||
SectorMode.MODE1 => Constants.Mode1UserDataEnd,
|
||||
SectorMode.MODE2 => Constants.Mode0UserDataEnd, // TODO: Support flexible sector length (2352)
|
||||
SectorMode.MODE2_FORM1 => Constants.Mode2Form1UserDataEnd,
|
||||
SectorMode.MODE2_FORM2 => Constants.Mode2Form2UserDataEnd, // TODO: Support flexible sector length (2348)
|
||||
_ => Constants.Mode0UserDataEnd,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user data start offset for a sector mode
|
||||
/// </summary>
|
||||
/// <param name="mode">Sector mode to get a value for</param>
|
||||
/// <returns>User data start offset, if possible</returns>
|
||||
public static long GetUserDataStart(this SectorMode mode)
|
||||
{
|
||||
return mode switch
|
||||
{
|
||||
SectorMode.UNKNOWN => Constants.Mode0UserDataStart,
|
||||
SectorMode.MODE0 => Constants.Mode0UserDataStart,
|
||||
SectorMode.MODE1 => Constants.Mode1UserDataStart,
|
||||
SectorMode.MODE2 => Constants.Mode0UserDataStart,
|
||||
SectorMode.MODE2_FORM1 => Constants.Mode2Form1UserDataStart,
|
||||
SectorMode.MODE2_FORM2 => Constants.Mode2Form2UserDataStart,
|
||||
_ => Constants.Mode0UserDataStart,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a stream that provides only the user data of a CDROM stream
|
||||
/// </summary>
|
||||
public class ISO9660Stream : Stream
|
||||
{
|
||||
// Base CDROM stream (2352-byte sector)
|
||||
private readonly Stream _baseStream;
|
||||
|
||||
// State variables
|
||||
private long _position = 0;
|
||||
private SectorMode _currentMode = SectorMode.UNKNOWN;
|
||||
private long _userDataStart = Constants.Mode1UserDataStart;
|
||||
private long _userDataEnd = Constants.Mode1UserDataEnd;
|
||||
#pragma warning disable IDE0044
|
||||
private long _isoSectorSize = Constants.Mode1DataSize;
|
||||
#pragma warning restore IDE0044
|
||||
|
||||
public ISO9660Stream(Stream inputStream)
|
||||
{
|
||||
if (!inputStream.CanSeek || !inputStream.CanRead)
|
||||
throw new ArgumentException("Stream must be readable and seekable.", nameof(inputStream));
|
||||
|
||||
_baseStream = inputStream;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool CanRead => _baseStream.CanRead;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool CanSeek => _baseStream.CanSeek;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool CanWrite => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Flush() => _baseStream.Flush();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override long Length
|
||||
=> _baseStream.Length / Constants.CDROMSectorSize * _isoSectorSize;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void SetLength(long value)
|
||||
=> throw new NotSupportedException("Setting the length of this stream is not supported.");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Write(byte[] buffer, int offset, int count)
|
||||
=> throw new NotSupportedException("Writing to this stream is not supported.");
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
_baseStream.Dispose();
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override long Position
|
||||
{
|
||||
// Get the position of the underlying ISO9660 stream
|
||||
get
|
||||
{
|
||||
// Get the user data location based on the current sector mode
|
||||
SetState(_position);
|
||||
|
||||
// Get the number of ISO sectors before current position
|
||||
long isoPosition = _position / Constants.CDROMSectorSize * _isoSectorSize;
|
||||
|
||||
// Add the within-sector position
|
||||
long remainder = _position % Constants.CDROMSectorSize;
|
||||
if (remainder > _userDataEnd)
|
||||
isoPosition += _isoSectorSize;
|
||||
else if (remainder > _userDataStart)
|
||||
isoPosition += remainder - _userDataStart;
|
||||
|
||||
return isoPosition;
|
||||
}
|
||||
set
|
||||
{
|
||||
// Seek to the underlying ISO9660 position
|
||||
Seek(value, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
int totalRead = 0;
|
||||
int remaining = count;
|
||||
|
||||
while (remaining > 0 && _position < _baseStream.Length)
|
||||
{
|
||||
// Determine location of current sector
|
||||
long baseStreamOffset = _position - (_position % Constants.CDROMSectorSize);
|
||||
|
||||
// Set the current sector's mode and user data location
|
||||
SetState(baseStreamOffset);
|
||||
|
||||
// Deal with case where base position is not in ISO stream
|
||||
long remainder = _position % Constants.CDROMSectorSize;
|
||||
long sectorOffset = remainder - _userDataStart;
|
||||
if (remainder < _userDataStart)
|
||||
{
|
||||
baseStreamOffset += _userDataStart;
|
||||
sectorOffset = 0;
|
||||
_position += _userDataStart;
|
||||
}
|
||||
else if (remainder >= _userDataEnd)
|
||||
{
|
||||
baseStreamOffset += Constants.CDROMSectorSize;
|
||||
sectorOffset = 0;
|
||||
_position += Constants.CDROMSectorSize - _userDataEnd + _userDataStart;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseStreamOffset += remainder;
|
||||
}
|
||||
|
||||
// Sanity check on read location before seeking
|
||||
if (baseStreamOffset < 0 || baseStreamOffset > _baseStream.Length)
|
||||
throw new ArgumentOutOfRangeException(nameof(offset), "Attempted to seek outside the stream boundaries.");
|
||||
|
||||
// Seek to target position in base CDROM stream
|
||||
_baseStream.SeekIfPossible(baseStreamOffset, SeekOrigin.Begin);
|
||||
|
||||
// Read the remaining bytes, up to max of one ISO sector (2048 bytes)
|
||||
int bytesToRead = (int)Math.Min(remaining, _isoSectorSize - sectorOffset);
|
||||
|
||||
// Don't overshoot end of stream
|
||||
bytesToRead = (int)Math.Min(bytesToRead, _baseStream.Length - _position);
|
||||
|
||||
// Finish reading if no more bytes to be read
|
||||
if (bytesToRead <= 0)
|
||||
break;
|
||||
|
||||
// Read up to 2048 bytes from base CDROM stream
|
||||
int bytesRead = _baseStream.Read(buffer, offset + totalRead, bytesToRead);
|
||||
|
||||
// Update state for base stream
|
||||
_position = _baseStream.Position;
|
||||
if (bytesToRead == (_isoSectorSize - sectorOffset))
|
||||
_position += Constants.CDROMSectorSize - _userDataEnd + _userDataStart;
|
||||
|
||||
// Update state for ISO stream
|
||||
totalRead += bytesRead;
|
||||
remaining -= bytesRead;
|
||||
|
||||
if (bytesRead == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
return totalRead;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override long Seek(long offset, SeekOrigin origin)
|
||||
{
|
||||
// Get the intended position for the ISO9660 stream
|
||||
long targetPosition = origin switch
|
||||
{
|
||||
SeekOrigin.Begin => offset,
|
||||
SeekOrigin.Current => Position + offset,
|
||||
SeekOrigin.End => Length + offset,
|
||||
_ => throw new ArgumentException("Invalid SeekOrigin.", nameof(origin)),
|
||||
};
|
||||
|
||||
// Get the number of ISO sectors before current position
|
||||
long newPosition = targetPosition / _isoSectorSize * Constants.CDROMSectorSize;
|
||||
|
||||
// Set the current sector's mode and user data location
|
||||
SetState(newPosition);
|
||||
|
||||
// Add the within-sector position
|
||||
newPosition += _userDataStart + (targetPosition % _isoSectorSize);
|
||||
if (newPosition < 0 || newPosition > _baseStream.Length)
|
||||
throw new ArgumentOutOfRangeException(nameof(offset), "Attempted to seek outside the stream boundaries.");
|
||||
|
||||
_position = _baseStream.SeekIfPossible(newPosition, SeekOrigin.Begin);
|
||||
return Position;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the current stream state based on the location
|
||||
/// </summary>
|
||||
/// <param name="sectorLocation">Sector location to update from</param>
|
||||
private void SetState(long sectorLocation)
|
||||
{
|
||||
long current = _baseStream.Position;
|
||||
long modePosition = sectorLocation - (sectorLocation % Constants.CDROMSectorSize) + 15;
|
||||
|
||||
// Get the current sector mode
|
||||
_baseStream.SeekIfPossible(modePosition, SeekOrigin.Begin);
|
||||
_currentMode = _baseStream.GetSectorMode();
|
||||
|
||||
// Set the user data location variables
|
||||
_userDataStart = _currentMode.GetUserDataStart();
|
||||
_userDataEnd = _currentMode.GetUserDataEnd();
|
||||
// _isoSectorSize = _currentMode.GetUserDataSize();
|
||||
|
||||
// Reset the stream position
|
||||
_baseStream.SeekIfPossible(current, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
using SabreTools.Data.Models.ISO9660;
|
||||
using SabreTools.Numerics;
|
||||
|
||||
namespace SabreTools.Data.Extensions
|
||||
{
|
||||
public static class ISO9660
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the logical block size from a sector length
|
||||
/// </summary>
|
||||
/// <param name="vd">Volume descriptor containing block information</param>
|
||||
/// <param name="sectorLength">Defined sector length</param>
|
||||
/// <returns>Size of a logical block</returns>
|
||||
public static short GetLogicalBlockSize(this VolumeDescriptor vd, short sectorLength)
|
||||
{
|
||||
BothInt16 blockSize;
|
||||
if (vd is PrimaryVolumeDescriptor pvd)
|
||||
blockSize = pvd.LogicalBlockSize;
|
||||
else if (vd is SupplementaryVolumeDescriptor svd)
|
||||
blockSize = svd.LogicalBlockSize;
|
||||
else
|
||||
return sectorLength;
|
||||
|
||||
// If the block size is inconsistent
|
||||
if (!blockSize.IsValid)
|
||||
{
|
||||
bool leValid = BlockSizeValid(blockSize.LittleEndian, sectorLength);
|
||||
bool beValid = BlockSizeValid(blockSize.BigEndian, sectorLength);
|
||||
|
||||
if (leValid && !beValid)
|
||||
blockSize = blockSize.LittleEndian;
|
||||
else if (beValid && !leValid)
|
||||
blockSize = blockSize.BigEndian;
|
||||
else
|
||||
return sectorLength;
|
||||
}
|
||||
|
||||
// Validate logical block size
|
||||
if (!BlockSizeValid(blockSize, sectorLength))
|
||||
blockSize = sectorLength;
|
||||
|
||||
return blockSize;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if a block size is valid
|
||||
/// </summary>
|
||||
/// <param name="blockSize">Block length to check</param>
|
||||
/// <param name="sectorLength">Defined sector length</param>
|
||||
/// <returns>True if the block length is valid, false otherwise</returns>
|
||||
private static bool BlockSizeValid(short blockSize, short sectorLength)
|
||||
=> blockSize >= 512 && blockSize <= sectorLength && (blockSize & (blockSize - 1)) == 0;
|
||||
}
|
||||
}
|
||||
using SabreTools.Data.Models.ISO9660;
|
||||
using SabreTools.Numerics;
|
||||
|
||||
namespace SabreTools.Data.Extensions
|
||||
{
|
||||
public static class ISO9660
|
||||
{
|
||||
/// <summary>
|
||||
/// Get the logical block size from a sector length
|
||||
/// </summary>
|
||||
/// <param name="vd">Volume descriptor containing block information</param>
|
||||
/// <param name="sectorLength">Defined sector length</param>
|
||||
/// <returns>Size of a logical block</returns>
|
||||
public static short GetLogicalBlockSize(this VolumeDescriptor vd, short sectorLength)
|
||||
{
|
||||
BothInt16 blockSize;
|
||||
if (vd is PrimaryVolumeDescriptor pvd)
|
||||
blockSize = pvd.LogicalBlockSize;
|
||||
else if (vd is SupplementaryVolumeDescriptor svd)
|
||||
blockSize = svd.LogicalBlockSize;
|
||||
else
|
||||
return sectorLength;
|
||||
|
||||
// If the block size is inconsistent
|
||||
if (!blockSize.IsValid)
|
||||
{
|
||||
bool leValid = BlockSizeValid(blockSize.LittleEndian, sectorLength);
|
||||
bool beValid = BlockSizeValid(blockSize.BigEndian, sectorLength);
|
||||
|
||||
if (leValid && !beValid)
|
||||
blockSize = blockSize.LittleEndian;
|
||||
else if (beValid && !leValid)
|
||||
blockSize = blockSize.BigEndian;
|
||||
else
|
||||
return sectorLength;
|
||||
}
|
||||
|
||||
// Validate logical block size
|
||||
if (!BlockSizeValid(blockSize, sectorLength))
|
||||
blockSize = sectorLength;
|
||||
|
||||
return blockSize;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if a block size is valid
|
||||
/// </summary>
|
||||
/// <param name="blockSize">Block length to check</param>
|
||||
/// <param name="sectorLength">Defined sector length</param>
|
||||
/// <returns>True if the block length is valid, false otherwise</returns>
|
||||
private static bool BlockSizeValid(short blockSize, short sectorLength)
|
||||
=> blockSize >= 512 && blockSize <= sectorLength && (blockSize & (blockSize - 1)) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using SabreTools.Data.Models.PortableExecutable;
|
||||
using SabreTools.Data.Models.PortableExecutable.Resource.Entries;
|
||||
using SabreTools.IO.Extensions;
|
||||
|
||||
#pragma warning disable IDE0017 // Simplify object initialization
|
||||
namespace SabreTools.Data.Extensions
|
||||
{
|
||||
public static class PortableExecutable
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
#pragma warning disable SYSLIB1045 // Convert to 'GeneratedRegexAttribute'
|
||||
namespace SabreTools.Data.Extensions
|
||||
{
|
||||
public static class WiseScript
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
|
||||
#pragma warning disable CA1069 // Enums values should not be duplicated
|
||||
namespace SabreTools.Data.Models.ASN1
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
#pragma warning disable IDE1006 // Naming Styles
|
||||
namespace SabreTools.Data.Models.ArchiveDotOrg
|
||||
{
|
||||
[XmlRoot("file")]
|
||||
@@ -202,4 +203,4 @@ namespace SabreTools.Data.Models.ArchiveDotOrg
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ namespace SabreTools.Data.Models.ArchiveDotOrg
|
||||
[XmlElement("file")]
|
||||
public File[]? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,4 @@ namespace SabreTools.Data.Models.AttractMode
|
||||
|
||||
public Row[]? Row { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,4 @@ namespace SabreTools.Data.Models.AttractMode
|
||||
|
||||
public string? FileIsAvailable { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
public const int MAX_MAP_MODELS = 400;
|
||||
public const int MAX_MAP_BRUSHES = 4096;
|
||||
public const int MAX_MAP_ENTITIES = 1024;
|
||||
public const int MAX_MAP_ENTSTRING = (128 * 1024);
|
||||
public const int MAX_MAP_ENTSTRING = 128 * 1024;
|
||||
|
||||
public const int MAX_MAP_PLANES = 32767;
|
||||
public const int MAX_MAP_NODES = 32767;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// related to the properties of a particular triangle in the
|
||||
/// displacement mesh.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class DispTri
|
||||
{
|
||||
@@ -16,4 +16,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public DispTriTag Tags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
|
||||
#pragma warning disable CA1069 // Enums values should not be duplicated
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM disc image, made up of data sectors, ISO 10149 / ECMA-130
|
||||
/// Intentionally not a mixed-mode CD disc image, pure CD-ROM disc (no audio sectors)
|
||||
/// This model intentionally does not take tracks into consideration
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// CD-ROM data sectors
|
||||
/// </summary>
|
||||
public DataSector[] Sectors { get; set; } = [];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM disc image, made up of data sectors, ISO 10149 / ECMA-130
|
||||
/// Intentionally not a mixed-mode CD disc image, pure CD-ROM disc (no audio sectors)
|
||||
/// This model intentionally does not take tracks into consideration
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// CD-ROM data sectors
|
||||
/// </summary>
|
||||
public DataSector[] Sectors { get; set; } = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,74 +1,74 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// CDROM constant values
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Size of a complete CDROM data sector
|
||||
/// </summary>
|
||||
public const long CDROMSectorSize = 2352;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode0 / Mode2 Formless
|
||||
/// </summary>
|
||||
public const long Mode0DataSize = 2336;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode0 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode0UserDataStart = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode0 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode0UserDataEnd = 2064;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode1
|
||||
/// </summary>
|
||||
public const long Mode1DataSize = 2048;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode1 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode1UserDataStart = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode1 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode1UserDataEnd = 2064;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode2 Form1
|
||||
/// </summary>
|
||||
public const long Mode2Form1DataSize = 2048;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form1 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode2Form1UserDataStart = 24;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form1 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode2Form1UserDataEnd = 2072;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode2 Form2
|
||||
/// </summary>
|
||||
public const long Mode2Form2DataSize = 2324;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form2 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode2Form2UserDataStart = 24;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form2 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode2Form2UserDataEnd = 2072;
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// CDROM constant values
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Size of a complete CDROM data sector
|
||||
/// </summary>
|
||||
public const long CDROMSectorSize = 2352;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode0 / Mode2 Formless
|
||||
/// </summary>
|
||||
public const long Mode0DataSize = 2336;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode0 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode0UserDataStart = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode0 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode0UserDataEnd = 2064;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode1
|
||||
/// </summary>
|
||||
public const long Mode1DataSize = 2048;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode1 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode1UserDataStart = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode1 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode1UserDataEnd = 2064;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode2 Form1
|
||||
/// </summary>
|
||||
public const long Mode2Form1DataSize = 2048;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form1 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode2Form1UserDataStart = 24;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form1 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode2Form1UserDataEnd = 2072;
|
||||
|
||||
/// <summary>
|
||||
/// Size of user data length for Mode2 Form2
|
||||
/// </summary>
|
||||
public const long Mode2Form2DataSize = 2324;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form2 sector where user data starts
|
||||
/// </summary>
|
||||
public const long Mode2Form2UserDataStart = 24;
|
||||
|
||||
/// <summary>
|
||||
/// Offset in a Mode2 Form2 sector where user data ends
|
||||
/// </summary>
|
||||
public const long Mode2Form2UserDataEnd = 2072;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM data sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public abstract class DataSector : ISO9660.Sector
|
||||
{
|
||||
/// <summary>
|
||||
/// Sync pattern, 12 bytes
|
||||
/// </summary>
|
||||
public byte[] SyncPattern { get; set; } = new byte[12];
|
||||
|
||||
/// <summary>
|
||||
/// Sector Address, 3 bytes
|
||||
/// </summary>
|
||||
public byte[] Address { get; set; } = new byte[3];
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM mode
|
||||
/// </summary>
|
||||
public byte Mode { get; set; }
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM data sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public abstract class DataSector : ISO9660.Sector
|
||||
{
|
||||
/// <summary>
|
||||
/// Sync pattern, 12 bytes
|
||||
/// </summary>
|
||||
public byte[] SyncPattern { get; set; } = new byte[12];
|
||||
|
||||
/// <summary>
|
||||
/// Sector Address, 3 bytes
|
||||
/// </summary>
|
||||
public byte[] Address { get; set; } = new byte[3];
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM mode
|
||||
/// </summary>
|
||||
public byte Mode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for a CD-ROM's sector mode
|
||||
/// Explicitly does not contain non-CD-ROM modes like AUDIO, CDG, CDI, and length-specific modes
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public enum SectorMode
|
||||
{
|
||||
/// <summary>
|
||||
/// CD-ROM Unknown Mode
|
||||
/// </summary>
|
||||
UNKNOWN,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM Mode 0 (All bytes after header are 0x00)
|
||||
/// </summary>
|
||||
MODE0,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM Mode 1
|
||||
/// </summary>
|
||||
MODE1,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM Mode 2 (Formless)
|
||||
/// </summary>
|
||||
MODE2,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM XA Mode 2 Form 1
|
||||
/// </summary>
|
||||
MODE2_FORM1,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM XA Mode 2 Form 2
|
||||
/// </summary>
|
||||
MODE2_FORM2,
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for a CD-ROM's sector mode
|
||||
/// Explicitly does not contain non-CD-ROM modes like AUDIO, CDG, CDI, and length-specific modes
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public enum SectorMode
|
||||
{
|
||||
/// <summary>
|
||||
/// CD-ROM Unknown Mode
|
||||
/// </summary>
|
||||
UNKNOWN,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM Mode 0 (All bytes after header are 0x00)
|
||||
/// </summary>
|
||||
MODE0,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM Mode 1
|
||||
/// </summary>
|
||||
MODE1,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM Mode 2 (Formless)
|
||||
/// </summary>
|
||||
MODE2,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM XA Mode 2 Form 1
|
||||
/// </summary>
|
||||
MODE2_FORM1,
|
||||
|
||||
/// <summary>
|
||||
/// CD-ROM XA Mode 2 Form 2
|
||||
/// </summary>
|
||||
MODE2_FORM2,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode0 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// User Data, 2336 bytes
|
||||
/// </summary>
|
||||
/// <remarks>Should be all 0x00</remarks>
|
||||
public byte[] UserData { get; set; } = new byte[2336];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode0 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// User Data, 2336 bytes
|
||||
/// </summary>
|
||||
/// <remarks>Should be all 0x00</remarks>
|
||||
public byte[] UserData { get; set; } = new byte[2336];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode1 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// User Data, 2048 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2048];
|
||||
|
||||
/// <summary>
|
||||
/// Error Detection Code, 4 bytes
|
||||
/// </summary>
|
||||
public byte[] EDC { get; set; } = new byte[4];
|
||||
|
||||
/// <summary>
|
||||
/// Reserved 8 bytes
|
||||
/// </summary>
|
||||
public byte[] Intermediate { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// Error Correction Code, 276 bytes
|
||||
/// </summary>
|
||||
public byte[] ECC { get; set; } = new byte[276];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode1 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// User Data, 2048 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2048];
|
||||
|
||||
/// <summary>
|
||||
/// Error Detection Code, 4 bytes
|
||||
/// </summary>
|
||||
public byte[] EDC { get; set; } = new byte[4];
|
||||
|
||||
/// <summary>
|
||||
/// Reserved 8 bytes
|
||||
/// </summary>
|
||||
public byte[] Intermediate { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// Error Correction Code, 276 bytes
|
||||
/// </summary>
|
||||
public byte[] ECC { get; set; } = new byte[276];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode 2 Form 1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode2Form1 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// Mode 2 subheader, 8 bytes
|
||||
/// </summary>
|
||||
public byte[] Subheader { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// User data, 2048 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2048];
|
||||
|
||||
/// <summary>
|
||||
/// Error Detection Code, 4 bytes
|
||||
/// </summary>
|
||||
public byte[] EDC { get; set; } = new byte[4];
|
||||
|
||||
/// <summary>
|
||||
/// Error Correction Code, 276 bytes
|
||||
/// </summary>
|
||||
public byte[] ECC { get; set; } = new byte[276];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode 2 Form 1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode2Form1 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// Mode 2 subheader, 8 bytes
|
||||
/// </summary>
|
||||
public byte[] Subheader { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// User data, 2048 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2048];
|
||||
|
||||
/// <summary>
|
||||
/// Error Detection Code, 4 bytes
|
||||
/// </summary>
|
||||
public byte[] EDC { get; set; } = new byte[4];
|
||||
|
||||
/// <summary>
|
||||
/// Error Correction Code, 276 bytes
|
||||
/// </summary>
|
||||
public byte[] ECC { get; set; } = new byte[276];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode 2 Form 2 sector
|
||||
/// Larger user data at expense of no error correction, just error detection
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode2Form2 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// Mode 2 subheader, 8 bytes
|
||||
/// </summary>
|
||||
public byte[] Subheader { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// User data, 2324 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2324];
|
||||
|
||||
/// <summary>
|
||||
/// Error Detection Code, 4 bytes
|
||||
/// </summary>
|
||||
public byte[] EDC { get; set; } = new byte[4];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode 2 Form 2 sector
|
||||
/// Larger user data at expense of no error correction, just error detection
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode2Form2 : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// Mode 2 subheader, 8 bytes
|
||||
/// </summary>
|
||||
public byte[] Subheader { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// User data, 2324 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2324];
|
||||
|
||||
/// <summary>
|
||||
/// Error Detection Code, 4 bytes
|
||||
/// </summary>
|
||||
public byte[] EDC { get; set; } = new byte[4];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode2Formless : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// User Data, 2336 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2336];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.CDROM
|
||||
{
|
||||
/// <summary>
|
||||
/// A CD-ROM Mode1 sector
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-130_2nd_edition_june_1996.pdf"/>
|
||||
public sealed class Mode2Formless : DataSector
|
||||
{
|
||||
/// <summary>
|
||||
/// User Data, 2336 bytes
|
||||
/// </summary>
|
||||
public byte[] UserData { get; set; } = new byte[2336];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace SabreTools.Data.Models.CFB
|
||||
|
||||
public const ulong SignatureUInt64 = 0xE11AB1A1E011CFD0;
|
||||
|
||||
|
||||
/// <see href="https://devblogs.microsoft.com/setup/identifying-windows-installer-file-types/"/>
|
||||
#region Class IDs
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
|
||||
#pragma warning disable CA1069 // Enums values should not be duplicated
|
||||
namespace SabreTools.Data.Models.COFF
|
||||
{
|
||||
[Flags]
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
|
||||
namespace SabreTools.Data.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/tree/main/doc/FileFormats/song.ini"/>
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/tree/main/doc/FileFormats/song.ini"/>
|
||||
/// <remarks>[song]/[Song]</remarks>
|
||||
public class SongIni
|
||||
{
|
||||
@@ -123,7 +123,7 @@ namespace SabreTools.Data.Models.Charts
|
||||
public string? Playlist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// (CH) Sub-playlist that the song should show up in.
|
||||
/// (CH) Sub-playlist that the song should show up in.
|
||||
/// </summary>
|
||||
/// <remarks>sub_playlist</remarks>
|
||||
public string? SubPlaylist { get; set; }
|
||||
@@ -341,28 +341,28 @@ namespace SabreTools.Data.Models.Charts
|
||||
/// Higher = later notes. Can be negative.
|
||||
/// </summary>
|
||||
/// <remarks>delay</remarks>
|
||||
[Obsolete]
|
||||
[Obsolete("Only used in older versions")]
|
||||
public long? Delay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the default sustain cutoff threshold with a specified value in ticks.
|
||||
/// </summary>
|
||||
/// <remarks>sustain_cutoff_threshold</remarks>
|
||||
[Obsolete]
|
||||
[Obsolete("Only used in older versions")]
|
||||
public long? SustainCutoffThreshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the default HOPO threshold with a specified value in ticks.
|
||||
/// </summary>
|
||||
/// <remarks>hopo_frequency</remarks>
|
||||
[Obsolete]
|
||||
[Obsolete("Only used in older versions")]
|
||||
public long? HopoFrequency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the HOPO threshold to be a 1/8th step.
|
||||
/// </summary>
|
||||
/// <remarks>eighthnote_hopo</remarks>
|
||||
[Obsolete]
|
||||
[Obsolete("Only used in older versions")]
|
||||
public bool? EighthNoteHopo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -370,7 +370,7 @@ namespace SabreTools.Data.Models.Charts
|
||||
/// Valid values are 103 and 116.
|
||||
/// </summary>
|
||||
/// <remarks>multiplier_note, star_power_note (PS)</remarks>
|
||||
[Obsolete]
|
||||
[Obsolete("Only used in older versions")]
|
||||
public long? MultiplierNote { get; set; }
|
||||
|
||||
#endregion
|
||||
@@ -399,7 +399,7 @@ namespace SabreTools.Data.Models.Charts
|
||||
/// (FoFiX) Overrides the natural HOPO threshold using numbers from 0 to 5.
|
||||
/// </summary>
|
||||
/// <remarks>hopofreq</remarks>
|
||||
[Obsolete]
|
||||
[Obsolete("Only used in FoFiX")]
|
||||
public long? HopoFreq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -618,4 +618,4 @@ namespace SabreTools.Data.Models.Charts
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace SabreTools.Data.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
public class Tier
|
||||
{
|
||||
/// <summary>
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Charts
|
||||
/// </summary>
|
||||
public string? UnlockId { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace SabreTools.Data.Models.Charts
|
||||
{
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
/// <see href="https://github.com/TheNathannator/GuitarGame_ChartFormats/blob/main/doc/FileFormats/Other/Frets%20on%20Fire%20X/Careers.md"/>
|
||||
/// <remarks>[titles]</remarks>
|
||||
public class TitlesIni
|
||||
{
|
||||
@@ -15,4 +15,4 @@ namespace SabreTools.Data.Models.Charts
|
||||
/// </summary>
|
||||
public Tier[]? Sections { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>default</remarks>
|
||||
public string? Default { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>clock, Numeric?</remarks>
|
||||
public string? Clock { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>forcepacking</remarks>
|
||||
public string? ForcePacking { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,4 +15,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>default, (yes|no) "no"</remarks>
|
||||
public string? Default { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>flags</remarks>
|
||||
public string? Flags { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>blit, (plain|dirty)</remarks>
|
||||
public string? Blit { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
{
|
||||
/// <remarks>game</remarks>
|
||||
public class Game : GameBase { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,4 +79,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>service, (yes|no) "no"</remarks>
|
||||
public string? Service { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
{
|
||||
/// <remarks>machine</remarks>
|
||||
public class Machine : GameBase { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>spamsum</remarks>
|
||||
public string? SpamSum { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>default</remarks>
|
||||
public string? Default { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
{
|
||||
/// <remarks>resource</remarks>
|
||||
public class Resource : GameBase { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using SabreTools.Data.Attributes;
|
||||
|
||||
#pragma warning disable IDE1006 // Naming Styles
|
||||
namespace SabreTools.Data.Models.ClrMamePro
|
||||
{
|
||||
/// <remarks>rom</remarks>
|
||||
|
||||
@@ -48,4 +48,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>forcepacking</remarks>
|
||||
public string? ForcePacking { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
[Required]
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
{
|
||||
/// <remarks>set</remarks>
|
||||
public class Set : GameBase { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
[Required]
|
||||
public string? Channels { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,4 @@ namespace SabreTools.Data.Models.ClrMamePro
|
||||
/// <remarks>freq, Numeric?</remarks>
|
||||
public string? Freq { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ namespace SabreTools.Data.Models.DosCenter
|
||||
/// <remarks>comment</remarks>
|
||||
public string? Comment { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace SabreTools.Data.Models.DosCenter
|
||||
/// <remarks>date, attribute</remarks>
|
||||
public string? Date { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,4 @@ namespace SabreTools.Data.Models.DosCenter
|
||||
/// <remarks>file</remarks>
|
||||
public File[]? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ namespace SabreTools.Data.Models.DosCenter
|
||||
/// <remarks>game</remarks>
|
||||
public Game[]? Game { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ namespace SabreTools.Data.Models.EverdriveSMDB
|
||||
{
|
||||
public Row[]? Row { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,4 @@ namespace SabreTools.Data.Models.EverdriveSMDB
|
||||
|
||||
public string? Size { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,4 @@ namespace SabreTools.Data.Models.GameHeader
|
||||
// Hex string, no prefix
|
||||
public string? SHA256 { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,4 @@ namespace SabreTools.Data.Models.GameHeader
|
||||
// Hex string, no prefix
|
||||
public string? EncryptedSHA256 { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,4 +199,4 @@ namespace SabreTools.Data.Models.GameHeader
|
||||
// Hex string, prefixed
|
||||
public string? RSASignature { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ namespace SabreTools.Data.Models.GameHeader
|
||||
|
||||
public string? ItalianTitle { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
|
||||
public SpamSum[]? SpamSum { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? Hash { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ namespace SabreTools.Data.Models.Hashfile
|
||||
[Required]
|
||||
public string? File { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,209 +1,209 @@
|
||||
using SabreTools.Numerics;
|
||||
|
||||
namespace SabreTools.Data.Models.ISO9660
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract Volume Descriptor with common fields used by Primary/Supplementary/Enhanced Volume Descriptors
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-119_5th_edition_december_2024.pdf"/>
|
||||
public abstract class BaseVolumeDescriptor : VolumeDescriptor
|
||||
{
|
||||
// Virtual variable of 1 byte goes here
|
||||
// PrimaryVolumeDescriptor: UnusedByte
|
||||
// SupplementaryVolumeDescriptor: VolumeFlags
|
||||
|
||||
/// <summary>
|
||||
/// 32-byte name of the intended system
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] SystemIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 32-byte name of the volume
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] VolumeIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 8 unused bytes at offset 72, should be all 0x00
|
||||
/// </summary>
|
||||
public byte[] Unused8Bytes { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// Number of logical blocks in this volume
|
||||
/// </summary>
|
||||
public BothInt32 VolumeSpaceSize { get; set; } = 0;
|
||||
|
||||
// Virtual variable of 32 bytes goes here:
|
||||
// PrimaryVolumeDescriptor: Unused32Bytes
|
||||
// SupplementaryVolumeDescriptor: EscapeSequences
|
||||
|
||||
/// <summary>
|
||||
/// Number of Volumes (discs) in this VolumeSet
|
||||
/// </summary>
|
||||
public BothInt16 VolumeSetSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Volume (disc) number in this volume set
|
||||
/// </summary>
|
||||
public BothInt16 VolumeSequenceNumber { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes per logical block, usually 2048
|
||||
/// Must be a power of 2, minimum 2^9, and not greater than the logical sector size
|
||||
/// </summary>
|
||||
public BothInt16 LogicalBlockSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes in the path table
|
||||
/// </summary>
|
||||
public BothInt32 PathTableSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the little-endian path table, type L
|
||||
/// Stored as int32-LSB
|
||||
/// </summary>
|
||||
public int PathTableLocationL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the optional little-endian path table, type L
|
||||
/// The "optional path table" does not exist if this value is 0
|
||||
/// Stored as int32-LSB
|
||||
/// </summary>
|
||||
public int OptionalPathTableLocationL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the big-endian path table, type M
|
||||
/// Stored as int32-MSB
|
||||
/// </summary>
|
||||
public int PathTableLocationM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the optional big-endian path table, type M
|
||||
/// The "optional path table" Does not exist if this value is 0
|
||||
/// Stored as int32-MSB
|
||||
/// </summary>
|
||||
public int OptionalPathTableLocationM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Root directory entry, 34 bytes
|
||||
/// DirectoryIdentifier = 0x00
|
||||
/// </summary>
|
||||
public DirectoryRecord RootDirectoryRecord { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the volume set
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] VolumeSetIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the publisher
|
||||
/// If specified, starts with 0x5F, followed by filename of file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] PublisherIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the data preparer
|
||||
/// If specified, starts with 0x5F, followed by filename of file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] DataPreparerIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the application
|
||||
/// If specified, starts with 0x5F, followed by filename of file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] ApplicationIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 37-byte filename of the Copyright file
|
||||
/// If specified, filename of a file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] CopyrightFileIdentifier { get; set; } = new byte[37];
|
||||
|
||||
/// <summary>
|
||||
/// 37-byte filename of the Abstract file
|
||||
/// If specified, filename of a file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] AbstractFileIdentifier { get; set; } = new byte[37];
|
||||
|
||||
/// <summary>
|
||||
/// 37-byte filename of the Bibliographic file
|
||||
/// If specified, filename of a file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] BibliographicFileIdentifier { get; set; } = new byte[37];
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Creation date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeCreationDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Modification date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeModificationDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Expiration date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeExpirationDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Effective date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeEffectiveDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Version number of the Records / Path Table format
|
||||
/// For Primary/Supplementary, this is 0x01
|
||||
/// For Enhanced, this is 0x02
|
||||
/// </summary>
|
||||
public byte FileStructureVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1 reserved byte, should be 0x00
|
||||
/// </summary>
|
||||
public byte ReservedByte { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 512 bytes for Application Use, contents not defined by ISO9660
|
||||
/// </summary>
|
||||
public byte[] ApplicationUse { get; set; } = new byte[512];
|
||||
|
||||
/// <summary>
|
||||
/// 653 reserved bytes, should be all 0x00
|
||||
/// </summary>
|
||||
public byte[] Reserved653Bytes { get; set; } = new byte[653];
|
||||
}
|
||||
}
|
||||
using SabreTools.Numerics;
|
||||
|
||||
namespace SabreTools.Data.Models.ISO9660
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract Volume Descriptor with common fields used by Primary/Supplementary/Enhanced Volume Descriptors
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-119_5th_edition_december_2024.pdf"/>
|
||||
public abstract class BaseVolumeDescriptor : VolumeDescriptor
|
||||
{
|
||||
// Virtual variable of 1 byte goes here
|
||||
// PrimaryVolumeDescriptor: UnusedByte
|
||||
// SupplementaryVolumeDescriptor: VolumeFlags
|
||||
|
||||
/// <summary>
|
||||
/// 32-byte name of the intended system
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] SystemIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 32-byte name of the volume
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] VolumeIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 8 unused bytes at offset 72, should be all 0x00
|
||||
/// </summary>
|
||||
public byte[] Unused8Bytes { get; set; } = new byte[8];
|
||||
|
||||
/// <summary>
|
||||
/// Number of logical blocks in this volume
|
||||
/// </summary>
|
||||
public BothInt32 VolumeSpaceSize { get; set; } = 0;
|
||||
|
||||
// Virtual variable of 32 bytes goes here:
|
||||
// PrimaryVolumeDescriptor: Unused32Bytes
|
||||
// SupplementaryVolumeDescriptor: EscapeSequences
|
||||
|
||||
/// <summary>
|
||||
/// Number of Volumes (discs) in this VolumeSet
|
||||
/// </summary>
|
||||
public BothInt16 VolumeSetSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Volume (disc) number in this volume set
|
||||
/// </summary>
|
||||
public BothInt16 VolumeSequenceNumber { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes per logical block, usually 2048
|
||||
/// Must be a power of 2, minimum 2^9, and not greater than the logical sector size
|
||||
/// </summary>
|
||||
public BothInt16 LogicalBlockSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes in the path table
|
||||
/// </summary>
|
||||
public BothInt32 PathTableSize { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the little-endian path table, type L
|
||||
/// Stored as int32-LSB
|
||||
/// </summary>
|
||||
public int PathTableLocationL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the optional little-endian path table, type L
|
||||
/// The "optional path table" does not exist if this value is 0
|
||||
/// Stored as int32-LSB
|
||||
/// </summary>
|
||||
public int OptionalPathTableLocationL { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the big-endian path table, type M
|
||||
/// Stored as int32-MSB
|
||||
/// </summary>
|
||||
public int PathTableLocationM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sector number of the start of the optional big-endian path table, type M
|
||||
/// The "optional path table" Does not exist if this value is 0
|
||||
/// Stored as int32-MSB
|
||||
/// </summary>
|
||||
public int OptionalPathTableLocationM { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Root directory entry, 34 bytes
|
||||
/// DirectoryIdentifier = 0x00
|
||||
/// </summary>
|
||||
public DirectoryRecord RootDirectoryRecord { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the volume set
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] VolumeSetIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the publisher
|
||||
/// If specified, starts with 0x5F, followed by filename of file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] PublisherIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the data preparer
|
||||
/// If specified, starts with 0x5F, followed by filename of file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] DataPreparerIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 128-byte name of the application
|
||||
/// If specified, starts with 0x5F, followed by filename of file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: a-characters only, padded to the right with spaces
|
||||
/// Supplementary: a1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] ApplicationIdentifier { get; set; } = new byte[128];
|
||||
|
||||
/// <summary>
|
||||
/// 37-byte filename of the Copyright file
|
||||
/// If specified, filename of a file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] CopyrightFileIdentifier { get; set; } = new byte[37];
|
||||
|
||||
/// <summary>
|
||||
/// 37-byte filename of the Abstract file
|
||||
/// If specified, filename of a file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] AbstractFileIdentifier { get; set; } = new byte[37];
|
||||
|
||||
/// <summary>
|
||||
/// 37-byte filename of the Bibliographic file
|
||||
/// If specified, filename of a file in root directory
|
||||
/// If not specified, all spaces (0x20)
|
||||
/// Primary: d-characters only, padded to the right with spaces
|
||||
/// Supplementary: d1-characters only, padded to the right with spaces
|
||||
/// Enhanced: Some other agreed upon character encoding, padded to the right with filler
|
||||
/// </summary>
|
||||
public byte[] BibliographicFileIdentifier { get; set; } = new byte[37];
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Creation date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeCreationDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Modification date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeModificationDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Expiration date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeExpirationDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// PVD-style DateTime format for the Effective date/time of the Volume
|
||||
/// </summary>
|
||||
public DecDateTime VolumeEffectiveDateTime { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Version number of the Records / Path Table format
|
||||
/// For Primary/Supplementary, this is 0x01
|
||||
/// For Enhanced, this is 0x02
|
||||
/// </summary>
|
||||
public byte FileStructureVersion { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1 reserved byte, should be 0x00
|
||||
/// </summary>
|
||||
public byte ReservedByte { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 512 bytes for Application Use, contents not defined by ISO9660
|
||||
/// </summary>
|
||||
public byte[] ApplicationUse { get; set; } = new byte[512];
|
||||
|
||||
/// <summary>
|
||||
/// 653 reserved bytes, should be all 0x00
|
||||
/// </summary>
|
||||
public byte[] Reserved653Bytes { get; set; } = new byte[653];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
namespace SabreTools.Data.Models.ISO9660
|
||||
{
|
||||
/// <summary>
|
||||
/// Boot Record Volume Descriptor
|
||||
/// Volume Descriptor with VolumeDescriptorType = 0x00
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-119_5th_edition_december_2024.pdf"/>
|
||||
public sealed class BootRecordVolumeDescriptor : VolumeDescriptor
|
||||
{
|
||||
/// <summary>
|
||||
/// 32-byte name of the intended system that can use this record
|
||||
/// a-characters only
|
||||
/// </summary>
|
||||
public byte[] BootSystemIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 32-byte name of this boot system
|
||||
/// a-characters only
|
||||
/// </summary>
|
||||
public byte[] BootIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 1997 bytes for Boot System Use, contents not defined by ISO9660
|
||||
/// </summary>
|
||||
public byte[] BootSystemUse { get; set; } = new byte[1997];
|
||||
}
|
||||
}
|
||||
namespace SabreTools.Data.Models.ISO9660
|
||||
{
|
||||
/// <summary>
|
||||
/// Boot Record Volume Descriptor
|
||||
/// Volume Descriptor with VolumeDescriptorType = 0x00
|
||||
/// </summary>
|
||||
/// <see href="https://ecma-international.org/wp-content/uploads/ECMA-119_5th_edition_december_2024.pdf"/>
|
||||
public sealed class BootRecordVolumeDescriptor : VolumeDescriptor
|
||||
{
|
||||
/// <summary>
|
||||
/// 32-byte name of the intended system that can use this record
|
||||
/// a-characters only
|
||||
/// </summary>
|
||||
public byte[] BootSystemIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 32-byte name of this boot system
|
||||
/// a-characters only
|
||||
/// </summary>
|
||||
public byte[] BootIdentifier { get; set; } = new byte[32];
|
||||
|
||||
/// <summary>
|
||||
/// 1997 bytes for Boot System Use, contents not defined by ISO9660
|
||||
/// </summary>
|
||||
public byte[] BootSystemUse { get; set; } = new byte[1997];
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user