Packrom.exe is the tool used to convert .HEX files to .UZE files, the only format supported by the SD Card Gameloader.
HEX files are the final product of compilation and a ASCII file format required by tools like AVRStudio and avrdude to flash AVR devices. The format of these files are relatively complex to decode with the limited program space of the bootloader. Moreover, additional meta-data can not be included (like the game name, author, etc).
UZE files on the other hand is an easy to process, pure binary form of HEX files content with a 512 bytes header. This header contains the aforementioned meta data. The Uzebox bootloader (aka Gameloader) only understands these .UZE files.
Note that Uzebox emulators support both HEX and UZE files.
- Build the tool from the sources or get the Windows pre-compiled binaries:
- Create a simple text file containing these fields and save it in the same folder as the HEX you want to convert and name it "gameinfo.properties":
name=Arkanoid author=Uze year=2008 genre=0
- Insure the packrom.exe tool is on your system's PATH
- From the command line interface, change directory to where your HEX file is located and Execute the following command (assuming the HEX file to convert is named arkanoid.hex):
packrom arkanoid.hex arkanoid.uze gameinfo.properties
Adding to the Build Process
UZE files are normally generated as part of the build process.
Edit your makefile with the following:
First Declare a variable name INFO at the beginning:
## General Flags PROJECT = Arkanoid GAME= Arkanoid MCU = atmega644 TARGET = $(GAME).elf CC = avr-gcc INFO=../gameinfo.properties
Then add this target to your makefile:
%.uze: $(TARGET) @echo -$(UZEBIN_DIR)packrom $(GAME).hex $@ $(INFO)
See Arkanoid's Makefile for a detailed example on how to configure this.
You can convert a bunch of hex files in one shot with this script. Just extract the zip and put your hex files inside and it will automagically convert them to .uze setting the name to the filename, the author to unknown, the year to 0000, and the genre to 0. It should be noted that on Linux, you'll need wine to use this.
You can also use a GUI version of packrom: PackromGUI.