parsines

A library for reading iNES formatted NES ROM files.


Keywords
nes, emulation, ines, rom
License
GPL-3.0
Install
pip install parsines==1.0.0a2

Documentation

parsines

A parsing library for reading iNES formatted NES ROM files. Currently only header parsing is supported, but hopefully soon you'll be able to use ines to get at CHR and PRG data.

See http://wiki.nesdev.com/w/index.php/INES for details about the INES file format.

installation

From source

    git clone https://www.github.com/wkmanire/parsines ParsINES
    cd ParsINES
    python setup.py install

With pip

# You need the --pre until I release a non-alpha version
    pip install --pre parsines

ines-util

    usage: ines-util [-h] [--json] inesfile

    Print information about iNES formatted files.

    positional arguments:
      inesfile    A path to an iNES ROM file.

    optional arguments:
      -h, --help  show this help message and exit
      --json      Print the information in a web friendly format.

Example plain text output

    iNES ROM File
    -------------
    ROM Version           = INES
    PRG ROM Size          = 64 KB or 65536 B
    CHR ROM Size          = 16 KB or 16384 B
    CHR RAM               = NO
    Mapper ID             = 1
    Mirroring             = horizontal
    Battery-backed ram    = YES at $6000 to $7FFF
    Trainer               = NO
    4-screen VRAM Layout  = NO
    VS System Cartridge   = NO
    8KB RAM Banks         = 1
    Color encoding system = NTSC

Example JSON output

    {
      "has_battery_backed_ram": true,
      "is_vs_system_cartridge": false,
      "prg_rom_size": 64,
      "color_encoding_system": "NTSC",
      "chr_rom_size": 16,
      "mapper_id": 1,
      "ram_banks": 1,
      "mirroring": "HORIZONTAL",
      "version": "INES",
      "uses_chr_ram": false,
      "has_4_screen_vram_layout": false,
      "has_trainer": false
    }

Output a Full JSON Array

When you use the --json arg you may optional specify a directory instead of an iNES file. Any files ending in .nes will be added to a single JSON Array in the output. This is useful for reporting statistics about an entire ROM collection, such as the frequency of occurrence of certain mapper IDs or video encoding system (PAL vs. NTSC) for instance.