Targeted download of MAME Roms...


Targeted download of MAME Roms...

Downloading all of MAME ROMs, is not useful, as many of them don't worth, as games or the emulation is not good. Also, each of us, has his personal preferences on which games he likes, remembers from his youth and has that nostalgia feeling. So, i wanted a way to download, almost, specific games, which have good emulation and are great games, even if i didn't have played them, back in the 80-90s.

I achieved this, with the help of this site: Arcade Database which offers a great search engine, to filter games and also export the results in various formats. This is not a step-to-step guide, fill free to make your own selections, apply filters that comply with your MAME version and personal interests on arcade games. So let's see how, we can use this site, to create a CSV list and use it to download a set of MAME ROMs, that is almost 100% playable and contains great games.

Visit the site and select Games from the menu in the left. In this page, you will see some edit boxes, buttons and links. Press the ADDITIONAL FILTERS link...

4

A popup box will appear with several tabs. This is the "factory" of creating the best choices for you. Read carefully each tab and the options you have. Select the ones that you want and after finishing, press the Search button. You could create a list, for a specific MAME version, another for games that came out after ex. 1992 or select the games with the best rating.

2

Now press the Options button (2)...

1

...and you will see the following box.

5

In this box, make sure to check the "Export a working romset"!!! With this option, you'll get all BIOS files that a ROM may need, so your game is playable. If you don't do it, then some games may not be playable.

Select the Linux Script button. Also select the Other Options link cause it has some useful options. Again, you decide which ones you want. At the end, press Export and wait to download the list/script file.

Now that you downloaded the script, open it with a text editor. The guys at the Arcade Database did all the job for us! Go to the the process_game function, which looks like this:

function process_game() {
    # ROMSET is the zip rom file name without extension (ex. mslug, pacman, atetris)
    ROMSET=$1
    # ROMTYPE is used for game type: P=parent, C=clone, N=none
    ROMTYPE=$2
    # ROMPARENT is the parent romset (only for clones)
    ROMPARENT=$3
    # SCREEN is the orientation of screen: H=horizontal, V=vertical, N=none/screenless
    SCREEN=$4
    # TITLE is the game title
    TITLE=$5
    echo "==============================================================================="
    echo "PROCESS GAME ${ROMSET} - ${TITLE}"
    echo "PARENT: ${ROMPARENT}  -  TYPE ${ROMTYPE}  -  SCREEN ${SCREEN}"
    echo "-------------------------------------------------------------------------------"
    echo "TODO: Complete here to do some action..."
    # Example:
    #   cp "${MAMEROOT}/titles/${ROMSET}.png" "${MAMEROOT}/titles.clones/${ROMSET}.png"
    #   if [ "${ROMTYPE}" == "P" ]; then echo "This is a parent rom"; fi
    echo ""
}

Change the text at the TODO line, to something more meaningful, like "Downloading Rom..." and add this line:

wget https://archive.org/download/arcade-0223-merged/Arcade/roms.zip/roms/${ROMSET}.zip

This line, will download a specific ROM from a .zip file, archived in the Archive.org site. If the site is down, or the link has changed you will get error messages. Find another package/set/zip file, that has the ROMs and edit the correct link.

Make the script executable with chmod +x scriptname.sh and execute it. After is finished, you will have a working ROM set, according to your preferences/selections.

Below is the top part of the script, as i configured it, to display the progress of the downloading, as i wanted to know how many files, has downloaded and how many more needs to get finished. You can keep this part and only add the second part, which contains the ROM info.

#!/bin/bash

# MAME EXPORT SCRIPT
# AUTHOR: Arcade Database by motoschifo - http://adb.arcadeitalia.net
# TITLE: MAME search - ADB
# DATE: 13/10/2024

# MAMEROOT is the root folder of Mame
MAMEROOT=~/mame

IDX=1
thisfile=`basename "$0"`
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
lineEnd="$(cat $SCRIPT_DIR/$thisfile | grep -n "JOB COMPLETED" | tail -n 1 | cut -d: -f1)"
lineStart="$(cat $SCRIPT_DIR/$thisfile | grep -n "process_game" | head -n 3 | tail -n 1 | cut -d: -f1)"

echo $lineEnd
echo $lineStart
let total=(lineEnd - lineStart)
echo $total

function process_game() {

    # ROMSET is the zip rom file name without extension (ex. mslug, pacman, atetris)
    ROMSET=$1
    # ROMTYPE is used for game type: P=parent, C=clone, N=none
    ROMTYPE=$2
    # ROMPARENT is the parent romset (only for clones)
    ROMPARENT=$3
    # SCREEN is the orientation of screen: H=horizontal, V=vertical, N=none/screenless
    SCREEN=$4
    # TITLE is the game title
    TITLE=$5
  clear
    echo "==============================================================================="
    echo "PROCESS GAME ${ROMSET} - ${TITLE}"
    echo "PARENT: ${ROMPARENT}  -  TYPE ${ROMTYPE}  -  SCREEN ${SCREEN}"
    echo "-------------------------------------------------------------------------------"
    echo "Processing file $IDX of $total"
    # Example:
    #   cp "${MAMEROOT}/titles/${ROMSET}.png" "${MAMEROOT}/titles.clones/${ROMSET}.png"
    #   if [ "${ROMTYPE}" == "P" ]; then echo "This is a parent rom"; fi
   wget https://archive.org/download/arcade-0223-merged/Arcade/roms.zip/roms/${ROMSET}.zip

  let "IDX++"
    echo ""
}

Add a comment

Previous Next