4th March 2006
Tested with MAME v0.104u4 and RAINE32 v0.43.0
This guide describes how to set up a MinGW environment that is suitable for compiling MAME and RAINE32. It is written in the same style as the document I wrote explaining how to create a DJGPP environment suitable for DMAME and RAINE. With the help of this guide any proficient PC user should be able to set up MinGW for MAME and RAINE32 in around 10 to 15 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 or waiting for me to update my guide.
The guide will explain how to install MinGW onto the D: drive but you can choose any drive and location that you wish (so long as you think about what you are doing!).
2. Installing MinGW (Minimalist GNU for Windows)
MinGW comes as separate downloadable components and you will need the following to compile MAME and RAINE32:
Note that the above files have the extension '.tar.gz'. This format originates from the Unix community and the files are actually created using two tools ('tar' creates a single archive of all the files and 'gzip' is used to compress the tar file). However, recent versions of WinZip support this compression format so you don't need any additional tools.
To install MinGW:
3. Installing MSYS (Minimal SYStem for MinGW):
To simplify the usage of MinGW, you need to install MSYS. It is simplest to describe it as a command prompt from which you can compile MAME and RAINE but the reality it provides far more than just that. It is a minimal POSIX system for MinGW and includes the various Unix commands that are required when compiling MAME as well as a fully functional version of GNU make. It also means that you don't need to configure your Windows PATH variable to get MinGW working and PATH conflicts should also be impossible.
To install MSYS:
4. Installing DirectX 7.0
MAME uses DirectX 7.0 and although RAINE32 uses Allegro (not DirectX directly), Allegro needs DirectX 7.0 when it is compiled. In other words, whether you intend to compile MAME or RAINE32 you need DirectX 7.0 installed.
To install DirectX 7.0:
Note: You will be asked if you want to overwrite some existing files (probably just the 9 files in the 'lib' directory with a '.a' extension). You should answer 'yes' to any questions asking if you wish to overwrite existing files.
5. Installing NASM
NASM (Netwide Assembler) is used by MAME and RAINE32 as an x86 assembler. You require the following archive:
To install NASM:
NASM is now installed.
6. Compiling MAME
The MAME source comes as a ZIP inside a ZIP to gain the greatest compression possible. To compile MAME, follow these steps:
A decent computer will take about 30 minutes to compile MAME but a low-spec machine could take a couple of hours or more!
7. Compiling MAME Updates
The MAME updates come as '.diff' files, distributed inside a ZIP. To compile the MAME update, follow these steps:
Tips (as above):