    NINA Header Version 1.01
    ========================

    Overview
    --------

    * The format may consist of a number of data blocks.

    * Each data block begins with an identifier and size field (4,4).

    * The header is recognised by the existance of the Primary Data Block.

    * Information stored in the header describes hardware requirement.

    Primary Data Block
    ------------------

    Identifier      "NINA"
    Size            size(PRG) + size(CHR) + 48 Bytes

    Block Information
      0x000000  Word    Maker Code
      0x000002  Byte    Game Code [4]
      0x00000E  Byte    Special Version
      0x00000F  Byte    Sub-Number
      0x000010  Byte    Game Title [21]
      0x000025  Byte    Map Mode
      0x000026  Byte    Catridge Type
      0x000027  Byte    ROM Size
      0x000028  Byte    RAM Size
      0x000029  Byte    Destination Code
      0x00002A  Byte    Licensee Code
      0x00002B  Byte    Mask ROM Version
      0x00002C  Word    Check Sum (PRG)
      0x00002E  Word    Check Sum (CHR)
    End Block

    The Program ROM and Character ROM (if present) follow the Primary Data Block.

    1.  Maker Code
        2-digit ASCII code assigned by Nintendo.

    2.  Game Code
        4-digit Game Code assigned by Nintendo. If the game program was assigned
        a 2-digit code, the code will be followed by 2 "Space" codes.

    3.  Special Version
        Assigned when necessary to distinguish between original and non-original
        mapping.

    4.  Sub-Number
        Assigned when necessary to distinguish between the same cartridge type
        or identify a custom mapper.

    5.  Game Title
        The game title using ASCII code.

    6.  Map Mode
        Background selection.

        00H - Horizontal           VRAM A10 = PPU A10
        01H - Vertical             VRAM A10 = PPU A11
        02H - Single-Screen        VRAM A10 = GND
        03H - Single-Screen        VRAM A10 = +5V
        8*H - Mapper Control

        The high-order bit should specify whether VRAM is hard-wired or controlled
        by a memory manager (mapper).

    7.  Cartridge Type
        The cartridge configuration.

        *0H - ROM
        *1H - ROM + RAM
        *2H - ROM + RAM + Battery
        *3H - ROM + Battery

        1*H - C*ROM
        2*H - U*ROM
        3*H - B*ROM
        4*H - G*ROM
        5*H - A*ROM
        6*H - D*ROM (Namcot 108)
        7*H - S*ROM (MMC1)
        8*H - P*ROM (MMC2)
        9*H - T*ROM (MMC3)
        A*H - F*ROM (MMC4)
        B*H - E*ROM (MMC5)
        C*H - H*ROM (MMC6)
        D*H - J*ROM (Sunsoft FME-7)
        E*H - Custom (see mappers)
        F*H - Other

    8.  ROM Size
        The Program and Character ROM size.

        PRG   Size                      CHR   Size
        *3H - 64K Bit                   3*H - 64K Bit
        *4H - 128K Bit                  4*H - 128K Bit
        *5H - 256K Bit                  5*H - 256K Bit
        *6H - 512K Bit                  6*H - 512K Bit
        *7H - 1M Bit                    7*H - 1M Bit
        *8H - 2M Bit                    8*H - 2M Bit
        *9H - 4M Bit                    9*H - 4M Bit

                                        0*H - CHRRAM

    9.  RAM Size
        The RAM size as described by the table below. If RAM is not installed,
        store 00H

        WRAM-0                          WRAM-1
        *0H - No RAM                    0*H - No RAM
        *1H - 16K Bit                   1*H - 16K Bit
        *3H - 64K Bit                   3*H - 64K Bit
        *5H - 256K Bit                  5*H - 256K Bit

    10. Destination Code
        The region code as described by the table below.

        PRG  CHR   Destination          Code
        *0H  0*H   Japan                (see licensee codes)
        *1H  1*H   North America        NES
        *2H  2*H   Europe               PAL
        *3H  3*H   Scandinavia          SCN
        *4H  4*H   Sweden               SWE
        *6H  6*H   France               FRA
        *7H  7*H   Holland              HOL
        *8H  8*H   Spain                ESP
        *9H  9*H   Germany              FRG
        *AH  A*H   Italy                ITA

    11. Licensee Code
        The Licensee code as assigned by Nintendo. If Licensee code 33H is used
        Maker Code and Game Code should contain valid data.

    12. Mask ROM Version
        The version number of the Program and Character mask ROM.

    15. Check sum (PRG)
        The Program ROM check sum.

    16. Check Sum (CHR)
        The Character ROM check sum.

    Production Board
    -----------------
    This information is valid for boards produced by Nintendo.

    Sub-Number is used in conjunction with Cartridge Type to identify the
    production board. The 5 low-order bits are used to identify the second
    character (sub-Char). The 3 high-order bits the third character
    (special-Char).

    If sub-Char is 00H, special-Char should be ignored.

             sub-Char   special-Char
        00H     N/A         N/A
        01H     'A'         '1'
        02H     'B'         '2'
        03H     'C'         '3'
        04H     'D'         'S'
        05H     'E'
        ...
        ...
        ...
        18H     'X'
        19H     'Y'
        1AH     'Z'

    Example 1:
      Cartridge Type = 92H (T*ROM)
      Sub-Number = 0BH ('K')
      Board = TKROM

    Example 2:
      Cartridge Type = 20H (U*ROM)
      Sub-Number = 2EH ('N', '1')
      Board = UN1ROM

    Licensee Codes
    --------------

      01H  HVC - Nintendo
      08H  CAP - Capcom
      09H  GAM - Hot-B
      0AH      - Jaleco
      0BH  CDS - Coconuts
      18H  HFC - Hudson Soft
      21H  TEC - Tokai Engineering (Sunsoft)
      28H  KTB - Kotobuki System
      29H  KKS - SETA
      35H  HCT - Hector
      49H  TIX - Tamtex (Irem)
      4AH  GAT - Gakken
      85H  GOI - GO.1
      86H  TIM - Tokuma Shoten Intermedia
      8BH  BPS - Bullet-Proof Software
      8CH  VIC - Vic Tokai
      8EH  CTS - Character Soft
      8FH  IMX - I'Max
      95H  VAR - Varie
      96H  YZW - Yonezawa
      99H  PAC - Pack-in-video
      9AH  NBF - Nichibutsu
      9BH  TCF - Tecmo
      9CH  IMA - Imagineer
      9EH  FAC - Face
      A2H  SCO - Scorpion Soft
      A4H  KDS - Konami
      A5H  KAC - KAC
      A6H  KWD - Kawada
      A7H  TFC - Takara
      A8H  ROY - Royal
      A9H  TJC - Technos
      AAH  VFR - Victor
      ABH  HSS - Hi-Score Software
      ACH  TDF - Toei
      ADH  THF - Toho
      AEH  TSS - TSS
      AFH      - Namco
      B1H  HSP - ASCII
      B2H  BAN - Bandai
      B3H  SFC - Soft Pro
      B4H  EFC - Enix
      B6H  HAL - HAL
      B7H  SFX - SNK
      B9H  PHF - Pony Canyon
      BAH  CBF - Culture Brain
      BBH      - Sunsoft
      BCH  TFS - Toemiland (Toshiba EMI)
      BDH  CBS - CBS/Sony Group
      BFH  SAC - Sammy
      C0H      - Taito
      C2H  KSC - Kemco-Seika
      C3H  SQF - SQUARE
      C4H  GTS - Tokuma Soft
      C5H  DFC - Data East
      C6H  TKS - Tokyo Shoseki/Tonkin House
      C7H  ECF - East Cube
      C8H  KOE - KOEI
      C9H  UPL - UPL
      CAH  KDS - Konami (Ultra Games/Palcom)
      CBH  VAP - Vap
      CCH  USE - USE
      CDH  MDC - Meldac
      CEH  PNF - Pony Canyon
      CFH  ANG - Angel
      D0H  DTF - Disco/Taito
      D1H  SFL - Sofel
      D2H  BTC - Bothtec (Quest)
      D3H  SEI - Sigma Enterprises
      D4H  ASK - ASK Kodansha
      D5H  KYG - Kyugo Boueki
      D6H  NAX - Naxat Soft
      D8H  STE - Status (Capcom)
      D9H  BAP - Banpresto
      DAH  TOM - Tomy
      DBH  HIR - Hiro
      DDH  NCS - NCS
      DEH  HUM - Human
      DFH  ALT - Altron
      E0H  DCE - K.K.DCE
      E1H  TCC - Towa Chiki
      E2H  SHI - Shinsei/Yutaka
      E3H  VRE - Varie
      E5H  EPO - Epoch
      E7H  ATH - Athena
      E8H  ASM - Asmik
      E9H  NAT - Natsume
      EAH  KIN - King Records
      EBH  ATL - Atlus
      ECH  ESF - Epic/Sony Records
      EDH  PIX - Pixel
      EEH  IGS - IGS
      EFH  FMI - Fujimic
      F0H  WAV - A-Wave
      ???  DBF - dB-SOFT
      ???  TOA - ToaPlan
      ???  NMK - NMK (Nihon Micom Kaihatsu)
      ???  RES - Rix Soft
      ???  VIS - Visco
      ???  MAM - M&M
      ???  TKR - Takeru
      ???  SAN - Sanritsu
      ???  IPC - Jingukan
      ???  NFC - Nihon Game

    Custom Mappers
    --------------
    The following memory mappers are defined by Cartridge Type Sub-Number.

      10H  Namcot 108
      11H  Namcot 163
      12H  Namcot 175
      13H  Namcot 340
      20H  Jaleco JF-11
      21H  Jaleco JF-13
      22H  Jaleco JF-16
      23H  Jaleco JF-17
      24H  Jaleco JF-19
      25H  Jaleco SS88006
      30H  Taito X1-005
      31H  Taito TC0190
      32H  Taito X1-017
      33H  Taito TC0350
      34H  Taito TC0690
      40H  Konami VRC
      41H  Konami VRC II
      42H  Konami VRC III
      43H  Konami VRC IV
      45H  Konami VRC VI
      46H  Konami VRC VII
      50H  Irem TAM-S1
      51H  Irem IF-09
      52H  Irem IF-12
      53H  Irem G-101
      54H  Irem H3001
      60H  Sunsoft-1 (C)
      61H  Sunsoft-1 (P)
      62H  Sunsoft-2
      63H  Sunsoft-3
      64H  Sunsoft-4
      65H  Sunsoft-5
      66H  Sunsoft FME-7
      70H  Bandai FCG-X
      71H  Bandai LZ93D50
      72H  Bandai LZ93D50 (Jump-2)
      73H  Bandai Datach
      74H  Bandai OekaKids
      80H  Color Dreams
      81H  Tengen Rambo-1
      82H  Camerica BF9093
      83H  Camerica BF9096
      84H  Camerica BF9097
      F0H  74*139/74
      F1H  74*161/32
      F2H  74*161/138
      F3H  74*161/161/32
      F4H  74*174/138

    Special Version is used to differentiate between mapping variations.
    For Standard mapping store 00H.

    Namcot 108
    ----------

    01H - Dragon Buster
    02H - Megami Tensei
    03H - Gauntlet
    04H - Devil Man / Dragon Spirit / Mahjong 3 / Quinty

    Konami VRC II
    -------------

    00H - Mapping A (A1:A0)
    01H - Mapping B (A0:A1)
    02H - Mapping A (A0:A1)

    Konami VRC IV
    -------------

    00H - A0:A1
    01H - A3:A2
    02H - A2:A3
    03H - A2:A1
    04H - A7:A6

    Konami VRC VI
    -------------

    00H - A1=A1, A0=A0
    01H - A1=A0, A0=A1

    Konami VRC VII
    --------------

    00H - A0=A4
    01H - A0=A3

    Taito TC0190
    ------------

    Special Version: 00H

                     ----_----
          CPU D0 <> |01     40| -- VCC
          CPU D1 <> |02     39| <- CPU R/W
          CPU D2 <> |03     38| <- CPU /CE
          CPU D3 <> |04     37| <- M2
          CPU D4 <> |05     36| -- NC
          CPU D5 <> |06     35| -- NC
          CPU D6 <> |07     34| <- PPU A10
          CPU D7 <> |08     33| <- PPU A11
         PRG A13 <- |09     32| <- PPU A12
         PRG A14 <- |10     31| -- GND
         PRG A15 <- |11     30| -> VRAM A10
         PRG A16 <- |12     29| -> CHR A10
         PRG A17 <- |13     28| -> CHR A11
         PRG A18 <- |14     27| -> CHR A12
          CPU A0 -> |15     26| -> CHR A13
          CPU A1 -> |16     25| -> CHR A14
         CPU A13 -> |17     24| -> CHR A15
         CPU A14 -> |18     23| -> CHR A16
         PRG /CE <- |19     22| -> CHR A17
             GND -- |20     21| -- NC
                     ---------

    Special Version: 01H (PAL16R4)

         PRG A14 <- |10     31| -- GND
         PRG A15 <- |11     30| -- NC
         PRG A16 <- |12     29| -> CHR A10

    Taito TC0350
    ------------

    Special Version: 00H

                     ----_----
             GND -- |01     48| -- VCC
         PRG A18 <- |02     47| <- M2
         PRG A16 <- |03     46| -> PRG A14
         PRG A17 <- |04     45| -> PRG A13
         PRG A15 <- |05     44| -> PRG /CE
         CPU A13 -> |06     43| <> CPU D7
         CPU A14 -> |07     42| <> CPU D6
          CPU A1 -> |08     41| <> CPU D5
          CPU A0 -> |09     40| <> CPU D4
          CPU D0 <> |10     39| <> CPU D3
          CPU D1 <> |11     38| -> CHR /OE
          CPU D2 <> |12     37| -> CHR A17
         CPU /CE -> |13     36| -> CHR A14
         CPU R/W -> |14     35| -> CHR A13
             IRQ <- |15     34| <- PPU A8
         PPU /RD -> |16     33| <- PPU A9
         CHR A16 <- |17     32| <- PPU A10
         CHR A15 <- |18     31| -> CHR A11
         CHR A12 <- |19     30| <- PPU A11
          PPU A7 -> |20     29| -> CHR A10*
          PPU A6 -> |21     28| <- PPU A12
          PPU A5 -> |22     27| -> CHR /RD
          PPU A4 -> |23     26| <- PPU A13
             GND -- |24     25| -- NC
                     ---------

    * Pin 29 is also connected to VRAM A10.

    Taito TC0690
    ------------

    Special Version: 00H

    01 -- NC            20 -- NC            33 -- NC            52 -- NC
    02 -- NC            21 -> IRQ           34 -- NC            53 <> CPU D5
    03 -> CHR A15       22 <- CPU /CE       35 -> PRG A14       54 <> CPU D1
    04 <- PPU /RD       23 -> PRG /CE       36 -- NC            55 <> CPU D4
    05 -- NC            24 <- CPU R/W       37 <- CPU A13       56 <> CPU D2
    06 -> CHR A10       25 -- Vcc           38 -> PRG A17       57 -- Vcc
    07 <- PPU A12*      26 -> PRG A15       39 -- NC            58 <> CPU D3
    08 <- PPU A11       27 -- GND           40 <- M2            59 -- GND
    09 -- Vcc           28 -> PRG A13       41 -- Vcc           60 -- NC
    10 <- PPU A10       29 <- CPU A14       42 -> CHR /OE       61 -> CHR A11
    11 -- GND           30 -> PRG A16       43 -- GND           62 -> CHR A16
    12 -> CHR A13       31 -- NC            44 <> CPU D7        63 -- NC
    13 <- PPU A13*      32 -- NC            45 <- CPU A0        64 -- NC
    14 -> CHR A14                           46 <> CPU D6
    15 -> CHR A12                           47 <- CPU A1
    16 -> VRAM A10                          48 <> CPU D0
    17 -> CHR A17                           49 -- NC
    18 -- NC                                50 -- NC
    19 -- NC                                51 -- NC

    * Latched (74LS157)

    Taito X1-005
    ------------

    Special Version: 00H

                     ----_----
              NC -- |01     48| -- VCC
              M2 -> |02     47| -> PRG A17
         CPU A12 -> |03     46| -> PRG A15
         CPU A13 -> |04     45| -> PRG A14
         CPU A14 -> |05     44| -> PRG A13
          CPU A6 -> |06     43| <- CPU A8
          CPU A5 -> |07     42| <- CPU A9
          CPU A4 -> |08     41| <- CPU A11
          CPU A3 -> |09     40| -> PRG A16
          CPU A2 -> |10     39| <- CPU A10
          CPU A1 -> |11     38| <- CPU /CE
          CPU A0 -> |12     37| <> CPU D7
          CPU D0 <> |13     36| <> CPU D6
          CPU D1 <> |14     35| <> CPU D5
          CPU D2 <> |15     34| <> CPU D4
         CPU R/W -> |16     33| <> CPU D3
         CHR A17 <- |17     32| -- NC
             GND -- |18     31| -> VRAM A10
         CHR A15 <- |19     30| -> CHR A14
         CHR A12 <- |20     29| -> CHR A13
         PPU A10 -> |21     28| -> CHR A11
         PPU A11 -> |22     27| -> CHR A16
         PPU A12 -> |23     26| -> CHR A10
             GND -- |24     25| -- NC
                     ---------

    Special Version: 01H

         CPU R/W -> |16     33| <> CPU D3
        VRAM A10 <- |17     32| -- NC
             GND -- |18     31| -- NC
         CHR A15 <- |19     30| -> CHR A14

    Bandai LZ93D50
    --------------

    Special Version: 01H (X24C01P)
    Special Version: 02H (X24C02P)

    Sunsoft 3
    ---------

    Special Version: 00H

                     ----_----
             GND -- |01     42| -- VCC
              M2 -> |02     41| -- NC
         CPU A11 -> |03     40| <> CPU D7
         CPU A12 -> |04     39| <> CPU D6
         CPU A13 -> |05     38| <> CPU D5
         CPU A14 -> |06     37| <> CPU D4
         CPU /CE -> |07     36| <> CPU D3
         CPU R/W -> |08     35| <> CPU D2
         PRG /CE <- |09     34| <> CPU D1
        VRAM A10 <- |10     33| <> CPU D0
         CHR /RD <- |11     32| -- NC
         CHR A10 <- |12     31| -- NC
         PPU A11 -> |13     30| <- PPU A13
         PPU A12 -> |14     29| <- PPU /RD
         CHR A16 <- |15     28| -> IRQ
         CHR A15 <- |16     27| -> PRG A14
         CHR A14 <- |17     26| -> PRG A15
         CHR A13 <- |18     25| -> PRG A16
         CHR A12 <- |19     24| -> PRG A17
         CHR A11 <- |20     23| -> PRG /A17
             GND -- |21     22| -> PRG A18
                     ---------

    Last updated 12th January 2014