genroms
ROM file generator
Version 1.8
Scott "Jerry" Lawrence
2004 January
genroms@umlautllama.com
http://www.umlautllama.com
OVERVIEW
This is a utility meant to aid in generating rom files for arcade machines or emulators. You pass it in a standard Intel Hex File (.IHX) along with a description of the rom layout in memory (.ROMS), and it will generate the rom files as specified in the rom layout file.
Primarilly, it is meant to help people that are trying to write programs for older arcade machines, or for circumstances where the rom layout may be strange, or non contiguous.
It's still your responsibility, as a programmer, to use the memory locations appropriate for your application. This utility just makes it easier to generate the ROM image files.
USAGE
Simply, all you need is a .ROMS rom layout file, along with the .IHX Intel Hex File generated by your assembler or compiler. Then just run the executable, "genroms" with the .ROMS filename and the .IHX filename as parameters like so:
genroms filename.roms filename.ihx
sample .roms and .ihx files are included with this distribution. The .ROMS file with this distribution is for the arcade game 'Pengo'. The current implementation of genroms supports just a single bank of memory... that is to say, that just the first set of roms in a 'begin' - 'end' is recognized by the program. It's not to great with error detection in the .ROMS file either... make sure it's correctly layed out. If 'roms' overlap eachother, then the results are undefined.
The format of the .ROMS file is as follows:
# this is a comment
begin [name of bank]
[start address] [size] [rom filename] [ideal descriptive name]
[start address] [size] [rom filename] [ideal descriptive name]
end
and an example:
# pengo memory layout:
# program space
begin program_space
0x0000 0x1000 ic8 program_1
0x1000 0x1000 ic7 program_2
0x2000 0x1000 ic15 program_3
0x3000 0x1000 ic14 program_4
0x4000 0x1000 ic21 program_5
0x5000 0x1000 ic20 program_6
0x6000 0x1000 ic32 program_7
0x7000 0x1000 ic31 program_8
end
the address and size need to be in hex format: 0xnnnn where 'nnnn' is the value in upper or lowercase hex. If the value is not prefixed with "0x", then it will not be recognized as a value, and an error will be generated.
If you are using genroms to apply patches to romsets, point genroms at a source directory by putting the -patch option on THE END of the command line. It will not work anywhere else on the command line. As genroms normally initializes the internal representation of the rom images, it starts by filling them with 0's. By using the -patch option, it then tries to load the respective rom file from the directory specified.
This means, you can have an .asm file that just does something like:
.org 3000
nop
nop
And the .ihx file will contain just those two nop's. By using the -patch option, it will load the appropriate rom file at 3000, then drop the two nop's over it.
Use the -patch option like this:
genroms filename.roms filename.ihx -patch ./roms/path/here
You can use genroms in your makefile to show a list of all of the roms in the 'program' group by running it like this:
genroms filename.roms -list
or
genroms filename.roms -listall
VERSION
The latest version of this should be available off of
http://www.cis.rit.edu/~jerry/Software
Be sure you're using the latest version.
BUILD
Since this was developed with standard command-line functionality, it should work on any system that has a POSIX compatible layer.
It was developed with the GNU compiler set on a SunOS machine, although it should be easy to port to other compilers.
Generally, just type 'gmake', and copy the executable generated (genroms) to your preferred bin location.
LICENSE
This tool is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This tool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this tool; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
