3rd September 2005
Tested with RAINE32 v0.43.0
This guide describes how to enhance a MinGW environment (set up using my MAME guide) so that it can compile RAINE32. It is written in the same style as the document I wrote explaining how to create the MinGW environment for MAME. With the help of this guide any proficient PC user should be able to set up MinGW for RAINE32 in around 15 to 20 minutes (assuming the required files are downloaded beforehand). The guide has been written with the intention that the user will gain an understanding of what they are doing rather than just downloading a ready prepared distribution. It will not tell you how to do basic tasks such as creating a directory or extracting files from a ZIP, it will tell you where to create a directory or where to extract a ZIP. So long as you have those basic skills then you should have no problems.
One of the big advantages of explaining things in this manner is that you can update your own environment to use newer versions of the tools as they come out, without being dependant on someone else doing it for you.
The guide will explain how to enhance MinGW on the D: drive but you can choose any drive and location that you wish (so long as you think about what you are doing!).
First things first, you must follow the guide for compiling MAME. You cannot continue with this guide until you have done that!
2. Installing Allegro
Allegro (A Low Level Game Routines
Library) is used by RAINE32 for graphics handling, sound and input handling.
Firstly, if you didn't install the DirectX 7.0 headers then do it now!
After compiling Allegro, install it as follows (from the MSYS window that you compiled under) :
Tip: You can create your Allegro directory anywhere that you wish (I only used the D: drive for simplicity). You will also notice that the first make command was 'make lib'. If you wish to do a full Allegro build (which includes example programs and is about 40MB bigger than the library alone) you can use 'make' instead of 'make lib'. However, only the library is required to compile RAINE32 so it is fairly useless doing a full build just for RAINE32.
3. Installing SDL
SDL (Simple DirectMedia Layer) is used by RAINE32 for sound handling. You need the following archive:
To install SDL:
SDL is now installed in your MinGW environment. Once installed in the MinGW environment, you can delete the SDL-1.2.9 directory.
4. Installing zlib
zlib (ZIP library) is used by RAINE32 for loading zipped ROMs.
To compile zlib from the source:
After compiling zlib, install it for MinGW as follows (from the MSYS window):
Once you have installed the required files you can delete D:\ZLIB if you wish. Programmers may wish to keep it for reference purposes but other than that you won't need it any longer.
Tip: As with Allegro it is not necessary that you use the D: drive for compiling zlib, it can be done anywhere on your machine.
5. Installing libpng
libpng (PNG library) is used by RAINE32 for loading and saving PNG images.
To compile libpng from the source:
After compiling libpng, install it for MinGW as follows (from the MSYS window):
Once you have installed the required files you can delete D:\lpng128 if you wish. Programmers may wish to keep it for reference purposes but other than that you won't need it any longer.
Tip: As with Allegro it is not necessary that you use the D: drive for compiling libpng, it can be done anywhere on your machine.
6. Installing NASM
You should have already installed NASM within the MAME guide but RAINE needs it to have a different name!
NASM is now installed.
7. Installing EXEDAT (optional)
EXEDAT is used to append RAINE.dat onto RAINE.EXE. It is part of Allegro so you don't need to download anything extra.
Compile EXEDAT as follows:
After compiling EXEDAT, install it for MinGW as follows:
EXEDAT is now installed. Once you have installed Allegro and EXEDAT, you can delete the Allegro directory if you wish.
8. Installing UPX (optional)
UPX (Ultimate Packer for eXecutables) is used to reduce the size of the RAINE32 executable. You will need the following archive:
To install UPX:
UPX is now installed and you can use it to compress any .EXE file that you wish (not just MAME and RAINE32).
9. Compiling RAINE32
To compile RAINE32 follow these steps:
A decent computer will take about 5 minutes to compile RAINE32 and compress it.