Address Arranger

addrarng.zip (16k) (SCEA) (broken link)
addrarng.zip (16k) (SCEE)

Here's a copy of the text file included in the zip.

======================================================================
                           Address Arranger
                        (c) 1997 Scott Cartier
======================================================================

Contents of addrarng.zip:
  o addrarng.txt - This file
  o addrarng.exe - The exectuable
  o addrarng.c   - Source code

======================================================================

What does it do?

  To answer that question we need a bit of background.  When 
  downloading programs to the Yaroze there are two methods for
  selecting the addresses for TIMs, RSDs, etc.  The static method
  picks a fixed address and loads all of the files there every time.
  The dynamic method calculates the end of the code space and places
  in the memory afterward.

  The advantage of the static method is that you don't need to reload
  your files every time you recompile "main"; you can just download
  "main" and go.  On the other hand, you have to figure out each
  file's address by hand.  If your file ever changes size then you
  need to recompute every address from that file onward.

  This program eases that burden.

  Rather than computing each address by hand, which can be tedious 
  and error-prone, you simply make a list of files.  The Address 
  Arranger packs them together one right after another, leaving no 
  space between the files (except for 1-3 bytes to make each begin on
  a 32-bit boundary).

  The program will also create a ".h" header file which you can 
  include in your program.  It's basically a list of #define 
  statements which you can reference in your program.  You also give
  the name for each #define in the input file.

======================================================================

Usage:  addrarng   

======================================================================

Input file
----------
The first line in the input file must be the starting address for
your files.  Typically this is 0x8009000 (you can leave off the "0x"
if you want).

The rest is your list of files, one on each line.  Give the file name
first followed by the name you want to output in the #define header
file.

You can include comments by beginning a line with double 
forward-slashes "//" (like a normal one-line C comment).  Blank lines
will also be ignored.

======================================================================

Output files
------------
In addition to the input file name you must give two output file 
names.  The first is the name of the header file you wish to create.
You should probably name it with a .h just for clarity.

The last parameter is the name of the auto file you wish created.  
You can use this for SIOCONS.  The program automatically appends
"load local main" and "go" at the end.

======================================================================

CAUTION:  If you specify an output file that already exists it will 
          be automatically overwritten.

======================================================================

An example file (filelist.txt):

  0x8009000

  // My graphics
  a.tim ADDRESS_A
  b.tim ADDRESS_B

  // Music stuff
  song.seq  ADDR_MUSIC

Let's say "a.tim" is 100 bytes and "b.tim" is 233 bytes.  Then if you
run the program like this:

C:\> addrarng filelist.txt addr.h auto

The file addr.h would be:

  #define ADDRESS_A 0x80090000
  #define ADDRESS_B 0x80090064
  #define ADDR_MUSIC 0x80090150

And the auto file would be:

  local dload a.tim 80090000
  local dload b.tim 80090064
  local dload music.seq 80090150
  local  load main
  go

Notice how the length of "b.tim" was rounded up to 236 bytes.  I've
had trouble when I didn't align each starting address on 32-bit
boundaries. 

======================================================================

Feel free to hack up the code to make it do what you want.  I'm sure
everyone's needs are a bit different.

======================================================================

addrarng.zip (16k) (SCEA) (broken link)
addrarng.zip (16k) (SCEE)


Top

This web page and all other pages on this site are © 1997 Scott Cartier