~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ***Building the Windows port of ZSNES with MinGW*** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Last updated 29/12/2005 I. Things you need: ------------------- - The ZSNES source code. You can download a package or get this from CVS. - MinGW v3.x or higher: http://www.mingw.org/ - Win32API (binary, not source code): http://www.mingw.org/ - Minimal DirectX 8 SDK for MinGW: http://www.talula.demon.co.uk/allegro/ - NASM v0.98.x: http://nasm.sf.net/ - zlib source code: http://www.gzip.org/zlib/ - libpng source code: http://www.libpng.org/ Note: Win32API 3.2 includes the DirectX libraries required for ZSNES, but it doesn't include all the headers. Future versions of Win32API may eliminate this requirement. II. Instructions: ------------------- 1) Install MinGW. From here on, the directory you installed it to will be referred to as MinGW\. After you finish the installation, add your MinGW\bin directory to your PATH environment variable. Info on how to do this can easily be obtained via Google. 2) Install Win32API by extracting its contents to your MinGW directory, overwriting any existing files. 3) Extract the Minimal DirectX 8 SDK archive and copy everything in the include directory to your MinGW\include directory. Do not overwrite any existing files. You do not need the files in the lib directory of the archive. 4) Install NASM. Extract nasmw.exe to your MinGW\bin directory and rename it to nasm.exe. 5) Extract zlib, libpng, and the ZSNES source. To ease compilation, we recommend placing everything in the same root directory, like so: |-src |----zlib |----libpng |----zsnes When you extract zlib and libpng, you will get directories with version numbers in the name, such as libpng-1.2.8 and zlib-1.2.1. You will need to rename these and remove the version numbers as shown in the diagram. 6) Go to your src\zlib directory using the command prompt. Run the following commands: copy win32\makefile.gcc makefile.gcc mingw32-make -f makefile.gcc After zlib compiles, copy zlib.h and zconf.h to MinGW\include and libz.a to MinGW\lib. 7) Go to your src\libpng directory. Run the following commands: copy scripts\makefile.gcc makefile mingw32-make Now copy png.h and pngconf.h to MinGW\include and libpng.a to MinGW\lib. 8) Go to your src\zsnes\src directory. Run the following command: mingw32-make -f makefile.ms PLATFORM=win32 9) If everything went well, you will end up with a zsnesw.exe file in your src\zsnes\src directory. You may want to compress this file with UPX, available at http://upx.sourceforge.net. This will reduce the file size from over 3MB to around 500KB. //eof