Hi, I hope this does the job for you, so you won’t have to do everything manually
This is my merger script, that I use atm, which puts roms from these two directories
/mame
/arcade
into a single playlist with the correct core (mame or fba)
Basically my script fetches the proper names of arcade roms from a local mame dat file (database.xml)
You can download the database from here
MAME Dats 0.172
http://www.progettosnaps.net/dats/
I just renamed the dat file to database.xml…
the getName() function fetches the name from the database
#!/bin/bash
getName () {
sed -n '/<machine name="'$1'"/,/<\/description>/p' database.xml > test.txt
local name=$(sed -n 's:.*<description>\(.*\)</description>.*:\1:p' test.txt)
echo $name
}
scanmame () {
for fullpath in $1; do
echo $fullpath
filename=$(basename "$fullpath")
gamename=$(getName ${filename%.*})
echo $gamename
if [ -z "$gamename" ]; then
echo "Not in db" >&2
else
echo $2
echo $3
echo "DETECT"
echo $4
fi
done
}
scanmame "/storage/roms/arcade/*.zip" "/tmp/cores/fba_libretro.so" "Arcade (FB Alpha - SVN)" "FB Alpha - Arcade Games.lpl" > "/storage/playlists/FB Alpha - Arcade Games.lpl"
scanmame "/storage/roms/mame/*.zip" "/tmp/cores/mame_libretro.so" "MAME" "FB Alpha - Arcade Games.lpl" >> "/storage/playlists/FB Alpha - Arcade Games.lpl"
To install and execute it
Just put it in e.g the config dir
login via ssh
user:root
pass:root
cd .config
chmod +x scanner.sh
./ scanner.sh
If some roms are not working for you, check if you have the right romset for you mame version
and if you have the parent roms for your rom.
Some roms need other images to get them to work.
The mamedb is a good place to check if you need a parent rom
To check logs…you can manually launch a core from the commandline over ssh and load a certain rom
killall retroarch
then
retroarch -L /tmp/cores/mame_libretro.so /roms/mame/something.zip
mame will print you the logs and also if you are missing a parent rom