-
Grab the latest msys2 tar.xz archive from http://repo.msys2.org/distrib/x86_64/
-
Extract the tar within that file with 7zip, then extract the msys64 folder from that to somewhere you have write privileges (the desktop or documents should be fine). This is a portable setup where everything you are working on is contained in the msys64 folder.
-
Follow these instructions to get your msys2 environment setup: https://bot.libretro.com/docs/compilation/windows/ You use the msys2_shell.cmd to open your msys2 shell. You can ignore the shortcuts section of that guide since you can just run the cmd and mingw64.exe directly from the msys64 folder. You can stop following the guide at the Nvidia toolkit part unless you want to compile RetroArch too.
-
After closing the msys2 shell window, you can start up mingw64.exe. In that prompt type:
git clone https://github.com/libretro/mame
The MAME source will start downloading. Once it’s done and you’re back to the $ prompt type:
cd mame
- Edit: This step can be skipped for now since NoNag works already in the current source without a patch. If this changes in the future this might be useful again.
Now we will apply Enverex’s NoNag patch. I had to regenerate it for some reason. Download it from here: https://www.dropbox.com/s/hpzyoxx5jgmxuya/mame-nonag.patch?dl=0 Move it to msys2\home\mame. Now in your mingw64 prompt type:
pacman -S patch
Type Y and hit enter to install the ability to use patches. Now type:
patch -p1 < mame-nonag.patch
The patch is now applied!
- Now type:
make -j5 -f Makefile.libretro STRIP_SYMBOLS=1
And hit Enter to start compiling. You can change the number next to the j to match the number of cores/threads your processor has + 1 for optimal compiling. The strip option will cut down on the core size by removing debug symbols you probably don’t need. Optionally, if you want an arcade only core, you can instead type:
make -j5 -f Makefile.libretro STRIP_SYMBOLS=1 SUBTARGET=arcade
Or to make a console/computer/MESS core:
make -j5 -f Makefile.libretro STRIP_SYMBOLS=1 SUBTARGET=MESS
Compiling MAME takes awhile; maybe more than an hour depending on your processor. When the $ prompt appears, compilation is done.
-
Look inside msys64\home<username>\mame for your fresh mame_libretro.dll. It’ll be named differently if you do the arcade or MESS subtarget. You can pop this in your RetroArch\cores folder and enjoy
-
If you want to easily update your core, you can open the mingw64.exe and type:
cd mame
Then:
git pull
Which will update your source files. Then you can make again to compile. Sometimes if the build has issues after updating you can try using:
make clean
To clean up precompiled stuff and then make again to compile cleanly.