                         * CARTRIDGE FILE FORMAT *

  The iNES distribution includes a single cartridge image with a program
allowing to test the emulator. There is also a source code of this program
included. Following is the format of ROM-image files used by iNES (.NES
extension):

byte    contents
-------------------------------------------------------------------------
0-3       String "NES^Z"
4         Number of 16kB ROM banks
5         Number of 8kB VROM banks
6         bit 0     1 for vertical mirroring, 0 for horizontal mirroring
          bit 1     1 for battery-backed RAM at $6000-$7FFF
          bit 2-3   Reserved
          bit 4-7   Type of ROM bank selector
                     0 - None
                     1 - Megaman2,Bomberman2,Destiny,etc.
                     2 - Castlevania,LifeForce,etc.
                    15 - 100-in-1 cartridge (experimental)
7-15      Reserved
16-...    ROM banks, in ascending order
...-EOF   VROM banks, in ascending order
-------------------------------------------------------------------------

  Note that this format will most likely change in the next version of
iNES, therefore do not take it for something permanent. The general
structure will stay the same though.

  The Vertical/Horizontal Mirroring flag requires an additional
explanation. In the real NES/Famicom cartridges, either A10 or A11 line of
the address bus can be connected. Depending on it, video memory may either
contain two screens at addresses $2000/$2400 mirrored at $2800/$2C00
(Vertical Mirroring), or two screens at $2000/$2800 mirrored at
$2400/$2C00 (Horizontal Mirroring). The games which only use one screen do
not care about the mirroring. The games using two screens require an
appropriate mirroring though.
