NdsForge.NET 1.0.1
Read, validate, edit, compare, and build Nintendo DS and DSi images from .NET
Loading...
Searching...
No Matches
NdsElfImportResult.cs
1using System.Collections.ObjectModel;
2
3namespace NdsForge;
4
6public sealed class NdsElfImportResult
7{
13 internal NdsElfImportResult(
15 NdsOverlayDefinition[] overlays,
16 bool hasOverlaySegments,
17 uint? arm7WramAddress)
18 {
19 Program = program;
20 Overlays = new ReadOnlyCollection<NdsOverlayDefinition>(overlays);
21 HasOverlaySegments = hasOverlaySegments;
22 Arm7WramAddress = arm7WramAddress;
23 }
24
27
29 public IReadOnlyList<NdsOverlayDefinition> Overlays { get; }
30
32 public bool HasOverlaySegments { get; }
33
35 public uint? Arm7WramAddress { get; }
36
41 {
42 ArgumentNullException.ThrowIfNull(builder);
43 switch (Program.Processor)
44 {
45 case NdsProcessor.Arm9: builder.Arm9 = Program; break;
46 case NdsProcessor.Arm7: builder.Arm7 = Program; break;
47 case NdsProcessor.Arm9i: builder.Arm9i = Program; break;
48 case NdsProcessor.Arm7i: builder.Arm7i = Program; break;
49 default: throw new InvalidOperationException("The imported Program has an unsupported processor identity.");
50 }
51
52 foreach (NdsOverlayDefinition overlay in Overlays)
53 {
54 builder.AddOverlay(overlay);
55 }
56
57 return builder;
58 }
59}
uint? Arm7WramAddress
Identifies the first selected DSi ARM7 WRAM virtual address in 0x03000000..0x037F7FFF.
NdsProgramDefinition Program
Contains cartridge-ready bytes with physical-address gaps initialized to zero and a translated entryp...
IReadOnlyList< NdsOverlayDefinition > Overlays
Contains validated private Overlay records and payloads, or an empty collection when none were reques...
NdsImageBuilder ApplyTo(NdsImageBuilder builder)
Applies the imported Program and every Overlay to a build recipe without hiding recipe mutation.
bool HasOverlaySegments
Reports flagged Overlay segments even when NdsElfImportOptions.ImportOverlays was disabled.
Assembles a deterministic Nintendo DS Image from typed Programs, metadata, Banner,...
Describes one Overlay record and its private Allocation when constructing a new Image.
Supplies one executable payload and the CPU addresses required to place it in a newly built image.
NdsProcessor
Identifies a processor and execution mode.