116 Commits
1.1.0 ... 1.4.9

Author SHA1 Message Date
Matt Nadareski
d144dd47a1 Bump version 2024-08-08 14:19:26 -04:00
Matt Nadareski
c4247c7ccb Move readme back to where it should be 2024-08-08 14:16:26 -04:00
Matt Nadareski
1e77437167 Fixup csproj a bit 2024-08-08 14:15:30 -04:00
Matt Nadareski
3d79e07d76 Move project to subfolder 2024-08-08 14:11:45 -04:00
Matt Nadareski
9d50d577ab Fix things found during NDecrypt usage 2024-08-08 13:18:47 -04:00
Matt Nadareski
494ca175fb Fix layout of ISv3 directory 2024-06-03 11:57:30 -04:00
Matt Nadareski
73b3d4a7a8 Bump version 2024-05-15 14:09:49 -04:00
Matt Nadareski
bd40158423 Forgot to check... 2024-05-15 14:08:14 -04:00
Matt Nadareski
149a45d871 Bump version 2024-05-15 14:00:54 -04:00
Matt Nadareski
e18d8d7543 Fix menu header parsing/serialization 2024-05-15 14:00:30 -04:00
Matt Nadareski
38f0d4aef5 Bump version 2024-05-13 13:18:47 -04:00
Matt Nadareski
3959993255 Fix XMID/XeMID comments 2024-05-09 21:40:43 -04:00
Matt Nadareski
00df5bdd6e UTF-8 treated like ASCII for old .NET 2024-05-07 05:28:46 -04:00
Matt Nadareski
00c087d8e0 Add third-party expansion fields for PKZIP 2024-04-28 02:30:46 -04:00
Matt Nadareski
6bc948784a Add PKZIP appendix A and B 2024-04-28 02:02:58 -04:00
Matt Nadareski
c4f14854c2 Add extensible data field definitions 2024-04-28 01:11:27 -04:00
Matt Nadareski
adaac68898 Bump version 2024-04-24 10:04:06 -04:00
Matt Nadareski
a9bc4a2bfe Fix getopts 2024-04-24 01:35:59 -04:00
Matt Nadareski
262b91de65 32 unicode characters, 64 bytes 2024-04-24 01:25:30 -04:00
Matt Nadareski
62bd6a4bde Add a couple of constants from UnshieldSharp 2024-04-24 00:36:41 -04:00
Matt Nadareski
7f14f0c5b0 Fix encoding for DirectoryEntry 2024-04-23 21:43:17 -04:00
Matt Nadareski
33d63fddae Bump version 2024-04-23 21:01:52 -04:00
Matt Nadareski
209be57bf4 Add layouts for some BD+ models 2024-04-23 20:59:47 -04:00
Matt Nadareski
a1581e9d9b Add layouts for some BFPK models 2024-04-23 20:58:51 -04:00
Matt Nadareski
521664d5a8 Add layouts for some BSP models 2024-04-23 20:57:24 -04:00
Matt Nadareski
73a8d91a83 Add layouts for some CFB models 2024-04-23 20:55:10 -04:00
Matt Nadareski
438e87f833 Add layouts for some CHD models 2024-04-23 20:50:09 -04:00
Matt Nadareski
2cdedbb456 Add layouts for some DVD models 2024-04-23 20:47:33 -04:00
Matt Nadareski
b57a545598 Add layouts for some GCF models 2024-04-23 20:38:11 -04:00
Matt Nadareski
8dc6eb2eee Add layouts for some IS-CAB models 2024-04-23 20:26:18 -04:00
Matt Nadareski
b58436d71a Add layouts for some MoPaQ models 2024-04-23 20:18:26 -04:00
Matt Nadareski
925c20021f Add layouts for some MSDOS models 2024-04-23 20:13:07 -04:00
Matt Nadareski
9bebf95599 Add layouts for some N3DS models 2024-04-23 20:09:39 -04:00
Matt Nadareski
089e13ca03 Add layouts for some NCF models 2024-04-23 19:34:56 -04:00
Matt Nadareski
de07b3b0dd Make some types non-nullable 2024-04-23 19:13:47 -04:00
Matt Nadareski
22cb5360e6 Add notes about prefixed strings 2024-04-23 17:20:05 -04:00
Matt Nadareski
a422ec7e6d Add layouts for some Nitro models 2024-04-23 17:15:15 -04:00
Matt Nadareski
f60afd6368 Add layouts for some PE models 2024-04-23 16:42:29 -04:00
Matt Nadareski
b8f67a8ab0 Add layouts for some VBSP models 2024-04-23 16:06:09 -04:00
Matt Nadareski
d844a8b582 Add layouts for some VPK models 2024-04-23 16:03:20 -04:00
Matt Nadareski
8583baa862 Add layouts for some WAD models 2024-04-23 15:56:43 -04:00
Matt Nadareski
8f3be17850 Add layouts for some XZP models 2024-04-23 15:49:41 -04:00
Matt Nadareski
5856967794 Fill and fix some ISAv3 information 2024-04-23 15:43:33 -04:00
Matt Nadareski
8f78c73c6f Fix publish scripts 2024-04-23 14:12:10 -04:00
Matt Nadareski
af4ff3d383 Bump version 2024-04-23 14:10:58 -04:00
Matt Nadareski
3e638a5c57 Make Linux publish script executable 2024-04-23 14:10:27 -04:00
Matt Nadareski
638d0226c1 Add publish scripts 2024-04-23 14:10:03 -04:00
Matt Nadareski
07c6d5b43a Obsolete is not an error... for now 2024-04-23 13:38:37 -04:00
Matt Nadareski
108e63a099 Add some null-terminated type flags 2024-04-23 13:36:24 -04:00
Matt Nadareski
c636d3252b Migrate many models to StructLayout 2024-04-23 13:30:43 -04:00
Matt Nadareski
b19dbf2254 Update APPNOTE link, add more Header IDs 2024-04-17 16:43:02 -04:00
Matt Nadareski
111b84170c Add relevant information to PKZIP archive 2024-04-17 16:09:30 -04:00
Matt Nadareski
2d7df0d4fb Add PKZIP archive model 2024-04-17 15:59:56 -04:00
Matt Nadareski
aba02663e5 Start adding PKZIP models 2024-04-17 15:47:41 -04:00
Matt Nadareski
594fec923a Bump version 2024-04-03 22:44:18 -04:00
Deterous
b5cf4e870d Add fields for v1.0 catalog.js files (#6) 2024-04-03 19:43:17 -07:00
Matt Nadareski
e6976796c2 Initial attempt at Delphi models 2024-04-02 10:58:20 -04:00
Deterous
295d8c7612 XboxOne/XboxSX catalog.js Model (#5)
* XboxOne catalog.js model

* Split Catalog object, bump version

* Minor fixes

* Custom JsonConverter for launchPackage

* Make launchPackage an abstract object

* Don't ignore packages

* Fix field types for Catalog/Package
2024-04-02 07:54:57 -07:00
Matt Nadareski
4dd184583c Revert XML tag for OfflineList duplicate ID 2024-03-19 15:30:45 -04:00
Matt Nadareski
081c9c9245 Bump version 2024-03-12 16:21:06 -04:00
Matt Nadareski
b974380ccf Fix SoftwareList.Disk field name 2024-03-12 15:28:58 -04:00
Matt Nadareski
41ed2cbc9a Fix XML element name for duplicateId 2024-03-12 00:07:47 -04:00
Matt Nadareski
2cfcb49e35 Fix missing OfflineList field 2024-03-11 23:35:22 -04:00
Matt Nadareski
b3f3f12b3e Use "main" instead of "master" 2024-02-27 19:06:26 -05:00
Matt Nadareski
b41700ff92 Update copyright date 2024-02-27 17:18:02 -05:00
Matt Nadareski
e8a357546b Add nuget package and PR workflows 2024-02-27 17:17:50 -05:00
Matt Nadareski
68f0201c11 Add SafeDisc encrypted file entry model 2023-11-30 19:11:52 -05:00
Matt Nadareski
25b6493249 Bump version 2023-11-21 11:15:24 -05:00
Matt Nadareski
a551363c0b Support .NET Framework 2.0 2023-11-20 23:44:05 -05:00
Matt Nadareski
2fd92aea8f Support .NET Framework 3.5 2023-11-20 21:10:43 -05:00
Matt Nadareski
a61b3d0ed9 Add IS Archive V3 models 2023-11-15 14:30:25 -05:00
Matt Nadareski
a40a6871df Bump version 2023-11-14 12:30:15 -05:00
Matt Nadareski
5792ec64c0 Cut off at .NET Framework 4.0 2023-11-08 10:45:12 -05:00
Matt Nadareski
3b13c7cc96 Cut off at .NET Framework 4.0 2023-11-08 10:44:47 -05:00
Matt Nadareski
894d7b62e2 Enable warnings as errors 2023-11-07 21:52:01 -05:00
Matt Nadareski
38e37b1a63 Support ancient .NET 2023-11-07 21:18:17 -05:00
Matt Nadareski
1f340bd244 Remove framework gating 2023-11-07 20:57:05 -05:00
Matt Nadareski
e582ce8726 Enable latest language version 2023-11-07 20:48:49 -05:00
Matt Nadareski
dad71add36 Expand supported RIDs 2023-11-07 20:47:31 -05:00
Matt Nadareski
cb2a28016e Enable broader support 2023-11-07 20:46:11 -05:00
Matt Nadareski
46a814ac73 Add PS3 SFB and SFO models 2023-11-03 15:18:26 -04:00
Matt Nadareski
8fabe9c02d Rename IRD to File internally 2023-10-29 21:53:12 -04:00
Matt Nadareski
21e22a1476 Bump version 2023-10-25 12:36:33 -04:00
Matt Nadareski
016057a837 Add mapping dictionaries for Xbox 2023-10-24 22:48:41 -04:00
Matt Nadareski
69ca889ac7 Add version guards around LZX.Chunk 2023-10-24 21:45:32 -04:00
Matt Nadareski
cd67a7282b Add version guards to IRD model 2023-10-23 11:33:50 -04:00
Matt Nadareski
948edbad58 Merge pull request #4 from Deterous/Deterous-patch-1
Improve IRD Model
2023-10-23 10:54:21 -04:00
Deterous
d445f02ba6 Specify the reserved attributes 2023-10-23 12:23:55 +13:00
Deterous
835fce7876 Comment on UID 2023-10-23 12:00:05 +13:00
Deterous
97513840e0 ID and UID are the same Property 2023-10-23 11:53:34 +13:00
Matt Nadareski
6112dcb391 Add IRD model 2023-10-22 01:03:34 -04:00
Matt Nadareski
c000e581c8 Bump version 2023-09-28 23:24:58 -04:00
Matt Nadareski
465cef4224 Add XGD4 identifier for PIC 2023-09-28 23:21:44 -04:00
Matt Nadareski
87cadbfd2b Add documentation around Quantum 2023-09-22 21:24:05 -04:00
Matt Nadareski
648ee2eaa5 Add back two properties 2023-09-22 21:15:52 -04:00
Matt Nadareski
daa814728d Simplify the Quantum models for now 2023-09-22 21:13:31 -04:00
Matt Nadareski
68aac36623 Fully create Chunk and ChunkHeader 2023-09-22 21:00:41 -04:00
Matt Nadareski
0c95cfcde4 More LZX cleanup 2023-09-22 20:47:29 -04:00
Matt Nadareski
6d6361c153 Start making LZX models better 2023-09-22 20:40:22 -04:00
Matt Nadareski
e4be402052 Bump version 2023-09-22 16:02:57 -04:00
Matt Nadareski
182c9bc756 Add remark on DeflateBlock 2023-09-22 15:37:49 -04:00
Matt Nadareski
cc62b3ffae This is an array 2023-09-22 15:34:55 -04:00
Matt Nadareski
7d34f486cd Make the MSZIP models better 2023-09-22 15:32:19 -04:00
Matt Nadareski
9c68cfc0c1 Fix issues found during MSZIP research 2023-09-22 11:54:48 -04:00
Matt Nadareski
9a5d681ad2 Bump version 2023-09-13 13:55:46 -04:00
Matt Nadareski
afb20e00be Add PIC models from MPF 2023-09-13 12:20:01 -04:00
Matt Nadareski
5a055a98c7 Add XMID and XeMID models from MPF 2023-09-13 12:11:56 -04:00
Matt Nadareski
793a4e2fdd Add cuesheet models from MPF 2023-09-13 11:34:58 -04:00
Matt Nadareski
43ff569ae3 Bump version 2023-09-10 21:40:05 -04:00
Matt Nadareski
970d2bddf9 Remove some lingering layout 2023-09-10 21:37:44 -04:00
Matt Nadareski
41a90278d5 Remove LayoutKind.Sequential
This may be replaced in the future when byte-serialzable types are more well-defined
2023-09-10 21:33:22 -04:00
Matt Nadareski
670b8428c2 Ensure explicit getters and setters 2023-09-10 21:24:10 -04:00
Matt Nadareski
e3c5c76ee5 Ensure more correct nullability 2023-09-10 20:47:25 -04:00
Matt Nadareski
89ba5f4508 Ensure more correct nullability 2023-09-10 20:27:14 -04:00
Matt Nadareski
ce072691bb Add first set of CHD models 2023-09-08 13:33:50 -04:00
Matt Nadareski
c52226cd3e Add Nuget link 2023-09-04 21:58:17 -04:00
699 changed files with 9007 additions and 9443 deletions

43
.github/workflows/build_nupkg.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Nuget Pack
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: 'SabreTools.Models/bin/Release/*.nupkg'
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: True
artifacts: 'SabreTools.Models/bin/Release/*.nupkg'
body: 'Last built commit: ${{ github.sha }}'
name: 'Rolling Release'
prerelease: True
replacesArtifacts: True
tag: "rolling"
updateOnlyUnreleased: True

17
.github/workflows/check_pr.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Build PR
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build

View File

@@ -1,150 +0,0 @@
namespace SabreTools.Models.AttractMode
{
public class Row
{
/// <remarks>Also called Romname</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
#if NET48
public string Title { get; set; }
#else
public string? Title { get; set; }
#endif
#if NET48
public string Emulator { get; set; }
#else
public string? Emulator { get; set; }
#endif
#if NET48
public string CloneOf { get; set; }
#else
public string? CloneOf { get; set; }
#endif
#if NET48
public string Year { get; set; }
#else
public string? Year { get; set; }
#endif
#if NET48
public string Manufacturer { get; set; }
#else
public string? Manufacturer { get; set; }
#endif
#if NET48
public string Category { get; set; }
#else
public string? Category { get; set; }
#endif
#if NET48
public string Players { get; set; }
#else
public string? Players { get; set; }
#endif
#if NET48
public string Rotation { get; set; }
#else
public string? Rotation { get; set; }
#endif
#if NET48
public string Control { get; set; }
#else
public string? Control { get; set; }
#endif
#if NET48
public string Status { get; set; }
#else
public string? Status { get; set; }
#endif
#if NET48
public string DisplayCount { get; set; }
#else
public string? DisplayCount { get; set; }
#endif
#if NET48
public string DisplayType { get; set; }
#else
public string? DisplayType { get; set; }
#endif
#if NET48
public string AltRomname { get; set; }
#else
public string? AltRomname { get; set; }
#endif
#if NET48
public string AltTitle { get; set; }
#else
public string? AltTitle { get; set; }
#endif
#if NET48
public string Extra { get; set; }
#else
public string? Extra { get; set; }
#endif
#if NET48
public string Buttons { get; set; }
#else
public string? Buttons { get; set; }
#endif
#if NET48
public string Favorite { get; set; }
#else
public string? Favorite { get; set; }
#endif
#if NET48
public string Tags { get; set; }
#else
public string? Tags { get; set; }
#endif
#if NET48
public string PlayedCount { get; set; }
#else
public string? PlayedCount { get; set; }
#endif
#if NET48
public string PlayedTime { get; set; }
#else
public string? PlayedTime { get; set; }
#endif
#if NET48
public string FileIsAvailable { get; set; }
#else
public string? FileIsAvailable { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}
}

View File

@@ -1,38 +0,0 @@
namespace SabreTools.Models.Compression.LZX
{
/// <summary>
/// An LZXD block represents a sequence of compressed data that is encoded with the same set of
/// Huffman trees, or a sequence of uncompressed data. There can be one or more LZXD blocks in a
/// compressed stream, each with its own set of Huffman trees. Blocks do not have to start or end on a
/// chunk boundary; blocks can span multiple chunks, or a single chunk can contain multiple blocks. The
/// number of chunks is related to the size of the data being compressed, while the number of blocks is
/// related to how well the data is compressed. The Block Type field, as specified in section 2.3.1.1,
/// indicates which type of block follows, and the Block Size field, as specified in section 2.3.1.2,
/// indicates the number of uncompressed bytes represented by the block. Following the generic block
/// header is a type-specific header that describes the remainder of the block.
/// </summary>
/// <see href="https://interoperability.blob.core.windows.net/files/MS-PATCH/%5bMS-PATCH%5d.pdf"/>
public class BlockHeader
{
/// <remarks>3 bits</remarks>
public BlockType BlockType;
/// <summary>
/// Block size is the high 8 bits of 24
/// </summary>
/// <remarks>8 bits</remarks>
public byte BlockSizeMSB;
/// <summary>
/// Block size is the middle 8 bits of 24
/// </summary>
/// <remarks>8 bits</remarks>
public byte BlockSizeByte2;
/// <summary>
/// Block size is the low 8 bits of 24
/// </summary>
/// <remarks>8 bits</remarks>
public byte BlocksizeLSB;
}
}

View File

@@ -1,46 +0,0 @@
namespace SabreTools.Models.Compression.LZX
{
public static class Constants
{
/* some constants defined by the LZX specification */
public const int LZX_MIN_MATCH = (2);
public const int LZX_MAX_MATCH = (257);
public const int LZX_NUM_CHARS = (256);
/// <summary>
/// also blocktypes 4-7 invalid
/// </summary>
public const int LZX_BLOCKTYPE_INVALID = (0);
public const int LZX_BLOCKTYPE_VERBATIM = (1);
public const int LZX_BLOCKTYPE_ALIGNED = (2);
public const int LZX_BLOCKTYPE_UNCOMPRESSED = (3);
public const int LZX_PRETREE_NUM_ELEMENTS = (20);
/// <summary>
/// aligned offset tree #elements
/// </summary>
public const int LZX_ALIGNED_NUM_ELEMENTS = (8);
/// <summary>
/// this one missing from spec!
/// </summary>
public const int LZX_NUM_PRIMARY_LENGTHS = (7);
/// <summary>
/// length tree #elements
/// </summary>
public const int LZX_NUM_SECONDARY_LENGTHS = (249);
/* LZX huffman defines: tweak tablebits as desired */
public const int LZX_PRETREE_MAXSYMBOLS = (LZX_PRETREE_NUM_ELEMENTS);
public const int LZX_PRETREE_TABLEBITS = (6);
public const int LZX_MAINTREE_MAXSYMBOLS = (LZX_NUM_CHARS + 50 * 8);
public const int LZX_MAINTREE_TABLEBITS = (12);
public const int LZX_LENGTH_MAXSYMBOLS = (LZX_NUM_SECONDARY_LENGTHS + 1);
public const int LZX_LENGTH_TABLEBITS = (12);
public const int LZX_ALIGNED_MAXSYMBOLS = (LZX_ALIGNED_NUM_ELEMENTS);
public const int LZX_ALIGNED_TABLEBITS = (7);
public const int LZX_LENTABLE_SAFETY = (64); /* we allow length table decoding overruns */
}
}

View File

@@ -1,102 +0,0 @@
namespace SabreTools.Models.Compression.LZX
{
public class Header
{
/*
2.2 Header
2.2.1 Chunk Size
The LZXD compressor emits chunks of compressed data. A chunk represents exactly 32 KB of
uncompressed data until the last chunk in the stream, which can represent less than 32 KB. To
ensure that an exact number of input bytes represent an exact number of output bytes for each
chunk, after each 32 KB of uncompressed data is represented in the output compressed bitstream, the
output bitstream is padded with up to 15 bits of zeros to realign the bitstream on a 16-bit boundary
(even byte boundary) for the next 32 KB of data. This results in a compressed chunk of a byte-aligned
size. The compressed chunk could be smaller than 32 KB or larger than 32 KB if the data is
incompressible when the chunk is not the last one.
The LZXD engine encodes a compressed, chunk-size prefix field preceding each compressed chunk in
the compressed byte stream. The compressed, chunk-size prefix field is a byte aligned, little-endian,
16-bit field. The chunk prefix chain could be followed in the compressed stream without
decompressing any data. The next chunk prefix is at a location computed by the absolute byte offset
location of this chunk prefix plus 2 (for the size of the chunk-size prefix field) plus the current chunk
size.
2.2.2 E8 Call Translation
E8 call translation is an optional feature that can be used when the data to compress contains x86
instruction sequences. E8 translation operates as a preprocessing stage before compressing each
chunk, and the compressed stream header contains a bit that indicates whether the decoder shall
reverse the translation as a postprocessing step after decompressing each chunk.
The x86 instruction beginning with a byte value of 0xE8 is followed by a 32-bit, little-endian relative
displacement to the call target. When E8 call translation is enabled, the following preprocessing steps
are performed on the uncompressed input before compression (assuming little-endian byte ordering):
Let chunk_offset refer to the total number of uncompressed bytes preceding this chunk.
Let E8_file_size refer to the caller-specified value given to the compressor or decoded from the header
of the compressed stream during decompression.
The following example shows how E8 translation is performed for each 32-KB chunk of uncompressed
data (or less than 32 KB if last chunk to compress).
if (( chunk_offset < 0x40000000 ) && ( chunk_size > 10 ))
for ( i = 0; i < (chunk_size 10); i++ )
if ( chunk_byte[ i ] == 0xE8 )
long current_pointer = chunk_offset + i;
long displacement = chunk_byte[ i+1 ] |
chunk_byte[ i+2 ] << 8 |
chunk_byte[ i+3 ] << 16 |
chunk_byte[ i+4 ] << 24;
long target = current_pointer + displacement;
if (( target >= 0 ) && ( target < E8_file_size+current_pointer))
if ( target >= E8_file_size )
target = displacement E8_file_size;
endif
chunk_byte[ i+1 ] = (byte)( target );
chunk_byte[ i+2 ] = (byte)( target >> 8 );
chunk_byte[ i+3 ] = (byte)( target >> 16 );
chunk_byte[ i+4 ] = (byte)( target >> 24 );
endif
i += 4;
endif
endfor
endif
After decompression, the E8 scanning algorithm is the same. The following example shows how E8
translation reversal is performed.
long value = chunk_byte[ i+1 ] |
chunk_byte[ i+2 ] << 8 |
chunk_byte[ i+3 ] << 16 |
chunk_byte[ i+4 ] << 24;
if (( value >= -current_pointer ) && ( value < E8_file_size ))
if ( value >= 0 )
displacement = value current_pointer;
else
displacement = value + E8_file_size;
endif
chunk_byte[ i+1 ] = (byte)( displacement );
chunk_byte[ i+2 ] = (byte)( displacement >> 8 );
chunk_byte[ i+3 ] = (byte)( displacement >> 16 );
chunk_byte[ i+4 ] = (byte)( displacement >> 24 );
endif
The first bit in the first chunk in the LZXD bitstream (following the 2-byte, chunk-size prefix described
in section 2.2.1) indicates the presence or absence of two 16-bit fields immediately following the
single bit. If the bit is set, E8 translation is enabled for all the following chunks in the stream using the
32-bit value derived from the two 16-bit fields as the E8_file_size provided to the compressor when E8
translation was enabled. Note that E8_file_size is completely independent of the length of the
uncompressed data. E8 call translation is disabled after the 32,768th chunk (after 1 gigabyte (GB) of
uncompressed data).
Field Comments Size
----------------------------------------------------------------
E8 translation 0-disabled, 1-enabled 1 bit
Translation size high word Only present if enabled 0 or 16 bits
Translation size low word Only present if enabled 0 or 16 bits
*/
}
}

View File

@@ -1,45 +0,0 @@
namespace SabreTools.Models.Compression.Quantum
{
public static class Constants
{
/// <summary>
/// Mask for Quantum Compression Level
/// </summary>
public const ushort MASK_QUANTUM_LEVEL = 0x00F0;
/// <summary>
/// Lowest Quantum Level (1)
/// </summary>
public const ushort QUANTUM_LEVEL_LO = 0x0010;
/// <summary>
/// Highest Quantum Level (7)
/// </summary>
public const ushort QUANTUM_LEVEL_HI = 0x0070;
/// <summary>
/// Amount to shift over to get int
/// </summary>
public const ushort SHIFT_QUANTUM_LEVEL = 4;
/// <summary>
/// Mask for Quantum Compression Memory
/// </summary>
public const ushort MASK_QUANTUM_MEM = 0x1F00;
/// <summary>
/// Lowest Quantum Memory (10)
/// </summary>
public const ushort QUANTUM_MEM_LO = 0x0A00;
/// <summary>
/// Highest Quantum Memory (21)
/// </summary>
public const ushort QUANTUM_MEM_HI = 0x1500;
/// <summary>
/// Amount to shift over to get int
/// </summary>
public const ushort SHIFT_QUANTUM_MEM = 8;
}
}

View File

@@ -1,23 +0,0 @@
namespace SabreTools.Models.Compression.Quantum
{
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/cabinet/cabinet.h"/>
/// <see href="http://www.russotto.net/quantumcomp.html"/>
public sealed class Model
{
public int TimeToReorder;
public int Entries;
#if NET48
public ModelSymbol[] Symbols;
#else
public ModelSymbol[]? Symbols;
#endif
#if NET48
public ushort[] LookupTable = new ushort[256];
#else
public ushort[]? LookupTable = new ushort[256];
#endif
}
}

View File

@@ -1,11 +0,0 @@
namespace SabreTools.Models.Compression.Quantum
{
/// <see href="https://github.com/wine-mirror/wine/blob/master/dlls/cabinet/cabinet.h"/>
/// <see href="http://www.russotto.net/quantumcomp.html"/>
public sealed class ModelSymbol
{
public ushort Symbol;
public ushort CumulativeFrequency;
}
}

View File

@@ -1,39 +0,0 @@
namespace SabreTools.Models.InstallShieldCabinet
{
/// <see href="https://github.com/twogood/unshield/blob/main/lib/cabfile.h"/>
/// TODO: Should standard and high values be combined?
public sealed class VolumeHeader
{
public uint DataOffset;
public uint DataOffsetHigh;
public uint FirstFileIndex;
public uint LastFileIndex;
public uint FirstFileOffset;
public uint FirstFileOffsetHigh;
public uint FirstFileSizeExpanded;
public uint FirstFileSizeExpandedHigh;
public uint FirstFileSizeCompressed;
public uint FirstFileSizeCompressedHigh;
public uint LastFileOffset;
public uint LastFileOffsetHigh;
public uint LastFileSizeExpanded;
public uint LastFileSizeExpandedHigh;
public uint LastFileSizeCompressed;
public uint LastFileSizeCompressedHigh;
}
}

View File

@@ -1,161 +0,0 @@
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The `LINEAR` executable-file header contains information that the loader requires for
/// segmented executable files. This information includes the linker version number, data
/// specified by linker, data specified by resource compiler, tables of segment data, tables
/// of resource data, and so on. The following illustrations shows the LE file header:
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
public sealed class Executable
{
/// <summary>
/// MS-DOS executable stub
/// </summary>
#if NET48
public MSDOS.Executable Stub { get; set; }
#else
public MSDOS.Executable? Stub { get; set; }
#endif
/// <summary>
/// Information block
/// </summary>
#if NET48
public InformationBlock InformationBlock { get; set; }
#else
public InformationBlock? InformationBlock { get; set; }
#endif
/// <summary>
/// Object table
/// </summary>
#if NET48
public ObjectTableEntry[] ObjectTable { get; set; }
#else
public ObjectTableEntry[]? ObjectTable { get; set; }
#endif
/// <summary>
/// Object page map
/// </summary>
#if NET48
public ObjectPageMapEntry[] ObjectPageMap { get; set; }
#else
public ObjectPageMapEntry[]? ObjectPageMap { get; set; }
#endif
// TODO: Object iterate data map table (Undefined)
/// <summary>
/// Resource table
/// </summary>
#if NET48
public ResourceTableEntry[] ResourceTable { get; set; }
#else
public ResourceTableEntry[]? ResourceTable { get; set; }
#endif
/// <summary>
/// Resident Name table
/// </summary>
#if NET48
public ResidentNamesTableEntry[] ResidentNamesTable { get; set; }
#else
public ResidentNamesTableEntry[]? ResidentNamesTable { get; set; }
#endif
/// <summary>
/// Entry table
/// </summary>
#if NET48
public EntryTableBundle[] EntryTable { get; set; }
#else
public EntryTableBundle[]? EntryTable { get; set; }
#endif
/// <summary>
/// Module format directives table (optional)
/// </summary>
#if NET48
public ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable { get; set; }
#else
public ModuleFormatDirectivesTableEntry[]? ModuleFormatDirectivesTable { get; set; }
#endif
/// <summary>
/// Verify record directive table (optional)
/// </summary>
#if NET48
public VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable { get; set; }
#else
public VerifyRecordDirectiveTableEntry[]? VerifyRecordDirectiveTable { get; set; }
#endif
/// <summary>
/// Fix-up page table
/// </summary>
#if NET48
public FixupPageTableEntry[] FixupPageTable { get; set; }
#else
public FixupPageTableEntry[]? FixupPageTable { get; set; }
#endif
/// <summary>
/// Fix-up record table
/// </summary>
#if NET48
public FixupRecordTableEntry[] FixupRecordTable { get; set; }
#else
public FixupRecordTableEntry[]? FixupRecordTable { get; set; }
#endif
/// <summary>
/// Import module name table
/// </summary>
#if NET48
public ImportModuleNameTableEntry[] ImportModuleNameTable { get; set; }
#else
public ImportModuleNameTableEntry[]? ImportModuleNameTable { get; set; }
#endif
/// <summary>
/// Import procedure name table
/// </summary>
#if NET48
public ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable { get; set; }
#else
public ImportModuleProcedureNameTableEntry[]? ImportModuleProcedureNameTable { get; set; }
#endif
/// <summary>
/// Per-Page checksum table
/// </summary>
#if NET48
public PerPageChecksumTableEntry[] PerPageChecksumTable { get; set; }
#else
public PerPageChecksumTableEntry[]? PerPageChecksumTable { get; set; }
#endif
/// <summary>
/// Non-Resident Name table
/// </summary>
#if NET48
public NonResidentNamesTableEntry[] NonResidentNamesTable { get; set; }
#else
public NonResidentNamesTableEntry[]? NonResidentNamesTable { get; set; }
#endif
// TODO: Non-resident directives data (Undefined)
/// <summary>
/// Debug information
/// </summary>
#if NET48
public DebugInformation DebugInformation { get; set; }
#else
public DebugInformation? DebugInformation { get; set; }
#endif
}
}

View File

@@ -1,718 +0,0 @@
using System.Xml.Serialization;
namespace SabreTools.Models.PortableExecutable
{
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
[XmlRoot(ElementName = "assembly", Namespace = "urn:schemas-microsoft-com:asm.v1")]
public sealed class AssemblyManifest
{
[XmlAttribute("manifestVersion")]
#if NET48
public string ManifestVersion;
#else
public string? ManifestVersion;
#endif
#region Group
[XmlElement("assemblyIdentity")]
#if NET48
public AssemblyIdentity[] AssemblyIdentities;
#else
public AssemblyIdentity[]? AssemblyIdentities;
#endif
[XmlElement("noInheritable")]
#if NET48
public AssemblyNoInheritable[] NoInheritables;
#else
public AssemblyNoInheritable[]? NoInheritables;
#endif
#endregion
#region Group
[XmlElement("description")]
#if NET48
public AssemblyDescription Description;
#else
public AssemblyDescription? Description;
#endif
[XmlElement("noInherit")]
#if NET48
public AssemblyNoInherit NoInherit;
#else
public AssemblyNoInherit? NoInherit;
#endif
//[XmlElement("noInheritable")]
//public AssemblyNoInheritable NoInheritable;
[XmlElement("comInterfaceExternalProxyStub")]
#if NET48
public AssemblyCOMInterfaceExternalProxyStub[] COMInterfaceExternalProxyStub;
#else
public AssemblyCOMInterfaceExternalProxyStub[]? COMInterfaceExternalProxyStub;
#endif
[XmlElement("dependency")]
#if NET48
public AssemblyDependency[] Dependency;
#else
public AssemblyDependency[]? Dependency;
#endif
[XmlElement("file")]
#if NET48
public AssemblyFile[] File;
#else
public AssemblyFile[]? File;
#endif
[XmlElement("clrClass")]
#if NET48
public AssemblyCommonLanguageRuntimeClass[] CLRClass;
#else
public AssemblyCommonLanguageRuntimeClass[]? CLRClass;
#endif
[XmlElement("clrSurrogate")]
#if NET48
public AssemblyCommonLanguageSurrogateClass[] CLRSurrogate;
#else
public AssemblyCommonLanguageSurrogateClass[]? CLRSurrogate;
#endif
#endregion
[XmlAnyElement]
#if NET48
public object[] EverythingElse;
#else
public object[]? EverythingElse;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyActiveCodePage
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyAutoElevate
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyBindingRedirect
{
[XmlAttribute("oldVersion")]
#if NET48
public string OldVersion;
#else
public string? OldVersion;
#endif
[XmlAttribute("newVersion")]
#if NET48
public string NewVersion;
#else
public string? NewVersion;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyCOMClass
{
[XmlAttribute("clsid")]
#if NET48
public string CLSID;
#else
public string? CLSID;
#endif
[XmlAttribute("threadingModel")]
#if NET48
public string ThreadingModel;
#else
public string? ThreadingModel;
#endif
[XmlAttribute("progid")]
#if NET48
public string ProgID;
#else
public string? ProgID;
#endif
[XmlAttribute("tlbid")]
#if NET48
public string TLBID;
#else
public string? TLBID;
#endif
[XmlAttribute("description")]
#if NET48
public string Description;
#else
public string? Description;
#endif
[XmlElement("progid")]
#if NET48
public AssemblyProgID[] ProgIDs;
#else
public AssemblyProgID[]? ProgIDs;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyCOMInterfaceExternalProxyStub
{
[XmlAttribute("iid")]
#if NET48
public string IID;
#else
public string? IID;
#endif
[XmlAttribute("name")]
#if NET48
public string Name;
#else
public string? Name;
#endif
[XmlAttribute("tlbid")]
#if NET48
public string TLBID;
#else
public string? TLBID;
#endif
[XmlAttribute("numMethods")]
#if NET48
public string NumMethods;
#else
public string? NumMethods;
#endif
[XmlAttribute("proxyStubClsid32")]
#if NET48
public string ProxyStubClsid32;
#else
public string? ProxyStubClsid32;
#endif
[XmlAttribute("baseInterface")]
#if NET48
public string BaseInterface;
#else
public string? BaseInterface;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyCOMInterfaceProxyStub
{
[XmlAttribute("iid")]
#if NET48
public string IID;
#else
public string? IID;
#endif
[XmlAttribute("name")]
#if NET48
public string Name;
#else
public string? Name;
#endif
[XmlAttribute("tlbid")]
#if NET48
public string TLBID;
#else
public string? TLBID;
#endif
[XmlAttribute("numMethods")]
#if NET48
public string NumMethods;
#else
public string? NumMethods;
#endif
[XmlAttribute("proxyStubClsid32")]
#if NET48
public string ProxyStubClsid32;
#else
public string? ProxyStubClsid32;
#endif
[XmlAttribute("baseInterface")]
#if NET48
public string BaseInterface;
#else
public string? BaseInterface;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyCommonLanguageRuntimeClass
{
[XmlAttribute("name")]
#if NET48
public string Name;
#else
public string? Name;
#endif
[XmlAttribute("clsid")]
#if NET48
public string CLSID;
#else
public string? CLSID;
#endif
[XmlAttribute("progid")]
#if NET48
public string ProgID;
#else
public string? ProgID;
#endif
[XmlAttribute("tlbid")]
#if NET48
public string TLBID;
#else
public string? TLBID;
#endif
[XmlAttribute("description")]
#if NET48
public string Description;
#else
public string? Description;
#endif
[XmlAttribute("runtimeVersion")]
#if NET48
public string RuntimeVersion;
#else
public string? RuntimeVersion;
#endif
[XmlAttribute("threadingModel")]
#if NET48
public string ThreadingModel;
#else
public string? ThreadingModel;
#endif
[XmlElement("progid")]
#if NET48
public AssemblyProgID[] ProgIDs;
#else
public AssemblyProgID[]? ProgIDs;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyCommonLanguageSurrogateClass
{
[XmlAttribute("clsid")]
#if NET48
public string CLSID;
#else
public string? CLSID;
#endif
[XmlAttribute("name")]
#if NET48
public string Name;
#else
public string? Name;
#endif
[XmlAttribute("runtimeVersion")]
#if NET48
public string RuntimeVersion;
#else
public string? RuntimeVersion;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDependency
{
[XmlElement("dependentAssembly")]
#if NET48
public AssemblyDependentAssembly DependentAssembly;
#else
public AssemblyDependentAssembly? DependentAssembly;
#endif
[XmlAttribute("optional")]
#if NET48
public string Optional;
#else
public string? Optional;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDependentAssembly
{
[XmlElement("assemblyIdentity")]
#if NET48
public AssemblyIdentity AssemblyIdentity;
#else
public AssemblyIdentity? AssemblyIdentity;
#endif
[XmlElement("bindingRedirect")]
#if NET48
public AssemblyBindingRedirect[] BindingRedirect;
#else
public AssemblyBindingRedirect[]? BindingRedirect;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDescription
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDisableTheming
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDisableWindowFiltering
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDPIAware
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyDPIAwareness
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyFile
{
[XmlAttribute("name")]
#if NET48
public string Name;
#else
public string? Name;
#endif
[XmlAttribute("hash")]
#if NET48
public string Hash;
#else
public string? Hash;
#endif
[XmlAttribute("hashalg")]
#if NET48
public string HashAlgorithm;
#else
public string? HashAlgorithm;
#endif
[XmlAttribute("size")]
#if NET48
public string Size;
#else
public string? Size;
#endif
#region Group
[XmlElement("comClass")]
#if NET48
public AssemblyCOMClass[] COMClass;
#else
public AssemblyCOMClass[]? COMClass;
#endif
[XmlElement("comInterfaceProxyStub")]
#if NET48
public AssemblyCOMInterfaceProxyStub[] COMInterfaceProxyStub;
#else
public AssemblyCOMInterfaceProxyStub[]? COMInterfaceProxyStub;
#endif
[XmlElement("typelib")]
#if NET48
public AssemblyTypeLib[] Typelib;
#else
public AssemblyTypeLib[]? Typelib;
#endif
[XmlElement("windowClass")]
#if NET48
public AssemblyWindowClass[] WindowClass;
#else
public AssemblyWindowClass[]? WindowClass;
#endif
#endregion
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyGDIScaling
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyHeapType
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyHighResolutionScrollingAware
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyIdentity
{
[XmlAttribute("name")]
#if NET48
public string Name;
#else
public string? Name;
#endif
[XmlAttribute("version")]
#if NET48
public string Version;
#else
public string? Version;
#endif
[XmlAttribute("type")]
#if NET48
public string Type;
#else
public string? Type;
#endif
[XmlAttribute("processorArchitecture")]
#if NET48
public string ProcessorArchitecture;
#else
public string? ProcessorArchitecture;
#endif
[XmlAttribute("publicKeyToken")]
#if NET48
public string PublicKeyToken;
#else
public string? PublicKeyToken;
#endif
[XmlAttribute("language")]
#if NET48
public string Language;
#else
public string? Language;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyLongPathAware
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyNoInherit
{
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyNoInheritable
{
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyPrinterDriverIsolation
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyProgID
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblySupportedOS
{
[XmlAttribute("Id")]
#if NET48
public string Id;
#else
public string? Id;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyTypeLib
{
[XmlElement("tlbid")]
#if NET48
public string TLBID;
#else
public string? TLBID;
#endif
[XmlElement("version")]
#if NET48
public string Version;
#else
public string? Version;
#endif
[XmlElement("helpdir")]
#if NET48
public string HelpDir;
#else
public string? HelpDir;
#endif
[XmlElement("resourceid")]
#if NET48
public string ResourceID;
#else
public string? ResourceID;
#endif
[XmlElement("flags")]
#if NET48
public string Flags;
#else
public string? Flags;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyUltraHighResolutionScrollingAware
{
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
/// <see href="https://learn.microsoft.com/en-us/windows/win32/sbscs/manifest-file-schema"/>
public sealed class AssemblyWindowClass
{
[XmlAttribute("versioned")]
#if NET48
public string Versioned;
#else
public string? Versioned;
#endif
[XmlText]
#if NET48
public string Value;
#else
public string? Value;
#endif
}
// TODO: Left off at <ElementType name="progid" />
}

View File

@@ -1,56 +0,0 @@
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// A menu resource consists of a MENUHEADER structure followed by one or more
/// NORMALMENUITEM or POPUPMENUITEM structures, one for each menu item in the menu
/// template. The MENUEX_TEMPLATE_HEADER and the MENUEX_TEMPLATE_ITEM structures
/// describe the format of extended menu resources.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/resource-file-formats"/>
public sealed class MenuResource
{
#region Menu header
/// <summary>
/// Menu header structure
/// </summary>
#if NET48
public MenuHeader MenuHeader;
#else
public MenuHeader? MenuHeader;
#endif
/// <summary>
/// Menu extended header structure
/// </summary>
#if NET48
public MenuHeaderExtended ExtendedMenuHeader;
#else
public MenuHeaderExtended? ExtendedMenuHeader;
#endif
#endregion
#region Menu items
/// <summary>
/// Menu items
/// </summary>
#if NET48
public MenuItem[] MenuItems;
#else
public MenuItem[]? MenuItems;
#endif
/// <summary>
/// Extended menu items
/// </summary>
#if NET48
public MenuItemExtended[] ExtendedMenuItems;
#else
public MenuItemExtended[]? ExtendedMenuItems;
#endif
#endregion
}
}

View File

@@ -2,6 +2,8 @@
This library comprises of models that represent either directly serializable or representative structures for all SabreTools projects. All of the main models representing metadata files should have parsers created outside of the current code.
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.Models).
In most completed models for serialization, there is a section that looks like the following:
```c#

View File

@@ -1,38 +0,0 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public abstract class DirectoryHeader<T>
{
public uint SectionOffset;
#if NET48
public T SectionCount;
#else
public T? SectionCount;
#endif
public uint FolderOffset;
#if NET48
public T FolderCount;
#else
public T? FolderCount;
#endif
public uint FileOffset;
#if NET48
public T FileCount;
#else
public T? FileCount;
#endif
public uint StringTableOffset;
#if NET48
public T StringTableCount;
#else
public T? StringTableCount;
#endif
}
}

View File

@@ -1,26 +0,0 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public class File4
{
public uint NameOffset;
#if NET48
public string Name;
#else
public string? Name;
#endif
public uint Offset;
public uint SizeOnDisk;
public uint Size;
public uint TimeModified;
public byte Dummy0;
public byte Type;
}
}

View File

@@ -1,38 +0,0 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public abstract class Folder<T>
{
public uint NameOffset;
#if NET48
public string Name;
#else
public string? Name;
#endif
#if NET48
public T FolderStartIndex;
#else
public T? FolderStartIndex;
#endif
#if NET48
public T FolderEndIndex;
#else
public T? FolderEndIndex;
#endif
#if NET48
public T FileStartIndex;
#else
public T? FileStartIndex;
#endif
#if NET48
public T FileEndIndex;
#else
public T? FileEndIndex;
#endif
}
}

View File

@@ -1,30 +0,0 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public sealed class Header4 : Header
{
#if NET48
public byte[] FileMD5;
#else
public byte[]? FileMD5;
#endif
#if NET48
public string Name;
#else
public string? Name;
#endif
#if NET48
public byte[] HeaderMD5;
#else
public byte[]? HeaderMD5;
#endif
public uint HeaderLength;
public uint FileDataOffset;
public uint Dummy0;
}
}

View File

@@ -1,48 +0,0 @@
namespace SabreTools.Models.SGA
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/SGAFile.h"/>
public abstract class Section<T>
{
#if NET48
public string Alias;
#else
public string? Alias;
#endif
#if NET48
public string Name;
#else
public string? Name;
#endif
#if NET48
public T FolderStartIndex;
#else
public T? FolderStartIndex;
#endif
#if NET48
public T FolderEndIndex;
#else
public T? FolderEndIndex;
#endif
#if NET48
public T FileStartIndex;
#else
public T? FileStartIndex;
#endif
#if NET48
public T FileEndIndex;
#else
public T? FileEndIndex;
#endif
#if NET48
public T FolderRootIndex;
#else
public T? FolderRootIndex;
#endif
}
}

View File

@@ -1,33 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Assembly Properties -->
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Version>1.1.0</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
<Description>Common models used by other SabreTools projects</Description>
<Copyright>Copyright (c) Matt Nadareski 2022-2023</Copyright>
<PackageProjectUrl>https://github.com/SabreTools/</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/SabreTools/SabreTools.Models</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>model models executable protection archive</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'!='net48'">
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath=""/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
</Project>

View File

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Models", "SabreTools.Models.csproj", "{51F0D5D9-7C2B-445A-8ECD-4A47B33609C4}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SabreTools.Models", "SabreTools.Models\SabreTools.Models.csproj", "{51F0D5D9-7C2B-445A-8ECD-4A47B33609C4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -1,17 +1,17 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <summary>
/// This record type is undocumented but found in real media key blocks
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public sealed class CopyrightRecord : Record
{
/// <summary>
/// Null-terminated ASCII string representing the copyright
/// </summary>
#if NET48
public string Copyright;
#else
[MarshalAs(UnmanagedType.LPStr)]
public string? Copyright;
#endif
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DriveRevocationListEntry
{
/// <summary>
@@ -16,10 +19,7 @@ namespace SabreTools.Models.AACS
/// (or the first in a range of Licensed Drives being revoked, in the
/// case of a non-zero Range value).
/// </summary>
#if NET48
public byte[] DriveID;
#else
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? DriveID;
#endif
}
}

View File

@@ -16,15 +16,11 @@ namespace SabreTools.Models.AACS
/// <summary>
/// The total number of Drive Revocation List Entry fields that follow.
/// </summary>
public uint TotalNumberOfEntries;
public uint TotalNumberOfEntries { get; set; }
/// <summary>
/// Revocation list entries
/// </summary>
#if NET48
public DriveRevocationSignatureBlock[] SignatureBlocks;
#else
public DriveRevocationSignatureBlock[]? SignatureBlocks;
#endif
public DriveRevocationSignatureBlock?[]? SignatureBlocks { get; set; }
}
}

View File

@@ -6,16 +6,12 @@ namespace SabreTools.Models.AACS
/// <summary>
/// The number of Drive Revocation List Entry fields in the signature block.
/// </summary>
public uint NumberOfEntries;
public uint NumberOfEntries { get; set; }
/// <summary>
/// A list of 8-byte Host Drive List Entry fields, the length of this
/// list being equal to the number in the signature block.
/// </summary>
#if NET48
public DriveRevocationListEntry[] EntryFields;
#else
public DriveRevocationListEntry[]? EntryFields;
#endif
public DriveRevocationListEntry?[]? EntryFields { get; set; }
}
}

View File

@@ -18,10 +18,6 @@ namespace SabreTools.Models.AACS
/// determines that the signature does not verify or is omitted, it
/// must refuse to use the Media Key.
/// </summary>
#if NET48
public byte[] SignatureData;
#else
public byte[]? SignatureData;
#endif
public byte[]? SignatureData { get; set; }
}
}

View File

@@ -6,10 +6,6 @@ namespace SabreTools.Models.AACS
/// <summary>
/// In this record, each subset-difference is encoded with 5 bytes.
/// </summary>
#if NET48
public SubsetDifference[] SubsetDifferences;
#else
public SubsetDifference[]? SubsetDifferences;
#endif
public SubsetDifference?[]? SubsetDifferences { get; set; }
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class HostRevocationListEntry
{
/// <summary>
@@ -16,10 +19,7 @@ namespace SabreTools.Models.AACS
/// first in a range of hosts being revoked, in the case of a non-zero
/// Range value).
/// </summary>
#if NET48
public byte[] HostID;
#else
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? HostID;
#endif
}
}

View File

@@ -19,15 +19,11 @@ namespace SabreTools.Models.AACS
/// <summary>
/// The total number of Host Revocation List Entry fields that follow.
/// </summary>
public uint TotalNumberOfEntries;
public uint TotalNumberOfEntries { get; set; }
/// <summary>
/// Revocation list entries
/// </summary>
#if NET48
public HostRevocationSignatureBlock[] SignatureBlocks;
#else
public HostRevocationSignatureBlock[]? SignatureBlocks;
#endif
public HostRevocationSignatureBlock?[]? SignatureBlocks { get; set; }
}
}

View File

@@ -6,16 +6,12 @@ namespace SabreTools.Models.AACS
/// <summary>
/// The number of Host Revocation List Entry fields in the signature block.
/// </summary>
public uint NumberOfEntries;
public uint NumberOfEntries { get; set; }
/// <summary>
/// A list of 8-byte Host Revocation List Entry fields, the length of this
/// list being equal to the number in the signature block.
/// </summary>
#if NET48
public HostRevocationListEntry[] EntryFields;
#else
public HostRevocationListEntry[]? EntryFields;
#endif
public HostRevocationListEntry?[]? EntryFields { get; set; }
}
}

View File

@@ -9,10 +9,6 @@ namespace SabreTools.Models.AACS
/// <summary>
/// Records
/// </summary>
#if NET48
public Record[] Records { get; set; }
#else
public Record[]? Records { get; set; }
#endif
public Record?[]? Records { get; set; }
}
}

View File

@@ -13,10 +13,6 @@ namespace SabreTools.Models.AACS
/// record. This 16 bytes is the ciphertext value C in the media
/// key calculation.
/// </summary>
#if NET48
public byte[][] MediaKeyData;
#else
public byte[][]? MediaKeyData;
#endif
public byte[][]? MediaKeyData { get; set; }
}
}

View File

@@ -15,7 +15,7 @@ namespace SabreTools.Models.AACS
/// <summary>
/// The Record Type field value indicates the type of the Record.
/// </summary>
public RecordType RecordType;
public RecordType RecordType { get; set; }
/// <summary>
/// The Record Length field value indicates the number of bytes in
@@ -23,6 +23,6 @@ namespace SabreTools.Models.AACS
/// fields themselves. Record lengths are always multiples of 4 bytes.
/// </summary>
// <remarks>UInt24 not UInt32</remarks>
public uint RecordLength;
public uint RecordLength { get; set; }
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.AACS
{
/// <see href="https://aacsla.com/wp-content/uploads/2019/02/AACS_Spec_Common_Final_0953.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class SubsetDifference
{
/// <summary>

View File

@@ -14,17 +14,13 @@ namespace SabreTools.Models.AACS
/// <summary>
/// The number of devices per index offset.
/// </summary>
public uint Span;
public uint Span { get; set; }
/// <summary>
/// These offsets refer to the offset within the following Explicit
/// Subset-Difference record, with 0 being the start of the record.
/// </summary>
// <remarks>UInt24 not UInt32</remarks>
#if NET48
public uint[] Offsets;
#else
public uint[]? Offsets;
#endif
public uint[]? Offsets { get; set; }
}
}

View File

@@ -17,7 +17,7 @@ namespace SabreTools.Models.AACS
/// controlling access to AACS Content on pre- recorded media. In
/// this case, the device shall not use the KCD.
/// </summary>
public MediaKeyBlockType MediaKeyBlockType;
public MediaKeyBlockType MediaKeyBlockType { get; set; }
/// <summary>
/// The Version Number is a 32-bit unsigned integer. Each time the
@@ -27,6 +27,6 @@ namespace SabreTools.Models.AACS
/// Version Numbers begin at 1; 0 is a special value used for test
/// Media Key Blocks.
/// </summary>
public uint VersionNumber;
public uint VersionNumber { get; set; }
}
}

View File

@@ -19,10 +19,6 @@ namespace SabreTools.Models.AACS
/// where 0xXXXXXXXXXXXXXXXX is an arbitrary 8-byte value, and Km is
/// the correct final Media Key value.
/// </summary>
#if NET48
public byte[] CiphertextValue;
#else
public byte[]? CiphertextValue;
#endif
public byte[]? CiphertextValue { get; set; }
}
}

View File

@@ -7,438 +7,198 @@ namespace SabreTools.Models.ArchiveDotOrg
public class File
{
[XmlAttribute("name")]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>Is this a set of defined values?</remarks>
[XmlAttribute("source")]
#if NET48
public string Source { get; set; }
#else
public string? Source { get; set; }
#endif
[XmlElement("btih")]
#if NET48
public string BitTorrentMagnetHash { get; set; }
#else
public string? BitTorrentMagnetHash { get; set; }
#endif
[XmlElement("mtime")]
#if NET48
public string LastModifiedTime { get; set; }
#else
public string? LastModifiedTime { get; set; }
#endif
[XmlElement("size")]
#if NET48
public string Size { get; set; }
#else
public string? Size { get; set; }
#endif
[XmlElement("md5")]
#if NET48
public string MD5 { get; set; }
#else
public string? MD5 { get; set; }
#endif
[XmlElement("crc32")]
#if NET48
public string CRC32 { get; set; }
#else
public string? CRC32 { get; set; }
#endif
[XmlElement("sha1")]
#if NET48
public string SHA1 { get; set; }
#else
public string? SHA1 { get; set; }
#endif
[XmlElement("filecount")]
#if NET48
public string FileCount { get; set; }
#else
public string? FileCount { get; set; }
#endif
/// <remarks>Is this a set of defined values?</remarks>
[XmlElement("format")]
#if NET48
public string Format { get; set; }
#else
public string? Format { get; set; }
#endif
[XmlElement("original")]
#if NET48
public string Original { get; set; }
#else
public string? Original { get; set; }
#endif
/// <remarks>Is this a set of defined values?</remarks>
[XmlElement("summation")]
#if NET48
public string Summation { get; set; }
#else
public string? Summation { get; set; }
#endif
[XmlElement("matrix_number")]
#if NET48
public string MatrixNumber { get; set; }
#else
public string? MatrixNumber { get; set; }
#endif
[XmlElement("collection-catalog-number")]
#if NET48
public string CollectionCatalogNumber { get; set; }
#else
public string? CollectionCatalogNumber { get; set; }
#endif
[XmlElement("publisher")]
#if NET48
public string Publisher { get; set; }
#else
public string? Publisher { get; set; }
#endif
[XmlElement("comment")]
#if NET48
public string Comment { get; set; }
#else
public string? Comment { get; set; }
#endif
#region ASR-Related
[XmlElement("asr_detected_lang")]
#if NET48
public string ASRDetectedLang { get; set; }
#else
public string? ASRDetectedLang { get; set; }
#endif
[XmlElement("asr_detected_lang_conf")]
#if NET48
public string ASRDetectedLangConf { get; set; }
#else
public string? ASRDetectedLangConf { get; set; }
#endif
[XmlElement("asr_transcribed_lang")]
#if NET48
public string ASRTranscribedLang { get; set; }
#else
public string? ASRTranscribedLang { get; set; }
#endif
[XmlElement("whisper_asr_module_version")]
#if NET48
public string WhisperASRModuleVersion { get; set; }
#else
public string? WhisperASRModuleVersion { get; set; }
#endif
[XmlElement("whisper_model_hash")]
#if NET48
public string WhisperModelHash { get; set; }
#else
public string? WhisperModelHash { get; set; }
#endif
[XmlElement("whisper_model_name")]
#if NET48
public string WhisperModelName { get; set; }
#else
public string? WhisperModelName { get; set; }
#endif
[XmlElement("whisper_version")]
#if NET48
public string WhisperVersion { get; set; }
#else
public string? WhisperVersion { get; set; }
#endif
#endregion
#region OCR-Related
[XmlElement("cloth_cover_detection_module_version")]
#if NET48
public string ClothCoverDetectionModuleVersion { get; set; }
#else
public string? ClothCoverDetectionModuleVersion { get; set; }
#endif
[XmlElement("hocr_char_to_word_hocr_version")]
#if NET48
public string hOCRCharToWordhOCRVersion { get; set; }
#else
public string? hOCRCharToWordhOCRVersion { get; set; }
#endif
[XmlElement("hocr_char_to_word_module_version")]
#if NET48
public string hOCRCharToWordModuleVersion { get; set; }
#else
public string? hOCRCharToWordModuleVersion { get; set; }
#endif
[XmlElement("hocr_fts_text_hocr_version")]
#if NET48
public string hOCRFtsTexthOCRVersion { get; set; }
#else
public string? hOCRFtsTexthOCRVersion { get; set; }
#endif
[XmlElement("hocr_fts_text_module_version")]
#if NET48
public string hOCRFtsTextModuleVersion { get; set; }
#else
public string? hOCRFtsTextModuleVersion { get; set; }
#endif
[XmlElement("hocr_pageindex_hocr_version")]
#if NET48
public string hOCRPageIndexhOCRVersion { get; set; }
#else
public string? hOCRPageIndexhOCRVersion { get; set; }
#endif
[XmlElement("hocr_pageindex_module_version")]
#if NET48
public string hOCRPageIndexModuleVersion { get; set; }
#else
public string? hOCRPageIndexModuleVersion { get; set; }
#endif
[XmlElement("ocr")]
#if NET48
public string TesseractOCR { get; set; }
#else
public string? TesseractOCR { get; set; }
#endif
[XmlElement("ocr_converted")]
#if NET48
public string TesseractOCRConverted { get; set; }
#else
public string? TesseractOCRConverted { get; set; }
#endif
[XmlElement("ocr_detected_lang")]
#if NET48
public string TesseractOCRDetectedLang { get; set; }
#else
public string? TesseractOCRDetectedLang { get; set; }
#endif
[XmlElement("ocr_detected_lang_conf")]
#if NET48
public string TesseractOCRDetectedLangConf { get; set; }
#else
public string? TesseractOCRDetectedLangConf { get; set; }
#endif
[XmlElement("ocr_detected_script")]
#if NET48
public string TesseractOCRDetectedScript { get; set; }
#else
public string? TesseractOCRDetectedScript { get; set; }
#endif
[XmlElement("ocr_detected_script_conf")]
#if NET48
public string TesseractOCRDetectedScriptConf { get; set; }
#else
public string? TesseractOCRDetectedScriptConf { get; set; }
#endif
[XmlElement("ocr_module_version")]
#if NET48
public string TesseractOCRModuleVersion { get; set; }
#else
public string? TesseractOCRModuleVersion { get; set; }
#endif
[XmlElement("ocr_parameters")]
#if NET48
public string TesseractOCRParameters { get; set; }
#else
public string? TesseractOCRParameters { get; set; }
#endif
[XmlElement("pdf_module_version")]
#if NET48
public string PDFModuleVersion { get; set; }
#else
public string? PDFModuleVersion { get; set; }
#endif
[XmlElement("word_conf_0_10")]
#if NET48
public string WordConfidenceInterval0To10 { get; set; }
#else
public string? WordConfidenceInterval0To10 { get; set; }
#endif
[XmlElement("word_conf_11_20")]
#if NET48
public string WordConfidenceInterval11To20 { get; set; }
#else
public string? WordConfidenceInterval11To20 { get; set; }
#endif
[XmlElement("word_conf_21_30")]
#if NET48
public string WordConfidenceInterval21To30 { get; set; }
#else
public string? WordConfidenceInterval21To30 { get; set; }
#endif
[XmlElement("word_conf_31_40")]
#if NET48
public string WordConfidenceInterval31To40 { get; set; }
#else
public string? WordConfidenceInterval31To40 { get; set; }
#endif
[XmlElement("word_conf_41_50")]
#if NET48
public string WordConfidenceInterval41To50 { get; set; }
#else
public string? WordConfidenceInterval41To50 { get; set; }
#endif
[XmlElement("word_conf_51_60")]
#if NET48
public string WordConfidenceInterval51To60 { get; set; }
#else
public string? WordConfidenceInterval51To60 { get; set; }
#endif
[XmlElement("word_conf_61_70")]
#if NET48
public string WordConfidenceInterval61To70 { get; set; }
#else
public string? WordConfidenceInterval61To70 { get; set; }
#endif
[XmlElement("word_conf_71_80")]
#if NET48
public string WordConfidenceInterval71To80 { get; set; }
#else
public string? WordConfidenceInterval71To80 { get; set; }
#endif
[XmlElement("word_conf_81_90")]
#if NET48
public string WordConfidenceInterval81To90 { get; set; }
#else
public string? WordConfidenceInterval81To90 { get; set; }
#endif
[XmlElement("word_conf_91_100")]
#if NET48
public string WordConfidenceInterval91To100 { get; set; }
#else
public string? WordConfidenceInterval91To100 { get; set; }
#endif
#endregion
#region Media-Related
[XmlElement("album")]
#if NET48
public string Album { get; set; }
#else
public string? Album { get; set; }
#endif
[XmlElement("artist")]
#if NET48
public string Artist { get; set; }
#else
public string? Artist { get; set; }
#endif
[XmlElement("bitrate")]
#if NET48
public string Bitrate { get; set; }
#else
public string? Bitrate { get; set; }
#endif
[XmlElement("creator")]
#if NET48
public string Creator { get; set; }
#else
public string? Creator { get; set; }
#endif
[XmlElement("height")]
#if NET48
public string Height { get; set; }
#else
public string? Height { get; set; }
#endif
[XmlElement("length")]
#if NET48
public string Length { get; set; }
#else
public string? Length { get; set; }
#endif
[XmlElement("preview-image")]
#if NET48
public string PreviewImage { get; set; }
#else
public string? PreviewImage { get; set; }
#endif
/// <remarks>Is this a set of defined values?</remarks>
[XmlElement("rotation")]
#if NET48
public string Rotation { get; set; }
#else
public string? Rotation { get; set; }
#endif
[XmlElement("title")]
#if NET48
public string Title { get; set; }
#else
public string? Title { get; set; }
#endif
[XmlElement("track")]
#if NET48
public string Track { get; set; }
#else
public string? Track { get; set; }
#endif
[XmlElement("width")]
#if NET48
public string Width { get; set; }
#else
public string? Width { get; set; }
#endif
#endregion
@@ -446,19 +206,11 @@ namespace SabreTools.Models.ArchiveDotOrg
/// <remarks>Should be empty</remarks>
[XmlAnyAttribute]
#if NET48
public XmlAttribute[] ADDITIONAL_ATTRIBUTES { get; set; }
#else
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
#endif
/// <remarks>Should be empty</remarks>
[XmlAnyElement]
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -7,29 +7,17 @@ namespace SabreTools.Models.ArchiveDotOrg
public class Files
{
[XmlElement("file")]
#if NET48
public File[] File { get; set; }
#else
public File[]? File { get; set; }
#endif
public File?[]? File { get; set; }
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
[XmlAnyAttribute]
#if NET48
public XmlAttribute[] ADDITIONAL_ATTRIBUTES { get; set; }
#else
public XmlAttribute[]? ADDITIONAL_ATTRIBUTES { get; set; }
#endif
/// <remarks>Should be empty</remarks>
[XmlAnyElement]
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -6,16 +6,8 @@ namespace SabreTools.Models.AttractMode
public class MetadataFile
{
[Required]
#if NET48
public string[] Header { get; set; }
#else
public string[]? Header { get; set; }
#endif
#if NET48
public Row[] Row { get; set; }
#else
public Row[]? Row { get; set; }
#endif
public Row?[]? Row { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
namespace SabreTools.Models.AttractMode
{
public class Row
{
/// <remarks>Also called Romname</remarks>
[Required]
public string? Name { get; set; }
public string? Title { get; set; }
public string? Emulator { get; set; }
public string? CloneOf { get; set; }
public string? Year { get; set; }
public string? Manufacturer { get; set; }
public string? Category { get; set; }
public string? Players { get; set; }
public string? Rotation { get; set; }
public string? Control { get; set; }
public string? Status { get; set; }
public string? DisplayCount { get; set; }
public string? DisplayType { get; set; }
public string? AltRomname { get; set; }
public string? AltTitle { get; set; }
public string? Extra { get; set; }
public string? Buttons { get; set; }
public string? Favorite { get; set; }
public string? Tags { get; set; }
public string? PlayedCount { get; set; }
public string? PlayedTime { get; set; }
public string? FileIsAvailable { get; set; }
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endregion
}
}

View File

@@ -6,57 +6,44 @@ namespace SabreTools.Models.BDPlus
/// <summary>
/// "BDSVM_CC"
/// </summary>
#if NET48
public string Signature;
#else
public string? Signature;
#endif
/// <remarks>8 bytes</remarks>
public string? Signature { get; set; }
/// <summary>
/// 5 bytes of unknown data
/// Unknown data
/// </summary>
#if NET48
public byte[] Unknown1;
#else
public byte[]? Unknown1;
#endif
/// <remarks>5 bytes</remarks>
public byte[]? Unknown1 { get; set; }
/// <summary>
/// Version year
/// </summary>
public ushort Year;
public ushort Year { get; set; }
/// <summary>
/// Version month
/// </summary>
public byte Month;
public byte Month { get; set; }
/// <summary>
/// Version day
/// </summary>
public byte Day;
public byte Day { get; set; }
/// <summary>
/// 4 bytes of unknown data
/// Unknown data
/// </summary>
#if NET48
public byte[] Unknown2;
#else
public byte[]? Unknown2;
#endif
/// <remarks>4 bytes</remarks>
public byte[]? Unknown2 { get; set; }
/// <summary>
/// Length
/// </summary>
public uint Length;
public uint Length { get; set; }
/// <summary>
/// Length bytes of data
/// </summary>
#if NET48
public byte[] Data;
#else
public byte[]? Data;
#endif
public byte[]? Data { get; set; }
}
}

View File

@@ -9,19 +9,11 @@
/// <summary>
/// Header
/// </summary>
#if NET48
public Header Header { get; set; }
#else
public Header? Header { get; set; }
#endif
/// <summary>
/// Files
/// </summary>
#if NET48
public FileEntry[] Files { get; set; }
#else
public FileEntry[]? Files { get; set; }
#endif
}
}

View File

@@ -9,30 +9,26 @@
/// <summary>
/// Name size
/// </summary>
public int NameSize;
public int NameSize { get; set; }
/// <summary>
/// Name
/// </summary>
#if NET48
public string Name;
#else
public string? Name;
#endif
public string? Name { get; set; }
/// <summary>
/// Uncompressed size
/// </summary>
public int UncompressedSize;
public int UncompressedSize { get; set; }
/// <summary>
/// Offset
/// </summary>
public int Offset;
public int Offset { get; set; }
/// <summary>
/// Compressed size
/// </summary>
public int CompressedSize;
public int CompressedSize { get; set; }
}
}

View File

@@ -6,17 +6,14 @@ namespace SabreTools.Models.BFPK
/// Header
/// </summary>
/// <see cref="https://forum.xentax.com/viewtopic.php?t=5102"/>
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public sealed class Header
{
/// <summary>
/// "BFPK"
/// </summary>
#if NET48
public string Magic;
#else
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string? Magic;
#endif
/// <summary>
/// Version

View File

@@ -1,3 +1,5 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BMP
{
/// <summary>
@@ -5,6 +7,7 @@ namespace SabreTools.Models.BMP
/// and layout of a file that contains a DIB.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapfileheader"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BITMAPFILEHEADER
{
/// <summary>

View File

@@ -1,9 +1,12 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BMP
{
/// <summary>
/// The BITMAPINFOHEADER structure contains information about the dimensions and
/// color format of a device-independent bitmap (DIB).
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public sealed class BITMAPINFOHEADER
{
/// <summary>

View File

@@ -9,37 +9,21 @@ namespace SabreTools.Models.BSP
/// <summary>
/// Header data
/// </summary>
#if NET48
public Header Header { get; set; }
#else
public Header? Header { get; set; }
#endif
/// <summary>
/// Lumps
/// </summary>
#if NET48
public Lump[] Lumps { get; set; }
#else
public Lump[]? Lumps { get; set; }
#endif
public Lump?[]? Lumps { get; set; }
/// <summary>
/// Texture header data
/// </summary>
#if NET48
public TextureHeader TextureHeader { get; set; }
#else
public TextureHeader? TextureHeader { get; set; }
#endif
/// <summary>
/// Textures
/// </summary>
#if NET48
public Texture[] Textures { get; set; }
#else
public Texture[]? Textures { get; set; }
#endif
public Texture?[]? Textures { get; set; }
}
}

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Header
{
/// <summary>

View File

@@ -1,6 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BSP
{
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Lump
{
/// <summary>

View File

@@ -6,52 +6,36 @@ namespace SabreTools.Models.BSP
/// <summary>
/// Name
/// </summary>
#if NET48
public string Name;
#else
public string? Name;
#endif
public string? Name { get; set; }
/// <summary>
/// Width
/// </summary>
public uint Width;
public uint Width { get; set; }
/// <summary>
/// Height
/// </summary>
public uint Height;
public uint Height { get; set; }
/// <summary>
/// Offsets
/// </summary>
#if NET48
public uint[] Offsets;
#else
public uint[]? Offsets;
#endif
public uint[]? Offsets { get; set; }
/// <summary>
/// Texture data
/// </summary>
#if NET48
public byte[] TextureData;
#else
public byte[]? TextureData;
#endif
public byte[]? TextureData { get; set; }
/// <summary>
/// Palette size
/// </summary>
public uint PaletteSize;
public uint PaletteSize { get; set; }
/// <summary>
/// Palette data
/// </summary>
#if NET48
public byte[] PaletteData;
#else
public byte[]? PaletteData;
#endif
public byte[]? PaletteData { get; set; }
}
}

View File

@@ -6,15 +6,12 @@ namespace SabreTools.Models.BSP
/// <summary>
/// Texture count
/// </summary>
public uint TextureCount;
public uint TextureCount { get; set; }
/// <summary>
/// Offsets
/// </summary>
#if NET48
public uint[] Offsets;
#else
public uint[]? Offsets;
#endif
/// <remarks>TextureCount entries</remarks>
public uint[]? Offsets { get; set; }
}
}

View File

@@ -12,11 +12,7 @@ namespace SabreTools.Models.CFB
/// <summary>
/// Compound file header
/// </summary>
#if NET48
public FileHeader Header { get; set; }
#else
public FileHeader? Header { get; set; }
#endif
/// <summary>
/// The FAT is the main allocator for space within a compound file.
@@ -29,11 +25,7 @@ namespace SabreTools.Models.CFB
///
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
/// </remarks>
#if NET48
public SectorNumber[] FATSectorNumbers { get; set; }
#else
public SectorNumber[]? FATSectorNumbers { get; set; }
#endif
/// <summary>
/// The mini FAT is used to allocate space in the mini stream.
@@ -46,11 +38,7 @@ namespace SabreTools.Models.CFB
///
/// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector
/// </remarks>
#if NET48
public SectorNumber[] MiniFATSectorNumbers { get; set; }
#else
public SectorNumber[]? MiniFATSectorNumbers { get; set; }
#endif
/// <summary>
/// The DIFAT array is used to represent storage of the FAT sectors.
@@ -67,11 +55,7 @@ namespace SabreTools.Models.CFB
/// If Header Major Version is 4, there MUST be 1,023 fields specified
/// to fill a 4,096-byte sector minus the "Next DIFAT Sector Location" field.
/// </remarks>
#if NET48
public SectorNumber[] DIFATSectorNumbers { get; set; }
#else
public SectorNumber[]? DIFATSectorNumbers { get; set; }
#endif
/// <summary>
/// The directory entry array is an array of directory entries that
@@ -103,10 +87,6 @@ namespace SabreTools.Models.CFB
/// all zeroes. The Modified Time field in the root storage directory
/// entry MAY be all zeroes.
/// <remarks>
#if NET48
public DirectoryEntry[] DirectoryEntries { get; set; }
#else
public DirectoryEntry[]? DirectoryEntries { get; set; }
#endif
}
}

View File

@@ -1,8 +1,10 @@
using System;
using System.Runtime.InteropServices;
namespace SabreTools.Models.CFB
{
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public sealed class DirectoryEntry
{
/// <summary>
@@ -16,11 +18,9 @@ namespace SabreTools.Models.CFB
/// The following characters are illegal and MUST NOT be part of the
/// name: '/', '\', ':', '!'.
/// </summary>
#if NET48
public string Name;
#else
/// <remarks>64 bytes</remarks>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string? Name;
#endif
/// <summary>
/// This field MUST be 0x00, 0x01, 0x02, or 0x05, depending on the
@@ -34,23 +34,27 @@ namespace SabreTools.Models.CFB
/// terminating null character in the count. This length MUST NOT exceed 64,
/// the maximum size of the Directory Entry Name field.
/// </summary>
[MarshalAs(UnmanagedType.U1)]
public ObjectType ObjectType;
/// <summary>
/// This field MUST be 0x00 (red) or 0x01 (black). All other values are not valid.
/// </summary>
[MarshalAs(UnmanagedType.U1)]
public ColorFlag ColorFlag;
/// <summary>
/// This field contains the stream ID of the left sibling. If there
/// is no left sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF).
/// </summary>
[MarshalAs(UnmanagedType.U4)]
public StreamID LeftSiblingID;
/// <summary>
/// This field contains the stream ID of the right sibling. If there
/// is no right sibling, the field MUST be set to NOSTREAM (0xFFFFFFFF).
/// </summary>
[MarshalAs(UnmanagedType.U4)]
public StreamID RightSiblingID;
/// <summary>
@@ -58,6 +62,7 @@ namespace SabreTools.Models.CFB
/// child object, including all entries for stream objects, the field
/// MUST be set to NOSTREAM (0xFFFFFFFF).
/// </summary>
[MarshalAs(UnmanagedType.U4)]
public StreamID ChildID;
/// <summary>

View File

@@ -1,8 +1,10 @@
using System;
using System.Runtime.InteropServices;
namespace SabreTools.Models.CFB
{
/// <see href="https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-CFB/%5bMS-CFB%5d.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FileHeader
{
/// <summary>
@@ -57,11 +59,9 @@ namespace SabreTools.Models.CFB
/// <summary>
/// This field MUST be set to all zeroes.
/// </summary>
#if NET48
public byte[] Reserved;
#else
/// <remarks>6 bytes</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[]? Reserved;
#endif
/// <summary>
/// This integer field contains the count of the number of directory sectors
@@ -126,10 +126,8 @@ namespace SabreTools.Models.CFB
/// This array of 32-bit integer fields contains the first 109 FAT sector
/// locations of the compound file
/// </summary>
#if NET48
public SectorNumber[] DIFAT;
#else
/// <remarks>109 entries</remarks>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 109)]
public SectorNumber[]? DIFAT;
#endif
}
}

View File

@@ -11,36 +11,32 @@ namespace SabreTools.Models.CFB
/// This field MUST be set to 0xFFFE. This field is a byte order mark for
/// all integer fields, specifying little-endian byte order.
/// </summary>
public ushort ByteOrder;
public ushort ByteOrder { get; set; }
/// <summary>
/// Format
/// </summary>
public ushort Format;
public ushort Format { get; set; }
/// <summary>
/// Build
/// </summary>
public ushort Build;
public ushort Build { get; set; }
/// <summary>
/// Platform ID
/// </summary>
public ushort PlatformID;
public ushort PlatformID { get; set; }
/// <summary>
/// CLSID
/// </summary>
public Guid CLSID;
public Guid CLSID { get; set; }
/// <summary>
/// 4 bytes of reserved data
/// </summary>
#if NET48
public byte[] Reserved;
#else
public byte[]? Reserved;
#endif
public byte[]? Reserved { get; set; }
#endregion
@@ -49,16 +45,12 @@ namespace SabreTools.Models.CFB
/// <summary>
/// Format ID, should be <see cref="Constants.FMTID_SummaryInformation"/>
/// </summary>
public Guid FormatID;
public Guid FormatID { get; set; }
/// <summary>
/// 16 bytes of unknown data
/// </summary>
#if NET48
public byte[] Unknown;
#else
public byte[]? Unknown;
#endif
public byte[]? Unknown { get; set; }
#endregion
@@ -67,27 +59,23 @@ namespace SabreTools.Models.CFB
/// <summary>
/// Location of the section
/// </summary>
public uint Offset;
public uint Offset { get; set; }
/// <summary>
/// Section count(?)
/// </summary>
public uint SectionCount;
public uint SectionCount { get; set; }
/// <summary>
/// Property count
/// </summary>
public uint PropertyCount;
public uint PropertyCount { get; set; }
/// <summary>
/// Properties
/// </summary>
/// <remarks>Each Variant might be followed by an index and offset value</remarks>
#if NET48
public Variant[] Properties;
#else
public Variant[]? Properties;
#endif
public Variant[]? Properties { get; set; }
#endregion
}

View File

@@ -9,41 +9,37 @@ namespace SabreTools.Models.CFB
/// <summary>
/// MUST be set to the size, in quad words (64 bits), of the structure.
/// </summary>
public uint Size;
public uint Size { get; set; }
/// <summary>
/// MUST be set to 0 and MUST be ignored by the recipient.
/// </summary>
public uint RpcReserved;
public uint RpcReserved { get; set; }
/// <summary>
/// MUST be set to one of the values specified with a "V".
/// </summary>
public VariantType VariantType;
public VariantType VariantType { get; set; }
/// <summary>
/// MAY be set to 0 and MUST be ignored by the recipient.
/// </summary>
public ushort Reserved1;
public ushort Reserved1 { get; set; }
/// <summary>
/// MAY be set to 0 and MUST be ignored by the recipient.
/// </summary>
public ushort Reserved2;
public ushort Reserved2 { get; set; }
/// <summary>
/// MAY be set to 0 and MUST be ignored by the recipient.
/// </summary>
public ushort Reserved3;
public ushort Reserved3 { get; set; }
/// <summary>
/// MUST contain an instance of the type, according to the value
/// in the <see cref="VariantType"/> field.
/// </summary>
#if NET48
public object Union;
#else
public object? Union;
#endif
public object? Union { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CompressedMapEntryV5
{
/// <summary>
/// Compression type
/// </summary>
public byte Compression;
/// <summary>
/// Compressed length
/// </summary>
/// <remarks>Actually UInt24</remarks>
public uint CompLength;
/// <summary>
/// Offset
/// </summary>
/// <remarks>Actually UInt48</remarks>
public ulong Offset;
/// <summary>
/// CRC-16 of the data
/// </summary>
public ushort CRC;
}
}

View File

@@ -0,0 +1,45 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CompressedMapHeaderV5
{
/// <summary>
/// Length of compressed map
/// </summary>
public uint Length;
/// <summary>
/// Offset of first block
/// </summary>
/// <remarks>Actually UInt48</remarks>
public ulong DataStart;
/// <summary>
/// CRC-16 of the map
/// </summary>
public ushort CRC;
/// <summary>
/// Bits used to encode complength
/// </summary>
public byte LengthBits;
/// <summary>
/// Bits used to encode self-refs
/// </summary>
public byte HunkBits;
/// <summary>
/// Bits used to encode parent unit refs
/// </summary>
public byte ParentUnitBits;
/// <summary>
/// Future use
/// </summary>
public byte Reserved;
}
}

View File

@@ -0,0 +1,42 @@
using System;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public enum CompressionType : uint
{
#region V1
CHDCOMPRESSION_NONE = 0,
CHDCOMPRESSION_ZLIB = 1,
#endregion
#region V3
CHDCOMPRESSION_ZLIB_PLUS = 2,
#endregion
#region V4
CHDCOMPRESSION_AV = 3,
#endregion
}
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[Flags]
public enum Flags : uint
{
/// <summary>
/// Set if this drive has a parent
/// </summary>
DriveHasParent = 0x00000001,
/// <summary>
/// Set if this drive allows writes
/// </summary>
DriveAllowsWrites = 0x00000002,
}
}

View File

@@ -0,0 +1,21 @@
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public abstract class Header
{
/// <summary>
/// 'MComprHD'
/// </summary>
public string? Tag { get; set; }
/// <summary>
/// Length of header (including tag and length fields)
/// </summary>
public uint Length { get; set; }
/// <summary>
/// Drive format version
/// </summary>
public uint Version { get; set; }
}
}

View File

@@ -0,0 +1,51 @@
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class HeaderV1 : Header
{
/// <summary>
/// Flags
/// </summary>
public Flags Flags { get; set; }
/// <summary>
/// Compression type
/// </summary>
public CompressionType Compression { get; set; }
/// <summary>
/// 512-byte sectors per hunk
/// </summary>
public uint HunkSize { get; set; }
/// <summary>
/// Total # of hunks represented
/// </summary>
public uint TotalHunks { get; set; }
/// <summary>
/// Number of cylinders on hard disk
/// </summary>
public uint Cylinders { get; set; }
/// <summary>
/// Number of heads on hard disk
/// </summary>
public uint Heads { get; set; }
/// <summary>
/// Number of sectors on hard disk
/// </summary>
public uint Sectors { get; set; }
/// <summary>
/// MD5 checksum of raw data
/// </summary>
public byte[]? MD5 { get; set; } = new byte[16];
/// <summary>
/// MD5 checksum of parent file
/// </summary>
public byte[]? ParentMD5 { get; set; } = new byte[16];
}
}

View File

@@ -0,0 +1,56 @@
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class HeaderV2 : Header
{
/// <summary>
/// Flags
/// </summary>
public Flags Flags { get; set; }
/// <summary>
/// Compression type
/// </summary>
public CompressionType Compression { get; set; }
/// <summary>
/// Seclen-byte sectors per hunk
/// </summary>
public uint HunkSize { get; set; }
/// <summary>
/// Total # of hunks represented
/// </summary>
public uint TotalHunks { get; set; }
/// <summary>
/// Number of cylinders on hard disk
/// </summary>
public uint Cylinders { get; set; }
/// <summary>
/// Number of heads on hard disk
/// </summary>
public uint Heads { get; set; }
/// <summary>
/// Number of sectors on hard disk
/// </summary>
public uint Sectors { get; set; }
/// <summary>
/// MD5 checksum of raw data
/// </summary>
public byte[]? MD5 { get; set; } = new byte[16];
/// <summary>
/// MD5 checksum of parent file
/// </summary>
public byte[]? ParentMD5 { get; set; } = new byte[16];
/// <summary>
/// Number of bytes per sector
/// </summary>
public uint BytesPerSector { get; set; }
}
}

View File

@@ -0,0 +1,56 @@
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class HeaderV3 : Header
{
/// <summary>
/// Flags
/// </summary>
public Flags Flags { get; set; }
/// <summary>
/// Compression type
/// </summary>
public CompressionType Compression { get; set; }
/// <summary>
/// Total # of hunks represented
/// </summary>
public uint TotalHunks { get; set; }
/// <summary>
/// Logical size of the data (in bytes)
/// </summary>
public ulong LogicalBytes { get; set; }
/// <summary>
/// Offset to the first blob of metadata
/// </summary>
public ulong MetaOffset { get; set; }
/// <summary>
/// MD5 checksum of raw data
/// </summary>
public byte[]? MD5 { get; set; } = new byte[16];
/// <summary>
/// MD5 checksum of parent file
/// </summary>
public byte[]? ParentMD5 { get; set; } = new byte[16];
/// <summary>
/// Number of bytes per hunk
/// </summary>
public uint HunkBytes { get; set; }
/// <summary>
/// SHA1 checksum of raw data
/// </summary>
public byte[]? SHA1 { get; set; } = new byte[20];
/// <summary>
/// SHA1 checksum of parent file
/// </summary>
public byte[]? ParentSHA1 { get; set; } = new byte[20];
}
}

View File

@@ -0,0 +1,51 @@
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class HeaderV4 : Header
{
/// <summary>
/// Flags
/// </summary>
public Flags Flags { get; set; }
/// <summary>
/// Compression type
/// </summary>
public CompressionType Compression { get; set; }
/// <summary>
/// Total # of hunks represented
/// </summary>
public uint TotalHunks { get; set; }
/// <summary>
/// Logical size of the data (in bytes)
/// </summary>
public ulong LogicalBytes { get; set; }
/// <summary>
/// Offset to the first blob of metadata
/// </summary>
public ulong MetaOffset { get; set; }
/// <summary>
/// Number of bytes per hunk
/// </summary>
public uint HunkBytes { get; set; }
/// <summary>
/// Combined raw+meta SHA1
/// </summary>
public byte[]? SHA1 { get; set; } = new byte[20];
/// <summary>
/// Combined raw+meta SHA1 of parent
/// </summary>
public byte[]? ParentSHA1 { get; set; } = new byte[20];
/// <summary>
/// Raw data SHA1
/// </summary>
public byte[]? RawSHA1 { get; set; } = new byte[20];
}
}

View File

@@ -0,0 +1,51 @@
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
public class HeaderV5 : Header
{
/// <summary>
/// Which custom compressors are used?
/// </summary>
public uint[] Compressors { get; set; } = new uint[4];
/// <summary>
/// Logical size of the data (in bytes)
/// </summary>
public ulong LogicalBytes { get; set; }
/// <summary>
/// Offset to the map
/// </summary>
public ulong MapOffset { get; set; }
/// <summary>
/// Offset to the first blob of metadata
/// </summary>
public ulong MetaOffset { get; set; }
/// <summary>
/// Number of bytes per hunk (512k maximum)
/// </summary>
public uint HunkBytes { get; set; }
/// <summary>
/// Number of bytes per unit within each hunk
/// </summary>
public uint UnitBytes { get; set; }
/// <summary>
/// Raw data SHA1
/// </summary>
public byte[]? RawSHA1 { get; set; }
/// <summary>
/// Combined raw+meta SHA1
/// </summary>
public byte[]? SHA1 { get; set; }
/// <summary>
/// Combined raw+meta SHA1 of parent
/// </summary>
public byte[]? ParentSHA1 { get; set; }
}
}

View File

@@ -0,0 +1,19 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class MapV1
{
/// <summary>
/// Starting offset within the file
/// </summary>
public ulong StartingOffset;
/// <summary>
/// Length of data; If == hunksize, data is uncompressed
/// </summary>
public ulong Length;
}
}

View File

@@ -0,0 +1,34 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class MapV3
{
/// <summary>
/// Starting offset within the file
/// </summary>
public ulong StartingOffset;
/// <summary>
/// 32-bit CRC of the uncompressed data
/// </summary>
public uint CRC32;
/// <summary>
/// Lower 16 bits of length
/// </summary>
public ushort LengthLo;
/// <summary>
/// Upper 8 bits of length
/// </summary>
public byte LengthHi;
/// <summary>
/// Flags, indicating compression info
/// </summary>
public byte Flags;
}
}

View File

@@ -0,0 +1,14 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.CHD
{
/// <see href="https://github.com/mamedev/mame/blob/master/src/lib/util/chd.h"/>
[StructLayout(LayoutKind.Sequential)]
public class UncompressedMapV5
{
/// <summary>
/// Starting offset / hunk size
/// </summary>
public uint StartingOffset;
}
}

View File

@@ -12,71 +12,43 @@ namespace SabreTools.Models.Charts
/// Title of the song.
/// </summary>
/// <remarks>name</remarks>
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <summary>
/// Artist(s) or band(s) behind the song.
/// </summary>
/// <remarks>artist</remarks>
#if NET48
public string Artist { get; set; }
#else
public string? Artist { get; set; }
#endif
/// <summary>
/// Title of the album the song is featured in.
/// </summary>
/// <remarks>album</remarks>
#if NET48
public string Album { get; set; }
#else
public string? Album { get; set; }
#endif
/// <summary>
/// Genre of the song.
/// </summary>
/// <remarks>genre</remarks>
#if NET48
public string Genre { get; set; }
#else
public string? Genre { get; set; }
#endif
/// <summary>
/// Sub-genre for the song.
/// </summary>
/// <remarks>sub_genre</remarks>
#if NET48
public string SubGenre { get; set; }
#else
public string? SubGenre { get; set; }
#endif
/// <summary>
/// Year of the songs release.
/// </summary>
/// <remarks>year</remarks>
#if NET48
public string Year { get; set; }
#else
public string? Year { get; set; }
#endif
/// <summary>
/// Community member responsible for charting the song.
/// </summary>
/// <remarks>charter, frets</remarks>
#if NET48
public string Charter { get; set; }
#else
public string? Charter { get; set; }
#endif
/// <summary>
/// Version number for the song.
@@ -118,11 +90,7 @@ namespace SabreTools.Models.Charts
/// Flavor text for this song, usually shown after picking the song or during loading.
/// </summary>
/// <remarks>loading_phrase</remarks>
#if NET48
public string LoadingPhrase { get; set; }
#else
public string? LoadingPhrase { get; set; }
#endif
#endregion
@@ -132,53 +100,33 @@ namespace SabreTools.Models.Charts
/// (FoFiX) Hex color to use in the song screen for the cassette.
/// </summary>
/// <remarks>cassettecolor</remarks>
#if NET48
public string CassetteColor { get; set; }
#else
public string? CassetteColor { get; set; }
#endif
/// <summary>
/// (FoFiX) Miscellaneous tags for the chart.
/// Only known valid value is `cover`.
/// </summary>
/// <remarks>tags</remarks>
#if NET48
public string Tags { get; set; }
#else
public string? Tags { get; set; }
#endif
/// <summary>
/// (PS) Two timestamps in milliseconds for preview start and end time.
/// Example: `55000 85000`
/// </summary>
/// <remarks>preview</remarks>
#if NET48
public long[] Preview { get; set; }
#else
public long[]? Preview { get; set; }
#endif
/// <summary>
/// (CH) Playlist that the song should show up in.
/// </summary>
/// <remarks>playlist</remarks>
#if NET48
public string Playlist { get; set; }
#else
public string? Playlist { get; set; }
#endif
/// <summary>
/// (CH) Sub-playlist that the song should show up in.
/// </summary>
/// <remarks>sub_playlist</remarks>
#if NET48
public string SubPlaylist { get; set; }
#else
public string? SubPlaylist { get; set; }
#endif
/// <summary>
/// (CH) Indicates if this song is a modchart.
@@ -350,51 +298,31 @@ namespace SabreTools.Models.Charts
/// Specifies a voice type for the singer (either "male" or "female").
/// </summary>
/// <remarks>vocal_gender</remarks>
#if NET48
public string VocalGender { get; set; }
#else
public string? VocalGender { get; set; }
#endif
/// <summary>
/// Specifies a tuning for 17-fret Pro Guitar.
/// </summary>
/// <remarks>real_guitar_tuning</remarks>
#if NET48
public string RealGuitarTuning { get; set; }
#else
public string? RealGuitarTuning { get; set; }
#endif
/// <summary>
/// Specifies a tuning for 22-fret Pro Guitar.
/// </summary>
/// <remarks>real_guitar_22_tuning</remarks>
#if NET48
public string RealGuitar22Tuning { get; set; }
#else
public string? RealGuitar22Tuning { get; set; }
#endif
/// <summary>
/// Specifies a tuning for 17-fret Pro Bass.
/// </summary>
/// <remarks>real_bass_tuning</remarks>
#if NET48
public string RealBassTuning { get; set; }
#else
public string? RealBassTuning { get; set; }
#endif
/// <summary>
/// Specifies a tuning for 22-fret Pro Bass.
/// </summary>
/// <remarks>real_bass_22_tuning</remarks>
#if NET48
public string RealBass22Tuning { get; set; }
#else
public string? RealBass22Tuning { get; set; }
#endif
/// <summary>
/// Specifies the number of lanes for the right hand in Real Keys.
@@ -479,11 +407,7 @@ namespace SabreTools.Models.Charts
/// Valid values are "none", "half", or "full".
/// </summary>
/// <remarks>early_hit_window_size</remarks>
#if NET48
public string EarlyHitWindowSize { get; set; }
#else
public string? EarlyHitWindowSize { get; set; }
#endif
/// <summary>
/// (CH) Sets whether or not end events in the chart will be respected.
@@ -560,31 +484,19 @@ namespace SabreTools.Models.Charts
/// Included in either the chart folder or the game the chart was made for, or sourced from this repository of icons.
/// </summary>
/// <remarks>icon</remarks>
#if NET48
public string Icon { get; set; }
#else
public string? Icon { get; set; }
#endif
/// <summary>
/// Name for a background image file.
/// </summary>
/// <remarks>background</remarks>
#if NET48
public string Background { get; set; }
#else
public string? Background { get; set; }
#endif
/// <summary>
/// Name for a background video file.
/// </summary>
/// <remarks>video</remarks>
#if NET48
public string Video { get; set; }
#else
public string? Video { get; set; }
#endif
/// <summary>
/// Name for a background video file.
@@ -610,11 +522,7 @@ namespace SabreTools.Models.Charts
/// Name for a cover image file.
/// </summary>
/// <remarks>cover</remarks>
#if NET48
public string Cover { get; set; }
#else
public string? Cover { get; set; }
#endif
#endregion
@@ -624,41 +532,25 @@ namespace SabreTools.Models.Charts
/// (PS) Name for banner A.
/// </summary>
/// <remarks>link_name_a</remarks>
#if NET48
public string LinkNameA { get; set; }
#else
public string? LinkNameA { get; set; }
#endif
/// <summary>
/// (PS) Name for banner B.
/// </summary>
/// <remarks>link_name_b</remarks>
#if NET48
public string LinkNameB { get; set; }
#else
public string? LinkNameB { get; set; }
#endif
/// <summary>
/// (PS) Link that clicking banner A will open.
/// </summary>
/// <remarks>banner_link_a</remarks>
#if NET48
public string BannerLinkA { get; set; }
#else
public string? BannerLinkA { get; set; }
#endif
/// <summary>
/// (PS) Link that clicking banner B will open.
/// </summary>
/// <remarks>banner_link_b</remarks>
#if NET48
public string BannerLinkB { get; set; }
#else
public string? BannerLinkB { get; set; }
#endif
#endregion
@@ -668,21 +560,13 @@ namespace SabreTools.Models.Charts
/// (FoFiX) High score data.
/// </summary>
/// <remarks>scores</remarks>
#if NET48
public string Scores { get; set; }
#else
public string? Scores { get; set; }
#endif
/// <summary>
/// (FoFiX) Additional score data.
/// </summary>
/// <remarks>scores_ext</remarks>
#if NET48
public string ScoresExt { get; set; }
#else
public string? ScoresExt { get; set; }
#endif
/// <summary>
/// (FoFiX) Play count.
@@ -700,31 +584,19 @@ namespace SabreTools.Models.Charts
/// (FoFiX) Career ID for this song.
/// </summary>
/// <remarks>unlock_id</remarks>
#if NET48
public string UnlockId { get; set; }
#else
public string? UnlockId { get; set; }
#endif
/// <summary>
/// (FoFiX) The career ID that must be completed to unlock this song.
/// </summary>
/// <remarks>unlock_require</remarks>
#if NET48
public string UnlockRequire { get; set; }
#else
public string? UnlockRequire { get; set; }
#endif
/// <summary>
/// (FoFiX) Text to display if the song is locked.
/// </summary>
/// <remarks>unlock_text</remarks>
#if NET48
public string UnlockText { get; set; }
#else
public string? UnlockText { get; set; }
#endif
/// <summary>
/// (FoFiX) Indicates if the song is unlocked.

View File

@@ -10,20 +10,12 @@ namespace SabreTools.Models.Charts
/// A space-separated list of .ini sections to include in the career.
/// </summary>
/// <remarks>sections</remarks>
#if NET48
public string[] SectionList { get; set; }
#else
public string[]? SectionList { get; set; }
#endif
/// <summary>
/// `name` - Display name of the tier.
/// `unlock_id` - Name used for associating a song with this tier, and for checking unlock requirements.
/// </summary>
#if NET48
public Dictionary<string, (string Name, string UnlockId)> Sections { get; set; }
#else
public Dictionary<string, (string Name, string UnlockId)>? Sections { get; set; }
#endif
public Dictionary<string, (string? Name, string? UnlockId)>? Sections { get; set; }
}
}

View File

@@ -5,20 +5,12 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,35 +5,19 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>description</remarks>
[Required]
#if NET48
public string Description { get; set; }
#else
public string? Description { get; set; }
#endif
/// <remarks>default</remarks>
#if NET48
public string Default { get; set; }
#else
public string? Default { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,42 +5,22 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>type, (cpu|audio)</remarks>
[Required]
#if NET48
public string Type { get; set; }
#else
public string? Type { get; set; }
#endif
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>flags</remarks>
#if NET48
public string Flags { get; set; }
#else
public string? Flags { get; set; }
#endif
/// <remarks>clock, Numeric?</remarks>
#if NET48
public string Clock { get; set; }
#else
public string? Clock { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -4,118 +4,54 @@ namespace SabreTools.Models.ClrMamePro
public class ClrMamePro
{
/// <remarks>name</remarks>
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>description</remarks>
#if NET48
public string Description { get; set; }
#else
public string? Description { get; set; }
#endif
/// <remarks>rootdir</remarks>
#if NET48
public string RootDir { get; set; }
#else
public string? RootDir { get; set; }
#endif
/// <remarks>category</remarks>
#if NET48
public string Category { get; set; }
#else
public string? Category { get; set; }
#endif
/// <remarks>version</remarks>
#if NET48
public string Version { get; set; }
#else
public string? Version { get; set; }
#endif
/// <remarks>date</remarks>
#if NET48
public string Date { get; set; }
#else
public string? Date { get; set; }
#endif
/// <remarks>author</remarks>
#if NET48
public string Author { get; set; }
#else
public string? Author { get; set; }
#endif
/// <remarks>homepage</remarks>
#if NET48
public string Homepage { get; set; }
#else
public string? Homepage { get; set; }
#endif
/// <remarks>url</remarks>
#if NET48
public string Url { get; set; }
#else
public string? Url { get; set; }
#endif
/// <remarks>comment</remarks>
#if NET48
public string Comment { get; set; }
#else
public string? Comment { get; set; }
#endif
/// <remarks>header</remarks>
#if NET48
public string Header { get; set; }
#else
public string? Header { get; set; }
#endif
/// <remarks>type</remarks>
#if NET48
public string Type { get; set; }
#else
public string? Type { get; set; }
#endif
/// <remarks>forcemerging</remarks>
#if NET48
public string ForceMerging { get; set; }
#else
public string? ForceMerging { get; set; }
#endif
/// <remarks>forcezipping</remarks>
#if NET48
public string ForceZipping { get; set; }
#else
public string? ForceZipping { get; set; }
#endif
/// <remarks>forcepacking</remarks>
#if NET48
public string ForcePacking { get; set; }
#else
public string? ForcePacking { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,34 +5,18 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>entry</remarks>
#if NET48
public string[] Entry { get; set; }
#else
public string[]? Entry { get; set; }
#endif
/// <remarks>default, (yes|no) "no"</remarks>
#if NET48
public string Default { get; set; }
#else
public string? Default { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,55 +5,27 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>md5</remarks>
#if NET48
public string MD5 { get; set; }
#else
public string? MD5 { get; set; }
#endif
/// <remarks>sha1</remarks>
#if NET48
public string SHA1 { get; set; }
#else
public string? SHA1 { get; set; }
#endif
/// <remarks>merge</remarks>
#if NET48
public string Merge { get; set; }
#else
public string? Merge { get; set; }
#endif
/// <remarks>status</remarks>
#if NET48
public string Status { get; set; }
#else
public string? Status { get; set; }
#endif
/// <remarks>flags</remarks>
#if NET48
public string Flags { get; set; }
#else
public string? Flags { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,48 +5,24 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>status, (good|imperfect|preliminary)</remarks>
[Required]
#if NET48
public string Status { get; set; }
#else
public string? Status { get; set; }
#endif
/// <remarks>color, (good|imperfect|preliminary)</remarks>
#if NET48
public string Color { get; set; }
#else
public string? Color { get; set; }
#endif
/// <remarks>sound, (good|imperfect|preliminary)</remarks>
#if NET48
public string Sound { get; set; }
#else
public string? Sound { get; set; }
#endif
/// <remarks>palettesize, Numeric?</remarks>
#if NET48
public string PaletteSize { get; set; }
#else
public string? PaletteSize { get; set; }
#endif
/// <remarks>blit, (plain|dirty)</remarks>
#if NET48
public string Blit { get; set; }
#else
public string? Blit { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -7,168 +7,80 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>description</remarks>
#if NET48
public string Description { get; set; }
#else
public string? Description { get; set; }
#endif
/// <remarks>year</remarks>
#if NET48
public string Year { get; set; }
#else
public string? Year { get; set; }
#endif
/// <remarks>manufacturer</remarks>
#if NET48
public string Manufacturer { get; set; }
#else
public string? Manufacturer { get; set; }
#endif
/// <remarks>category</remarks>
#if NET48
public string Category { get; set; }
#else
public string? Category { get; set; }
#endif
/// <remarks>cloneof</remarks>
#if NET48
public string CloneOf { get; set; }
#else
public string? CloneOf { get; set; }
#endif
/// <remarks>romof</remarks>
#if NET48
public string RomOf { get; set; }
#else
public string? RomOf { get; set; }
#endif
/// <remarks>sampleof</remarks>
#if NET48
public string SampleOf { get; set; }
#else
public string? SampleOf { get; set; }
#endif
/// <remarks>release</remarks>
#if NET48
public Release[] Release { get; set; }
#else
public Release[]? Release { get; set; }
#endif
/// <remarks>biosset</remarks>
#if NET48
public BiosSet[] BiosSet { get; set; }
#else
public BiosSet[]? BiosSet { get; set; }
#endif
/// <remarks>rom</remarks>
#if NET48
public Rom[] Rom { get; set; }
#else
public Rom[]? Rom { get; set; }
#endif
/// <remarks>disk</remarks>
#if NET48
public Disk[] Disk { get; set; }
#else
public Disk[]? Disk { get; set; }
#endif
/// <remarks>sample</remarks>
#if NET48
public Sample[] Sample { get; set; }
#else
public Sample[]? Sample { get; set; }
#endif
/// <remarks>archive</remarks>
#if NET48
public Archive[] Archive { get; set; }
#else
public Archive[]? Archive { get; set; }
#endif
#region Aaru Extensions
/// <remarks>media, Appears after Disk</remarks>
#if NET48
public Media[] Media { get; set; }
#else
public Media[]? Media { get; set; }
#endif
#endregion
#region MAME Extensions
/// <remarks>chip, Appears after Archive</remarks>
#if NET48
public Chip[] Chip { get; set; }
#else
public Chip[]? Chip { get; set; }
#endif
/// <remarks>video, Appears after Chip</remarks>
#if NET48
public Video[] Video { get; set; }
#else
public Video[]? Video { get; set; }
#endif
/// <remarks>sound, Appears after Video</remarks>
#if NET48
public Sound Sound { get; set; }
#else
public Sound? Sound { get; set; }
#endif
/// <remarks>input, Appears after Sound</remarks>
#if NET48
public Input Input { get; set; }
#else
public Input? Input { get; set; }
#endif
/// <remarks>dipswitch, Appears after Input</remarks>
#if NET48
public DipSwitch[] DipSwitch { get; set; }
#else
public DipSwitch[]? DipSwitch { get; set; }
#endif
/// <remarks>driver, Appears after DipSwitch</remarks>
#if NET48
public Driver Driver { get; set; }
#else
public Driver? Driver { get; set; }
#endif
#endregion
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,56 +5,28 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>players, Numeric/remarks>
[Required]
#if NET48
public string Players { get; set; }
#else
public string? Players { get; set; }
#endif
/// <remarks>control</remarks>
#if NET48
public string Control { get; set; }
#else
public string? Control { get; set; }
#endif
/// <remarks>buttons, Numeric</remarks>
[Required]
#if NET48
public string Buttons { get; set; }
#else
public string? Buttons { get; set; }
#endif
/// <remarks>coins, Numeric</remarks>
#if NET48
public string Coins { get; set; }
#else
public string? Coins { get; set; }
#endif
/// <remarks>tilt, (yes|no) "no"</remarks>
#if NET48
public string Tilt { get; set; }
#else
public string? Tilt { get; set; }
#endif
/// <remarks>service, (yes|no) "no"</remarks>
#if NET48
public string Service { get; set; }
#else
public string? Service { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,48 +5,24 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>md5</remarks>
#if NET48
public string MD5 { get; set; }
#else
public string? MD5 { get; set; }
#endif
/// <remarks>sha1</remarks>
#if NET48
public string SHA1 { get; set; }
#else
public string? SHA1 { get; set; }
#endif
/// <remarks>sha256</remarks>
#if NET48
public string SHA256 { get; set; }
#else
public string? SHA256 { get; set; }
#endif
/// <remarks>spamsum</remarks>
#if NET48
public string SpamSum { get; set; }
#else
public string? SpamSum { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -3,27 +3,15 @@ namespace SabreTools.Models.ClrMamePro
public class MetadataFile
{
/// <remarks>clrmamepro</remarks>
#if NET48
public ClrMamePro ClrMamePro { get; set; }
#else
public ClrMamePro? ClrMamePro { get; set; }
#endif
/// <remarks>game, machine, resource, set</remarks>
#if NET48
public GameBase[] Game { get; set; }
#else
public GameBase[]? Game { get; set; }
#endif
public GameBase?[]? Game { get; set; }
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,49 +5,25 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>region</remarks>
[Required]
#if NET48
public string Region { get; set; }
#else
public string? Region { get; set; }
#endif
/// <remarks>language</remarks>
#if NET48
public string Language { get; set; }
#else
public string? Language { get; set; }
#endif
/// <remarks>date</remarks>
#if NET48
public string Date { get; set; }
#else
public string? Date { get; set; }
#endif
/// <remarks>default</remarks>
#if NET48
public string Default { get; set; }
#else
public string? Default { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,181 +5,93 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>size, Numeric</remarks>
[Required]
#if NET48
public string Size { get; set; }
#else
public string? Size { get; set; }
#endif
/// <remarks>crc</remarks>
#if NET48
public string CRC { get; set; }
#else
public string? CRC { get; set; }
#endif
/// <remarks>md5</remarks>
#if NET48
public string MD5 { get; set; }
#else
public string? MD5 { get; set; }
#endif
/// <remarks>sha1</remarks>
#if NET48
public string SHA1 { get; set; }
#else
public string? SHA1 { get; set; }
#endif
/// <remarks>merge</remarks>
#if NET48
public string Merge { get; set; }
#else
public string? Merge { get; set; }
#endif
/// <remarks>status</remarks>
#if NET48
public string Status { get; set; }
#else
public string? Status { get; set; }
#endif
/// <remarks>flags</remarks>
#if NET48
public string Flags { get; set; }
#else
public string? Flags { get; set; }
#endif
/// <remarks>date</remarks>
#if NET48
public string Date { get; set; }
#else
public string? Date { get; set; }
#endif
#region Hash Extensions
/// <remarks>sha256; Also in No-Intro spec; Appears after SHA1</remarks>
#if NET48
public string SHA256 { get; set; }
#else
public string? SHA256 { get; set; }
#endif
/// <remarks>sha384; Appears after SHA256</remarks>
#if NET48
public string SHA384 { get; set; }
#else
public string? SHA384 { get; set; }
#endif
/// <remarks>sha512; Appears after SHA384</remarks>
#if NET48
public string SHA512 { get; set; }
#else
public string? SHA512 { get; set; }
#endif
/// <remarks>spamsum; Appears after SHA512</remarks>
#if NET48
public string SpamSum { get; set; }
#else
public string? SpamSum { get; set; }
#endif
#endregion
#region DiscImgeCreator Extensions
/// <remarks>xxh3_64; Appears after SpamSum</remarks>
#if NET48
public string xxHash364 { get; set; }
#else
public string? xxHash364 { get; set; }
#endif
/// <remarks>xxh3_128; Appears after xxHash364</remarks>
#if NET48
public string xxHash3128 { get; set; }
#else
public string? xxHash3128 { get; set; }
#endif
#endregion
#region MAME Extensions
/// <remarks>region; Appears after Status</remarks>
#if NET48
public string Region { get; set; }
#else
public string? Region { get; set; }
#endif
/// <remarks>offs; Appears after Flags</remarks>
#if NET48
public string Offs { get; set; }
#else
public string? Offs { get; set; }
#endif
#endregion
#region No-Intro Extensions
/// <remarks>serial; Appears after Offs</remarks>
#if NET48
public string Serial { get; set; }
#else
public string? Serial { get; set; }
#endif
/// <remarks>header; Appears after Serial</remarks>
#if NET48
public string Header { get; set; }
#else
public string? Header { get; set; }
#endif
#endregion
#region RomVault Extensions
/// <remarks>inverted; Boolean; Appears after Date</remarks>
#if NET48
public string Inverted { get; set; }
#else
public string? Inverted { get; set; }
#endif
/// <remarks>mia; Boolean; Appears after Inverted</remarks>
#if NET48
public string MIA { get; set; }
#else
public string? MIA { get; set; }
#endif
#endregion
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -4,108 +4,48 @@ namespace SabreTools.Models.ClrMamePro
public class RomVault
{
/// <remarks>name</remarks>
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
/// <remarks>description</remarks>
#if NET48
public string Description { get; set; }
#else
public string? Description { get; set; }
#endif
/// <remarks>rootdir</remarks>
#if NET48
public string RootDir { get; set; }
#else
public string? RootDir { get; set; }
#endif
/// <remarks>category</remarks>
#if NET48
public string Category { get; set; }
#else
public string? Category { get; set; }
#endif
/// <remarks>version</remarks>
#if NET48
public string Version { get; set; }
#else
public string? Version { get; set; }
#endif
/// <remarks>date</remarks>
#if NET48
public string Date { get; set; }
#else
public string? Date { get; set; }
#endif
/// <remarks>author</remarks>
#if NET48
public string Author { get; set; }
#else
public string? Author { get; set; }
#endif
/// <remarks>homepage</remarks>
#if NET48
public string Homepage { get; set; }
#else
public string? Homepage { get; set; }
#endif
/// <remarks>url</remarks>
#if NET48
public string Url { get; set; }
#else
public string? Url { get; set; }
#endif
/// <remarks>comment</remarks>
#if NET48
public string Comment { get; set; }
#else
public string? Comment { get; set; }
#endif
/// <remarks>header</remarks>
#if NET48
public string Header { get; set; }
#else
public string? Header { get; set; }
#endif
/// <remarks>type</remarks>
#if NET48
public string Type { get; set; }
#else
public string? Type { get; set; }
#endif
/// <remarks>forcemerging</remarks>
#if NET48
public string ForceMerging { get; set; }
#else
public string? ForceMerging { get; set; }
#endif
/// <remarks>forcezipping</remarks>
#if NET48
public string ForceZipping { get; set; }
#else
public string? ForceZipping { get; set; }
#endif
/// <remarks>forcepacking</remarks>
#if NET48
public string ForcePacking { get; set; }
#else
public string? ForcePacking { get; set; }
#endif
}
}

View File

@@ -5,20 +5,12 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>name</remarks>
[Required]
#if NET48
public string Name { get; set; }
#else
public string? Name { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public string[] ADDITIONAL_ELEMENTS { get; set; }
#else
public string[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,20 +5,12 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>channels, Numeric?</remarks>
[Required]
#if NET48
public string Channels { get; set; }
#else
public string? Channels { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

View File

@@ -5,63 +5,31 @@ namespace SabreTools.Models.ClrMamePro
{
/// <remarks>screen, (raster|vector)</remarks>
[Required]
#if NET48
public string Screen { get; set; }
#else
public string? Screen { get; set; }
#endif
/// <remarks>orientation, (vertical|horizontal)</remarks>
[Required]
#if NET48
public string Orientation { get; set; }
#else
public string? Orientation { get; set; }
#endif
/// <remarks>x, Numeric?</remarks>
#if NET48
public string X { get; set; }
#else
public string? X { get; set; }
#endif
/// <remarks>y, Numeric?</remarks>
#if NET48
public string Y { get; set; }
#else
public string? Y { get; set; }
#endif
/// <remarks>aspectx, Numeric?</remarks>
#if NET48
public string AspectX { get; set; }
#else
public string? AspectX { get; set; }
#endif
/// <remarks>aspecty, Numeric?</remarks>
#if NET48
public string AspectY { get; set; }
#else
public string? AspectY { get; set; }
#endif
/// <remarks>freq, Numeric?</remarks>
#if NET48
public string Freq { get; set; }
#else
public string? Freq { get; set; }
#endif
#region DO NOT USE IN PRODUCTION
/// <remarks>Should be empty</remarks>
#if NET48
public object[] ADDITIONAL_ELEMENTS { get; set; }
#else
public object[]? ADDITIONAL_ELEMENTS { get; set; }
#endif
#endregion
}

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