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

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;

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) |
| |
+-----------------------------------------------+

perl Makefile.PL
make
make test
make install

Creates a new instance of the module. An optional filename argument may be passed to immediately load the data.
Reads the ROM structure into memory.
Returns the raw (composite) sprite in the specified CHR bank at the specified array index.

The following accessors are available:


Brian Cassidy <bricas@cpan.org>

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.