Converter Version 1
One thing really bugs me about the Yaroze is the memory management. Bugs is perhaps
a wrong word. Having everything at set memory addresses is somewhat reminiscent of
developing on the Amiga and Commodore 64 of old. It brings with it a certain feeling of
intimacy with the machine.
On the playstation though it can be a pain. We need to write the code, and then upload the
code to the machine, making sure all the time that the memory addresses that we are
loading the data to doesn’t overwrite the tail of our code, or vice versa. Converter is a
way to tackle that problem.
What it does is turn a binary data file into a C header file. The binary data is converted
into ASCII text and dumped into a suitably large character array. From that point on you
can include the header file into your project and refer to the variable name to get the
address of the data. Compile your project and the data gets compiled along with it.
Upload the project and the data goes with it. If ever update the graphics in your
application, then just run Converter again and dump the new header file into your project
ready to go.
I wrote the source originally to run on a Linux box, one part of the growing development
network here at DaPad. For that reason its all completely standard ANSI C that should
compile under DJGPP or whatever other compiler you are using without any problem at
all. One problem I do know of though is that as a CodeWarrior console project it doesn’t
always print all the text onto the screen that you would like it to. Annoying but true.
Still, have fun.
|