namespace SabreTools.Data.Models.NES { /// /// Common NES header pieces /// /// /// public abstract class CartHeader { /// /// Constant $4E $45 $53 $1A (ASCII "NES" followed by MS-DOS end-of-file) /// public byte[] IdentificationString { get; set; } = new byte[4]; /// /// Size of PRG ROM in 16 KB units /// public byte PrgRomSize { get; set; } /// /// Size of CHR ROM in 8 KB units /// /// Value 0 means the board uses CHR RAM public byte ChrRomSize { get; set; } #region Byte 6 /// /// Nametable arrangement /// /// Byte 6, Bit 0 public NametableArrangement NametableArrangement { get; set; } /// /// Cartridge contains battery-backed PRG RAM ($6000-7FFF) /// or other persistent memory /// /// Byte 6, Bit 1 public bool BatteryBackedPrgRam { get; set; } /// /// 512-byte trainer at $7000-$71FF /// /// Byte 6, Bit 2 public bool TrainerPresent { get; set; } /// /// Alternative nametable layout /// /// Byte 6, Bit 3 public bool AlternativeNametableLayout { get; set; } /// /// Lower nibble of Mapper number /// /// Byte 6, Bits 4-7 public byte MapperLowerNibble { get; set; } #endregion #region Byte 7 /// /// Nametable arrangement /// /// /// Byte 7, Bits 0-1 /// /// The PlayChoice-10 bit is not part of the official specification, /// and most emulators simply ignore the extra 8 KB of data. PlayChoice /// games are designed to look good with the 2C03 RGB PPU, which handles /// color emphasis differently from a standard NES PPU. /// /// Vs. games have a coin slot and different palettes. The detection /// of which palette a particular game uses is left unspecified. /// public ConsoleType ConsoleType { get; set; } /// /// Indicates NES 2.0 format /// /// /// Byte 7, Bits 2-3 == 0x02 /// /// NES 2.0 is a more recent extension to the format that allows more /// flexibility in ROM and RAM size, among other things. /// public bool NES20 { get; set; } /// /// Upper nibble of Mapper number /// /// Byte 7, Bits 4-7 public byte MapperUpperNibble { get; set; } #endregion } }