Packrom

From Uzebox Wiki
Revision as of 15:56, 25 October 2011 by Uze (talk | contribs) (→‎Usage)
Jump to navigation Jump to search

Packrom 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 the Uzem emulator supports both HEX and UZE files.

Usage

  • Build the tool from the sources (or get the Windows pre-compiled binaries) here (i.e: uzebox_bin_Win32_dev_trunk_r168.zip).
  • 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.