Files

104 lines
3.4 KiB
C#
Raw Permalink Normal View History

2026-03-06 10:35:07 -05:00
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>
2026-03-10 17:06:01 -04:00
public class CartHeader1 : CartHeader
2026-03-06 10:35:07 -05:00
{
// 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>
2026-03-06 16:00:36 -05:00
public byte PrgRamSize { get; set; }
2026-03-06 10:35:07 -05:00
/// <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; }
2026-03-06 15:36:02 -05:00
#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>
2026-03-06 16:17:18 -05:00
public byte Byte10ReservedBits23 { get; set; }
2026-03-06 15:36:02 -05:00
2026-03-06 10:35:07 -05:00
/// <summary>
2026-03-06 15:36:02 -05:00
/// PRG RAM ($6000-$7FFF) present
2026-03-06 10:35:07 -05:00
/// </summary>
/// <remarks>
2026-03-06 15:36:02 -05:00
/// Byte 10, Bit 4
///
2026-03-06 10:35:07 -05:00
/// This byte is not part of the official specification, and relatively
/// few emulators honor it.
/// </remarks>
2026-03-06 16:00:36 -05:00
public bool PrgRamPresent { get; set; }
2026-03-06 15:36:02 -05:00
/// <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>
2026-03-06 16:17:18 -05:00
public byte Byte10ReservedBits67 { get; set; }
2026-03-06 15:36:02 -05:00
#endregion
2026-03-06 10:35:07 -05:00
/// <summary>
/// Unused padding to align to 16 bytes
/// </summary>
public byte[] Padding { get; set; } = new byte[5];
}
}