NdsForge.NET 1.0.1
Read, validate, edit, compare, and build Nintendo DS and DSi images from .NET
Loading...
Searching...
No Matches
NdsWriteOptions.cs
1namespace NdsForge;
2
4public sealed record NdsWriteOptions
5{
7 public static NdsWriteOptions Default { get; } = new();
8
10 public int RelocatedFileAlignment { get; init; } = 0x200;
11
13 public byte PaddingByte { get; init; } = 0xFF;
14
16 public bool VerifyOutput { get; init; } = true;
17
19 public bool OverwriteDestination { get; init; }
20
24 internal void Validate()
25 {
26 ArgumentOutOfRangeException.ThrowIfNegativeOrZero(RelocatedFileAlignment);
27 if ((RelocatedFileAlignment & (RelocatedFileAlignment - 1)) != 0)
28 {
29 throw new ArgumentException("Relocated file alignment must be a power of two.", nameof(RelocatedFileAlignment));
30 }
31 }
32}
Controls preservation-oriented image saves.
bool OverwriteDestination
Gets whether a path save may atomically replace an existing regular file.
bool VerifyOutput
Gets whether the completed output is reopened and verified.
static NdsWriteOptions Default
Uses 512-byte relocation alignment, 0xFF padding, verification, and no implicit path overwrite.
int RelocatedFileAlignment
Aligns newly appended payload starts; it must be a positive power of two and defaults to one ROM sect...
byte PaddingByte
Fills bytes between the prior used end and a relocated payload, commonly 0xFF for cartridge padding.