Understanding ROM File Formats: Headers, Mappers, and Compatibility
A technical reference to iNES, SNES SFC/SMC, Game Boy GBC, and other ROM container formats — what the headers contain and why mapper support determines which games load correctly.
When a game is dumped from its original cartridge to a digital file, the resulting ROM is not simply a raw binary blob. It is a container — a structured file format that describes the ROM's hardware configuration, memory layout, and the mapper or memory controller chip that allows the game to access more memory than the CPU's address space would otherwise permit. Understanding these formats is essential for anyone building emulation infrastructure, and the details matter more than they appear to at first glance.
The iNES Format: The NES Standard
The iNES format, developed by iNES emulator author Marat Fayzullin in 1995, became the de facto standard for NES ROM distribution and has remained so for nearly three decades. An iNES file begins with a 16-byte header whose fields specify the number of 16KB program ROM banks, the number of 8KB character ROM banks, the mirroring type (horizontal or vertical), whether battery-backed RAM is present, and most importantly, the mapper number — an integer identifying which memory bank switching circuit the cartridge uses.
The mapper number is the most consequential field in the header. The NES's 6502 CPU has a 16-bit address space, limiting it to 64KB of directly addressable memory. Early NES cartridges fit within this space comfortably, but later titles used mapper chips that allowed the cartridge to present different banks of ROM into the CPU's address window at different times. The NES2.0 format, a backward-compatible extension developed in 2012, extends the mapper number to 12 bits (supporting over 4,000 mapper variants) and adds fields for the submapper variant, ROM size extensions for very large cartridges, and timing region specification.
SNES Formats: SFC, SMC, and the Header Problem
SNES ROM formats are more complicated, primarily because of the existence of the SMC header — a 512-byte prepended header added by early copier hardware that dumped SNES cartridges. SMC headers contain information about the cartridge but are not part of the original cartridge data. Emulators must detect and strip them before mapping the ROM. Detection is straightforward: a file whose size modulo 1,024 equals 512 bytes almost certainly has an SMC header prepended.
The raw SNES ROM data itself contains its own internal header at a fixed offset that varies depending on whether the cartridge uses LoROM or HiROM memory mapping. This internal header specifies the game title, the cartridge type (ROM only, ROM+RAM, ROM+RAM+Battery, ROM+special chip), the ROM size, the RAM size, the region code, and the checksum. Parsing this header correctly is essential for identifying which additional chips are present — the SA-1, Super FX, DSP-1, and others each require additional hardware emulation beyond the main SNES chipset.
Game Boy and GBC Formats
Game Boy ROM files are relatively simple by comparison. The internal ROM header at offset 0x100 contains the Nintendo logo data (which the boot ROM checks for authenticity), the game title, a manufacturer code, the CGB (Color Game Boy) flag, the cartridge type byte, the ROM size code, the RAM size code, and checksum bytes. The cartridge type byte is the Game Boy equivalent of the NES mapper number — it identifies which memory bank controller is present (MBC1, MBC2, MBC3, MBC5, and others) and whether battery-backed RAM, a real-time clock, or infrared hardware is included.
The CGB flag is particularly important for emulation accuracy. A value of 0x80 indicates that the game supports Game Boy Color features but also runs on original Game Boy hardware in monochrome mode. A value of 0xC0 indicates the game is CGB-only. Emulators must check this flag to determine the correct hardware mode and color palette handling for the title.
Mapper Support: The Long Tail of Compatibility
The practical limiting factor on how many titles an emulator supports is the breadth of its mapper implementation. The NES mapper registry contains over 400 distinct mapper numbers, though approximately 95% of commercially released titles use the top 20 most common mappers. Supporting all 400+ mappers requires significant ongoing engineering effort and is frequently deprioritized in favor of accuracy improvements for common mappers.
RetroCloud's NES emulation currently supports 312 mapper variants, covering approximately 99.3% of the commercial library and a large portion of the homebrew catalog. Our mapper implementation is modular: each mapper is implemented as a self-contained component with a standardized interface for CPU and PPU bus access events. Adding a new mapper requires only implementing that component and registering it in the mapper registry, without modifying the core CPU or PPU emulation code.
No-Intro and Redump: The Canonical ROM Standards
The No-Intro and Redump preservation projects maintain databases of verified ROM dumps with cryptographic hashes. A No-Intro verified dump is guaranteed to be an exact bit-for-bit copy of the original media with no modifications, header additions, or trainer data prepended. These databases are the reference standard for ROM authenticity in the emulation community and the foundation of RetroCloud's catalog validation process.
Every ROM in RetroCloud's catalog is cross-referenced against No-Intro and Redump databases at ingestion time. Dumps that do not match any known good hash are flagged for review and are not served to end users until they pass validation. This policy ensures that the games our platform delivers are accurate representations of the original software — not modified, patched, or incorrectly dumped versions that could produce incorrect behavior in emulation. For a platform whose mission is preservation, this validation step is non-negotiable.
Future Format Considerations
As the preserved library expands into later console generations, new format challenges emerge. PlayStation disc images involve multi-track ISO/CUE structures with mixed-mode data and audio tracks. Nintendo 64 ROMs exist in three byte-order variants (big-endian, byte-swapped, and little-endian) that must be normalized before emulation. Nintendo DS ROMs contain complex header structures describing multiple ARM processor binary images and filesystem layouts. Each new system brings new format complexity, and building robust parsing and validation pipelines for each is a recurring engineering investment that we treat as foundational infrastructure rather than an optional feature.
Sofia Reyes
Head of API Platform, RetroCloud
Sofia leads RetroCloud's public API and developer ecosystem. Her background spans API design, developer experience, OpenAPI standards, and real-time systems engineering for partner integrations.