Files
Matt Nadareski 7689c6dd07 Libraries
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
2026-03-21 16:26:56 -04:00

104 lines
3.4 KiB
C#

namespace SabreTools.Data.Models.NES
{
/// <summary>
/// NES 1.0 header information
/// </summary>
/// <see href="https://www.nesdev.org/wiki/INES"/>
/// <remarks>
/// Older versions of the iNES emulator ignored bytes 7-15, and several ROM management
/// tools wrote messages in there. Commonly, these will be filled with "DiskDude!",
/// which results in 64 being added to the mapper number.
///
/// A general rule of thumb: if the last 4 bytes are not all zero, and the header is
/// not marked for NES 2.0 format, an emulator should either mask off the upper 4 bits
/// of the mapper number or simply refuse to load the ROM.
/// </remarks>
public class CartHeader1 : CartHeader
{
// All common header parts take up bytes 0-7
/// <summary>
/// Size of PRG RAM in 8 KB units
/// </summary>
/// <remarks>
/// Value 0 infers 8 KB for compatibility; see PRG RAM circuit.
/// This was a later extension to the iNES format and not widely used.
/// NES 2.0 is recommended for specifying PRG RAM size instead.
/// </remarks>
public byte PrgRamSize { get; set; }
/// <summary>
/// TV system (rarely used extension)
/// </summary>
/// <remarks>
/// Though in the official specification, very few emulators honor this bit
/// as virtually no ROM images in circulation make use of it.
/// </remarks>
public TVSystem TVSystem { get; set; }
#region Byte 10
/// <summary>
/// TV system with extended values
/// </summary>
/// <remarks>
/// Byte 10, Bits 0-1
///
/// This byte is not part of the official specification, and relatively
/// few emulators honor it.
/// </remarks>
public TVSystemExtended TVSystemExtended { get; set; }
/// <summary>
/// Unknown reserved bits
/// </summary>
/// <remarks>
/// Byte 10, Bits 2-3
///
/// This byte is not part of the official specification, and relatively
/// few emulators honor it.
/// </remarks>
public byte Byte10ReservedBits23 { get; set; }
/// <summary>
/// PRG RAM ($6000-$7FFF) present
/// </summary>
/// <remarks>
/// Byte 10, Bit 4
///
/// This byte is not part of the official specification, and relatively
/// few emulators honor it.
/// </remarks>
public bool PrgRamPresent { get; set; }
/// <summary>
/// Board has bus conflicts
/// </summary>
/// <remarks>
/// Byte 10, Bit 5
///
/// This byte is not part of the official specification, and relatively
/// few emulators honor it.
/// </remarks>
public bool HasBusConflicts { get; set; }
/// <summary>
/// Unknown reserved bits
/// </summary>
/// <remarks>
/// Byte 10, Bits 6-7
///
/// This byte is not part of the official specification, and relatively
/// few emulators honor it.
/// </remarks>
public byte Byte10ReservedBits67 { get; set; }
#endregion
/// <summary>
/// Unused padding to align to 16 bytes
/// </summary>
public byte[] Padding { get; set; } = new byte[5];
}
}