Compare commits

..

2 Commits

Author SHA1 Message Date
Matt Nadareski
f5a8d239fa Set the window bits for IS-CAB zlib 2025-11-14 20:13:42 -05:00
Matt Nadareski
ba0161ce02 Attempt to replace old zlib implementations 2025-11-14 19:56:19 -05:00
2110 changed files with 23300 additions and 122371 deletions

View File

@@ -1,167 +0,0 @@
# top-most EditorConfig file
root = true
# C# files
[*.cs]
# Indentation and spacing
charset = utf-8
indent_size = 4
indent_style = space
tab_width = 4
trim_trailing_whitespace = true
# New line preferences
end_of_line = lf
insert_final_newline = true
max_line_length = unset
# using directive preferences
csharp_using_directive_placement = outside_namespace
dotnet_diagnostic.IDE0005.severity = error
# Code-block preferences
csharp_style_namespace_declarations = block_scoped
csharp_style_prefer_method_group_conversion = true
csharp_style_prefer_top_level_statements = false
# Expression-level preferences
csharp_prefer_simple_default_expression = true
csharp_style_inlined_variable_declaration = true
csharp_style_unused_value_assignment_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable
dotnet_diagnostic.IDE0001.severity = warning
dotnet_diagnostic.IDE0002.severity = warning
dotnet_diagnostic.IDE0004.severity = warning
dotnet_diagnostic.IDE0010.severity = error
dotnet_diagnostic.IDE0051.severity = warning
dotnet_diagnostic.IDE0052.severity = warning
dotnet_diagnostic.IDE0072.severity = warning
dotnet_diagnostic.IDE0080.severity = warning
dotnet_diagnostic.IDE0100.severity = error
dotnet_diagnostic.IDE0110.severity = error
dotnet_diagnostic.IDE0120.severity = warning
dotnet_diagnostic.IDE0121.severity = warning
dotnet_diagnostic.IDE0240.severity = error
dotnet_diagnostic.IDE0241.severity = error
dotnet_style_coalesce_expression = true
dotnet_style_namespace_match_folder = false
dotnet_style_null_propagation = true
dotnet_style_prefer_auto_properties = true
dotnet_style_prefer_collection_expression = when_types_loosely_match
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
dotnet_style_prefer_compound_assignment = true
csharp_style_prefer_simple_property_accessors = true
dotnet_style_prefer_simplified_interpolation = true
dotnet_style_prefer_simplified_boolean_expressions = true
csharp_style_prefer_unbound_generic_type_in_nameof = true
# Field preferences
dotnet_diagnostic.IDE0044.severity = warning
dotnet_style_readonly_field = true
# Language keyword vs. framework types preferences
dotnet_diagnostic.IDE0049.severity = error
dotnet_style_predefined_type_for_locals_parameters_members = true
dotnet_style_predefined_type_for_member_access = true
# Modifier preferences
csharp_prefer_static_local_function = true
csharp_style_prefer_readonly_struct = true
dotnet_diagnostic.IDE0036.severity = warning
dotnet_diagnostic.IDE0040.severity = error
dotnet_diagnostic.IDE0380.severity = error
dotnet_style_require_accessibility_modifiers = always
# New-line preferences
dotnet_diagnostic.IDE2000.severity = warning
dotnet_diagnostic.IDE2002.severity = warning
dotnet_diagnostic.IDE2003.severity = warning
dotnet_diagnostic.IDE2004.severity = warning
dotnet_diagnostic.IDE2005.severity = warning
dotnet_diagnostic.IDE2006.severity = warning
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
dotnet_style_allow_multiple_blank_lines_experimental = false
dotnet_style_allow_statement_immediately_after_block_experimental = false
# Null-checking preferences
csharp_style_conditional_delegate_call = true
# Parameter preferences
dotnet_code_quality_unused_parameters = all
dotnet_diagnostic.IDE0280.severity = error
# Parentheses preferences
dotnet_diagnostic.IDE0047.severity = warning
dotnet_diagnostic.IDE0048.severity = warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
dotnet_style_parentheses_in_other_operators = always_for_clarity
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
# Pattern-matching preferences
dotnet_diagnostic.IDE0019.severity = warning
dotnet_diagnostic.IDE0020.severity = warning
dotnet_diagnostic.IDE0038.severity = warning
dotnet_diagnostic.IDE0066.severity = none
dotnet_diagnostic.IDE0083.severity = warning
dotnet_diagnostic.IDE0260.severity = warning
csharp_style_pattern_matching_over_as_with_null_check = true
csharp_style_pattern_matching_over_is_with_cast_check = true
csharp_style_prefer_not_pattern = true
csharp_style_prefer_pattern_matching = true
# this. and Me. preferences
dotnet_style_qualification_for_event = false
dotnet_style_qualification_for_field = false
dotnet_style_qualification_for_method = false
dotnet_style_qualification_for_property = false
# var preferences
csharp_style_var_for_built_in_types = false
csharp_style_var_when_type_is_apparent = true
# .NET formatting options
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
# C# formatting options
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

View File

@@ -1,48 +1,48 @@
name: Build and Test name: Build and Test
on: on:
push: push:
branches: ["main"] branches: [ "main" ]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Run tests
run: dotnet test
- name: Run publish script
run: ./publish-nix.sh -d
- name: Setup .NET - name: Update rolling tag
uses: actions/setup-dotnet@v5 run: |
with: git config user.name "github-actions[bot]"
dotnet-version: | git config user.email "github-actions[bot]@users.noreply.github.com"
8.0.x git tag -f rolling
9.0.x git push origin :refs/tags/rolling || true
10.0.x git push origin rolling --force
- name: Run tests - name: Upload to rolling
run: dotnet test uses: ncipollo/release-action@v1.20.0
with:
- name: Run publish script allowUpdates: True
run: ./publish-nix.sh -d artifacts: "*.nupkg,*.snupkg,*.zip"
body: 'Last built commit: ${{ github.sha }}'
- name: Update rolling tag name: 'Rolling Release'
run: | prerelease: True
git config user.name "github-actions[bot]" replacesArtifacts: True
git config user.email "github-actions[bot]@users.noreply.github.com" tag: "rolling"
git tag -f rolling updateOnlyUnreleased: True
git push origin :refs/tags/rolling || true
git push origin rolling --force
- name: Upload to rolling
uses: ncipollo/release-action@v1.20.0
with:
allowUpdates: True
artifacts: "*.nupkg,*.snupkg,*.zip"
body: "Last built commit: ${{ github.sha }}"
name: "Rolling Release"
prerelease: True
replacesArtifacts: True
tag: "rolling"
updateOnlyUnreleased: True

View File

@@ -3,21 +3,21 @@ name: Build PR
on: [pull_request] on: [pull_request]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
run: dotnet build
- name: Setup .NET - name: Run tests
uses: actions/setup-dotnet@v5 run: dotnet test
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
run: dotnet build
- name: Run tests
run: dotnet test

1
.gitignore vendored
View File

@@ -4,7 +4,6 @@
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files # User-specific files
*.lscache
*.suo *.suo
*.user *.user
*.userosscache *.userosscache

10
.vscode/launch.json vendored
View File

@@ -1,9 +1,9 @@
{ {
// Use IntelliSense to find out which attributes exist for C# debugging // Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes // Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": ".NET Core Launch (ExtractionTool)", "name": ".NET Core Launch (ExtractionTool)",
"type": "coreclr", "type": "coreclr",

View File

@@ -10,7 +10,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>3.2.0</Version> <Version>2.1.0</Version>
</PropertyGroup> </PropertyGroup>
<!-- Support All Frameworks --> <!-- Support All Frameworks -->
@@ -29,14 +29,14 @@
<!-- These are needed for dealing with native Windows DLLs --> <!-- These are needed for dealing with native Windows DLLs -->
<ItemGroup Condition="'$(RuntimeIdentifier)'=='win-x86'"> <ItemGroup Condition="'$(RuntimeIdentifier)'=='win-x86'">
<ContentWithTargetPath Include="..\runtimes\win-x86\native\StormLib.dll"> <ContentWithTargetPath Include="..\SabreTools.Serialization\runtimes\win-x86\native\StormLib.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>Always</CopyToPublishDirectory> <CopyToPublishDirectory>Always</CopyToPublishDirectory>
<TargetPath>StormLib.dll</TargetPath> <TargetPath>StormLib.dll</TargetPath>
</ContentWithTargetPath> </ContentWithTargetPath>
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(RuntimeIdentifier)'=='win-x64'"> <ItemGroup Condition="'$(RuntimeIdentifier)'=='win-x64'">
<ContentWithTargetPath Include="..\runtimes\win-x64\native\StormLib.dll"> <ContentWithTargetPath Include="..\SabreTools.Serialization\runtimes\win-x64\native\StormLib.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>Always</CopyToPublishDirectory> <CopyToPublishDirectory>Always</CopyToPublishDirectory>
<TargetPath>StormLib.dll</TargetPath> <TargetPath>StormLib.dll</TargetPath>
@@ -44,13 +44,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SabreTools.Wrappers\SabreTools.Wrappers.csproj" /> <ProjectReference Include="..\SabreTools.Serialization\SabreTools.Serialization.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SabreTools.CommandLine" Version="1.5.0" /> <PackageReference Include="SabreTools.CommandLine" Version="[1.4.0]" />
<PackageReference Include="SabreTools.IO" Version="2.3.0" /> <PackageReference Include="SabreTools.IO" Version="[1.9.0]" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.11" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.0" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net452`))" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -3,8 +3,8 @@ using System.IO;
using SabreTools.CommandLine; using SabreTools.CommandLine;
using SabreTools.CommandLine.Inputs; using SabreTools.CommandLine.Inputs;
using SabreTools.IO.Extensions; using SabreTools.IO.Extensions;
using SabreTools.Numerics.Extensions; using SabreTools.Serialization;
using SabreTools.Wrappers; using SabreTools.Serialization.Wrappers;
namespace ExtractionTool.Features namespace ExtractionTool.Features
{ {
@@ -113,52 +113,198 @@ namespace ExtractionTool.Features
/// <param name="path">File path</param> /// <param name="path">File path</param>
private void ExtractFile(string file) private void ExtractFile(string file)
{ {
Console.WriteLine($"Attempting to extract all files from {file}");
using Stream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
// Get the extension for certain checks
string extension = Path.GetExtension(file).ToLower().TrimStart('.');
// Get the first 16 bytes for matching
byte[] magic = new byte[16];
try try
{ {
Console.WriteLine($"Attempting to extract all files from {file}"); int read = stream.Read(magic, 0, 16);
using Stream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); stream.SeekIfPossible(0, SeekOrigin.Begin);
// Read the first 32 bytes
byte[] magic = stream.PeekBytes(32);
// Get the file type
string extension = Path.GetExtension(file).TrimStart('.');
WrapperType ft = WrapperFactory.GetFileType(magic ?? [], extension);
// Print out the file format
Console.WriteLine($"File format found: {ft}");
// Setup the wrapper to extract
var wrapper = WrapperFactory.CreateWrapper(ft, stream);
// If we don't have a wrapper
if (wrapper is null)
{
Console.WriteLine($"Either {ft} is not supported or something went wrong during parsing!");
Console.WriteLine();
return;
}
// If the wrapper is not extractable
if (wrapper is not IExtractable extractable)
{
Console.WriteLine($"{ft} is not supported for extraction!");
Console.WriteLine();
return;
}
// Print the preamble
Console.WriteLine($"Attempting to extract from '{wrapper.Description()}'");
Console.WriteLine();
// Attempt the extraction
Directory.CreateDirectory(OutputPath);
extractable.Extract(OutputPath, Debug);
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine(Debug ? ex : "[Exception opening file, please try again]"); if (Debug) Console.Error.WriteLine(ex);
Console.WriteLine(); return;
}
// Get the file type
WrapperType ft = WrapperFactory.GetFileType(magic, extension);
var wrapper = WrapperFactory.CreateWrapper(ft, stream);
// Create the output directory
Directory.CreateDirectory(OutputPath);
// Print the preamble
Console.WriteLine($"Attempting to extract from '{wrapper?.Description() ?? "UNKNOWN"}'");
Console.WriteLine();
switch (wrapper)
{
// 7-zip
case SevenZip sz:
sz.Extract(OutputPath, Debug);
break;
// BFPK archive
case BFPK bfpk:
bfpk.Extract(OutputPath, Debug);
break;
// BSP
case BSP bsp:
bsp.Extract(OutputPath, Debug);
break;
// bzip2
case BZip2 bzip2:
bzip2.Extract(OutputPath, Debug);
break;
// CD-ROM bin file
case CDROM cdrom:
cdrom.Extract(OutputPath, Debug);
break;
// CFB
case CFB cfb:
cfb.Extract(OutputPath, Debug);
break;
// GCF
case GCF gcf:
gcf.Extract(OutputPath, Debug);
break;
// gzip
case GZip gzip:
gzip.Extract(OutputPath, Debug);
break;
// InstallShield Archive V3 (Z)
case InstallShieldArchiveV3 isv3:
isv3.Extract(OutputPath, Debug);
break;
// IS-CAB archive
case InstallShieldCabinet iscab:
iscab.Extract(OutputPath, Debug);
break;
// ISO 9660 volume
case ISO9660 iso9660:
iso9660.Extract(OutputPath, Debug);
break;
// LZ-compressed file, KWAJ variant
case LZKWAJ kwaj:
kwaj.Extract(OutputPath, Debug);
break;
// LZ-compressed file, QBasic variant
case LZQBasic qbasic:
qbasic.Extract(OutputPath, Debug);
break;
// LZ-compressed file, SZDD variant
case LZSZDD szdd:
szdd.Extract(OutputPath, Debug);
break;
// Microsoft Cabinet archive
case MicrosoftCabinet mscab:
mscab.Extract(OutputPath, Debug);
break;
// MoPaQ (MPQ) archive
case MoPaQ mpq:
mpq.Extract(OutputPath, Debug);
break;
// New Executable
case NewExecutable nex:
nex.Extract(OutputPath, Debug);
break;
// PAK
case PAK pak:
pak.Extract(OutputPath, Debug);
break;
// PFF
case PFF pff:
pff.Extract(OutputPath, Debug);
break;
// PKZIP
case PKZIP pkzip:
pkzip.Extract(OutputPath, Debug);
break;
// Portable Executable
case PortableExecutable pex:
pex.Extract(OutputPath, Debug);
break;
// Quantum
case Quantum quantum:
quantum.Extract(OutputPath, Debug);
break;
// RAR
case RAR rar:
rar.Extract(OutputPath, Debug);
break;
// SGA
case SGA sga:
sga.Extract(OutputPath, Debug);
break;
// Tape Archive
case TapeArchive tar:
tar.Extract(OutputPath, Debug);
break;
// VBSP
case VBSP vbsp:
vbsp.Extract(OutputPath, Debug);
break;
// VPK
case VPK vpk:
vpk.Extract(OutputPath, Debug);
break;
// WAD3
case WAD3 wad:
wad.Extract(OutputPath, Debug);
break;
// xz
case XZ xz:
xz.Extract(OutputPath, Debug);
break;
// XZP
case XZP xzp:
xzp.Extract(OutputPath, Debug);
break;
// ZSTD
case ZSTD zstd:
zstd.Extract(OutputPath, Debug);
break;
// Everything else
default:
Console.WriteLine("Not a supported extractable file format, skipping...");
Console.WriteLine();
break;
} }
} }

View File

@@ -20,7 +20,7 @@ namespace ExtractionTool
var commandSet = CreateCommands(mainFeature); var commandSet = CreateCommands(mainFeature);
// If we have no args, show the help and quit // If we have no args, show the help and quit
if (args is null || args.Length == 0) if (args == null || args.Length == 0)
{ {
commandSet.OutputAllHelp(); commandSet.OutputAllHelp();
return; return;

View File

@@ -5,8 +5,8 @@ using SabreTools.CommandLine;
using SabreTools.CommandLine.Inputs; using SabreTools.CommandLine.Inputs;
using SabreTools.Hashing; using SabreTools.Hashing;
using SabreTools.IO.Extensions; using SabreTools.IO.Extensions;
using SabreTools.Numerics.Extensions; using SabreTools.Serialization;
using SabreTools.Wrappers; using SabreTools.Serialization.Wrappers;
namespace InfoPrint.Features namespace InfoPrint.Features
{ {
@@ -35,11 +35,10 @@ namespace InfoPrint.Features
private const string _hashName = "hash"; private const string _hashName = "hash";
internal readonly FlagInput HashInput = new(_hashName, ["-c", "--hash"], "Output file hashes"); internal readonly FlagInput HashInput = new(_hashName, ["-c", "--hash"], "Output file hashes");
#if NETCOREAPP
private const string _jsonName = "json"; private const string _jsonName = "json";
internal readonly FlagInput JsonInput = new(_jsonName, ["-j", "--json"], "Print info as JSON"); internal readonly FlagInput JsonInput = new(_jsonName, ["-j", "--json"], "Print info as JSON");
#endif
private const string _recursiveName = "recursive";
internal readonly FlagInput RecursiveInput = new(_recursiveName, ["-r", "--recursive"], "Recursively print info from embedded files");
#endregion #endregion
@@ -58,15 +57,12 @@ namespace InfoPrint.Features
/// </summary> /// </summary>
public bool Hash { get; private set; } public bool Hash { get; private set; }
#if NETCOREAPP
/// <summary> /// <summary>
/// Enable JSON output /// Enable JSON output
/// </summary> /// </summary>
public bool Json { get; private set; } public bool Json { get; private set; }
#endif
/// <summary>
/// Enable outputting subfile information
/// </summary>
public bool Recursive { get; private set; }
public MainFeature() public MainFeature()
: base(DisplayName, _flags, _description) : base(DisplayName, _flags, _description)
@@ -76,8 +72,9 @@ namespace InfoPrint.Features
Add(DebugInput); Add(DebugInput);
Add(HashInput); Add(HashInput);
Add(FileOnlyInput); Add(FileOnlyInput);
#if NETCOREAPP
Add(JsonInput); Add(JsonInput);
Add(RecursiveInput); #endif
} }
/// <inheritdoc/> /// <inheritdoc/>
@@ -87,8 +84,9 @@ namespace InfoPrint.Features
Debug = GetBoolean(_debugName); Debug = GetBoolean(_debugName);
Hash = GetBoolean(_hashName); Hash = GetBoolean(_hashName);
FileOnly = GetBoolean(_fileOnlyName); FileOnly = GetBoolean(_fileOnlyName);
#if NETCOREAPP
Json = GetBoolean(_jsonName); Json = GetBoolean(_jsonName);
Recursive = GetBoolean(_recursiveName); #endif
// Loop through the input paths // Loop through the input paths
for (int i = 0; i < Inputs.Count; i++) for (int i = 0; i < Inputs.Count; i++)
@@ -144,7 +142,7 @@ namespace InfoPrint.Features
if (Hash) if (Hash)
{ {
var hashBuilder = PrintHashInfo(file); var hashBuilder = PrintHashInfo(file);
if (hashBuilder is not null) if (hashBuilder != null)
{ {
// Create the output data // Create the output data
string hashData = hashBuilder.ToString(); string hashData = hashBuilder.ToString();
@@ -160,8 +158,8 @@ namespace InfoPrint.Features
{ {
using Stream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); using Stream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
// Read the first 32 bytes // Read the first 8 bytes
byte[] magic = stream.PeekBytes(32); byte[] magic = stream.PeekBytes(8);
// Get the file type // Get the file type
string extension = Path.GetExtension(file).TrimStart('.'); string extension = Path.GetExtension(file).TrimStart('.');
@@ -174,36 +172,34 @@ namespace InfoPrint.Features
var wrapper = WrapperFactory.CreateWrapper(ft, stream); var wrapper = WrapperFactory.CreateWrapper(ft, stream);
// If we don't have a wrapper // If we don't have a wrapper
if (wrapper is null) if (wrapper == null)
{ {
Console.WriteLine($"Either {ft} is not supported or something went wrong during parsing!"); Console.WriteLine($"Either {ft} is not supported or something went wrong during parsing!");
Console.WriteLine(); Console.WriteLine();
return; return;
} }
// If the wrapper is not printable #if NETCOREAPP
if (wrapper is not IPrintable printable)
{
Console.WriteLine($"{ft} is not supported for printing!");
Console.WriteLine();
return;
}
// If we have the JSON flag // If we have the JSON flag
if (Json) if (Json)
{ {
// Create the output data // Create the output data
string serializedData = printable.ExportJSON(Recursive); string serializedData = wrapper.ExportJSON();
// Write the output data // Write the output data
using var jsw = new StreamWriter(File.OpenWrite($"{filenameBase}.json")); using var jsw = new StreamWriter(File.OpenWrite($"{filenameBase}.json"));
jsw.WriteLine(serializedData); jsw.WriteLine(serializedData);
jsw.Flush(); jsw.Flush();
} }
#endif
// Create the output data // Create the output data
var builder = new StringBuilder(); var builder = wrapper.ExportStringBuilder();
printable.PrintInformation(builder, Recursive); if (builder == null)
{
Console.WriteLine("No item information could be generated");
return;
}
// Only print to console if enabled // Only print to console if enabled
if (!FileOnly) if (!FileOnly)
@@ -239,7 +235,7 @@ namespace InfoPrint.Features
{ {
// Get all file hashes for flexibility // Get all file hashes for flexibility
var hashes = HashTool.GetFileHashes(file); var hashes = HashTool.GetFileHashes(file);
if (hashes is null) if (hashes == null)
{ {
if (Debug) Console.WriteLine($"Hashes for {file} could not be retrieved"); if (Debug) Console.WriteLine($"Hashes for {file} could not be retrieved");
return null; return null;
@@ -247,29 +243,27 @@ namespace InfoPrint.Features
// Output subset of available hashes // Output subset of available hashes
var builder = new StringBuilder(); var builder = new StringBuilder();
if (hashes.TryGetValue(HashType.CRC16, out string? crc16) && crc16 is not null) if (hashes.TryGetValue(HashType.CRC16, out string? crc16) && crc16 != null)
builder.AppendLine($"CRC-16 checksum: {crc16}"); builder.AppendLine($"CRC-16 checksum: {crc16}");
if (hashes.TryGetValue(HashType.CRC32, out string? crc32) && crc32 is not null) if (hashes.TryGetValue(HashType.CRC32, out string? crc32) && crc32 != null)
builder.AppendLine($"CRC-32 checksum: {crc32}"); builder.AppendLine($"CRC-32 checksum: {crc32}");
if (hashes.TryGetValue(HashType.CRC64, out string? crc64) && crc64 is not null) if (hashes.TryGetValue(HashType.MD2, out string? md2) && md2 != null)
builder.AppendLine($"CRC-64 checksum: {crc64}");
if (hashes.TryGetValue(HashType.MD2, out string? md2) && md2 is not null)
builder.AppendLine($"MD2 hash: {md2}"); builder.AppendLine($"MD2 hash: {md2}");
if (hashes.TryGetValue(HashType.MD4, out string? md4) && md4 is not null) if (hashes.TryGetValue(HashType.MD4, out string? md4) && md4 != null)
builder.AppendLine($"MD4 hash: {md4}"); builder.AppendLine($"MD4 hash: {md4}");
if (hashes.TryGetValue(HashType.MD5, out string? md5) && md5 is not null) if (hashes.TryGetValue(HashType.MD5, out string? md5) && md5 != null)
builder.AppendLine($"MD5 hash: {md5}"); builder.AppendLine($"MD5 hash: {md5}");
if (hashes.TryGetValue(HashType.RIPEMD128, out string? ripemd128) && ripemd128 is not null) if (hashes.TryGetValue(HashType.RIPEMD128, out string? ripemd128) && ripemd128 != null)
builder.AppendLine($"RIPEMD-128 hash: {ripemd128}"); builder.AppendLine($"RIPEMD-128 hash: {ripemd128}");
if (hashes.TryGetValue(HashType.RIPEMD160, out string? ripemd160) && ripemd160 is not null) if (hashes.TryGetValue(HashType.RIPEMD160, out string? ripemd160) && ripemd160 != null)
builder.AppendLine($"RIPEMD-160 hash: {ripemd160}"); builder.AppendLine($"RIPEMD-160 hash: {ripemd160}");
if (hashes.TryGetValue(HashType.SHA1, out string? sha1) && sha1 is not null) if (hashes.TryGetValue(HashType.SHA1, out string? sha1) && sha1 != null)
builder.AppendLine($"SHA-1 hash: {sha1}"); builder.AppendLine($"SHA-1 hash: {sha1}");
if (hashes.TryGetValue(HashType.SHA256, out string? sha256) && sha256 is not null) if (hashes.TryGetValue(HashType.SHA256, out string? sha256) && sha256 != null)
builder.AppendLine($"SHA-256 hash: {sha256}"); builder.AppendLine($"SHA-256 hash: {sha256}");
if (hashes.TryGetValue(HashType.SHA384, out string? sha384) && sha384 is not null) if (hashes.TryGetValue(HashType.SHA384, out string? sha384) && sha384 != null)
builder.AppendLine($"SHA-384 hash: {sha384}"); builder.AppendLine($"SHA-384 hash: {sha384}");
if (hashes.TryGetValue(HashType.SHA512, out string? sha512) && sha512 is not null) if (hashes.TryGetValue(HashType.SHA512, out string? sha512) && sha512 != null)
builder.AppendLine($"SHA-512 hash: {sha512}"); builder.AppendLine($"SHA-512 hash: {sha512}");
return builder; return builder;

View File

@@ -10,7 +10,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings> <SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>3.2.0</Version> <Version>2.1.0</Version>
</PropertyGroup> </PropertyGroup>
<!-- Support All Frameworks --> <!-- Support All Frameworks -->
@@ -28,13 +28,13 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\SabreTools.Wrappers\SabreTools.Wrappers.csproj" /> <ProjectReference Include="..\SabreTools.Serialization\SabreTools.Serialization.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SabreTools.CommandLine" Version="1.5.0" /> <PackageReference Include="SabreTools.CommandLine" Version="[1.4.0]" />
<PackageReference Include="SabreTools.Hashing" Version="2.1.0" /> <PackageReference Include="SabreTools.Hashing" Version="[1.6.0]" />
<PackageReference Include="SabreTools.IO" Version="2.3.0" /> <PackageReference Include="SabreTools.IO" Version="[1.9.0]" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -15,7 +15,7 @@ namespace InfoPrint
var commandSet = CreateCommands(mainFeature); var commandSet = CreateCommands(mainFeature);
// If we have no args, show the help and quit // If we have no args, show the help and quit
if (args is null || args.Length == 0) if (args == null || args.Length == 0)
{ {
commandSet.OutputAllHelp(); commandSet.OutputAllHelp();
return; return;

View File

@@ -1,4 +1,4 @@
Copyright (c) 2018-2026 Matt Nadareski Copyright (c) 2018-2025 Matt Nadareski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@@ -2,10 +2,20 @@
[![Build and Test](https://github.com/SabreTools/SabreTools.Serialization/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/SabreTools/SabreTools.Serialization/actions/workflows/build_and_test.yml) [![Build and Test](https://github.com/SabreTools/SabreTools.Serialization/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/SabreTools/SabreTools.Serialization/actions/workflows/build_and_test.yml)
This meta-library comprises of serializers that both read and write from files and streams to the dedicated models as well as convert to and from the common internal models. This library is partially used by the current parsing and writing code but none of the internal model serialization is used. This library comprises of serializers that both read and write from files and streams to the dedicated models as well as convert to and from the common internal models. This library is partially used by the current parsing and writing code but none of the internal model serialization is used.
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Serialization). Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Serialization).
The following non-project libraries (or ports thereof) are used for file handling:
- [GrindCore.SharpCompress](https://github.com/Nanook/GrindCore.SharpCompress) - Common archive format extraction
- [StormLibSharp](https://github.com/robpaveza/stormlibsharp) - MoPaQ extraction [Unused in non-Windows builds due to Windows-specific libraries]
The following projects have influenced this library:
- [libmspack](https://github.com/kyz/libmspack) - Documentation around the MS-CAB format and associated compression methods.
- [Unshield](https://github.com/twogood/unshield/) - InstallShield CAB extraction tool that influenced internal handling
## Releases ## Releases
For the most recent stable build, download the latest release here: [Releases Page](https://github.com/SabreTools/SabreTools.Serialization/releases) For the most recent stable build, download the latest release here: [Releases Page](https://github.com/SabreTools/SabreTools.Serialization/releases)
@@ -14,7 +24,7 @@ For the latest WIP build here: [Rolling Release](https://github.com/SabreTools/S
## InfoPrint ## InfoPrint
**InfoPrint** is a reference implementation for the deserialization and printing features of the library, packaged as a standalone executable for all supported platforms. It will attempt to detect and display information about many supported file types, optionally both hashing the file and outputting the information to a JSON file. **InfoPrint** is a reference implementation for the deserialization and printing features of the library, packaged as a standalone executable for all supported platforms. It will attempt to detect and display information about many supported file types, optionally both hashing the file and outputting the information to a JSON file (.NET Core 3.1 and above only).
```text ```text
InfoPrint <options> file|directory ... InfoPrint <options> file|directory ...
@@ -25,7 +35,6 @@ Options:
-c, --hash Output file hashes -c, --hash Output file hashes
-f, --file Print to file only -f, --file Print to file only
-j, --json Print info as JSON -j, --json Print info as JSON
-r, --recursive Recursively print info from embedded files
``` ```
## ExtractionTool ## ExtractionTool
@@ -44,12 +53,9 @@ Options:
| Format Name | Notes | | Format Name | Notes |
| --- | --- | | --- | --- |
| 7-zip archive | .NET Framework 4.6.2 and greater | | 7-zip archive | .NET Framework 4.6.2 and greater |
| Atari 7800 (A78) Cart Image | Header and ROM data |
| Atari Lynx (LNX) Cart Image | Header and ROM data |
| BFPK custom archive format | | | BFPK custom archive format | |
| bzip2 archive | .NET Framework 4.6.2 and greater | | bzip2 archive | .NET Framework 4.6.2 and greater |
| Compound File Binary (CFB) | Only CFB common pieces extractable | | Compound File Binary (CFB) | Only CFB common pieces extractable. .NET Framework 4.0 and greater |
| fwNES FDS file | Header and disk data |
| gzip archive | | | gzip archive | |
| Half-Life Game Cache File (GCF) | | | Half-Life Game Cache File (GCF) | |
| Half-Life Level (BSP) | | | Half-Life Level (BSP) | |
@@ -58,12 +64,10 @@ Options:
| Half-Life 2 Level (VBSP) | | | Half-Life 2 Level (VBSP) | |
| InstallShield Archive V3 (Z) | | | InstallShield Archive V3 (Z) | |
| InstallShield CAB | | | InstallShield CAB | |
| ISO9660 | ISO and BIN files |
| Microsoft cabinet file | Does not support LZX or Quantum compression | | Microsoft cabinet file | Does not support LZX or Quantum compression |
| Microsoft LZ-compressed files | KWAJ, QBasic, and SZDD variants | | Microsoft LZ-compressed files | KWAJ, QBasic, and SZDD variants |
| MoPaQ game data archive (MPQ) | Windows only | | MoPaQ game data archive (MPQ) | Windows only |
| New Exectuable | Embedded archives and executables in the overlay and Wise installer | | New Exectuable | Embedded archives and executables in the overlay and Wise installer |
| Nintendo Entertainment System (NES) Cart Image | Header, Trainer data, PRG-ROM, CHR-ROM, Unheadered ROM, and PlayChoice-10 INST-ROM |
| NovaLogic Game Archive Format (PFF) | | | NovaLogic Game Archive Format (PFF) | |
| PKZIP and derived files (ZIP, etc.) | .NET Framework 4.6.2 and greater | | PKZIP and derived files (ZIP, etc.) | .NET Framework 4.6.2 and greater |
| Portable Executable | Embedded archives and executables in the resources and overlay, CExe-packed data, SFX archives (7-zip, PKZIP, and RAR), and Wise installer | | Portable Executable | Embedded archives and executables in the resources and overlay, CExe-packed data, SFX archives (7-zip, PKZIP, and RAR), and Wise installer |
@@ -73,22 +77,45 @@ Options:
| Tape archive (TAR) | | | Tape archive (TAR) | |
| Valve Package File (VPK) | | | Valve Package File (VPK) | |
| XBox Package File (XZP) | | | XBox Package File (XZP) | |
| Xbox DVD Filesystem (XISO) | |
| xz archive (XZ) | .NET Framework 4.6.2 and greater | | xz archive (XZ) | .NET Framework 4.6.2 and greater |
| ZArchive | |
## Interfaces
Below is a table representing the various conversion interfaces that are implemented within this library.
| Interface Name | Source Type | Destination Type |
| --- | --- | --- |
| `SabreTools.Serialization.Interfaces.IByteReader<TModel>` | `byte[]?` | `TModel` |
| `SabreTools.Serialization.Interfaces.IByteWriter<TModel>` | `TModel` | `byte[]?` |
| `SabreTools.Serialization.Interfaces.ICrossModel<TSource, TDest>` | `TSource`/`TDest` | `TDest`/`TSource` |
| `SabreTools.Serialization.Interfaces.IFileReader<TModel>` | `string?` path | `TModel` |
| `SabreTools.Serialization.Interfaces.IFileWriter<TModel>` | `TModel` | `string?` path |
| `SabreTools.Serialization.Interfaces.IStreamReader<TModel>` | `Stream?` | `TModel` |
| `SabreTools.Serialization.Interfaces.IStreamWriter<TModel>` | `TModel` | `Stream?` |
| `SabreTools.Serialization.Interfaces.IStringReader<TModel>` | `string?` representation | `TModel` |
| `SabreTools.Serialization.Interfaces.IStringWriter<TModel>` | `TModel` | `string?` representation |
Below is a table representing the various non-conversion interfaces that are implemented within this library.
| Interface Name | Purpose |
| --- | --- |
| `SabreTools.Serialization.Wrappers.IExtractable` | Marks a wrapper as able to be extracted |
| `SabreTools.Serialization.Wrappers.IPrintable` | Marks a wrapper as able to print model information |
| `SabreTools.Serialization.Wrappers.IWrapper` | Represents an item with a description and JSON serializable state, allowing for extensions |
| `SabreTools.Serialization.Wrappers.IWrapper<TModel>` | Wraps a model with source data, allowing for extensions |
## Namespaces ## Namespaces
Below are a list of the included namespaces with links to their README files: Below is a table of all namespaces within the library and what they represent
- [SabreTools.Data.Extensions](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Data.Extensions) | Namespace | Description |
- [SabreTools.Data.Models](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Data.Models) | --- | --- |
- [SabreTools.Metadata.DatFiles](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Metadata.DatFiles) | `SabreTools.Data.Attributes` | Common attributes for data marking and manipulation |
- [SabreTools.Metadata.DatItems](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Metadata.Datitems) | `SabreTools.Data.Extensions` | Extension methods related to models |
- [SabreTools.Metadata.Filter](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Metadata.Filter) | `SabreTools.Data.Models` | Models representing different file and structure types |
- [SabreTools.Metadata.Reports](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Metadata.Reports) | `SabreTools.Data.ObjectIdentifier` | Object Identifier (OID) parsing |
- [SabreTools.ObjectIdentifier](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.ObjectIdentifier) | `SabreTools.Serialization.CrossModel` | Convert between models; mainly used for metadata files converting to and from a common, `Dictionary`-based model |
- [SabreTools.Serialization.CrossModel](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Serialization.CrossModel) | `SabreTools.Serialization.Interfaces` | Interfaces used commonly throughout the library |
- [SabreTools.Serialization.Readers](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Serialization.Readers) | `SabreTools.Serialization.Readers` | Convert from external sources to models |
- [SabreTools.Serialization.Writers](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Serialization.Writers) | `SabreTools.Serialization.Wrappers` | Classes that wrap serialization and models to allow for including extension properties |
- [SabreTools.Wrappers](https://github.com/SabreTools/SabreTools.Serialization/tree/main/SabreTools.Wrappers) | `SabreTools.Serialization.Writers` | Convert from models to external sources |

View File

@@ -1,141 +0,0 @@
using SabreTools.Data.Models.Atari7800;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class Atari7800CartExtensionsTests
{
[Theory]
[InlineData((AudioDevice)0, "POKEY - none, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
// POKEY
[InlineData(AudioDevice.Pokey440, "POKEY - @440, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
[InlineData(AudioDevice.Pokey450, "POKEY - @450, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
[InlineData(AudioDevice.Pokey450Plus440, "POKEY - @450+@440, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
[InlineData(AudioDevice.Pokey800, "POKEY - @800, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
[InlineData(AudioDevice.Pokey4000, "POKEY - @4000, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
[InlineData((AudioDevice)0x0007, "Unknown 7, No YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
// YM2151
[InlineData(AudioDevice.YM2151460, "POKEY - none, YM2151 @460, No COVOX @430, No ADPCM Audio Stream @420")]
// COVOX
[InlineData(AudioDevice.COVOX430, "POKEY - none, No YM2151 @460, COVOX @430, No ADPCM Audio Stream @420")]
// ADPCM
[InlineData(AudioDevice.ADPCMAudioStream420, "POKEY - none, No YM2151 @460, No COVOX @430, ADPCM Audio Stream @420")]
public void FromAudioDeviceTest(AudioDevice audio, string expected)
{
string actual = audio.FromAudioDevice();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData((CartType)0, "N/A")]
[InlineData(CartType.PokeyAt4000, "pokey at $4000")]
[InlineData(CartType.SupergameBankSwitched, "supergame bank switched")]
[InlineData(CartType.SupergameRamAt4000, "supergame ram at $4000")]
[InlineData(CartType.RomAt4000, "rom at $4000")]
[InlineData(CartType.Bank6At4000, "bank 6 at $4000")]
[InlineData(CartType.BankedRam, "banked ram")]
[InlineData(CartType.PokeyAt450, "pokey at $450")]
[InlineData(CartType.MirrorRamAt4000, "mirror ram at $4000")]
[InlineData(CartType.ActivisionBanking, "activision banking")]
[InlineData(CartType.AbsoluteBanking, "absolute banking")]
[InlineData(CartType.PokeyAt440, "pokey at $440")]
[InlineData(CartType.Ym2151At460461, "ym2151 at $460/$461")]
[InlineData(CartType.Souper, "souper")]
[InlineData(CartType.Banksets, "banksets")]
[InlineData(CartType.HaltBankedRam, "halt banked ram")]
[InlineData(CartType.PokeyAt800, "pokey@800")]
public void FromCartTypeTest(CartType type, string expected)
{
string actual = type.FromCartType();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(ControllerType.None, "none")]
[InlineData(ControllerType.Joystick, "7800 joystick")]
[InlineData(ControllerType.Lightgun, "lightgun")]
[InlineData(ControllerType.Paddle, "paddle")]
[InlineData(ControllerType.Trakball, "trakball")]
[InlineData(ControllerType.VcsJoystick, "2600 joystick")]
[InlineData(ControllerType.VcsDriving, "2600 driving")]
[InlineData(ControllerType.VcsKeypad, "2600 keypad")]
[InlineData(ControllerType.STMouse, "ST mouse")]
[InlineData(ControllerType.AmigaMouse, "Amiga mouse")]
[InlineData(ControllerType.AtariVoxSaveKey, "AtariVox/SaveKey")]
[InlineData(ControllerType.SNES2Atari, "SNES2Atari")]
[InlineData(ControllerType.Mega7800, "Mega7800")]
public void FromControllerTypeTest(ControllerType type, string expected)
{
string actual = type.FromControllerType();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(Interrupt.None, "None")]
[InlineData(Interrupt.Pokey1, "POKEY 1 (@450 | @800 | @4000)")]
[InlineData(Interrupt.Pokey2, "POKEY 2 (@440)")]
[InlineData(Interrupt.YM2151, "YM2151")]
public void FromInterruptTest(Interrupt interrupt, string expected)
{
string actual = interrupt.FromInterrupt();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(Mapper.Linear, "Linear")]
[InlineData(Mapper.SuperGame, "SuperGame")]
[InlineData(Mapper.Activision, "Activision")]
[InlineData(Mapper.Absolute, "Absolute")]
[InlineData(Mapper.Souper, "Souper")]
public void FromMapperTest(Mapper mapper, string expected)
{
string actual = mapper.FromMapper();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(MapperOptions.SuperGameNone, "Option at @4000 - none, Standard ROM")]
[InlineData(MapperOptions.SuperGame16KRAM, "Option at @4000 - 16K RAM, Standard ROM")]
[InlineData(MapperOptions.SuperGame8KEXRAMA8, "Option at @4000 - 8K EXRAM/A8, Standard ROM")]
[InlineData(MapperOptions.SuperGame32KEXRAMM2, "Option at @4000 - 32K EXRAM/M2, Standard ROM")]
[InlineData(MapperOptions.SuperGameEXROM, "Option at @4000 - EXROM, Standard ROM")]
[InlineData(MapperOptions.SuperGameEXFIX, "Option at @4000 - EXFIX, Standard ROM")]
[InlineData(MapperOptions.SuperGame32KEXRAMX2, "Option at @4000 - 32k EXRAM/X2, Standard ROM")]
[InlineData(MapperOptions.BanksetRom, "Option at @4000 - none, Bankset ROM")]
public void FromMapperOptionsTest(MapperOptions options, string expected)
{
string actual = options.FromMapperOptions();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(SaveDevice.None, "None")]
[InlineData(SaveDevice.HSC, "HSC")]
[InlineData(SaveDevice.SaveKeyAtariVox, "SaveKey/AtariVox")]
public void FromSaveDeviceTest(SaveDevice device, string expected)
{
string actual = device.FromSaveDevice();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(SlotPassthroughDevice.None, "None")]
[InlineData(SlotPassthroughDevice.XM, "XM")]
public void FromSlotPassthroughDeviceTest(SlotPassthroughDevice device, string expected)
{
string actual = device.FromSlotPassthroughDevice();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData((TVType)0, "NTSC, Component, Single-region")]
[InlineData(TVType.PAL, "PAL, Component, Single-region")]
[InlineData(TVType.Composite, "NTSC, Composite, Single-region")]
[InlineData(TVType.MultiRegion, "NTSC, Component, Multi-region")]
public void FromTVTypeTest(TVType type, string expected)
{
string actual = type.FromTVType();
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,18 +0,0 @@
using SabreTools.Data.Models.AtariLynx;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class AtariLynxCartExtensionsTests
{
[Theory]
[InlineData(Rotation.NoRotation, "No rotation (horizontal, buttons right)")]
[InlineData(Rotation.RotateLeft, "Rotate left (vertical, buttons down)")]
[InlineData(Rotation.RotateRight, "Rotate right (vertical, buttons up)")]
public void FromRotationTest(Rotation rotation, string expected)
{
string actual = rotation.FromRotation();
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,65 +0,0 @@
using System.IO;
using SabreTools.Data.Models.CDROM;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class CDROMExtensionsTests
{
[Theory]
[InlineData(new byte[0], SectorMode.UNKNOWN)]
[InlineData(new byte[] { 0x00 }, SectorMode.MODE0)]
[InlineData(new byte[] { 0x01 }, SectorMode.MODE1)]
[InlineData(new byte[] { 0x02 }, SectorMode.UNKNOWN)]
[InlineData(new byte[] { 0x02, 0x00, 0x00, 0x00 }, SectorMode.MODE2_FORM1)]
[InlineData(new byte[] { 0x02, 0x00, 0x00, 0x20 }, SectorMode.MODE2_FORM2)]
[InlineData(new byte[] { 0x03 }, SectorMode.UNKNOWN)]
public void GetSectorModeTest(byte[] bytes, SectorMode expected)
{
var stream = new MemoryStream(bytes);
SectorMode actual = stream.GetSectorMode();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(SectorMode.UNKNOWN, 2336)]
[InlineData(SectorMode.MODE0, 2336)]
[InlineData(SectorMode.MODE1, 2048)]
[InlineData(SectorMode.MODE2, 2336)]
[InlineData(SectorMode.MODE2_FORM1, 2048)]
[InlineData(SectorMode.MODE2_FORM2, 2324)]
public void GetUserDataSizeTest(SectorMode mode, long expected)
{
long actual = mode.GetUserDataSize();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(SectorMode.UNKNOWN, 2064)]
[InlineData(SectorMode.MODE0, 2064)]
[InlineData(SectorMode.MODE1, 2064)]
[InlineData(SectorMode.MODE2, 2064)]
[InlineData(SectorMode.MODE2_FORM1, 2072)]
[InlineData(SectorMode.MODE2_FORM2, 2072)]
public void GetUserDataEndTest(SectorMode mode, long expected)
{
long actual = mode.GetUserDataEnd();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(SectorMode.UNKNOWN, 16)]
[InlineData(SectorMode.MODE0, 16)]
[InlineData(SectorMode.MODE1, 16)]
[InlineData(SectorMode.MODE2, 16)]
[InlineData(SectorMode.MODE2_FORM1, 24)]
[InlineData(SectorMode.MODE2_FORM2, 24)]
public void GetUserDataStart(SectorMode mode, long expected)
{
long actual = mode.GetUserDataStart();
Assert.Equal(expected, actual);
}
// TODO: Figure out how to add UserDataStream tests
}
}

View File

@@ -1,17 +0,0 @@
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class CFBExtensionsTests
{
[Theory]
[InlineData(null, null)]
[InlineData(new byte[0], "")]
// TODO: Create more artifical tests
public void DecodeStreamNameTest(byte[]? bytes, string? expected)
{
string? actual = bytes.DecodeStreamName();
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,138 +0,0 @@
using SabreTools.Data.Models.ISO9660;
using SabreTools.Numerics;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class ISO9660ExtensionsTests
{
[Fact]
public void GetLogicalBlockSize_Generic_SectorLength()
{
VolumeDescriptor vd = new GenericVolumeDescriptor();
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(sectorLength, actual);
}
[Fact]
public void GetLogicalBlockSize_PVD_ValidBothEndian_ValidBlockSize_BlockSize()
{
VolumeDescriptor vd = new PrimaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(2048, 2048)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(2048, actual);
}
[Fact]
public void GetLogicalBlockSize_PVD_ValidBothEndian_InvalidBlockSize_SectorLength()
{
VolumeDescriptor vd = new PrimaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(2352, 2352)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(4096, actual);
}
[Fact]
public void GetLogicalBlockSize_PVD_InvalidBothEndian_ValidLE_LEValue()
{
VolumeDescriptor vd = new PrimaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(2048, -1)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(2048, actual);
}
[Fact]
public void GetLogicalBlockSize_PVD_InvalidBothEndian_ValidBE_BEValue()
{
VolumeDescriptor vd = new PrimaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(-1, 2048)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(2048, actual);
}
[Fact]
public void GetLogicalBlockSize_PVD_InvalidBothEndian_BothInvalid_SectorLength()
{
VolumeDescriptor vd = new PrimaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(-1, -2)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(sectorLength, actual);
}
[Fact]
public void GetLogicalBlockSize_SVD_ValidBothEndian_ValidBlockSize_BlockSize()
{
VolumeDescriptor vd = new SupplementaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(2048, 2048)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(2048, actual);
}
[Fact]
public void GetLogicalBlockSize_SVD_ValidBothEndian_InvalidBlockSize_SectorLength()
{
VolumeDescriptor vd = new SupplementaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(2352, 2352)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(4096, actual);
}
[Fact]
public void GetLogicalBlockSize_SVD_InvalidBothEndian_ValidLE_LEValue()
{
VolumeDescriptor vd = new SupplementaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(2048, -1)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(2048, actual);
}
[Fact]
public void GetLogicalBlockSize_SVD_InvalidBothEndian_ValidBE_BEValue()
{
VolumeDescriptor vd = new SupplementaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(-1, 2048)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(2048, actual);
}
[Fact]
public void GetLogicalBlockSize_SVD_InvalidBothEndian_BothInvalid_SectorLength()
{
VolumeDescriptor vd = new SupplementaryVolumeDescriptor
{
LogicalBlockSize = new BothInt16(-1, -2)
};
short sectorLength = 4096;
short actual = vd.GetLogicalBlockSize(sectorLength);
Assert.Equal(sectorLength, actual);
}
}
}

View File

@@ -1,156 +0,0 @@
using SabreTools.Data.Models.InstallShieldCabinet;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class InstallShieldCabinetExtensionsTests
{
#region IsCompressed
[Fact]
public void IsCompressed_Null_True()
{
FileDescriptor? fd = null;
bool actual = fd.IsCompressed();
Assert.True(actual);
}
[Fact]
public void IsCompressed_Compressed_True()
{
FileDescriptor? fd = new FileDescriptor { Flags = FileFlags.FILE_COMPRESSED };
bool actual = fd.IsCompressed();
Assert.True(actual);
}
[Fact]
public void IsCompressed_NotCompressed_False()
{
FileDescriptor? fd = new FileDescriptor { Flags = 0 };
bool actual = fd.IsCompressed();
Assert.False(actual);
}
#endregion
#region IsInvalid
[Fact]
public void IsInvalid_Null_True()
{
FileDescriptor? fd = null;
bool actual = fd.IsInvalid();
Assert.True(actual);
}
[Fact]
public void IsInvalid_Invalid_True()
{
FileDescriptor? fd = new FileDescriptor { Flags = FileFlags.FILE_INVALID };
bool actual = fd.IsInvalid();
Assert.True(actual);
}
[Fact]
public void IsInvalid_Valid_False()
{
FileDescriptor? fd = new FileDescriptor { Flags = 0 };
bool actual = fd.IsInvalid();
Assert.False(actual);
}
#endregion
#region IsObfuscated
[Fact]
public void IsObfuscated_Null_False()
{
FileDescriptor? fd = null;
bool actual = fd.IsObfuscated();
Assert.False(actual);
}
[Fact]
public void IsObfuscated_Obfuscated_True()
{
FileDescriptor? fd = new FileDescriptor { Flags = FileFlags.FILE_OBFUSCATED };
bool actual = fd.IsObfuscated();
Assert.True(actual);
}
[Fact]
public void IsObfuscated_NotObfuscated_False()
{
FileDescriptor? fd = new FileDescriptor { Flags = 0 };
bool actual = fd.IsObfuscated();
Assert.False(actual);
}
#endregion
#region IsSplit
[Fact]
public void IsSplit_Null_False()
{
FileDescriptor? fd = null;
bool actual = fd.IsSplit();
Assert.False(actual);
}
[Fact]
public void IsSplit_Split_True()
{
FileDescriptor? fd = new FileDescriptor { Flags = FileFlags.FILE_SPLIT };
bool actual = fd.IsSplit();
Assert.True(actual);
}
[Fact]
public void IsSplit_NotSplitFalse()
{
FileDescriptor? fd = new FileDescriptor { Flags = 0 };
bool actual = fd.IsSplit();
Assert.False(actual);
}
#endregion
#region GetMajorVersion
[Fact]
public void GetMajorVersion_NullCabinet_NegativeOne()
{
Cabinet? cabinet = null;
int actual = cabinet.GetMajorVersion();
Assert.Equal(-1, actual);
}
[Fact]
public void GetMajorVersion_NullHeader_NegativeOne()
{
CommonHeader? cabinet = null;
int actual = cabinet.GetMajorVersion();
Assert.Equal(-1, actual);
}
[Theory]
[InlineData(0x00000000, 0)]
[InlineData(0x00000004, 4)]
[InlineData(0x01000000, 0)]
[InlineData(0x01004000, 4)]
[InlineData(0x02000000, 0)]
[InlineData(0x02000190, 4)]
[InlineData(0x04000000, 0)]
[InlineData(0x04000190, 4)]
public void GetMajorVersionTest(uint version, int expected)
{
CommonHeader? cabinet = new CommonHeader { Version = version };
int actual = cabinet.GetMajorVersion();
Assert.Equal(expected, actual);
}
#endregion
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,206 +0,0 @@
using SabreTools.Data.Models.NES;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class NESCartExtensionsTests
{
[Theory]
[InlineData(ConsoleType.StandardSystem, "Nintendo Entertainment System/Family Computer")]
[InlineData(ConsoleType.VSUnisystem, "VS Unisystem")]
[InlineData(ConsoleType.PlayChoice10, "PlayChoice-10 (8 KB of Hint Screen data stored after CHR data)")]
[InlineData(ConsoleType.ExtendedConsoleType, "Extended Console Type")]
public void FromConsoleTypeTest(ConsoleType type, string expected)
{
string actual = type.FromConsoleType();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(CPUPPUTiming.RP2C02, "RP2C02 (NTSC NES)")]
[InlineData(CPUPPUTiming.RP2C07, "RP2C07 (Licensed PAL NES)")]
[InlineData(CPUPPUTiming.MultipleRegion, "Multiple-region")]
[InlineData(CPUPPUTiming.UA6538, "UA6538 (Dendy)")]
public void FromCPUPPUTimingTest(CPUPPUTiming timing, string expected)
{
string actual = timing.FromCPUPPUTiming();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(DefaultExpansionDevice.Unspecified, "Unspecified")]
[InlineData(DefaultExpansionDevice.StandardControllers, "Standard NES/Famicom controllers")]
[InlineData(DefaultExpansionDevice.NESFourScore, "NES Four Score/Satellite with two additional standard controllers")]
[InlineData(DefaultExpansionDevice.FamicomFourPlayersAdapter, "Famicom Four Players Adapter with two additional standard controllers using the 'simple' protocol")]
[InlineData(DefaultExpansionDevice.VsSystem4016, "Vs. System (1P via $4016)")]
[InlineData(DefaultExpansionDevice.VsSystem4017, "Vs. System (1P via $4017)")]
[InlineData(DefaultExpansionDevice.Reserved06, "Reserved (0x06)")]
[InlineData(DefaultExpansionDevice.VsZapper, "Vs. Zapper")]
[InlineData(DefaultExpansionDevice.Zapper4017, "Zapper ($4017)")]
[InlineData(DefaultExpansionDevice.TwoZappers, "Two Zappers")]
[InlineData(DefaultExpansionDevice.BandaiHyperShotLightgun, "Bandai Hyper Shot Lightgun")]
[InlineData(DefaultExpansionDevice.PowerPadSideA, "Power Pad Side A")]
[InlineData(DefaultExpansionDevice.PowerPadSideB, "Power Pad Side B")]
[InlineData(DefaultExpansionDevice.FamilyTrainerSideA, "Family Trainer Side A")]
[InlineData(DefaultExpansionDevice.FamilyTrainerSideB, "Family Trainer Side B")]
[InlineData(DefaultExpansionDevice.ArkanoidVausControllerNES, "Arkanoid Vaus Controller (NES)")]
[InlineData(DefaultExpansionDevice.ArkanoidVausControllerFamicom, "Arkanoid Vaus Controller (Famicom)")]
[InlineData(DefaultExpansionDevice.TwoVausControllersPlusFamicomDataRecorder, "Two Vaus Controllers plus Famicom Data Recorder")]
[InlineData(DefaultExpansionDevice.KonamiHyperShotController, "Konami Hyper Shot Controller")]
[InlineData(DefaultExpansionDevice.CoconutsPachinkoController, "Coconuts Pachinko Controller")]
[InlineData(DefaultExpansionDevice.ExcitingBoxingPunchingBag, "Exciting Boxing Punching Bag (Blowup Doll)")]
[InlineData(DefaultExpansionDevice.JissenMahjongController, "Jissen Mahjong Controller")]
[InlineData(DefaultExpansionDevice.YonezawaPartyTap, "米澤 (Yonezawa) Party Tap")]
[InlineData(DefaultExpansionDevice.OekaKidsTablet, "Oeka Kids Tablet")]
[InlineData(DefaultExpansionDevice.SunsoftBarcodeBattler, "Sunsoft Barcode Battler")]
[InlineData(DefaultExpansionDevice.MiraclePianoKeyboard, "Miracle Piano Keyboard")]
[InlineData(DefaultExpansionDevice.PokkunMoguraaTapTapMat, "Pokkun Moguraa Tap-tap Mat (Whack-a-Mole Mat and Mallet)")]
[InlineData(DefaultExpansionDevice.TopRider, "Top Rider (Inflatable Bicycle)")]
[InlineData(DefaultExpansionDevice.DoubleFisted, "Double-Fisted (Requires or allows use of two controllers by one player)")]
[InlineData(DefaultExpansionDevice.Famicom3DSystem, "Famicom 3D System")]
[InlineData(DefaultExpansionDevice.DoremikkoKeyboard, "Doremikko Keyboard")]
[InlineData(DefaultExpansionDevice.ROBGyromite, "R.O.B. Gyromite")]
[InlineData(DefaultExpansionDevice.FamicomDataRecorder, "Famicom Data Recorder ('silent' keyboard)")]
[InlineData(DefaultExpansionDevice.ASCIITurboFile, "ASCII Turbo File")]
[InlineData(DefaultExpansionDevice.IGSStorageBattleBox, "IGS Storage Battle Box")]
[InlineData(DefaultExpansionDevice.FamilyBASICKeyboardPlusFamicomDataRecorder, "Family BASIC Keyboard plus Famicom Data Recorder")]
[InlineData(DefaultExpansionDevice.DongdaPECKeyboard, "东达 (Dōngdá) PEC Keyboard")]
[InlineData(DefaultExpansionDevice.BitCorpBit79Keyboard, "普澤 (Pǔzé, a.k.a. Bit Corp.) Bit-79 Keyboard")]
[InlineData(DefaultExpansionDevice.SuborKeyboard, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusMacroWinnersMouse, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Macro Winners Mouse")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusSuborMouse4016, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Subor Mouse via $4016")]
[InlineData(DefaultExpansionDevice.SNESMouse4016, "SNES Mouse ($4016)")]
[InlineData(DefaultExpansionDevice.Multicart, "Multicart")]
[InlineData(DefaultExpansionDevice.TwoSNESControllers, "Two SNES controllers replacing the two standard NES controllers")]
[InlineData(DefaultExpansionDevice.RacerMateBicycle, "RacerMate Bicycle")]
[InlineData(DefaultExpansionDevice.UForce, "U-Force")]
[InlineData(DefaultExpansionDevice.ROBStackUp, "R.O.B. Stack-Up")]
[InlineData(DefaultExpansionDevice.CityPatrolmanLightgun, "City Patrolman Lightgun")]
[InlineData(DefaultExpansionDevice.SharpC1CassetteInterface, "Sharp C1 Cassette Interface")]
[InlineData(DefaultExpansionDevice.StandardControllerWithSwappedInputs, "Standard Controller with swapped Left-Right/Up-Down/B-A")]
[InlineData(DefaultExpansionDevice.ExcaliburSudokuPad, "Excalibur Sudoku Pad")]
[InlineData(DefaultExpansionDevice.ABLPinball, "ABL Pinball")]
[InlineData(DefaultExpansionDevice.GoldenNuggetCasinoExtraButtons, "Golden Nugget Casino extra buttons")]
[InlineData(DefaultExpansionDevice.KedaKeyboard, "科达 (Kēdá) Keyboard")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusSuborMouse4017, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Subor Mouse via $4017")]
[InlineData(DefaultExpansionDevice.PortTestController, "Port test controller")]
[InlineData(DefaultExpansionDevice.BandaiMultiGamePlayerGamepad, "Bandai Multi Game Player Gamepad buttons")]
[InlineData(DefaultExpansionDevice.VenomTVDanceMat, "Venom TV Dance Mat")]
[InlineData(DefaultExpansionDevice.LGTVRemoteControl, "LG TV Remote Control")]
[InlineData(DefaultExpansionDevice.FamicomNetworkController, "Famicom Network Controller")]
[InlineData(DefaultExpansionDevice.KingFishingController, "King Fishing Controller")]
[InlineData(DefaultExpansionDevice.CroakyKaraokeController, "Croaky Karaoke Controller")]
[InlineData(DefaultExpansionDevice.KingwonKeyboard, "科王 (Kēwáng, a.k.a. Kingwon) Keyboard")]
[InlineData(DefaultExpansionDevice.ZechengKeyboard, "泽诚 (Zéchéng) Keyboard")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusL90RotatedPS2Mouse4017, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus L90-rotated PS/2 mouse in $4017")]
[InlineData(DefaultExpansionDevice.PS2KeyboardInUM6578PS2PortPS2Mouse4017, "PS/2 Keyboard in UM6578 PS/2 port, PS/2 Mouse via $4017")]
[InlineData(DefaultExpansionDevice.PS2MouseInUM6578PS2Port, "PS/2 Mouse in UM6578 PS/2 port")]
[InlineData(DefaultExpansionDevice.YuxingMouse4016, "裕兴 (Yùxìng) Mouse via $4016")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusYuxingMouse4016, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus 裕兴 (Yùxìng) Mouse mouse in $4016")]
[InlineData(DefaultExpansionDevice.GigggleTVPump, "Gigggle TV Pump")]
[InlineData(DefaultExpansionDevice.BBKKeyboardPlusR90RotatedPS2Mouse4017, "步步高 (Bùbùgāo, a.k.a. BBK) Keyboard plus R90-rotated PS/2 mouse in $4017")]
[InlineData(DefaultExpansionDevice.MagicalCooking, "Magical Cooking")]
[InlineData(DefaultExpansionDevice.SNESMouse4017, "SNES Mouse ($4017)")]
[InlineData(DefaultExpansionDevice.Zapper4016, "Zapper ($4016)")]
[InlineData(DefaultExpansionDevice.ArkanoidVausControllerPrototype, "Arkanoid Vaus Controller (Prototype)")]
[InlineData(DefaultExpansionDevice.TVMahjongGameController, "TV 麻雀 Game (TV Mahjong Game) Controller")]
[InlineData(DefaultExpansionDevice.MahjongGekitouDensetsuController, "麻雀激闘伝説 (Mahjong Gekitou Densetsu) Controller")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusXInvertedPS2Mouse4017, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus X-inverted PS/2 mouse in $4017")]
[InlineData(DefaultExpansionDevice.IBMPCXTKeyboard, "IBM PC/XT Keyboard")]
[InlineData(DefaultExpansionDevice.SuborKeyboardPlusMegaBookMouse, "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Mega Book Mouse")]
public void FromDefaultExpansionDeviceTest(DefaultExpansionDevice device, string expected)
{
string actual = device.FromDefaultExpansionDevice();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(ExtendedConsoleType.RegularSystem, "Regular NES/Famicom/Dendy")]
[InlineData(ExtendedConsoleType.NintendoVsSystem, "Nintendo Vs. System")]
[InlineData(ExtendedConsoleType.Playchoice10, "Playchoice 10")]
[InlineData(ExtendedConsoleType.RegularFamicloneDecimalMode, "Regular Famiclone, but with CPU that supports Decimal Mode")]
[InlineData(ExtendedConsoleType.RegularNESWithEPSM, "Regular NES/Famicom with EPSM module or plug-through cartridge")]
[InlineData(ExtendedConsoleType.VRTechnologyVT01, "V.R. Technology VT01 with red/cyan STN palette")]
[InlineData(ExtendedConsoleType.VRTechnologyVT02, "V.R. Technology VT02")]
[InlineData(ExtendedConsoleType.VRTechnologyVT03, "V.R. Technology VT03")]
[InlineData(ExtendedConsoleType.VRTechnologyVT09, "V.R. Technology VT09")]
[InlineData(ExtendedConsoleType.VRTechnologyVT32, "V.R. Technology VT32")]
[InlineData(ExtendedConsoleType.VRTechnologyVT369, "V.R. Technology VT369")]
[InlineData(ExtendedConsoleType.UMCUM6578, "UMC UM6578")]
[InlineData(ExtendedConsoleType.FamicomNetworkSystem, "Famicom Network System")]
[InlineData(ExtendedConsoleType.ReservedD, "Reserved (0x0D)")]
[InlineData(ExtendedConsoleType.ReservedE, "Reserved (0x0E)")]
[InlineData(ExtendedConsoleType.ReservedF, "Reserved (0x0F)")]
public void FromExtendedConsoleTypeTest(ExtendedConsoleType type, string expected)
{
string actual = type.FromExtendedConsoleType();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(NametableArrangement.Vertical, "Vertical")]
[InlineData(NametableArrangement.Horizontal, "Horizontal")]
public void FromNametableArrangementTest(NametableArrangement arrangement, string expected)
{
string actual = arrangement.FromNametableArrangement();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(TVSystem.NTSC, "NTSC")]
[InlineData(TVSystem.PAL, "PAL")]
public void FromTVSystemTest(TVSystem system, string expected)
{
string actual = system.FromTVSystem();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(TVSystemExtended.NTSC, "NTSC")]
[InlineData(TVSystemExtended.DualCompatible1, "Dual-compatible (0x01)")]
[InlineData(TVSystemExtended.PAL, "PAL")]
[InlineData(TVSystemExtended.DualCompatible3, "Dual-compatible (0x03)")]
public void FromTVSystemExtendedTest(TVSystemExtended system, string expected)
{
string actual = system.FromTVSystemExtended();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(VsHardwareType.VsUnisystem, "Vs. Unisystem (normal)")]
[InlineData(VsHardwareType.VsUnisystemRBIBaseballProtection, "Vs. Unisystem (RBI Baseball protection)")]
[InlineData(VsHardwareType.VsUnisystemTKOBoxingProtection, "Vs. Unisystem (TKO Boxing protection)")]
[InlineData(VsHardwareType.VsUnisystemSuperXeviousProtection, "Vs. Unisystem (Super Xevious protection)")]
[InlineData(VsHardwareType.VsUnisystemVsIceClimberJapanProtection, "Vs. Unisystem (Vs. Ice Climber Japan protection)")]
[InlineData(VsHardwareType.VsDualSystem, "Vs. Dual System (normal)")]
[InlineData(VsHardwareType.VsDualSystemRaidOnBungelingBayProtection, "Vs. Dual System (Raid on Bungeling Bay protection)")]
public void FromVsHardwareTypeTest(VsHardwareType type, string expected)
{
string actual = type.FromVsHardwareType();
Assert.Equal(expected, actual);
}
[Theory]
[InlineData(VsSystemType.AnyRP2C03RC2C03Variant, "Any RP2C03/RC2C03 variant")]
[InlineData(VsSystemType.Reserved1, "Reserved (0x01)")]
[InlineData(VsSystemType.RP2C040001, "RP2C04-0001")]
[InlineData(VsSystemType.RP2C040002, "RP2C04-0002")]
[InlineData(VsSystemType.RP2C040003, "RP2C04-0003")]
[InlineData(VsSystemType.RP2C040004, "RP2C04-0004")]
[InlineData(VsSystemType.Reserved6, "Reserved (0x06)")]
[InlineData(VsSystemType.Reserved7, "Reserved (0x07)")]
[InlineData(VsSystemType.RC2C0501, "RC2C05-01 (signature unknown)")]
[InlineData(VsSystemType.RC2C0502, "RC2C05-02 ($2002 AND $3F =$3D)")]
[InlineData(VsSystemType.RC2C0503, "RC2C05-03 ($2002 AND $1F =$1C)")]
[InlineData(VsSystemType.RC2C0504, "RC2C05-04 ($2002 AND $1F =$1B)")]
[InlineData(VsSystemType.ReservedC, "Reserved (0x0C)")]
[InlineData(VsSystemType.ReservedD, "Reserved (0x0D)")]
[InlineData(VsSystemType.ReservedE, "Reserved (0x0E)")]
[InlineData(VsSystemType.ReservedF, "Reserved (0x0F)")]
public void FromVsSystemTypeTest(VsSystemType type, string expected)
{
string actual = type.FromVsSystemType();
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,61 +0,0 @@
using SabreTools.Data.Models.NewExecutable;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class NewExecutableExtensionsTests
{
#region IsIntegerType
[Fact]
public void IsIntegerType_RTIE_HighBitSet_True()
{
var entry = new ResourceTypeInformationEntry { TypeID = 0xFFFF };
bool actual = entry.IsIntegerType();
Assert.True(actual);
}
[Fact]
public void IsIntegerType_RTIE_HighBitClear_False()
{
var entry = new ResourceTypeInformationEntry { TypeID = 0x0000 };
bool actual = entry.IsIntegerType();
Assert.False(actual);
}
[Fact]
public void IsIntegerType_RTRE_HighBitSet_True()
{
var entry = new ResourceTypeResourceEntry { ResourceID = 0xFFFF };
bool actual = entry.IsIntegerType();
Assert.True(actual);
}
[Fact]
public void IsIntegerType_RTRE_HighBitClear_False()
{
var entry = new ResourceTypeResourceEntry { ResourceID = 0x0000 };
bool actual = entry.IsIntegerType();
Assert.False(actual);
}
#endregion
#region GetEntryType
[Theory]
[InlineData(0x00, SegmentEntryType.Unused)]
[InlineData(0x01, SegmentEntryType.FixedSegment)]
[InlineData(0xAA, SegmentEntryType.FixedSegment)]
[InlineData(0xFE, SegmentEntryType.FixedSegment)]
[InlineData(0xFF, SegmentEntryType.MoveableSegment)]
public void GetEntryTypeTest(byte segmentIndicator, SegmentEntryType expected)
{
var entry = new EntryTableBundle { SegmentIndicator = segmentIndicator };
SegmentEntryType actual = entry.GetEntryType();
Assert.Equal(expected, actual);
}
#endregion
}
}

View File

@@ -1,129 +0,0 @@
using SabreTools.Data.Models.NintendoDisc;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class NintendoDiscExtensionsTests
{
#region GetPlatform
[Fact]
public void GetPlatform_Object_WiiMagic_Wii()
{
var header = new DiscHeader { WiiMagic = Constants.WiiMagicWord };
Platform actual = header.GetPlatform();
Assert.Equal(Platform.Wii, actual);
}
[Fact]
public void GetPlatform_Object_GCMagic_GC()
{
var header = new DiscHeader { GCMagic = Constants.GCMagicWord };
Platform actual = header.GetPlatform();
Assert.Equal(Platform.GameCube, actual);
}
[Fact]
public void GetPlatform_Object_ValidGameID_GC()
{
var header = new DiscHeader { GameId = "GABC01" };
Platform actual = header.GetPlatform();
Assert.Equal(Platform.GameCube, actual);
}
[Fact]
public void GetPlatform_Object_InvalidGameID_Unknown()
{
var header = new DiscHeader { GameId = "XABC01" };
Platform actual = header.GetPlatform();
Assert.Equal(Platform.Unknown, actual);
}
[Fact]
public void GetPlatform_Object_DefaultHeader_Unknown()
{
var header = new DiscHeader();
Platform actual = header.GetPlatform();
Assert.Equal(Platform.Unknown, actual);
}
[Fact]
public void GetPlatform_Bytes_WiiMagic_Wii()
{
byte[] header =
[
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00-0x07
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x08-0x0F
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x10-0x17
0x5D, 0x1C, 0x9E, 0xA3, 0x00, 0x00, 0x00, 0x00, // 0x18-0x1F
];
Platform actual = header.GetPlatform();
Assert.Equal(Platform.Wii, actual);
}
[Fact]
public void GetPlatform_Bytes_GCMagic_GC()
{
byte[] header =
[
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x00-0x07
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x08-0x0F
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x10-0x17
0x00, 0x00, 0x00, 0x00, 0xC2, 0x33, 0x9F, 0x3D, // 0x18-0x1F
];
Platform actual = header.GetPlatform();
Assert.Equal(Platform.GameCube, actual);
}
[Fact]
public void GetPlatform_Bytes_ValidGameID_GC()
{
byte[] header = [(byte)'G', (byte)'A', (byte)'B', (byte)'C'];
Platform actual = header.GetPlatform();
Assert.Equal(Platform.GameCube, actual);
}
[Fact]
public void GetPlatform_Bytes_InvalidGameID_Unknown()
{
byte[] header = [(byte)'G', (byte)'A', (byte)'B', 0x00];
Platform actual = header.GetPlatform();
Assert.Equal(Platform.Unknown, actual);
}
[Fact]
public void GetPlatform_Bytes_DefaultHeader_Unknown()
{
byte[] header = [];
Platform actual = header.GetPlatform();
Assert.Equal(Platform.Unknown, actual);
}
#endregion
#region IsGameCubeTitleType
[Theory]
[InlineData('\0', false)]
[InlineData('a', false)]
[InlineData('A', false)]
[InlineData('d', false)]
[InlineData('D', true)]
[InlineData('g', false)]
[InlineData('G', true)]
[InlineData('r', false)]
[InlineData('R', true)]
public void IsGameCubeTitleTypeTest(char c, bool expected)
{
bool actual = c.IsGameCubeTitleType();
Assert.Equal(expected, actual);
}
#endregion
}
}

View File

@@ -1,26 +0,0 @@
using SabreTools.Data.Models.OperaFS;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class OperaFSExtensionsTests
{
[Fact]
public void DirectoryDescriptor_EqualsExactly_Empty()
{
var dir1 = new DirectoryDescriptor();
var dir2 = new DirectoryDescriptor();
bool actual = dir1.EqualsExactly(dir2);
Assert.True(actual);
}
[Fact]
public void DirectoryRecord_EqualsExactly_Empty()
{
var dr1 = new DirectoryRecord();
var dr2 = new DirectoryRecord();
bool actual = dr1.EqualsExactly(dr2);
Assert.True(actual);
}
}
}

View File

@@ -1,21 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SabreTools.Data.Extensions\SabreTools.Data.Extensions.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,59 +0,0 @@
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class WiseScriptExtensionsTests
{
[Theory]
// Defined functions
[InlineData("f0", "Add Directory to PATH")]
[InlineData("f1", "Add to AUTOEXEC.BAT")]
[InlineData("f2", "Add to CONFIG.SYS")]
[InlineData("f3", "Add to SYSTEM.INI")]
[InlineData("f8", "Read INI Value")]
[InlineData("f9", "Get Registry Key Value")]
[InlineData("f10", "Register Font")]
[InlineData("f11", "Win32 System Directory")]
[InlineData("f12", "Check Configuration")]
[InlineData("f13", "Search for File")]
[InlineData("f15", "Read/Write Binary File")]
[InlineData("f16", "Set Variable")]
[InlineData("f17", "Get Environment Variable")]
[InlineData("f19", "Check if File/Dir Exists")]
[InlineData("f20", "Set File Attributes")]
[InlineData("f21", "Set Files/Buffers")]
[InlineData("f22", "Find File in Path")]
[InlineData("f23", "Check Disk Space")]
[InlineData("f25", "Insert Line Into Text File")]
[InlineData("f27", "Parse String")]
[InlineData("f28", "Exit Installation")]
[InlineData("f29", "Self-Register OCXs/DLLs")]
[InlineData("f30", "Install DirectX Components")]
[InlineData("f31", "Wizard Block")]
[InlineData("f33", "Read/Update Text File")]
[InlineData("f34", "Post to HTTP Server")]
[InlineData("f35", "Prompt for Filename")]
[InlineData("f36", "Start/Stop Service")]
[InlineData("f38", "Check HTTP Connection")]
// Undefined functions
[InlineData("f4", "UNDEFINED f4")]
[InlineData("f5", "UNDEFINED f5")]
[InlineData("f6", "UNDEFINED f6")]
[InlineData("f7", "UNDEFINED f7")]
[InlineData("f14", "UNDEFINED f14")]
[InlineData("f18", "UNDEFINED f18")]
[InlineData("f24", "UNDEFINED f24")]
[InlineData("f26", "UNDEFINED f26")]
[InlineData("f32", "UNDEFINED f32")]
[InlineData("f37", "UNDEFINED f37")]
// External DLL
[InlineData(null, null)]
[InlineData("f99", "UNDEFINED f99")]
[InlineData("func", "External: func")]
public void FromWiseFunctionIdTest(string? functionId, string? expected)
{
string? actual = functionId.FromWiseFunctionId();
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,20 +0,0 @@
using System.Linq;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class XZExtensionsTests
{
[Fact]
public void VariableLengthIntegerTest()
{
ulong expected = 123456789;
byte[] encoded = expected.EncodeVariableLength();
Assert.True(encoded.SequenceEqual<byte>([0x95, 0x9A, 0xEF, 0x3A]));
ulong actual = encoded.DecodeVariableLength(maxSize: 16, out int length);
Assert.Equal(expected, actual);
Assert.Equal(4, length);
}
}
}

View File

@@ -1,17 +0,0 @@
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class XboxExecutableExtensionsTests
{
[Theory]
[InlineData(0x00000000, "0000-000")]
[InlineData(0x4142000F, "AB-015")]
[InlineData(0x3132F000, "12-61440")]
public void ToFormattedXBETitleIDTest(uint value, string expected)
{
string actual = value.ToFormattedXBETitleID();
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,18 +0,0 @@
using SabreTools.Data.Models.ZArchive;
using Xunit;
namespace SabreTools.Data.Extensions.Test
{
public class ZArchiveExtensionsTests
{
[Fact]
public void GetName_Null()
{
var de = new DirectoryEntry();
NameTable nt = new NameTable();
string? expected = null;
string? actual = de.GetName(nt);
Assert.Equal(expected, actual);
}
}
}

View File

@@ -1,327 +0,0 @@
using System.Collections.Generic;
using SabreTools.Data.Models.Atari7800;
namespace SabreTools.Data.Extensions
{
public static class Atari7800CartExtensions
{
/// <summary>
/// Convert a <see cref="AudioDevice"/> value to string
/// </summary>
public static string FromAudioDevice(this AudioDevice audio)
{
string[] devices = new string[4];
byte pokey = (byte)((byte)audio & 0x07);
devices[0] = pokey switch
{
0 => "POKEY - none",
1 => "POKEY - @440",
2 => "POKEY - @450",
3 => "POKEY - @450+@440",
4 => "POKEY - @800",
5 => "POKEY - @4000",
_ => $"Unknown {pokey}",
};
byte ym2151 = (byte)(((byte)audio >> 3) & 0x01);
devices[1] = ym2151 switch
{
0 => "No YM2151 @460",
1 => "YM2151 @460",
_ => $"Unknown {ym2151}",
};
byte covox = (byte)(((byte)audio >> 4) & 0x01);
devices[2] = covox switch
{
0 => "No COVOX @430",
1 => "COVOX @430",
_ => $"Unknown {covox}",
};
byte adpcm = (byte)(((byte)audio >> 5) & 0x01);
devices[3] = adpcm switch
{
0 => "No ADPCM Audio Stream @420",
1 => "ADPCM Audio Stream @420",
_ => $"Unknown {adpcm}",
};
return string.Join(", ", [.. devices]);
}
/// <summary>
/// Convert a <see cref="CartType"/> value to string
/// </summary>
public static string FromCartType(this CartType type)
{
List<string> types = [];
#if NET20 || NET35
if ((type & CartType.PokeyAt4000) != 0)
#else
if (type.HasFlag(CartType.PokeyAt4000))
#endif
types.Add("pokey at $4000");
#if NET20 || NET35
if ((type & CartType.SupergameBankSwitched) != 0)
#else
if (type.HasFlag(CartType.SupergameBankSwitched))
#endif
types.Add("supergame bank switched");
#if NET20 || NET35
if ((type & CartType.SupergameRamAt4000) != 0)
#else
if (type.HasFlag(CartType.SupergameRamAt4000))
#endif
types.Add("supergame ram at $4000");
#if NET20 || NET35
if ((type & CartType.RomAt4000) != 0)
#else
if (type.HasFlag(CartType.RomAt4000))
#endif
types.Add("rom at $4000");
#if NET20 || NET35
if ((type & CartType.Bank6At4000) != 0)
#else
if (type.HasFlag(CartType.Bank6At4000))
#endif
types.Add("bank 6 at $4000");
#if NET20 || NET35
if ((type & CartType.BankedRam) != 0)
#else
if (type.HasFlag(CartType.BankedRam))
#endif
types.Add("banked ram");
#if NET20 || NET35
if ((type & CartType.PokeyAt450) != 0)
#else
if (type.HasFlag(CartType.PokeyAt450))
#endif
types.Add("pokey at $450");
#if NET20 || NET35
if ((type & CartType.MirrorRamAt4000) != 0)
#else
if (type.HasFlag(CartType.MirrorRamAt4000))
#endif
types.Add("mirror ram at $4000");
#if NET20 || NET35
if ((type & CartType.ActivisionBanking) != 0)
#else
if (type.HasFlag(CartType.ActivisionBanking))
#endif
types.Add("activision banking");
#if NET20 || NET35
if ((type & CartType.AbsoluteBanking) != 0)
#else
if (type.HasFlag(CartType.AbsoluteBanking))
#endif
types.Add("absolute banking");
#if NET20 || NET35
if ((type & CartType.PokeyAt440) != 0)
#else
if (type.HasFlag(CartType.PokeyAt440))
#endif
types.Add("pokey at $440");
#if NET20 || NET35
if ((type & CartType.Ym2151At460461) != 0)
#else
if (type.HasFlag(CartType.Ym2151At460461))
#endif
types.Add("ym2151 at $460/$461");
#if NET20 || NET35
if ((type & CartType.Souper) != 0)
#else
if (type.HasFlag(CartType.Souper))
#endif
types.Add("souper");
#if NET20 || NET35
if ((type & CartType.Banksets) != 0)
#else
if (type.HasFlag(CartType.Banksets))
#endif
types.Add("banksets");
#if NET20 || NET35
if ((type & CartType.HaltBankedRam) != 0)
#else
if (type.HasFlag(CartType.HaltBankedRam))
#endif
types.Add("halt banked ram");
#if NET20 || NET35
if ((type & CartType.PokeyAt800) != 0)
#else
if (type.HasFlag(CartType.PokeyAt800))
#endif
types.Add("pokey@800");
// If no flags are set
if (types.Count == 0)
types.Add("N/A");
return string.Join(", ", [.. types]);
}
/// <summary>
/// Convert a <see cref="ControllerType"/> value to string
/// </summary>
public static string FromControllerType(this ControllerType type)
{
return type switch
{
ControllerType.None => "none",
ControllerType.Joystick => "7800 joystick",
ControllerType.Lightgun => "lightgun",
ControllerType.Paddle => "paddle",
ControllerType.Trakball => "trakball",
ControllerType.VcsJoystick => "2600 joystick",
ControllerType.VcsDriving => "2600 driving",
ControllerType.VcsKeypad => "2600 keypad",
ControllerType.STMouse => "ST mouse",
ControllerType.AmigaMouse => "Amiga mouse",
ControllerType.AtariVoxSaveKey => "AtariVox/SaveKey",
ControllerType.SNES2Atari => "SNES2Atari",
ControllerType.Mega7800 => "Mega7800",
_ => $"Unknown {(byte)type}",
};
}
/// <summary>
/// Convert a <see cref="Interrupt"/> value to string
/// </summary>
public static string FromInterrupt(this Interrupt interrupt)
{
return interrupt switch
{
Interrupt.None => "None",
Interrupt.Pokey1 => "POKEY 1 (@450 | @800 | @4000)",
Interrupt.Pokey2 => "POKEY 2 (@440)",
Interrupt.YM2151 => "YM2151",
_ => $"Unknown {(byte)interrupt}",
};
}
/// <summary>
/// Convert a <see cref="Mapper"/> value to string
/// </summary>
public static string FromMapper(this Mapper mapper)
{
return mapper switch
{
Mapper.Linear => "Linear",
Mapper.SuperGame => "SuperGame",
Mapper.Activision => "Activision",
Mapper.Absolute => "Absolute",
Mapper.Souper => "Souper",
_ => $"Unknown {(byte)mapper}",
};
}
/// <summary>
/// Convert a <see cref="MapperOptions"/> value to string
/// </summary>
public static string FromMapperOptions(this MapperOptions options)
{
string[] romOptions = new string[2];
byte option4000 = (byte)((byte)options & 0x07);
romOptions[0] = option4000 switch
{
0 => "Option at @4000 - none",
1 => "Option at @4000 - 16K RAM",
2 => "Option at @4000 - 8K EXRAM/A8",
3 => "Option at @4000 - 32K EXRAM/M2",
4 => "Option at @4000 - EXROM",
5 => "Option at @4000 - EXFIX",
6 => "Option at @4000 - 32k EXRAM/X2",
_ => $"Unknown {option4000}",
};
byte romType = (byte)(((byte)options >> 7) & 0x01);
romOptions[1] = romType switch
{
0 => "Standard ROM",
1 => "Bankset ROM",
_ => $"Unknown {romType}",
};
return string.Join(", ", [.. romOptions]);
}
/// <summary>
/// Convert a <see cref="SaveDevice"/> value to string
/// </summary>
public static string FromSaveDevice(this SaveDevice device)
{
return device switch
{
SaveDevice.None => "None",
SaveDevice.HSC => "HSC",
SaveDevice.SaveKeyAtariVox => "SaveKey/AtariVox",
_ => $"Unknown {(byte)device}",
};
}
/// <summary>
/// Convert a <see cref="SlotPassthroughDevice"/> value to string
/// </summary>
public static string FromSlotPassthroughDevice(this SlotPassthroughDevice device)
{
return device switch
{
SlotPassthroughDevice.None => "None",
SlotPassthroughDevice.XM => "XM",
_ => $"Unknown {(byte)device}",
};
}
/// <summary>
/// Convert a <see cref="TVType"/> value to string
/// </summary>
public static string FromTVType(this TVType type)
{
string[] types = new string[3];
byte standard = (byte)((byte)type & 0x01);
types[0] = standard switch
{
0 => "NTSC",
1 => "PAL",
_ => $"Unknown {standard}",
};
byte connection = (byte)(((byte)type >> 1) & 0x01);
types[1] = connection switch
{
0 => "Component",
1 => "Composite",
_ => $"Unknown {standard}",
};
byte region = (byte)(((byte)type >> 2) & 0x01);
types[2] = region switch
{
0 => "Single-region",
1 => "Multi-region",
_ => $"Unknown {standard}",
};
return string.Join(", ", [.. types]);
}
}
}

View File

@@ -1,21 +0,0 @@
using SabreTools.Data.Models.AtariLynx;
namespace SabreTools.Data.Extensions
{
public static class AtariLynxCartExtensions
{
/// <summary>
/// Convert a <see cref="Rotation"/> value to string
/// </summary>
public static string FromRotation(this Rotation rotation)
{
return rotation switch
{
Rotation.NoRotation => "No rotation (horizontal, buttons right)",
Rotation.RotateLeft => "Rotate left (vertical, buttons down)",
Rotation.RotateRight => "Rotate right (vertical, buttons up)",
_ => $"Unknown {(byte)rotation}",
};
}
}
}

View File

@@ -1,33 +0,0 @@
using SabreTools.Data.Models.BSP;
namespace SabreTools.Data.Extensions
{
public static class BSPExtensions
{
/// <summary>
/// Convert a <see cref="BspLumpType"/> value to string
/// </summary>
public static string FromBspLumpType(this BspLumpType type)
{
return type switch
{
BspLumpType.LUMP_ENTITIES => " - LUMP_ENTITIES",
BspLumpType.LUMP_PLANES => " - LUMP_PLANES",
BspLumpType.LUMP_TEXTURES => " - LUMP_TEXTURES",
BspLumpType.LUMP_VERTICES => " - LUMP_VERTICES",
BspLumpType.LUMP_VISIBILITY => " - LUMP_VISIBILITY",
BspLumpType.LUMP_NODES => " - LUMP_NODES",
BspLumpType.LUMP_TEXINFO => " - LUMP_TEXINFO",
BspLumpType.LUMP_FACES => " - LUMP_FACES",
BspLumpType.LUMP_LIGHTING => " - LUMP_LIGHTING",
BspLumpType.LUMP_CLIPNODES => " - LUMP_CLIPNODES",
BspLumpType.LUMP_LEAVES => " - LUMP_LEAVES",
BspLumpType.LUMP_MARKSURFACES => " - LUMP_MARKSURFACES",
BspLumpType.LUMP_EDGES => " - LUMP_EDGES",
BspLumpType.LUMP_SURFEDGES => " - LUMP_SURFEDGES",
BspLumpType.LUMP_MODELS => " - LUMP_MODELS",
_ => string.Empty,
};
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,241 +0,0 @@
using SabreTools.Data.Models.NES;
namespace SabreTools.Data.Extensions
{
public static class NESCartExtensions
{
/// <summary>
/// Convert a <see cref="ConsoleType"/> value to string
/// </summary>
public static string FromConsoleType(this ConsoleType type)
{
return type switch
{
ConsoleType.StandardSystem => "Nintendo Entertainment System/Family Computer",
ConsoleType.VSUnisystem => "VS Unisystem",
ConsoleType.PlayChoice10 => "PlayChoice-10 (8 KB of Hint Screen data stored after CHR data)",
ConsoleType.ExtendedConsoleType => "Extended Console Type",
_ => $"Unknown {(byte)type}",
};
}
/// <summary>
/// Convert a <see cref="CPUPPUTiming"/> value to string
/// </summary>
public static string FromCPUPPUTiming(this CPUPPUTiming timing)
{
return timing switch
{
CPUPPUTiming.RP2C02 => "RP2C02 (NTSC NES)",
CPUPPUTiming.RP2C07 => "RP2C07 (Licensed PAL NES)",
CPUPPUTiming.MultipleRegion => "Multiple-region",
CPUPPUTiming.UA6538 => "UA6538 (Dendy)",
_ => $"Unknown {(byte)timing}",
};
}
/// <summary>
/// Convert a <see cref="DefaultExpansionDevice"/> value to string
/// </summary>
public static string FromDefaultExpansionDevice(this DefaultExpansionDevice device)
{
return device switch
{
DefaultExpansionDevice.Unspecified => "Unspecified",
DefaultExpansionDevice.StandardControllers => "Standard NES/Famicom controllers",
DefaultExpansionDevice.NESFourScore => "NES Four Score/Satellite with two additional standard controllers",
DefaultExpansionDevice.FamicomFourPlayersAdapter => "Famicom Four Players Adapter with two additional standard controllers using the 'simple' protocol",
DefaultExpansionDevice.VsSystem4016 => "Vs. System (1P via $4016)",
DefaultExpansionDevice.VsSystem4017 => "Vs. System (1P via $4017)",
DefaultExpansionDevice.Reserved06 => "Reserved (0x06)",
DefaultExpansionDevice.VsZapper => "Vs. Zapper",
DefaultExpansionDevice.Zapper4017 => "Zapper ($4017)",
DefaultExpansionDevice.TwoZappers => "Two Zappers",
DefaultExpansionDevice.BandaiHyperShotLightgun => "Bandai Hyper Shot Lightgun",
DefaultExpansionDevice.PowerPadSideA => "Power Pad Side A",
DefaultExpansionDevice.PowerPadSideB => "Power Pad Side B",
DefaultExpansionDevice.FamilyTrainerSideA => "Family Trainer Side A",
DefaultExpansionDevice.FamilyTrainerSideB => "Family Trainer Side B",
DefaultExpansionDevice.ArkanoidVausControllerNES => "Arkanoid Vaus Controller (NES)",
DefaultExpansionDevice.ArkanoidVausControllerFamicom => "Arkanoid Vaus Controller (Famicom)",
DefaultExpansionDevice.TwoVausControllersPlusFamicomDataRecorder => "Two Vaus Controllers plus Famicom Data Recorder",
DefaultExpansionDevice.KonamiHyperShotController => "Konami Hyper Shot Controller",
DefaultExpansionDevice.CoconutsPachinkoController => "Coconuts Pachinko Controller",
DefaultExpansionDevice.ExcitingBoxingPunchingBag => "Exciting Boxing Punching Bag (Blowup Doll)",
DefaultExpansionDevice.JissenMahjongController => "Jissen Mahjong Controller",
DefaultExpansionDevice.YonezawaPartyTap => "米澤 (Yonezawa) Party Tap",
DefaultExpansionDevice.OekaKidsTablet => "Oeka Kids Tablet",
DefaultExpansionDevice.SunsoftBarcodeBattler => "Sunsoft Barcode Battler",
DefaultExpansionDevice.MiraclePianoKeyboard => "Miracle Piano Keyboard",
DefaultExpansionDevice.PokkunMoguraaTapTapMat => "Pokkun Moguraa Tap-tap Mat (Whack-a-Mole Mat and Mallet)",
DefaultExpansionDevice.TopRider => "Top Rider (Inflatable Bicycle)",
DefaultExpansionDevice.DoubleFisted => "Double-Fisted (Requires or allows use of two controllers by one player)",
DefaultExpansionDevice.Famicom3DSystem => "Famicom 3D System",
DefaultExpansionDevice.DoremikkoKeyboard => "Doremikko Keyboard",
DefaultExpansionDevice.ROBGyromite => "R.O.B. Gyromite",
DefaultExpansionDevice.FamicomDataRecorder => "Famicom Data Recorder ('silent' keyboard)",
DefaultExpansionDevice.ASCIITurboFile => "ASCII Turbo File",
DefaultExpansionDevice.IGSStorageBattleBox => "IGS Storage Battle Box",
DefaultExpansionDevice.FamilyBASICKeyboardPlusFamicomDataRecorder => "Family BASIC Keyboard plus Famicom Data Recorder",
DefaultExpansionDevice.DongdaPECKeyboard => "东达 (Dōngdá) PEC Keyboard",
DefaultExpansionDevice.BitCorpBit79Keyboard => "普澤 (Pǔzé, a.k.a. Bit Corp.) Bit-79 Keyboard",
DefaultExpansionDevice.SuborKeyboard => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard",
DefaultExpansionDevice.SuborKeyboardPlusMacroWinnersMouse => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Macro Winners Mouse",
DefaultExpansionDevice.SuborKeyboardPlusSuborMouse4016 => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Subor Mouse via $4016",
DefaultExpansionDevice.SNESMouse4016 => "SNES Mouse ($4016)",
DefaultExpansionDevice.Multicart => "Multicart",
DefaultExpansionDevice.TwoSNESControllers => "Two SNES controllers replacing the two standard NES controllers",
DefaultExpansionDevice.RacerMateBicycle => "RacerMate Bicycle",
DefaultExpansionDevice.UForce => "U-Force",
DefaultExpansionDevice.ROBStackUp => "R.O.B. Stack-Up",
DefaultExpansionDevice.CityPatrolmanLightgun => "City Patrolman Lightgun",
DefaultExpansionDevice.SharpC1CassetteInterface => "Sharp C1 Cassette Interface",
DefaultExpansionDevice.StandardControllerWithSwappedInputs => "Standard Controller with swapped Left-Right/Up-Down/B-A",
DefaultExpansionDevice.ExcaliburSudokuPad => "Excalibur Sudoku Pad",
DefaultExpansionDevice.ABLPinball => "ABL Pinball",
DefaultExpansionDevice.GoldenNuggetCasinoExtraButtons => "Golden Nugget Casino extra buttons",
DefaultExpansionDevice.KedaKeyboard => "科达 (Kēdá) Keyboard",
DefaultExpansionDevice.SuborKeyboardPlusSuborMouse4017 => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Subor Mouse via $4017",
DefaultExpansionDevice.PortTestController => "Port test controller",
DefaultExpansionDevice.BandaiMultiGamePlayerGamepad => "Bandai Multi Game Player Gamepad buttons",
DefaultExpansionDevice.VenomTVDanceMat => "Venom TV Dance Mat",
DefaultExpansionDevice.LGTVRemoteControl => "LG TV Remote Control",
DefaultExpansionDevice.FamicomNetworkController => "Famicom Network Controller",
DefaultExpansionDevice.KingFishingController => "King Fishing Controller",
DefaultExpansionDevice.CroakyKaraokeController => "Croaky Karaoke Controller",
DefaultExpansionDevice.KingwonKeyboard => "科王 (Kēwáng, a.k.a. Kingwon) Keyboard",
DefaultExpansionDevice.ZechengKeyboard => "泽诚 (Zéchéng) Keyboard",
DefaultExpansionDevice.SuborKeyboardPlusL90RotatedPS2Mouse4017 => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus L90-rotated PS/2 mouse in $4017",
DefaultExpansionDevice.PS2KeyboardInUM6578PS2PortPS2Mouse4017 => "PS/2 Keyboard in UM6578 PS/2 port, PS/2 Mouse via $4017",
DefaultExpansionDevice.PS2MouseInUM6578PS2Port => "PS/2 Mouse in UM6578 PS/2 port",
DefaultExpansionDevice.YuxingMouse4016 => "裕兴 (Yùxìng) Mouse via $4016",
DefaultExpansionDevice.SuborKeyboardPlusYuxingMouse4016 => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus 裕兴 (Yùxìng) Mouse mouse in $4016",
DefaultExpansionDevice.GigggleTVPump => "Gigggle TV Pump",
DefaultExpansionDevice.BBKKeyboardPlusR90RotatedPS2Mouse4017 => "步步高 (Bùbùgāo, a.k.a. BBK) Keyboard plus R90-rotated PS/2 mouse in $4017",
DefaultExpansionDevice.MagicalCooking => "Magical Cooking",
DefaultExpansionDevice.SNESMouse4017 => "SNES Mouse ($4017)",
DefaultExpansionDevice.Zapper4016 => "Zapper ($4016)",
DefaultExpansionDevice.ArkanoidVausControllerPrototype => "Arkanoid Vaus Controller (Prototype)",
DefaultExpansionDevice.TVMahjongGameController => "TV 麻雀 Game (TV Mahjong Game) Controller",
DefaultExpansionDevice.MahjongGekitouDensetsuController => "麻雀激闘伝説 (Mahjong Gekitou Densetsu) Controller",
DefaultExpansionDevice.SuborKeyboardPlusXInvertedPS2Mouse4017 => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus X-inverted PS/2 mouse in $4017",
DefaultExpansionDevice.IBMPCXTKeyboard => "IBM PC/XT Keyboard",
DefaultExpansionDevice.SuborKeyboardPlusMegaBookMouse => "小霸王 (Xiǎobàwáng, a.k.a. Subor) Keyboard plus Mega Book Mouse",
_ => $"Unknown {(byte)device}",
};
}
/// <summary>
/// Convert a <see cref="ExtendedConsoleType"/> value to string
/// </summary>
public static string FromExtendedConsoleType(this ExtendedConsoleType type)
{
return type switch
{
ExtendedConsoleType.RegularSystem => "Regular NES/Famicom/Dendy",
ExtendedConsoleType.NintendoVsSystem => "Nintendo Vs. System",
ExtendedConsoleType.Playchoice10 => "Playchoice 10",
ExtendedConsoleType.RegularFamicloneDecimalMode => "Regular Famiclone, but with CPU that supports Decimal Mode",
ExtendedConsoleType.RegularNESWithEPSM => "Regular NES/Famicom with EPSM module or plug-through cartridge",
ExtendedConsoleType.VRTechnologyVT01 => "V.R. Technology VT01 with red/cyan STN palette",
ExtendedConsoleType.VRTechnologyVT02 => "V.R. Technology VT02",
ExtendedConsoleType.VRTechnologyVT03 => "V.R. Technology VT03",
ExtendedConsoleType.VRTechnologyVT09 => "V.R. Technology VT09",
ExtendedConsoleType.VRTechnologyVT32 => "V.R. Technology VT32",
ExtendedConsoleType.VRTechnologyVT369 => "V.R. Technology VT369",
ExtendedConsoleType.UMCUM6578 => "UMC UM6578",
ExtendedConsoleType.FamicomNetworkSystem => "Famicom Network System",
ExtendedConsoleType.ReservedD => "Reserved (0x0D)",
ExtendedConsoleType.ReservedE => "Reserved (0x0E)",
ExtendedConsoleType.ReservedF => "Reserved (0x0F)",
_ => $"Unknown {(byte)type}",
};
}
/// <summary>
/// Convert a <see cref="NametableArrangement"/> value to string
/// </summary>
public static string FromNametableArrangement(this NametableArrangement arrangement)
{
return arrangement switch
{
NametableArrangement.Vertical => "Vertical",
NametableArrangement.Horizontal => "Horizontal",
_ => $"Unknown {(byte)arrangement}",
};
}
/// <summary>
/// Convert a <see cref="TVSystem"/> value to string
/// </summary>
public static string FromTVSystem(this TVSystem system)
{
return system switch
{
TVSystem.NTSC => "NTSC",
TVSystem.PAL => "PAL",
_ => $"Unknown {(byte)system}",
};
}
/// <summary>
/// Convert a <see cref="TVSystemExtended"/> value to string
/// </summary>
public static string FromTVSystemExtended(this TVSystemExtended system)
{
return system switch
{
TVSystemExtended.NTSC => "NTSC",
TVSystemExtended.DualCompatible1 => "Dual-compatible (0x01)",
TVSystemExtended.PAL => "PAL",
TVSystemExtended.DualCompatible3 => "Dual-compatible (0x03)",
_ => $"Unknown {(byte)system}",
};
}
/// <summary>
/// Convert a <see cref="VsHardwareType"/> value to string
/// </summary>
public static string FromVsHardwareType(this VsHardwareType type)
{
return type switch
{
VsHardwareType.VsUnisystem => "Vs. Unisystem (normal)",
VsHardwareType.VsUnisystemRBIBaseballProtection => "Vs. Unisystem (RBI Baseball protection)",
VsHardwareType.VsUnisystemTKOBoxingProtection => "Vs. Unisystem (TKO Boxing protection)",
VsHardwareType.VsUnisystemSuperXeviousProtection => "Vs. Unisystem (Super Xevious protection)",
VsHardwareType.VsUnisystemVsIceClimberJapanProtection => "Vs. Unisystem (Vs. Ice Climber Japan protection)",
VsHardwareType.VsDualSystem => "Vs. Dual System (normal)",
VsHardwareType.VsDualSystemRaidOnBungelingBayProtection => "Vs. Dual System (Raid on Bungeling Bay protection)",
_ => $"Unknown {(byte)type}",
};
}
/// <summary>
/// Convert a <see cref="VsSystemType"/> value to string
/// </summary>
public static string FromVsSystemType(this VsSystemType type)
{
return type switch
{
VsSystemType.AnyRP2C03RC2C03Variant => "Any RP2C03/RC2C03 variant",
VsSystemType.Reserved1 => "Reserved (0x01)",
VsSystemType.RP2C040001 => "RP2C04-0001",
VsSystemType.RP2C040002 => "RP2C04-0002",
VsSystemType.RP2C040003 => "RP2C04-0003",
VsSystemType.RP2C040004 => "RP2C04-0004",
VsSystemType.Reserved6 => "Reserved (0x06)",
VsSystemType.Reserved7 => "Reserved (0x07)",
VsSystemType.RC2C0501 => "RC2C05-01 (signature unknown)",
VsSystemType.RC2C0502 => "RC2C05-02 ($2002 AND $3F =$3D)",
VsSystemType.RC2C0503 => "RC2C05-03 ($2002 AND $1F =$1C)",
VsSystemType.RC2C0504 => "RC2C05-04 ($2002 AND $1F =$1B)",
VsSystemType.ReservedC => "Reserved (0x0C)",
VsSystemType.ReservedD => "Reserved (0x0D)",
VsSystemType.ReservedE => "Reserved (0x0E)",
VsSystemType.ReservedF => "Reserved (0x0F)",
_ => $"Unknown {(byte)type}",
};
}
}
}

View File

@@ -1,77 +0,0 @@
using SabreTools.Data.Models.NintendoDisc;
using SabreTools.Numerics.Extensions;
namespace SabreTools.Data.Extensions
{
public static class NintendoDiscExtensions
{
/// <summary>
/// Get the platform associated with a disc header
/// </summary>
public static Platform GetPlatform(this DiscHeader header)
{
if (header.WiiMagic == Constants.WiiMagicWord)
return Platform.Wii;
else if (header.GCMagic == Constants.GCMagicWord)
return Platform.GameCube;
else if (header.GameId.Length >= 1 && IsGameCubeTitleType(header.GameId[0]))
return Platform.GameCube;
else
return Platform.Unknown;
}
/// <summary>
/// Get the platform associated with a disc header
/// </summary>
public static Platform GetPlatform(this byte[] header)
{
// Check for Wii magic bytes
if (header.Length >= 0x1C)
{
int offset = 0x18;
uint magic = header.ReadUInt32BigEndian(ref offset);
if (magic == Constants.WiiMagicWord)
return Platform.Wii;
}
// Check for GameCube magic bytes
if (header.Length >= 0x20)
{
int offset = 0x1C;
uint magic = header.ReadUInt32BigEndian(ref offset);
if (magic == Constants.GCMagicWord)
return Platform.GameCube;
}
// Check for a valid game ID
if (header.Length >= 4)
{
for (int i = 0; i < 4; i++)
{
byte c = header[i];
if (!((c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9')))
return Platform.Unknown;
}
return Platform.GameCube;
}
return Platform.Unknown;
}
/// <summary>
/// Returns true if the GameId first character is a known GameCube title type prefix.
/// Used as a fallback when the GC magic word is absent from the disc image.
/// </summary>
public static bool IsGameCubeTitleType(this char c)
=> c == 'G' || c == 'D' || c == 'R';
/// <summary>
/// Returns true if the byte is a known Nintendo disc title type code
/// (first byte of the 6-char GameId, e.g. 'G'=GameCube, 'R'=GameCube,
/// 'D'=GameCube demo, 'S'=Wii, 'F'=Wii channel)
/// </summary>
public static bool IsNintendoDiscTitleType(this byte b)
=> b == 'G' || b == 'D' || b == 'R' || b == 'S' || b == 'F';
}
}

View File

@@ -1,78 +0,0 @@
using SabreTools.Data.Models.OperaFS;
using SabreTools.Matching;
namespace SabreTools.Data.Extensions
{
public static class OperaFSExtensions
{
/// <summary>
/// Compare two DirectoryDescriptor objects
/// </summary>
/// <param name="dir1">The provided DirectoryDescriptor</param>
/// <param name="dir2">The DirectoryDescriptor to compare against</param>
/// <returns>True if all fields are equal, otherwise false</returns>
public static bool EqualsExactly(this DirectoryDescriptor dir1, DirectoryDescriptor dir2)
{
if (dir1.NextBlock != dir2.NextBlock)
return false;
if (dir1.PreviousBlock != dir2.PreviousBlock)
return false;
if (dir1.Flags != dir2.Flags)
return false;
if (dir1.FirstFreeByte != dir2.FirstFreeByte)
return false;
if (dir1.FirstEntryOffset != dir2.FirstEntryOffset)
return false;
if (dir1.DirectoryRecords.Length != dir2.DirectoryRecords.Length)
return false;
for (int i = 0; i < dir1.DirectoryRecords.Length; i++)
{
if (!dir1.DirectoryRecords[i].EqualsExactly(dir2.DirectoryRecords[i]))
return false;
}
return true;
}
/// <summary>
/// Compare two DirectoryRecord objects
/// </summary>
/// <param name="dir1">The provided DirectoryRecord</param>
/// <param name="dir2">The DirectoryRecord to compare against</param>
/// <returns>True if all fields are equal, otherwise false</returns>
public static bool EqualsExactly(this DirectoryRecord dr1, DirectoryRecord dr2)
{
if ((byte)dr1.DirectoryRecordFlags != (byte)dr2.DirectoryRecordFlags)
return false;
if (!dr1.UniqueIdentifier.EqualsExactly(dr2.UniqueIdentifier))
return false;
if (!dr1.Type.EqualsExactly(dr2.Type))
return false;
if (dr1.BlockSize != dr2.BlockSize)
return false;
if (dr1.ByteCount != dr2.ByteCount)
return false;
if (dr1.BlockCount != dr2.BlockCount)
return false;
if (dr1.Burst != dr2.Burst)
return false;
if (dr1.Gap != dr2.Gap)
return false;
if (!dr1.Filename.EqualsExactly(dr2.Filename))
return false;
if (dr1.LastAvatarIndex != dr2.LastAvatarIndex)
return false;
if (dr1.AvatarList.Length != dr2.AvatarList.Length)
return false;
for (int i = 0; i < dr1.AvatarList.Length; i++)
{
if (dr1.AvatarList[i] != dr2.AvatarList[i])
return false;
}
return true;
}
}
}

View File

@@ -1,98 +0,0 @@
using System;
using SabreTools.Data.Models.COFF;
namespace SabreTools.Data.Extensions
{
// TODO: Add tests
public static class PortableExecutableExtensions
{
/// <summary>
/// Convert a relative virtual address to a physical one
/// </summary>
/// <param name="rva">Relative virtual address to convert</param>
/// <param name="sections">Array of sections to check against</param>
/// <returns>Physical address, 0 on error</returns>
public static uint ConvertVirtualAddress(this uint rva, SectionHeader[] sections)
{
// If we have an invalid section table, we can't do anything
if (sections.Length == 0)
return 0;
// If the RVA is 0, we just return 0 because it's invalid
if (rva == 0)
return 0;
// If the RVA matches a section start exactly, use that
var matchingSection = Array.Find(sections, s => s.VirtualAddress == rva);
if (matchingSection is not null)
return rva - matchingSection.VirtualAddress + matchingSection.PointerToRawData;
// Loop through all of the sections
uint maxVirtualAddress = 0, maxRawPointer = 0;
for (int i = 0; i < sections.Length; i++)
{
// If the section "starts" at 0, just skip it
var section = sections[i];
if (section.PointerToRawData == 0)
continue;
// If the virtual address is greater than the RVA
if (rva < section.VirtualAddress)
continue;
// Cache the maximum matching section data, in case of a miss
if (rva >= section.VirtualAddress)
{
maxVirtualAddress = section.VirtualAddress;
maxRawPointer = section.PointerToRawData;
}
// Attempt to derive the physical address from the current section
if (section.VirtualSize != 0 && rva <= section.VirtualAddress + section.VirtualSize)
return rva - section.VirtualAddress + section.PointerToRawData;
else if (section.SizeOfRawData != 0 && rva <= section.VirtualAddress + section.SizeOfRawData)
return rva - section.VirtualAddress + section.PointerToRawData;
}
return maxRawPointer != 0 ? rva - maxVirtualAddress + maxRawPointer : 0;
}
/// <summary>
/// Find the section a revlative virtual address lives in
/// </summary>
/// <param name="rva">Relative virtual address to convert</param>
/// <param name="sections">Array of sections to check against</param>
/// <returns>Section index, null on error</returns>
public static int ContainingSectionIndex(this uint rva, SectionHeader[] sections)
{
// If we have an invalid section table, we can't do anything
if (sections is null || sections.Length == 0)
return -1;
// If the RVA is 0, we just return -1 because it's invalid
if (rva == 0)
return -1;
// Loop through all of the sections
for (int i = 0; i < sections.Length; i++)
{
// If the section "starts" at 0, just skip it
var section = sections[i];
if (section.PointerToRawData == 0)
continue;
// If the virtual address is greater than the RVA
if (rva < section.VirtualAddress)
continue;
// Attempt to derive the physical address from the current section
if (section.VirtualSize != 0 && rva <= section.VirtualAddress + section.VirtualSize)
return i;
else if (section.SizeOfRawData != 0 && rva <= section.VirtualAddress + section.SizeOfRawData)
return i;
}
return -1;
}
}
}

View File

@@ -1,24 +0,0 @@
# SabreTools.Data.Extensions
This library contains extension methods related to models. These extensions are used in both reader and wrapper code.
## Provided Extension Classes
| Class Name | Applicable Namespace |
| --- | --- |
| `Atari7800CartExtensions` | `SabreTools.Data.Models.Atari7800` |
| `AtariLynxCartExtensions` | `SabreTools.Data.Models.AtariLynx` |
| `BSPExtensions` | `SabreTools.Data.Models.BSP` |
| `CDROMExtensions` | `SabreTools.Data.Models.CDROM` |
| `CFBExtensions` | `SabreTools.Data.Models.CFB` |
| `InstallShieldCabinetExtensions` | `SabreTools.Data.Models.InstallShieldCabinet` |
| `ISO9660Extensions` | `SabreTools.Data.Models.ISO9660` |
| `MetadataExtensions` | `SabreTools.Data.Models.Metadata` |
| `NESCartExtensions` | `SabreTools.Data.Models.NES` |
| `NewExecutableExtensions` | `SabreTools.Data.Models.NewExecutable` |
| `PortableExecutableExtensions` | `SabreTools.Data.Models.COFF` |
| `TypeLengthValueExtensions` | `SabreTools.Data.Models.ASN1` and `SabreTools.ObjectIdentifier` |
| `VBSPExtensions` | `SabreTools.Data.Models.BSP` |
| `WiseScriptExtensions` | `SabreTools.Data.Models.WiseInstaller` |
| `XboxExecutableExtensions` | `SabreTools.Data.Models.XboxExecutable` |
| `XZExtensions` | `SabreTools.Data.Models.XZ` |

View File

@@ -1,43 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Assembly Properties -->
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;net10.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<IncludeSymbols>true</IncludeSymbols>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>3.2.0</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
<Description>Extension methods related to models</Description>
<Copyright>Copyright (c) Matt Nadareski 2019-2026</Copyright>
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Serialization</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>models extensions conversion</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NetLegacySupport.Numerics" Version="1.0.1" Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))" />
<PackageReference Include="SabreTools.IO" Version="2.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SabreTools.Data.Models\SabreTools.Data.Models.csproj" />
<ProjectReference Include="..\SabreTools.ObjectIdentifier\SabreTools.ObjectIdentifier.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,82 +0,0 @@
using SabreTools.Data.Models.BSP;
namespace SabreTools.Data.Extensions
{
public static class VBSPExtensions
{
/// <summary>
/// Convert a <see cref="VbspLumpType"/> value to string
/// </summary>
public static string FromVbspLumpType(this VbspLumpType type)
{
return type switch
{
VbspLumpType.LUMP_ENTITIES => " - LUMP_ENTITIES",
VbspLumpType.LUMP_PLANES => " - LUMP_PLANES",
VbspLumpType.LUMP_TEXTURES => " - LUMP_TEXDATA",
VbspLumpType.LUMP_VERTICES => " - LUMP_VERTEXES",
VbspLumpType.LUMP_VISIBILITY => " - LUMP_VISIBILITY",
VbspLumpType.LUMP_NODES => " - LUMP_NODES",
VbspLumpType.LUMP_TEXINFO => " - LUMP_TEXINFO",
VbspLumpType.LUMP_FACES => " - LUMP_FACES",
VbspLumpType.LUMP_LIGHTING => " - LUMP_LIGHTING",
VbspLumpType.LUMP_CLIPNODES => " - LUMP_OCCLUSION",
VbspLumpType.LUMP_LEAVES => " - LUMP_LEAVES",
VbspLumpType.LUMP_MARKSURFACES => " - LUMP_FACEIDS",
VbspLumpType.LUMP_EDGES => " - LUMP_EDGES",
VbspLumpType.LUMP_SURFEDGES => " - LUMP_SURFEDGES",
VbspLumpType.LUMP_MODELS => " - LUMP_MODELS",
VbspLumpType.LUMP_WORLDLIGHTS => " - LUMP_WORLDLIGHTS",
VbspLumpType.LUMP_LEAFFACES => " - LUMP_LEAFFACES",
VbspLumpType.LUMP_LEAFBRUSHES => " - LUMP_LEAFBRUSHES",
VbspLumpType.LUMP_BRUSHES => " - LUMP_BRUSHES",
VbspLumpType.LUMP_BRUSHSIDES => " - LUMP_BRUSHSIDES",
VbspLumpType.LUMP_AREAS => " - LUMP_AREAS",
VbspLumpType.LUMP_AREAPORTALS => " - LUMP_AREAPORTALS",
VbspLumpType.LUMP_PORTALS => " - LUMP_PORTALS / LUMP_UNUSED0 / LUMP_PROPCOLLISION",
VbspLumpType.LUMP_CLUSTERS => " - LUMP_CLUSTERS / LUMP_UNUSED1 / LUMP_PROPHULLS",
VbspLumpType.LUMP_PORTALVERTS => " - LUMP_PORTALVERTS / LUMP_UNUSED2 / LUMP_FAKEENTITIES / LUMP_PROPHULLVERTS",
VbspLumpType.LUMP_CLUSTERPORTALS => " - LUMP_CLUSTERPORTALS / LUMP_UNUSED3 / LUMP_PROPTRIS",
VbspLumpType.LUMP_DISPINFO => " - LUMP_DISPINFO",
VbspLumpType.LUMP_ORIGINALFACES => " - LUMP_ORIGINALFACES",
VbspLumpType.LUMP_PHYSDISP => " - LUMP_PHYSDISP",
VbspLumpType.LUMP_PHYSCOLLIDE => " - LUMP_PHYSCOLLIDE",
VbspLumpType.LUMP_VERTNORMALS => " - LUMP_VERTNORMALS",
VbspLumpType.LUMP_VERTNORMALINDICES => " - LUMP_VERTNORMALINDICES",
VbspLumpType.LUMP_DISP_LIGHTMAP_ALPHAS => " - LUMP_DISP_LIGHTMAP_ALPHAS",
VbspLumpType.LUMP_DISP_VERTS => " - LUMP_DISP_VERTS",
VbspLumpType.LUMP_DISP_LIGHTMAP_SAMPLE_POSITIONS => " - LUMP_DISP_LIGHTMAP_SAMPLE_POSITIONS",
VbspLumpType.LUMP_GAME_LUMP => " - LUMP_GAME_LUMP",
VbspLumpType.LUMP_LEAFWATERDATA => " - LUMP_LEAFWATERDATA",
VbspLumpType.LUMP_PRIMITIVES => " - LUMP_PRIMITIVES",
VbspLumpType.LUMP_PRIMVERTS => " - LUMP_PRIMVERTS",
VbspLumpType.LUMP_PRIMINDICES => " - LUMP_PRIMINDICES",
VbspLumpType.LUMP_PAKFILE => " - LUMP_PAKFILE",
VbspLumpType.LUMP_CLIPPORTALVERTS => " - LUMP_CLIPPORTALVERTS",
VbspLumpType.LUMP_CUBEMAPS => " - LUMP_CUBEMAPS",
VbspLumpType.LUMP_TEXDATA_STRING_DATA => " - LUMP_TEXDATA_STRING_DATA",
VbspLumpType.LUMP_TEXDATA_STRING_TABLE => " - LUMP_TEXDATA_STRING_TABLE",
VbspLumpType.LUMP_OVERLAYS => " - LUMP_OVERLAYS",
VbspLumpType.LUMP_LEAFMINDISTTOWATER => " - LUMP_LEAFMINDISTTOWATER",
VbspLumpType.LUMP_FACE_MACRO_TEXTURE_INFO => " - LUMP_FACE_MACRO_TEXTURE_INFO",
VbspLumpType.LUMP_DISP_TRIS => " - LUMP_DISP_TRIS",
VbspLumpType.LUMP_PHYSCOLLIDESURFACE => " - LUMP_PHYSCOLLIDESURFACE / LUMP_PROP_BLOB",
VbspLumpType.LUMP_WATEROVERLAYS => " - LUMP_WATEROVERLAYS",
VbspLumpType.LUMP_LIGHTMAPPAGES => " - LUMP_LIGHTMAPPAGES / LUMP_LEAF_AMBIENT_INDEX_HDR",
VbspLumpType.LUMP_LIGHTMAPPAGEINFOS => " - LUMP_LIGHTMAPPAGEINFOS / LUMP_LEAF_AMBIENT_INDEX",
VbspLumpType.LUMP_LIGHTING_HDR => " - LUMP_LIGHTING_HDR",
VbspLumpType.LUMP_WORLDLIGHTS_HDR => " - LUMP_WORLDLIGHTS_HDR",
VbspLumpType.LUMP_LEAF_AMBIENT_LIGHTING_HDR => " - LUMP_LEAF_AMBIENT_LIGHTING_HDR",
VbspLumpType.LUMP_LEAF_AMBIENT_LIGHTING => " - LUMP_LEAF_AMBIENT_LIGHTING",
VbspLumpType.LUMP_XZIPPAKFILE => " - LUMP_XZIPPAKFILE",
VbspLumpType.LUMP_FACES_HDR => " - LUMP_FACES_HDR",
VbspLumpType.LUMP_MAP_FLAGS => " - LUMP_MAP_FLAGS",
VbspLumpType.LUMP_OVERLAY_FADES => " - LUMP_OVERLAY_FADES",
VbspLumpType.LUMP_OVERLAY_SYSTEM_LEVELS => " - LUMP_OVERLAY_SYSTEM_LEVELS",
VbspLumpType.LUMP_PHYSLEVEL => " - LUMP_PHYSLEVEL",
VbspLumpType.LUMP_DISP_MULTIBLEND => " - LUMP_DISP_MULTIBLEND",
_ => string.Empty,
};
}
}
}

View File

@@ -1,32 +0,0 @@
using System;
using SabreTools.Numerics.Extensions;
namespace SabreTools.Data.Extensions
{
public static class XboxExecutableExtensions
{
/// <summary>
/// Convert a UInt32 to a formatted XBE title ID
/// </summary>
public static string ToFormattedXBETitleID(this uint value)
{
// Convert to a byte array
byte[] data = BitConverter.GetBytes(value);
// Create the prefix
string prefix1 = (0x41 <= data[3] && data[3] <= 0x5A) || (0x30 <= data[3] && data[3] <= 0x39)
? $"{(char)data[3]}"
: $"{data[3]:X2}";
string prefix2 = (0x41 <= data[2] && data[2] <= 0x5A) || (0x30 <= data[2] && data[2] <= 0x39)
? $"{(char)data[2]}"
: $"{data[2]:X2}";
// Create the serial
int offset = 0;
ushort serial = data.ReadUInt16LittleEndian(ref offset);
// Assemble and return
return $"{prefix1}{prefix2}-{serial:D3}";
}
}
}

View File

@@ -1,36 +0,0 @@
using System;
using System.Text;
using SabreTools.Data.Models.ZArchive;
namespace SabreTools.Data.Extensions
{
public static class ZArchiveExtensions
{
/// <summary>
/// Retrieves the name of the specified node from the NameTable
/// </summary>
/// <param name="node">Node in the file tree</param>
/// <param name="nameTable">ZArchive NameTable</param>
/// <returns>UTF-8 string representing node's name</returns>
public static string? GetName(this FileDirectoryEntry node, NameTable nameTable)
{
// Check for a valid offset into the NameTable
uint nameOffset = node.NameOffsetAndTypeFlag & Constants.RootNode;
if (nameOffset == Constants.RootNode)
return null;
// Get the index into the name table
var index = Array.IndexOf(nameTable.NameTableOffsets, nameOffset);
if (index < 0)
return null;
// Get the name entry for the requested index
var nameEntry = nameTable.NameEntries[index];
if (nameEntry is null)
return null;
// Decode name to UTF-8
return Encoding.UTF8.GetString(nameEntry.NodeName);
}
}
}

View File

@@ -1,20 +0,0 @@
namespace SabreTools.Data.Models.Atari7800
{
/// <summary>
/// Atari 7800 headered cart
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
public class Cart
{
/// <summary>
/// A78 header
/// </summary>
/// <remarks>If omitted, format is technically BIN</remarks>
public Header? Header { get; set; }
/// <summary>
/// Cartridge data
/// </summary>
public byte[] Data { get; set; } = [];
}
}

View File

@@ -1,49 +0,0 @@
namespace SabreTools.Data.Models.Atari7800
{
public static class Constants
{
/// <summary>
/// A78 magic string (null-padded)
/// </summary>
public static readonly byte[] MagicBytesWithNull =
[
0x41, 0x54, 0x41, 0x52, 0x49, 0x37, 0x38, 0x30,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
/// <summary>
/// A78 magic string (null-padded)
/// </summary>
public const string MagicStringWithNull = "ATARI7800\0\0\0\0\0\0\0";
/// <summary>
/// A78 magic string (space-padded)
/// </summary>
public static readonly byte[] MagicBytesWithSpace =
[
0x41, 0x54, 0x41, 0x52, 0x49, 0x37, 0x38, 0x30,
0x30, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
];
/// <summary>
/// A78 magic string (space-padded)
/// </summary>
public const string MagicStringWithSpace = "ATARI7800 ";
/// <summary>
/// A78 header end magic text
/// </summary>
public static readonly byte[] HeaderEndMagicBytes =
[
0x41, 0x43, 0x54, 0x55, 0x41, 0x4C, 0x20, 0x43,
0x41, 0x52, 0x54, 0x20, 0x44, 0x41, 0x54, 0x41,
0x20, 0x53, 0x54, 0x41, 0x52, 0x54, 0x53, 0x20,
0x48, 0x45, 0x52, 0x45,
];
/// <summary>
/// A78 header end magic text
/// </summary>
public const string HeaderEndMagicString = "ACTUAL CART DATA STARTS HERE";
}
}

View File

@@ -1,380 +0,0 @@
using System;
namespace SabreTools.Data.Models.Atari7800
{
/// <summary>
/// Audio device (v4+ only)
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
[Flags]
public enum AudioDevice : ushort
{
#region POKEY location
/// <summary>
/// POKEY - none
/// </summary>
PokeyNone = 0b00000000,
/// <summary>
/// POKEY - @440
/// </summary>
Pokey440 = 0b00000001,
/// <summary>
/// POKEY - @450
/// </summary>
Pokey450 = 0b00000010,
/// <summary>
/// POKEY - @450+@440
/// </summary>
Pokey450Plus440 = 0b00000011,
/// <summary>
/// POKEY - @800
/// </summary>
Pokey800 = 0b00000100,
/// <summary>
/// POKEY - @4000
/// </summary>
Pokey4000 = 0b00000101,
#endregion
/// <summary>
/// YM2151 @460
/// </summary>
YM2151460 = 0b00001000,
/// <summary>
/// COVOX @430
/// </summary>
COVOX430 = 0b00010000,
/// <summary>
/// ADPCM Audio Stream @420
/// </summary>
ADPCMAudioStream420 = 0b00100000,
}
/// <summary>
/// Cart type specifications
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
[Flags]
public enum CartType : ushort
{
/// <summary>
/// pokey at $4000
/// </summary>
PokeyAt4000 = 0b00000000_00000001,
/// <summary>
/// supergame bank switched
/// </summary>
SupergameBankSwitched = 0b00000000_00000010,
/// <summary>
/// supergame ram at $4000
/// </summary>
SupergameRamAt4000 = 0b00000000_00000100,
/// <summary>
/// rom at $4000
/// </summary>
RomAt4000 = 0b00000000_00001000,
/// <summary>
/// bank 6 at $4000
/// </summary>
Bank6At4000 = 0b00000000_00010000,
/// <summary>
/// banked ram
/// </summary>
BankedRam = 0b00000000_00100000,
/// <summary>
/// pokey at $450
/// </summary>
PokeyAt450 = 0b00000000_01000000,
/// <summary>
/// mirror ram at $4000
/// </summary>
MirrorRamAt4000 = 0b00000000_10000000,
/// <summary>
/// activision banking
/// </summary>
ActivisionBanking = 0b00000001_00000000,
/// <summary>
/// absolute banking
/// </summary>
AbsoluteBanking = 0b00000010_00000000,
/// <summary>
/// pokey at $440
/// </summary>
PokeyAt440 = 0b00000100_00000000,
/// <summary>
/// ym2151 at $460/$461
/// </summary>
Ym2151At460461 = 0b00001000_00000000,
/// <summary>
/// souper
/// </summary>
Souper = 0b00010000_00000000,
/// <summary>
/// banksets
/// </summary>
Banksets = 0b00100000_00000000,
/// <summary>
/// halt banked ram
/// </summary>
HaltBankedRam = 0b01000000_00000000,
/// <summary>
/// pokey@800
/// </summary>
PokeyAt800 = 0b10000000_00000000,
}
/// <summary>
/// Controller type
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
public enum ControllerType : byte
{
/// <summary>
/// none
/// </summary>
None = 0,
/// <summary>
/// 7800 joystick
/// </summary>
Joystick = 1,
/// <summary>
/// lightgun
/// </summary>
Lightgun = 2,
/// <summary>
/// paddle
/// </summary>
Paddle = 3,
/// <summary>
/// trakball
/// </summary>
Trakball = 4,
/// <summary>
/// 2600 joystick
/// </summary>
VcsJoystick = 5,
/// <summary>
/// 2600 driving
/// </summary>
VcsDriving = 6,
/// <summary>
/// 2600 keypad
/// </summary>
VcsKeypad = 7,
/// <summary>
/// ST mouse
/// </summary>
STMouse = 8,
/// <summary>
/// Amiga mouse
/// </summary>
AmigaMouse = 9,
/// <summary>
/// AtariVox/SaveKey
/// </summary>
AtariVoxSaveKey = 10,
/// <summary>
/// SNES2Atari
/// </summary>
SNES2Atari = 11,
/// <summary>
/// Mega7800
/// </summary>
Mega7800 = 12,
}
/// <summary>
/// Interrupt (v4+ only)
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
[Flags]
public enum Interrupt : ushort
{
None = 0b00000000,
/// <summary>
/// POKEY 1 (@450 | @800 | @4000)
/// </summary>
Pokey1 = 0b00000001,
/// <summary>
/// POKEY 2 (@440)
/// </summary>
Pokey2 = 0b00000010,
/// <summary>
/// YM2151
/// </summary>
YM2151 = 0b00000100,
}
/// <summary>
/// Mapper (v4+ only)
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
public enum Mapper : byte
{
Linear = 0,
SuperGame = 1,
Activision = 2,
Absolute = 3,
Souper = 4,
}
/// <summary>
/// Mapper options/details (v4+ only)
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
[Flags]
public enum MapperOptions : byte
{
#region Linear
/// <summary>
/// Option at @4000 - none
/// </summary>
LinearNone = 0b00000000,
/// <summary>
/// Option at @4000 - 16K RAM
/// </summary>
Linear16KRAM = 0b00000001,
/// <summary>
/// Option at @4000 - 8K EXRAM/A8
/// </summary>
Linear8KEXRAMA8 = 0b00000010,
/// <summary>
/// Option at @4000 - 32K EXRAM/M2
/// </summary>
Linear32KEXRAMM2 = 0b00000011,
#endregion
#region SuperGame
/// <summary>
/// Option at @4000 - none
/// </summary>
SuperGameNone = 0b00000000,
/// <summary>
/// Option at @4000 - 16K RAM
/// </summary>
SuperGame16KRAM = 0b00000001,
/// <summary>
/// Option at @4000 - 8K EXRAM/A8
/// </summary>
SuperGame8KEXRAMA8 = 0b00000010,
/// <summary>
/// Option at @4000 - 32K EXRAM/M2
/// </summary>
SuperGame32KEXRAMM2 = 0b00000011,
/// <summary>
/// Option at @4000 - EXROM
/// </summary>
SuperGameEXROM = 0b00000100,
/// <summary>
/// Option at @4000 - EXFIX
/// </summary>
SuperGameEXFIX = 0b00000101,
/// <summary>
/// Option at @4000 - 32k EXRAM/X2
/// </summary>
SuperGame32KEXRAMX2 = 0b00000110,
#endregion
/// <summary>
/// Bankset ROM
/// </summary>
BanksetRom = 0b10000000,
}
/// <summary>
/// Save device
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
public enum SaveDevice : byte
{
None = 0b00000000,
/// <summary>
/// HSC
/// </summary>
HSC = 0b00000001,
/// <summary>
/// SaveKey/AtariVox
/// </summary>
SaveKeyAtariVox = 0b00000010,
}
/// <summary>
/// Slot passthrough device
/// </summary>
public enum SlotPassthroughDevice : byte
{
None = 0b00000000,
XM = 0b00000001,
}
/// <summary>
/// TV type
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
[Flags]
public enum TVType : byte
{
NTSC = 0b00000000,
PAL = 0b00000001,
Component = 0b00000000,
Composite = 0b00000010,
SingleRegion = 0b00000000,
MultiRegion = 0b00000100,
}
}

View File

@@ -1,115 +0,0 @@
namespace SabreTools.Data.Models.Atari7800
{
/// <summary>
/// Atari 7800 emulator header
/// </summary>
/// <see href="https://7800.8bitdev.org/index.php/A78_Header_Specification"/>
public class Header
{
/// <summary>
/// Header version
/// </summary>
/// <remarks>
/// Current header version is 4.
/// If no V4 features are used, this should be set to 3.
/// </remarks>
public byte HeaderVersion { get; set; }
/// <summary>
/// "ATARI7800" with 7 null bytes following
/// </summary>
public byte[] MagicText { get; set; } = new byte[16];
/// <summary>
/// Cart title, encoding not specified
/// </summary>
public byte[] CartTitle { get; set; } = new byte[32];
/// <summary>
/// ROM size without header data
/// </summary>
/// <remarks>
/// Endianness possibly varies by version?
/// Version 1 - Big-endian
/// Version 2 - ?????
/// Version 3 - Documented as little-endian (unconfirmed)
/// Version 4 - Documented as little-endian (unconfirmed)
/// </remarks>
public uint RomSizeWithoutHeader { get; set; }
/// <summary>
/// Cart type flags
/// </summary>
public CartType CartType { get; set; }
/// <summary>
/// Controller 1 type
/// </summary>
public ControllerType Controller1Type { get; set; }
/// <summary>
/// Controller 2 type
/// </summary>
public ControllerType Controller2Type { get; set; }
/// <summary>
/// TV type
/// </summary>
public TVType TVType { get; set; }
/// <summary>
/// Save device
/// </summary>
public SaveDevice SaveDevice { get; set; }
/// <summary>
/// Reserved
/// </summary>
public byte[] Reserved { get; set; } = new byte[4];
/// <summary>
/// Slot passthrough device
/// </summary>
public SlotPassthroughDevice SlotPassthroughDevice { get; set; }
#region Version 4+
/// <summary>
/// Mapper
/// </summary>
/// <remarks>v4+ only</remarks>
public Mapper Mapper { get; set; }
/// <summary>
/// Mapper options
/// </summary>
/// <remarks>v4+ only</remarks>
public MapperOptions MapperOptions { get; set; }
/// <summary>
/// Audio device(s)
/// </summary>
public AudioDevice AudioDevice { get; set; }
/// <summary>
/// Interrupt
/// </summary>
public Interrupt Interrupt { get; set; }
#endregion
/// <summary>
/// Padding from end of header data to end magic text
/// </summary>
/// <remarks>
/// 36 bytes in versions lower than 4.
/// 30 bytes in versions 4 and above.
/// </remarks>
public byte[] Padding { get; set; } = [];
/// <summary>
/// "ACTUAL CART DATA STARTS HERE"
/// </summary>
public byte[] EndMagicText { get; set; } = new byte[28];
}
}

View File

@@ -1,20 +0,0 @@
namespace SabreTools.Data.Models.AtariLynx
{
/// <summary>
/// Atari Lynx headered cart (LNX)
/// </summary>
/// <see href="https://github.com/mozzwald/handy-sdl/blob/master/src/handy-0.95/cart.h"/>
public class Cart
{
/// <summary>
/// LNX header
/// </summary>
/// <remarks>If omitted, format is technically LYX</remarks>
public Header? Header { get; set; }
/// <summary>
/// Cartridge data
/// </summary>
public byte[] Data { get; set; } = [];
}
}

View File

@@ -1,15 +0,0 @@
namespace SabreTools.Data.Models.AtariLynx
{
public static class Constants
{
/// <summary>
/// LNX magic string
/// </summary>
public static readonly byte[] MagicBytes = [0x4C, 0x59, 0x4E, 0x58];
/// <summary>
/// LNX magic string
/// </summary>
public const string MagicString = "LYNX";
}
}

View File

@@ -1,24 +0,0 @@
namespace SabreTools.Data.Models.AtariLynx
{
/// <summary>
/// Screen rotation
/// </summary>
/// <see href="https://github.com/mozzwald/handy-sdl/blob/master/src/handy-0.95/cart.h"/>
public enum Rotation : byte
{
/// <summary>
/// No rotation (horizontal, buttons right)
/// </summary>
NoRotation = 0,
/// <summary>
/// Rotate left (vertical, buttons down)
/// </summary>
RotateLeft = 1,
/// <summary>
/// Rotate right (vertical, buttons up)
/// </summary>
RotateRight = 2,
}
}

View File

@@ -1,54 +0,0 @@
namespace SabreTools.Data.Models.AtariLynx
{
/// <summary>
/// Atari Lynx emulator header
/// </summary>
/// <see href="https://github.com/mozzwald/handy-sdl/blob/master/src/handy-0.95/cart.h"/>
public class Header
{
/// <summary>
/// "LYNX"
/// </summary>
/// <remarks>4 bytes</remarks>
public byte[] Magic { get; set; } = new byte[4];
/// <summary>
/// Page size for bank 0
/// </summary>
public ushort Bank0PageSize { get; set; }
/// <summary>
/// Page size for bank 1
/// </summary>
public ushort Bank1PageSize { get; set; }
/// <summary>
/// Header version
/// </summary>
/// <remarks>Must be 0x0001</remarks>
public ushort Version { get; set; }
/// <summary>
/// Game title (Null-padded ASCII)
/// </summary>
/// <remarks>32 bytes</remarks>
public byte[] CartName { get; set; } = new byte[32];
/// <summary>
/// Publisher name
/// </summary>
/// <remarks>16 bytes</remarks>
public byte[] Manufacturer { get; set; } = new byte[16];
/// <summary>
/// Screen rotation
/// </summary>
public Rotation Rotation { get; set; }
/// <summary>
/// Padding
/// </summary>
/// <remarks>5 bytes</remarks>
public byte[] Spare { get; set; } = new byte[5];
}
}

View File

@@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class ATA
{
public Dump Identify { get; set; }
}
}

View File

@@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Advertisement
{
public string Manufacturer { get; set; }
public string Product { get; set; }
public FileType File { get; set; }
public ulong FileSize { get; set; }
public ulong Frames { get; set; }
[XmlIgnore]
public bool FramesSpecified { get; set; }
public double Duration { get; set; }
public float MeanFrameRate { get; set; }
[XmlIgnore]
public bool MeanFrameRateSpecified { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlElement("AudioTrack")]
public AudioTracks[] AudioTrack { get; set; }
[XmlElement("VideoTrack")]
public VideoTracks[] VideoTrack { get; set; }
[XmlElement("SubtitleTrack")]
public SubtitleTracks[] SubtitleTrack { get; set; }
public Recording Recording { get; set; }
}
}

View File

@@ -1,40 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class AudioBlock
{
public Image Image { get; set; }
public ulong Size { get; set; }
public string AccoustID { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
public string Format { get; set; }
}
}

View File

@@ -1,60 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class AudioMedia
{
public Image Image { get; set; }
public ulong Size { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
public Sequence Sequence { get; set; }
public string PartNumber { get; set; }
public string SerialNumber { get; set; }
public string Manufacturer { get; set; }
public string Model { get; set; }
public string AccoustID { get; set; }
[XmlElement("Block")]
public AudioBlock[] Block { get; set; }
public string CopyProtection { get; set; }
public Dimensions Dimensions { get; set; }
public Scans Scans { get; set; }
[XmlArrayItem("DumpHardware", IsNullable = false)]
public DumpHardware[] DumpHardwareArray { get; set; }
}
}

View File

@@ -1,50 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class AudioTracks
{
[XmlArrayItem("Language", IsNullable = false)]
public Language[] Languages { get; set; }
[XmlAttribute]
public uint TrackNumber { get; set; }
[XmlAttribute]
public string AccoustID { get; set; }
[XmlAttribute]
public string Codec { get; set; }
[XmlAttribute]
public uint Channels { get; set; }
[XmlAttribute]
public double SampleRate { get; set; }
[XmlAttribute]
public long MeanBitrate { get; set; }
}
}

View File

@@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Barcode
{
[XmlAttribute]
public BarcodeType type { get; set; }
[XmlText]
public string Value { get; set; }
}
}

View File

@@ -1,117 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class BlockMedia
{
public Image Image { get; set; }
public ulong Size { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] ContentChecksums { get; set; }
public Sequence Sequence { get; set; }
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Serial { get; set; }
public string Firmware { get; set; }
public string Interface { get; set; }
public string PartNumber { get; set; }
public string SerialNumber { get; set; }
public uint PhysicalBlockSize { get; set; }
public uint LogicalBlockSize { get; set; }
public ulong LogicalBlocks { get; set; }
[XmlArrayItem("BlockSize", IsNullable = false)]
public BlockSize[] VariableBlockSize { get; set; }
[XmlArrayItem("Partition", IsNullable = false)]
public TapePartition[] TapeInformation { get; set; }
public Scans Scans { get; set; }
public ATA ATA { get; set; }
public PCI PCI { get; set; }
public PCMCIA PCMCIA { get; set; }
public SecureDigital SecureDigital { get; set; }
public MultiMediaCard MultiMediaCard { get; set; }
public SCSI SCSI { get; set; }
public USB USB { get; set; }
public Dump MAM { get; set; }
public ushort Heads { get; set; }
[XmlIgnore]
public bool HeadsSpecified { get; set; }
public uint Cylinders { get; set; }
[XmlIgnore]
public bool CylindersSpecified { get; set; }
public ulong SectorsPerTrack { get; set; }
[XmlIgnore]
public bool SectorsPerTrackSpecified { get; set; }
[XmlElement("Track")]
public BlockTrack[] Track { get; set; }
public string CopyProtection { get; set; }
public Dimensions Dimensions { get; set; }
[XmlArrayItem("Partition", IsNullable = false)]
public Partition[] FileSystemInformation { get; set; }
[XmlArrayItem("DumpHardware", IsNullable = false)]
public DumpHardware[] DumpHardwareArray { get; set; }
public string DiskType { get; set; }
public string DiskSubType { get; set; }
}
}

View File

@@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class BlockSize
{
[XmlAttribute]
public uint startingBlock { get; set; }
[XmlText]
public uint Value { get; set; }
}
}

View File

@@ -1,50 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class BlockTrack
{
public Image Image { get; set; }
public ulong Size { get; set; }
public ushort Head { get; set; }
public uint Cylinder { get; set; }
public ulong StartSector { get; set; }
public ulong EndSector { get; set; }
public ulong Sectors { get; set; }
public uint BytesPerSector { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
public string Format { get; set; }
}
}

View File

@@ -1,58 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Book
{
[XmlArrayItem("Barcode", IsNullable = false)]
public Barcode[] Barcodes { get; set; }
public Cover Cover { get; set; }
public string Name { get; set; }
public string Editorial { get; set; }
public string Author { get; set; }
[XmlElement(DataType = "date")]
public System.DateTime PublicationDate { get; set; }
[XmlIgnore]
public bool PublicationDateSpecified { get; set; }
[XmlArrayItem("Language", IsNullable = false)]
public Language[] Language { get; set; }
public uint Pages { get; set; }
[XmlIgnore]
public bool PagesSpecified { get; set; }
public string PageSize { get; set; }
public Scan Scan { get; set; }
}
}

View File

@@ -1,42 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Border
{
public string Image { get; set; }
public ulong Size { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlAttribute]
public uint session { get; set; }
[XmlIgnore]
public bool sessionSpecified { get; set; }
}
}

View File

@@ -1,112 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
[XmlRootAttribute("CICMMetadata", Namespace = "", IsNullable = false)]
public class CICMMetadata
{
[XmlElement("Developer")]
public string[] Developer { get; set; }
[XmlElement("Publisher")]
public string[] Publisher { get; set; }
[XmlElement("Author")]
public string[] Author { get; set; }
[XmlElement("Performer")]
public string[] Performer { get; set; }
public string Name { get; set; }
public string Version { get; set; }
public ReleaseType ReleaseType { get; set; }
[XmlIgnore]
public bool ReleaseTypeSpecified { get; set; }
[XmlElement(DataType = "date")]
public System.DateTime ReleaseDate { get; set; }
[XmlIgnore]
public bool ReleaseDateSpecified { get; set; }
[XmlArrayItem("Barcode", IsNullable = false)]
public Barcode[] Barcodes { get; set; }
public string PartNumber { get; set; }
public string SerialNumber { get; set; }
[XmlArrayItem("Keyword", IsNullable = false)]
public string[] Keywords { get; set; }
[XmlElement("Magazine")]
public Magazine[] Magazine { get; set; }
[XmlElement("Book")]
public Book[] Book { get; set; }
[XmlArrayItem("Category", IsNullable = false)]
public string[] Categories { get; set; }
[XmlArrayItem("Subcategory", IsNullable = false)]
public string[] Subcategories { get; set; }
[XmlArrayItem("Language", IsNullable = false)]
public Language[] Languages { get; set; }
[XmlArrayItem("System", IsNullable = false)]
public string[] Systems { get; set; }
[XmlArrayItem("Architecture", IsNullable = false)]
public Architecture[] Architectures { get; set; }
[XmlArrayItem("RequiredOperatingSystem", IsNullable = false)]
public RequiredOperatingSystem[] RequiredOperatingSystems { get; set; }
[XmlElement("UserManual")]
public UserManual[] UserManual { get; set; }
[XmlElement("OpticalDisc")]
public OpticalDisc[] OpticalDisc { get; set; }
[XmlElement("Advertisement")]
public Advertisement[] Advertisement { get; set; }
[XmlElement("LinearMedia")]
public LinearMedia[] LinearMedia { get; set; }
[XmlElement("PCICard")]
public PCI[] PCICard { get; set; }
[XmlElement("BlockMedia")]
public BlockMedia[] BlockMedia { get; set; }
[XmlElement("AudioMedia")]
public AudioMedia[] AudioMedia { get; set; }
}
}

View File

@@ -1,34 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Case
{
[XmlElement("CaseType")]
public CaseType CaseType { get; set; }
public Scans Scans { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class CaseScan
{
public CaseScanElement CaseScanElement { get; set; }
public Scan Scan { get; set; }
}
}

View File

@@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Checksum
{
[XmlAttribute]
public ChecksumType type { get; set; }
[XmlText]
public string Value { get; set; }
}
}

View File

@@ -1,104 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class ContentsFile
{
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlArrayItem("ExtendedAttribute", IsNullable = false)]
public ExtendedAttribute[] ExtendedAttributes { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public System.DateTime creationTime { get; set; }
[XmlIgnore]
public bool creationTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime accessTime { get; set; }
[XmlIgnore]
public bool accessTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime statusChangeTime { get; set; }
[XmlIgnore]
public bool statusChangeTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime backupTime { get; set; }
[XmlIgnore]
public bool backupTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime lastWriteTime { get; set; }
[XmlIgnore]
public bool lastWriteTimeSpecified { get; set; }
[XmlAttribute]
public ulong attributes { get; set; }
[XmlAttribute]
public uint posixMode { get; set; }
[XmlIgnore]
public bool posixModeSpecified { get; set; }
[XmlAttribute]
public ulong deviceNumber { get; set; }
[XmlIgnore]
public bool deviceNumberSpecified { get; set; }
[XmlAttribute]
public ulong posixGroupId { get; set; }
[XmlIgnore]
public bool posixGroupIdSpecified { get; set; }
[XmlAttribute]
public ulong inode { get; set; }
[XmlAttribute]
public ulong links { get; set; }
[XmlAttribute]
public ulong posixUserId { get; set; }
[XmlIgnore]
public bool posixUserIdSpecified { get; set; }
[XmlAttribute]
public ulong length { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Coordinates
{
public double Latitude { get; set; }
public double Longitude { get; set; }
}
}

View File

@@ -1,37 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Cover
{
public FileType File { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlElement(DataType = "base64Binary")]
public byte[] Thumbnail { get; set; }
}
}

View File

@@ -1,46 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Dimensions
{
public double Diameter { get; set; }
[XmlIgnore]
public bool DiameterSpecified { get; set; }
public double Height { get; set; }
[XmlIgnore]
public bool HeightSpecified { get; set; }
public double Width { get; set; }
[XmlIgnore]
public bool WidthSpecified { get; set; }
public double Thickness { get; set; }
}
}

View File

@@ -1,107 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class DirectoryType
{
[XmlElement("File")]
public ContentsFile[] File { get; set; }
[XmlElement("Directory")]
public DirectoryType[] Directory { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public System.DateTime creationTime { get; set; }
[XmlIgnore]
public bool creationTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime accessTime { get; set; }
[XmlIgnore]
public bool accessTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime statusChangeTime { get; set; }
[XmlIgnore]
public bool statusChangeTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime backupTime { get; set; }
[XmlIgnore]
public bool backupTimeSpecified { get; set; }
[XmlAttribute]
public System.DateTime lastWriteTime { get; set; }
[XmlIgnore]
public bool lastWriteTimeSpecified { get; set; }
[XmlAttribute]
public ulong attributes { get; set; }
[XmlAttribute]
public uint posixMode { get; set; }
[XmlIgnore]
public bool posixModeSpecified { get; set; }
[XmlAttribute]
public ulong deviceNumber { get; set; }
[XmlIgnore]
public bool deviceNumberSpecified { get; set; }
[XmlAttribute]
public ulong posixGroupId { get; set; }
[XmlIgnore]
public bool posixGroupIdSpecified { get; set; }
[XmlAttribute]
public ulong inode { get; set; }
[XmlIgnore]
public bool inodeSpecified { get; set; }
[XmlAttribute]
public ulong links { get; set; }
[XmlIgnore]
public bool linksSpecified { get; set; }
[XmlAttribute]
public ulong posixUserId { get; set; }
[XmlIgnore]
public bool posixUserIdSpecified { get; set; }
}
}

View File

@@ -1,36 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Dump
{
public string Image { get; set; }
public ulong Size { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
}
}

View File

@@ -1,44 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class DumpHardware
{
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Revision { get; set; }
public string Firmware { get; set; }
public string Serial { get; set; }
[XmlArrayItem("Extent", IsNullable = false)]
public Extent[] Extents { get; set; }
public Software Software { get; set; }
}
}

View File

@@ -1,42 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class EVPD
{
public string Image { get; set; }
public ulong Size { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlAttribute]
public byte page { get; set; }
[XmlIgnore]
public bool pageSpecified { get; set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class ExtendedAttribute
{
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlAttribute]
public string name { get; set; }
[XmlAttribute]
public ulong length { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Extent
{
public ulong Start { get; set; }
public ulong End { get; set; }
}
}

View File

@@ -1,90 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class FileSystem
{
public string Type { get; set; }
public System.DateTime CreationDate { get; set; }
[XmlIgnore]
public bool CreationDateSpecified { get; set; }
public System.DateTime ModificationDate { get; set; }
[XmlIgnore]
public bool ModificationDateSpecified { get; set; }
public System.DateTime BackupDate { get; set; }
[XmlIgnore]
public bool BackupDateSpecified { get; set; }
public uint ClusterSize { get; set; }
public ulong Clusters { get; set; }
public ulong Files { get; set; }
[XmlIgnore]
public bool FilesSpecified { get; set; }
public bool Bootable { get; set; }
public string VolumeSerial { get; set; }
public string VolumeName { get; set; }
public ulong FreeClusters { get; set; }
[XmlIgnore]
public bool FreeClustersSpecified { get; set; }
public bool Dirty { get; set; }
public System.DateTime ExpirationDate { get; set; }
[XmlIgnore]
public bool ExpirationDateSpecified { get; set; }
public System.DateTime EffectiveDate { get; set; }
[XmlIgnore]
public bool EffectiveDateSpecified { get; set; }
public string SystemIdentifier { get; set; }
public string VolumeSetIdentifier { get; set; }
public string PublisherIdentifier { get; set; }
public string DataPreparerIdentifier { get; set; }
public string ApplicationIdentifier { get; set; }
public FilesystemContents Contents { get; set; }
}
}

View File

@@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class FileType
{
[XmlAttribute]
public string format { get; set; }
[XmlText]
public string Value { get; set; }
}
}

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class FilesystemContents
{
[XmlElement("File")]
public ContentsFile[] File { get; set; }
[XmlElement("Directory")]
public DirectoryType[] Directory { get; set; }
[XmlAttribute]
public string @namespace { get; set; }
}
}

View File

@@ -1,41 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Image
{
[XmlAttribute]
public string format { get; set; }
[XmlAttribute]
public ulong offset { get; set; }
[XmlIgnore]
public bool offsetSpecified { get; set; }
[XmlText]
public string Value { get; set; }
}
}

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class LayeredText
{
[XmlAttribute]
public uint layer { get; set; }
[XmlIgnore]
public bool layerSpecified { get; set; }
[XmlText]
public string Value { get; set; }
}
}

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Layers
{
[XmlElement("Sectors")]
public Sectors[] Sectors { get; set; }
[XmlAttribute]
public LayerType type { get; set; }
[XmlIgnore]
public bool typeSpecified { get; set; }
}
}

View File

@@ -1,79 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class LinearMedia
{
public Image Image { get; set; }
public ulong Size { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] ImageChecksums { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
public string PartNumber { get; set; }
public string SerialNumber { get; set; }
public string Title { get; set; }
public uint Sequence { get; set; }
[XmlIgnore]
public bool SequenceSpecified { get; set; }
public uint ImageInterleave { get; set; }
[XmlIgnore]
public bool ImageInterleaveSpecified { get; set; }
public uint Interleave { get; set; }
[XmlIgnore]
public bool InterleaveSpecified { get; set; }
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Package { get; set; }
public string Interface { get; set; }
public Dimensions Dimensions { get; set; }
public Scans Scans { get; set; }
[XmlArrayItem("DumpHardware", IsNullable = false)]
public DumpHardware[] DumpHardwareArray { get; set; }
public PCMCIA PCMCIA { get; set; }
public string CopyProtection { get; set; }
}
}

View File

@@ -1,61 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Magazine
{
[XmlArrayItem("Barcode", IsNullable = false)]
public Barcode[] Barcodes { get; set; }
public Cover Cover { get; set; }
public string Name { get; set; }
public string Editorial { get; set; }
[XmlElement(DataType = "date")]
public System.DateTime PublicationDate { get; set; }
[XmlIgnore]
public bool PublicationDateSpecified { get; set; }
public uint Number { get; set; }
[XmlIgnore]
public bool NumberSpecified { get; set; }
[XmlArrayItem("Language", IsNullable = false)]
public Language[] Language { get; set; }
public uint Pages { get; set; }
[XmlIgnore]
public bool PagesSpecified { get; set; }
public string PageSize { get; set; }
public Scan Scan { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class MediaScan
{
public MediaScanElement MediaScanElement { get; set; }
public Scan Scan { get; set; }
}
}

View File

@@ -1,36 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class MultiMediaCard
{
public Dump CID { get; set; }
public Dump CSD { get; set; }
public Dump ExtendedCSD { get; set; }
public Dump OCR { get; set; }
}
}

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class OCR
{
public string Author { get; set; }
public string Software { get; set; }
public string SoftwareVersion { get; set; }
[XmlArrayItem("Language", IsNullable = false)]
public Language[] Language { get; set; }
}
}

View File

@@ -1,138 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class OpticalDisc
{
public Image Image { get; set; }
public ulong Size { get; set; }
public Sequence Sequence { get; set; }
public Layers Layers { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
public string PartNumber { get; set; }
public string SerialNumber { get; set; }
[XmlElement("RingCode")]
public LayeredText[] RingCode { get; set; }
[XmlElement("MasteringSID")]
public LayeredText[] MasteringSID { get; set; }
[XmlElement("Toolstamp")]
public LayeredText[] Toolstamp { get; set; }
[XmlElement("MouldSID")]
public LayeredText[] MouldSID { get; set; }
[XmlElement("MouldText")]
public LayeredText[] MouldText { get; set; }
public string DiscType { get; set; }
public string DiscSubType { get; set; }
public int Offset { get; set; }
[XmlIgnore]
public bool OffsetSpecified { get; set; }
[XmlElement("Tracks")]
public uint[] Tracks { get; set; }
public uint Sessions { get; set; }
public string CopyProtection { get; set; }
public Dimensions Dimensions { get; set; }
public Case Case { get; set; }
public Scans Scans { get; set; }
public Dump PFI { get; set; }
public Dump DMI { get; set; }
public Dump CMI { get; set; }
public Dump BCA { get; set; }
public Dump ATIP { get; set; }
public Dump ADIP { get; set; }
public Dump PMA { get; set; }
public Dump DDS { get; set; }
public Dump SAI { get; set; }
public Dump LastRMD { get; set; }
public Dump PRI { get; set; }
public Dump MediaID { get; set; }
public Dump PFIR { get; set; }
public Dump DCB { get; set; }
public Dump DI { get; set; }
public Dump PAC { get; set; }
public Dump TOC { get; set; }
public Dump LeadInCdText { get; set; }
[XmlElement("FirstTrackPregrap")]
public Border[] FirstTrackPregrap { get; set; }
[XmlElement("LeadIn")]
public Border[] LeadIn { get; set; }
[XmlElement("LeadOut")]
public Border[] LeadOut { get; set; }
public Xbox Xbox { get; set; }
public PS3Encryption PS3Encryption { get; set; }
public string MediaCatalogueNumber { get; set; }
[XmlElement("Track")]
public Track[] Track { get; set; }
[XmlArrayItem("DumpHardware", IsNullable = false)]
public DumpHardware[] DumpHardwareArray { get; set; }
}
}

View File

@@ -1,36 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class PCI
{
public ushort VendorID { get; set; }
public ushort DeviceID { get; set; }
public Dump Configuration { get; set; }
public LinearMedia ExpansionROM { get; set; }
}
}

View File

@@ -1,50 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class PCMCIA
{
public Dump CIS { get; set; }
public string Compliance { get; set; }
public ushort ManufacturerCode { get; set; }
[XmlIgnore]
public bool ManufacturerCodeSpecified { get; set; }
public ushort CardCode { get; set; }
[XmlIgnore]
public bool CardCodeSpecified { get; set; }
public string Manufacturer { get; set; }
public string ProductName { get; set; }
[XmlElement("AdditionalInformation")]
public string[] AdditionalInformation { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class PS3Encryption
{
public string Key { get; set; }
public string Serial { get; set; }
}
}

View File

@@ -1,44 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Partition
{
public uint Sequence { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public ulong StartSector { get; set; }
public ulong EndSector { get; set; }
public string Description { get; set; }
[XmlArrayItem("FileSystem", IsNullable = false)]
public FileSystem[] FileSystems { get; set; }
}
}

View File

@@ -1,42 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Recording
{
public string Broadcaster { get; set; }
public string BroadcastPlatform { get; set; }
public SourceFormat SourceFormat { get; set; }
public System.DateTime Timestamp { get; set; }
[XmlElement("Software")]
public Software[] Software { get; set; }
public Coordinates Coordinates { get; set; }
}
}

View File

@@ -1,34 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class RequiredOperatingSystem
{
public string Name { get; set; }
[XmlElement("Version")]
public string[] Version { get; set; }
}
}

View File

@@ -1,40 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class SCSI
{
public Dump Inquiry { get; set; }
[XmlElement("EVPD")]
public EVPD[] EVPD { get; set; }
public Dump ModeSense { get; set; }
public Dump ModeSense10 { get; set; }
public Dump LogSense { get; set; }
}
}

View File

@@ -1,43 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Scan
{
public FileType File { get; set; }
[XmlArrayItem("Checksum", IsNullable = false)]
public Checksum[] Checksums { get; set; }
[XmlElement("Scanner")]
public Scanner[] Scanner { get; set; }
[XmlElement("ScanProcessing")]
public ScanProcessing[] ScanProcessing { get; set; }
[XmlElement("OCR")]
public OCR[] OCR { get; set; }
}
}

View File

@@ -1,34 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class ScanProcessing
{
public string Author { get; set; }
public string Software { get; set; }
public string SoftwareVersion { get; set; }
}
}

View File

@@ -1,40 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Scanner
{
public string Author { get; set; }
public string Manufacturer { get; set; }
public string Model { get; set; }
public string Serial { get; set; }
public string Software { get; set; }
public string SoftwareVersion { get; set; }
}
}

View File

@@ -1,32 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Scans
{
public CaseScan CaseScan { get; set; }
public MediaScan Scan { get; set; }
}
}

View File

@@ -1,38 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
//This source code was auto-generated by MonoXSD
//
// Originally sourced from https://github.com/aaru-dps/Aaru/blob/v5.4/CICMMetadata/dotnet/cicm.cs
// The above header is from the original generated code
// Some formatting cleanup has been done to fit project standards
using System;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
namespace SabreTools.Data.Models.CICM
{
[GeneratedCode("xsd", "0.0.0.0")]
[Serializable]
public class Sectors
{
[XmlAttribute]
public uint layer { get; set; }
[XmlIgnore]
public bool layerSpecified { get; set; }
[XmlText]
public ulong Value { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More