[mythtv-users] feeding the correct argument to sdlmame with, mythgame

Giles gbirchley at blueyonder.co.uk
Fri Mar 25 06:29:32 UTC 2011

On 25/03/11 04:33, scram69 wrote:
> On Tue, Mar 22, 2011 at 10:19 PM, scram69<scram69 at gmail.com>  wrote:
>> On Mon, Mar 21, 2011 at 7:24 AM, Giles<gbirchley at blueyonder.co.uk>  wrote:
>>> On 21/03/11 10:15, mythtv-users-request at mythtv.org wrote:
>>> Date: Sun, 20 Mar 2011 21:07:09 -0700
>>> From: scram69<scram69 at gmail.com>
>>> Subject: [mythtv-users] feeding the correct argument to sdlmame with
>>>      mythgame
>>> To: Discussion about mythtv<mythtv-users at mythtv.org>
>>> Message-ID:
>>>      <AANLkTinUfcZM7qEsVkib_2Pyww9UyoGkChHHEYfb9Csy at mail.gmail.com>
>>> Content-Type: text/plain; charset=ISO-8859-1
>>> mythgame currently launches the selected player using the command
>>> listed in the setup page, but automatically appends
>>> "path/to/romfile.zip" to the command.  sdlmame, on the other hand
>>> wants a command like mame64 gamename, and the path for the roms is
>>> stored in a config file.  I guess I'm dense, but I can't figure out
>>> what to put on the commandline in the settings page in order to get
>>> sdlmame to work.  I've tried %gamename or just gamename, since these
>>> are in the database, but mythgame just parses them literally, e.g.:
>>> "mame64 %gamename "/Users/Shared/roms/asteroids.zip"".  Anyone using
>>> sdlmame with mythgame?
>>> I put a text file with the rom name in the mythgame rom launch path (I don't
>>> want to display my entire romset in mythgame) and this seems to launch
>>> sdlmame roms okay, even though the config file"mame.ini" points to a romset
>>> elsewhere - on launching it complains that some rom files may be missing,
>>> but this doesn't stop them launching (if you get my drift). However it
>>> relatively easy, and perhaps more elegant, to truncate the string sent to
>>> mame to remove the path - I do this to launch aae, which is a vector arcade
>>> emulator that runs under wine. My script to start aae that mythgame points
>>> to is as follows:
>>> #!/bin/bash
>>> qjoypad "aae"&
>>> export LD_LIBRARY_PATH='/home/mythtv/.wine/drive_c/"Program Files"/aae'
>>> cd /home/mythtv/.wine/drive_c/"Program Files"/aae
>>> wine aae.exe "${1##/*/}"
>>> # strips out longest string between / and / ie removes the path - so no path
>>> will be sent to aae, just rom name
>>> xrandr -s 1680x1050
>>> qjoypad "mythtv"&
>>> So if you write your own script to call mame with something similar it
>>> should work ie. write a script that goes:
>>> #!/bin/bash
>>> mame "${1##/*/}"
>>> and this should strip out the path info that mythgame sends to mame. Save
>>> the script as start_mame (or something) and in the mythgame command
>>> configuration tell it to launch mame with:
>>> start_mame s%
>> Giles,
>> Thanks - replacing the game executable with a shell script is a good
>> idea for a workaround for this issue.  I guess the typical mythtgame
>> user is running an emulator that expects the full path to the rom (in
>> quotes, no less) as an argument.  I'll give the script approach a try.
>> I cc'd the list so others might find your solution-
>> Steve
> Well, the problem was more strange than I thought.  Turns out, sdlmame
> doesn't know where to find its config file, mame.ini.  It doesn't even
> assume it's in the same directory as the executable.  I fixed the
> problem by adding -inipath /path/to/mame.ini to the command line in
> the player settings.
I've not got mame installed on this computer, but if my memory serves me 
correctly in Fedora the mame.ini file is in /usr/share/mame/ini by 
default. You'll need to edit this file to look in  /path/to/mame.ini or 
where-ever your preferred location is.

More information about the mythtv-users mailing list