The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Games::NES::SpriteMaker - manipulate PNM files and generate NES sprite data from them

VERSION

version 0.02

SYNOPSIS

  use Games::NES::SpriteMaker 'image_to_sprite';

  open my $fh, '>', 'sprites.chr';
  my $chr = image_to_sprite('spritemap.pgm');
  $fh->print($chr);
  $fh->close;

DESCRIPTION

This module contains useful functions for manipulating images in the PNM format in order to create and modify sprite data (CHR-ROM banks) in NES roms. The idea is that drawing sprites is much easier in a real graphics editor, and then you can save the image as a .pbm/.pgm/.ppm file and convert it into sprite data directly, rather than having to edit sprites in a hex editor.

Right now, the capabilities are pretty limited, but I'm open to adding more functionality as it becomes useful.

FUNCTIONS

image_to_sprite($data, %opts)

Converts PNM data to CHR-ROM data. $data can either be a filename or a scalar reference which is a reference to a string containing PNM-format data. %opts is a hash of options for how to generate the data. Currently the only option is rom_size, which determines the size of the .chr file to generate. It defaults to 8192.

BUGS

Please report any bugs to GitHub Issues at https://github.com/doy/games-nes-spritemaker/issues.

SEE ALSO

SUPPORT

You can find this documentation for this module with the perldoc command.

    perldoc Games::NES::SpriteMaker

You can also look for information at:

AUTHOR

Jesse Luehrs <doy@tozt.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Jesse Luehrs.

This is free software, licensed under:

  The MIT (X11) License