Macintosh Codewarrior/Yaroze Help

Using a Yaroze on a macintosh is slightly more complicated then on a PC, but it can be done. First of all you will need the Yaroze Version of Metrowerk's 'Codewarrior'. To run programs that other people have already written and up-loaded as executable files, you will also need:

ResEdit, or another program to change the types and creators of files. ResEdit is avalible from here (365k).

Some compressed file Extractors for various formats, namely LHA (i.e LZH,LHA,LZH), ZIP, TAR and G-ZIP. There are various shareware programs avalible to do this job, but the ones that I have tried are listed here:

Zipit (487k)
LHA Expander (105k)
MacGzip (234k)
Tar (40k)

All are easy to use.

I will split this document into two sections, one for running programs from source (i.e ones that you have written) and running pre-compiled programs.

Pre-compiled programs

The easiest thing to do is to run executable Yaroze programs written by other people. To find a program to run, goto the Net Yaroze Demo web page. The files are generally compressed in one of the formats above, so once they are downloaded, run the appropriate helper app to de-compress the files. Note that files with the extention .tar.gz need to be decompressed in Gzip first and this file must then be compressed in Tar.

First of all, locate the main program file, normally called MAIN. Run ResEdit (or another program for changing types and creators) and goto 'Get Info for ' in the file menu. Change the type to PSX and the creator to CWIE.
Next install the patch for the PSComm utility and then run the program called PSCommUtil. With most of the programs that have been written there will be a file called AUTO, BATCH or something similar. This is a simple ASCII text document written by the author of the program that contains a list of instructions to the DOS version of SIOCONS. The file cntains a list of files and memory locations to download into. Open it up with SimpleText (or another text editor) and will look something like this:

local dload a.tmd 80090000
local dload b.tmd 800c0000
local dload Ps.nhk 800f0000
local load main
go

This file would tell SIOCONS to download a.tmd to the memory location 0x80090000 (in hex). What you must do, is load PSCommUtil and connect to the playstation after setting the options up in the connect menu. Next goto 'Download DATA file' in the 'Program Execution' menu. Select one of the files in the folder you decompressed the files into listed in the Batch file (e.g a.tmd), click OK and type in the memory address (with an 0x at the front to tell PSCommUtil that is is a HEX number). Click OK again and the data file will be downloaded into the Yaroze Playstation. Repeat this process until you reach the line that downloads the main program file. This looks different to the other lines as it has no memory address. do the same as above but select 'download program' instead of download data.

Once all the files are downloaded, you are ready to play, simply click run on th program execution menu and wait for the playstation to start the program.

Using Codewarrior to compile and debug your own programs

If you have already used the GNU version of the Yaroze compiler, and want to use Codewarrior to compile and debug programs, there are a few things you must do.

1. Create a new project as a Yaroze project.
2. Change the target name of the project to something different to the project name. The default is for the names to be the same, but this produces an error. The target name is in the edit-preferences menu.
3. If you are planning to use any external files, like 3D objects or Texture maps, then you must add the line

#include "MWDebugIO.h"

And then add the file MWDebugIO.lib to the project. You can then load the files that you want to use into the yaroze dynamically mallocing and freeing memory for textures and models on the fly, although this does have the overhead of a slow connection to the computer through the serial cable. The function to load a file from the hard disk is:

MWbload("filename", (void*)memory_location);

To debug your program, you must then select 'enable debugging' from the run menu, and then select debug from the same menu. The debugger should then connect to the playstation (make sure it is at the terminal screen on the playstation) and then you can select run from the debugger menu to step through, or run your program. Everything else from now on is more or less the same as the GNU compiler in DOS.

Also, see a simple CD-Player that uses fonts and the control pad by clicking here

By Daryl Cooper, Last updated 2/5/97