Brian Cassidy > Games-NES-ROM > Games::NES::ROM

Download:
Games-NES-ROM-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.05   Source  

NAME ^

Games::NES::ROM - View information about an NES game from a ROM file

SYNOPSIS ^

    use Games::NES::ROM;
    
    # Read in the ROM
    my $rom = Games::NES::ROM->new( 'file.nes' );

    # Access the details
    print 'PRG Banks: ', $rom->PRG_count, "\n";
    print 'CHR Banks: ', $rom->CHR_count, "\n";
    # etc...
    
    # View the CRC checksum
    print 'CRC: ', $rom->CRC;

DESCRIPTION ^

This module loads the details of an NES rom file. An NES ROM file is layed out as follows:

    +-----------+---------------+---------+---------+ Header
    | NES\0x01a | [PC] [CC] X X | X X X X | X X X X | 16 Bytes
    +-----------+---------------+---------+---------+
    |                                               |
    |          PRG Banks (PC * 16384 Bytes)         |
    |                                               |
    +-----------------------------------------------+
    |                                               |
    |          CHR Banks (CC * 8192 Bytes)          |
    |                                               |
    +-----------------------------------------------+
    |                                               |
    |          Title (128 Bytes - Optional)         |
    |                                               |
    +-----------------------------------------------+

INSTALLATION ^

    perl Makefile.PL
    make
    make test
    make install

METHODS ^

new( [$filename] )

Creates a new instance of the module. An optional filename argument may be passed to immediately load the data.

load( $file )

Reads the ROM structure into memory.

sprite( $chr_bank, $index )

Returns the raw (composite) sprite in the specified CHR bank at the specified array index.

ACCESSORS ^

The following accessors are available:

SEE ALSO ^

AUTHOR ^

Brian Cassidy <bricas@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2007 by Brian Cassidy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.