Introduction
iNES is the original header for .nes files, named after the iNES
emulator that introduced it in the 1990s. It stores a Nintendo Entertainment System
cartridge’s program ROM and graphics ROM behind a 16-byte header that tells the emulator
how the cartridge was wired, above all which mapper chip it used to switch banks of ROM
in and out. Most of the NES ROM images in circulation use it.
Structure
The file starts with the 16-byte header. The first four bytes are
4E 45 53 1A (NES and an MS-DOS end-of-file character). Byte 4
gives the size of the program ROM in 16 KB units and byte 5 the size of the character
(graphics) ROM in 8 KB units, where 0 means the cartridge uses RAM for graphics. Bytes 6
and 7 hold flags: the screen mirroring, whether there is battery-backed save RAM,
whether a 512-byte trainer follows the header, and the mapper number split across the
two high nibbles. Byte 8 can give the size of work RAM and byte 9 the TV system, but
few files fill them in, and the rest of the header is zero. Every byte and bit, the
mapper numbers most files use and a worked example are on the
header page.
0magicNES\x1A4 bytes4PRG ROM size in 16 KB units, CHR ROM size in 8 KB units2 bytes6flags 6 and flags 7: mirroring, battery, trainer, mapper number2 bytes8work RAM size, TV system, then zeros8 bytes16trainer, only when flag 6 bit 2 is set512 bytes…PRG ROM: the game’s program16 KB units…CHR ROM: the game’s tile graphics8 KB units
Telling it apart
The file starts with 4E 45 53 1A and bits 2 and 3 of byte 7 are
00. When they are 10 in binary, the file is
NES 2.0.
Not described
The header is described byte by byte and the mappers page names every number from 0 to 255. What remains:
Known, not yet covered
- Reference: the register layout of each mapper. The mappers page gives layouts for 254 of the 254 mappers that have a wiki page (239 and 247 have none), with a section of its own for the MMC5. The stubs 20, 39, 51, 53, 54, 98, 102, 109, 110, 124, 127, 129, 130, 131, 160, 161, 169, 170, 175, 179, 181, 186, 204, 214, 216, 217, 220, 222, 223, 224, 238, 244, 248 and 251 are in that count and say so: their wiki pages have no register detail, or only say that the number duplicates another mapper. Each row links the NESdev Wiki page that holds the layout. The rows were all re-read from the wiki on 2026-11-19; where a layout is given, it is only as complete as that page.
- Viewer: the explorer opens iNES files: flags 6 to 10 decoded byte by byte, the trainer, the PRG ROM in banks as the mapper switches them, the CHR ROM as tiles, the vectors and the 2A03 disassembly; PlayChoice-10 ROMs and a trailing title are separated. Partial: all 254 iNES mappers that have a wiki page (0 to 255 except 239 and 247) now have a mirroring sentence, a bus-conflict sentence, a battery and WRAM sentence, an IRQ sentence, a PRG layout or the reason none is drawn, and CHR windows with the register that chooses each bank or the reason none is drawn (a sentence beginning “not described by the wiki” means the wiki row says nothing on that item; stub pages say so). Across all numbers PRG banking is drawn for 213 mappers in their usual mode (320 more say why not: several modes or window sizes the one-window model cannot show, or no rule on the wiki), the register table is held for 430 (round 8 added 48, round 9 another 75, round 10 another 191, round 12 another 30 and round 13 the boards 143 and 165, each written from the whole raw wiki page, among them the Sachen 8259 boards 135, 138, 139 and 141 and the memory-only rows of 0, 55, 195, 198, 199, 252 and 253; the redirect pages 128, 155, 166, 182 and 264 carry the table of the page they point to); of the iNES numbers the mappers whose pages give no register address (stubs, duplicates and one-game notes such as 20, 39, 51, 53, 54, 60, 74, 98, 102, 109, 110, 124, 127, 129 to 131, 144, 151, 158, 160, 161, 169 to 171, 175, 179, 181, 186, 192, 194, 196, 204, 213, 214, 216 to 218, 220, 222 to 224, 238, 244, 248 and 251) and 99, whose only register ($4016) lies below the $4020 limit of the table, have none; for them the register-layout row is the only place the registers are listed; where a page draws two fields on the same bit the table says “as drawn”), a CHR banking view (the windows of PPU
$0000–$1FFFand how many banks each can show) exists for 328, of which 225 also say which register bits select the bank of each window (205 give the reason for none), and a one-sentence IRQ description for 533 (most for mappers above 255). The IRQs are described, not run, and no register value is applied. For many boards with several banking modes (MMC1, MMC3, MMC5, the VRC2/4 swap mode, VRC6, the J.Y. Company ASIC, the Super Magic Card, 49, 115, 163, 164, 176) each extra mode is drawn as its own set of rows, and the expansion-audio mappers (5, 19, 20, 24, 26, 69, 85) have an “Expansion audio” row that links to the chapter. A “Mapper behaviour” section links each mapper to its register-layout row and gives those sentences. - Hardware: the console side is now written: CPU memory map, controllers and DMA, PPU registers, APU registers, expansion audio (VRC6, VRC7, FDS, MMC5, Namco 163, Sunsoft 5B) and timing and regions. Round 3 added thirteen more chapters and round 4 added FDS BIOS, PAL video and PPU power-up state and errata (the list is on the NES overview). Round 5 added the Famicom Network System page, the remaining input devices on the controllers page, the PPU glitches and the Programming the FDS guide. Not written: Power Glove, U-Force, the RacerMate Bicycle and the Top Rider Bike (their wiki pages do not exist) and the 10NES chip’s internal program (the wiki has no page for it).
Unknown
- Reference: mapper numbers 239 and 247, which the wiki lists without a page.
Variants
- iNES ROM image – the original 16-byte header with an 8-bit mapper number
- NES 2.0 ROM image – the extended header: exact mapper, memory sizes and console timing
Links
Software
Reference
- iNES – NESdev Wiki’s description of the header