Hi @Tarrasque , i am fairly sure that this works on all systems able to build Libretro MAME in the first place.
I can confirm that it works on Windows 7 and Linux Mint 19.3.
I never tried it on ARM or other systems (don’t know how to do that. Is it possible to cross compile them from Windows or Linux?)
Steps to compile a custom MAME core
(With proper paths)
1. Make sure that you can build the most recent version
git clone http://github.com/libretro/mame
cd mame
make -j3 -f Makefile.libretro #Complete build
make -j3 -f Makefile.libretro SUBTARGET=arcade #Arcade-only build
make -j3 -f Makefile.libretro SUBTARGET=mess #Softlist-only build
-j = number of jobs
-f = file (Makefile.libretro)
2. Reset the contents of the repository to a clean state
(do this inside the mame
directory)
make clean
git reset --hard
3. Checkout the desired version source
[NOTE] Make sure the version contains a Makefile.libretro
. Not all commits have the Makefile.libretro
so you have to search for the right one.
git checkout 3ec4cbb
e.g.
mame 0.217 = aedbec9
mame 0.216 = no Makefile.libretro
mame 0.215 = 7cf10a3
mame 0.214 = 3ec4cbb
mame 0.213 = no Makefile.libretro
mame 0.212 = 725827c
mame 0.211 = 3cbaac0
mame 0.210 = no Makefile.libretro
mame 0.209 = 1961f6c
…
4. Edit the following files:
-
mame/src/osd/libretro/libretro-internal/libretro.cpp
(core information displayed in RetroArch)
479 - info->library_name = "MAME";
480 - info->library_version = bare_build_version;
479 + info->library_name = "MAME 2019";
480 + info->library_version = "0.214 custom";
-
mame/src/osd/libretro/libretro-internal/libretro_shared.h
(name of the directorys [saves, states, system, etc.], core name etc.)
111 - static const char core[] = "mame";
111 + static const char core[] = "mame2019";
5. Build your custom MAME core
make -j3 -f Makefile.libretro #Complete build
make -j3 -f Makefile.libretro SUBTARGET=arcade #Arcade-only build
make -j3 -f Makefile.libretro SUBTARGET=mess #Softlist-only build
The resulting core is still mame_libretro.*
since i don’t have found a way to rename it in the building process without getting an error, so you have to rename it to your liking. e.g. mame2019_libretro.*
6. Create a matching *.info file
-
RetroArch/info/mame.info
or .config/retroarch/info/mame.info
(core name in RetroArch)
- rename to match the core
(e.g. mame2019_libretro.dll
= mame2019_libretro.info
)
001 - display_name = "Arcade (MAME)"
004 - corename = "MAME (Git)"
001 + display_name = "Arcade (MAME 2019)"
004 + corename = "MAME 2019 (based on 0.214)" # <- optional