Configuring MythGame Emulation

From MythTV Official Wiki
Revision as of 18:16, 20 June 2006 by Bigwavedave (talk | contribs) (ZSNES)

Jump to: navigation, search


These instructions are specific to MythGame v0.19. (MythGame 0.18 instructions may be found here.) This document covers configuration of MythGame after it is installed; compilation and installation are not covered.

Note that the term player refers to the emulator software (ie, xmame) and not the human playing the games.

ROM Layout

MyhtTV categorizes your ROMs by system type (NES, SNES, etc). It also requires a path to provide to each emulator. Thus it's desirable to store your ROMs in separate directories based on the system. An example directory structure is given below. Your structure may differ but separation by system type is key.

/usr/emulators/amiga/chip   (For the Kickstart Image)

ROM Descriptions

MythGame allows you to provide titles, descriptions, screenshots, release year, and other information for your ROMs. This information can be automatically detected by matching CRC values. For automatic detection the romdb must be populated. This appears to be done by default; however, you can find an SQL load script in the v0.19 source packages as romdb-20051116-02.tgz. Or you can grab the a similar file from [1]. Untar and load:

tar -xzvf romdb-20051116-02.tgz
mysql -D mythconverg -u mythtv -p < romdb-2005-1101-01.sql

If running the above reports errors it's likely because the SQL file includes commands to create romdb table and your system already has the romdb tabe. Try removing the following lines from .sql file and re-running the above mysql command: CREATE TABLE romdb ( ... ) TYPE=MyISAM;

MythGame 0.19.0-Specific Note

On at least one reported system MythGame v0.19.0 was failing to load from the romdb table because of a code error in MythGame's gamehandler.cpp. The fix is to delete the trailing space in the SELECT statement in InitMetaData(). Change this:

QString thequery = QString("SELECT crc, category, year, country, name, "
                           "description, publisher, platform, version, "
                           "binfile FROM romdb WHERE platform = \"%1\"; ")

To this:

QString thequery = QString("SELECT crc, category, year, country, name, "
                           "description, publisher, platform, version, "
                           "binfile FROM romdb WHERE platform = \"%1\";")


TODO: need information on how to associate screenshots with games.

Generated Screenshots

A new | ticket provides a patch for MythGame that allows you to generate screenshots for the ROMS automaticaly within MythGame.

It uses the program scrot to generate screenshots of your X display.

It has also a patch included wich delays the loading of the screenshots about 300 msec so that scrolling through the roms goes as fast as without the screenshots.


Each emulator (called player within MythTV) must be setup individually. Setup consists of specifying a name, the type of hardware being emulated, the binary to execute, and the location of the roms.

If the path to the emulator binary is in your PATH there's no need to specify it in the setup. To determine which path a program is installed run which <program>.

Most emulators are included with OS distributions. Consult your package manager (rpm, dselect, emerge, synaptic, etc) before installing from source (unless you have a specific reason to do so).

Nintendo: SNES



Version: 1.42

ZNES requires a mouse for configuration in the GUI, keyboard support is not fully implemented. Fortunately the configuration only has to be done once.

Start ZSNES to create the config file. I recommend setting the option 2x Super SAI Engine under Configuration > Video so the picture looks smoother. After configuring ZSNES and exiting you must copy the configuration (by default ~/.zsnes) to the mythtv user directory (probably ~mythtv/.zsnes).

NOTE: (Current as of 06/20/2006) FC5 users may encounter issues compiling the 1.42 version. Consider getting the CVS version from SourceForge.

Add a new player in MythGame's setup:

Player Name: SNES 
Type: SNES 
Command: zsnes 
Rom Path: /usr/emulators/snes/roms



Version: 1.43

An alternate SNES emulator is called SNES9x. The quality of this emulator is near to ZSNES, if not better. It has no frontend on Linux but frontends just get in the way on MythTV. Everything can be configured through the command line, and most options work for all games, so once you have it set up you only need to modify command line options when you change hardware, like joysticks.

To view the configuration options run snes9x -h.

On many linux distributions to utilize full screen mode in SNES9x you need to add the SUID bit to your SNES9x binary. This is a security risk, but it makes games much more enjoyable. To add the SUID bit, do this:

 chmod 4750 `which snes9x`

Please adjust group and world permissions as necessary to suit your distribution.

Add a new player in MythGame's setup:

Player Name: SNES 
Type: SNES9X 
Command: snes9x -stereo -r 6 -tr -fs
Rom Path: /usr/emulators/snes/roms


If you are interested in using SNES9x with a joystick, please read about the -joydev and -joymap command line options. In addition, if you have the luxury of building snes9x from source, Reboot's joyaxisX patch is an excellent and necessary addition to the program.

Nintendo: NES



Version: 0.98.13

Start fceu with fceu -inputcfg gamepad1 %romname% to configure your joystick. In XWindows, the executable may be fceu-sdl instead of fceu.

Add a new player in MythGame's setup:

Player Name: NES 
Type: NES 
Command: fceu --fs 1 --joy1 1 --xres 1024 --yres 768
Rom Path: /usr/emulators/nes/roms

Nintendo: Game Boy Advance & Game Boy

Visual Boy Advance


Version: 1.80 SDL

The latest cvs version is recommended though older binaries do work. To get the latest cvs version run cvs -z3 co -P VisualBoyAdvance

Then we need to go into the VisualBoyAdvance directory and run: ./configure

After that we do: make

And then after compilation has completed we can copy the VisualBoyAdvance binary from the source dir to our binary directory (ie /usr/local/bin/).

You then need to edit the VisualBoyAdvance.cfg to edit your Joystick settings. If you want to change it, you can get a program called SLD-Test from the GameBoyAdvance homepage to get the correct settings for your joystick!

Add a new player in MythGame's setup:

Player Name: GBA
Type: OTHER 
Command: VisualBoyAdvance -F -4 (or -3, or -2 depending on your screen size, whatever works best for you)
Rom Path: /path/to/gba/roms

(The Parameters -F runs the emulator in a full screen and -4, -3, or -2 enlarges the picture x4, x3, or x2 respectively. Experiment to see which one fits your screen the best.)

Note: if you cannot get VisualBoyAdvance to compile, your best bet for Fedora Core 4 is to install this:

Nintendo: N64

Mupen 64


Version: 0.5

You must compile Mupen from source because the binary versions do not include the nogui version.

Download Mupen source by running wget Then extract the source.

Configure Mupen with ./configure

libSDL-devel is required to compile Mupen. See

Mupen64 0.5 comes with a bug which results in the nogui version not compiling. To fix this, edit main/main.c and insert the following at the beginning of the file:

#include <dirent.h>
#include <sys/stat.h>

Compile the Mupen nogui Version with: make mupen64_nogui

Now you need the MUPEN Plugins. You can also compile them or get them within the binary distribution of the Mupen Webpage (the latter is much easier and recommended).

Create a config file to use with Mupen. An example file follows:


Gfx Plugin = /usr/emulators/n64/bin/plugins/
Audio Plugin = /usr/emulators/n64/bin/plugins/
Input Plugin = /usr/emulators/n64/bin/plugins/
RSP Plugin = /usr/emulators/n64/bin/
Fullscreen = true
Emulation Mode = 2
No Ask = true

Add a new player in MythGame's setup:

Player Name: N64
Type: N64
Command: mupen64_nogui
Rom Path: /usr/emulators/n64/roms

Commodore: Amiga



Version: 0.8.29

This emulators is a backport to linux from WinUAE.

Add a new player in MythGame's setup:

Player Name: Amiga
Type: AMIGA 
Command: /usr/emulators/amiga/bin/uae -s floppy0=%d1 -s floppy1=%d2 -s floppy2=%d3 
-s floppy3=%d4 -s  floppy_speed=800 -s kickstart_rom_file=/usr/emulators/amiga/chip/KICK31.ROM
-s gfx_fullscreen_amiga=true -s use_gui=false
Rom Path: /usr/emulators/amiga/roms
Span Disks: yes

(Note: the command is a single line; it is split here so it fits on the screen.)



Additional details needed.

Origanal UAE


Version: 0.8.23

Additional details needed.

Atari: Lynx

Handy SDL


Version: 0.82 R1

You also need a BIOS image from the Atari Lynx. Copy this into the directory with the emulator's binary. (Info: You are only allowed to use a BIOS dump of your own Lynx machine!)

Player Name: Atari Lynx
Type: OTHER 
Command: sdyhandy %s -fullscreen -scale 4 -sound -joystick
Rom Path: /usr/emulators/atari/lynx/roms



Version: 0.106

You might have to play around with your xmarerc (or in the case of the SDL version, xmame-SDLrc). See the xmame docs. Run xmame with --showconfig to see your current configuration.

Remember to place the .zip files for your ROMS into your roms directory. Do not unzip them, MythGame will have a peek inside them. If you have snapshots in a snap directory, and they are zipped, you'll have to unzip them for MythGame to show them.

Player Name: XMAME
Type: MAME 
Command: xmame -fullscreen -vidmod 1 %s
Rom Path: /usr/emulators/xmame/roms

Others have reported the following command to enable fullscreen and sound:

Command: xmame.SDL -dp sdl -fullscreen %s

Sega: MegaDrive/Genesis



Version: 1.23

Note: compiling of the source from the above website has failed on at least one system. Using your distribution's packaged version is highly recommended.

Player Name: MegaDrive
Type: OTHER 
Command: dgen -f -G 800x600 -j
Rom Path: /usr/emulators/megadrive/roms




Version: ?

Install for linux is straightfoward when one follows this howto.

To make this work with MythGame a few changes have to be made:

The script suggested at step 10 needs a slight modification:

change this line -- ./epsxe to this -- ./epsxe -nogui -loadiso $1

This will allow you to run iso/bin files from within MythGame, however, it won't work for loading cds.

In addition, to get nice fullscreen, I found it better to set the resolution to your screens resolution worked better than choosing fullscreen.

Finally, do look into using the joypad plugin. This is especially true if you will be using a joystick.

Player Name: ePSXe
Type: OTHER 
Command: /usr/local/bin/start_epsxe
Rom Path: /usr/emulators/ps1/roms

More Emulators...

Following are alternate emulators. Additional instructions are encouraged so if you get one of these working please update this document.




Multiple Systems

  • Xe Game Boy, MegaDrive, Super Famicom, PC-FX, Playstation, GameGear, ...
  • Mednafen Atari Lynx, GameBoy, GameBoy Color, GameBoy Advance, NES, PC Engine(TurboGrafx 16), and SuperGrafx
  • [2] Xmess (Many Sytems...)

Remote Control Integration

It's very convenient to use your remote, and not a keyboard, to exit an emulator in MythGame. Most of the emulators do not support lirc natively. They also will not work with lirc's irexec because the emulators use SDL, ignoring all X11 key events. Fortunately through a combination of programs it's possible to have your remote trigger SDL key events the emulators respond to.

The instructions below pertain to specific emulators. The process is easily extended to other emulators though. Two examples are provided to aid understanding.

Note: irexec is used to invoke an external command. Thus you can not use irexec to control MythTV; instead use MythTV's native support for lirc.

Base Requirements

xmacro can send events understood by SDL programs (such as the emulators). It's xmacroplay-keys program is used to send an escape key event. You must install it; check your distribution for a precompiled package (ie, apt-get install xmacro).

lirc's irexec is used to capture remote events and invoke xmacroplay-keys. Add the following to your .lircrc:

   prog = irexec
   button = Exit
   repeat = 0
   config = xmacroplay-keys :0 Escape

Note: change the above Exit button to whatever mapping/button you want to use on your remote to exit the emulator.

irexec can't be running all the time or it and MythTV will respond to remote events causing Escape to be invoked inside MythTV twice. So instead start irexec immediately before running an emulator and kill irexec when the emulator exits. The scripts below do exactly this.

Another possible Option is that you create a Script wich kills all your emulators like:

   killall mupen64_nogui
   killall zsnes
   killall fceu

then you add to your to your .lircrc:

   prog = irexec
   button = Exit
   repeat = 0
   config =

with this option you don't need to create a script for every emu, only on to kill the emu's. But be aware, not every emu can be exited so, but you kann try to add a -9 to killall wich exits the emu in every case.


Enter the following script as

   # zsnes path + executable
   # irexec path + executable
   # irexec process name to kill
   $IREXEC &
   $ZSNES -m "$1"
   killall $IREXEC_PS
   exit 0

Adjust the paths and executables along with any arguments to zsnes (-m above). In the MythGame player's setup invoke the above script instead of zsnes directly.


Enter the following script as

   # fceu path + executable
   # irexec path + executable
   # irexec process name to kill
   $IREXEC &
   $FCEU -fs 1 -input1 -gamepad -no8lim 1 "$1"
   killall $IREXEC_PS

Adjust the paths and executables along with any arguments to fceu (-fs 1 -input1 -gamepad -no8lim 1 above). In the MythGame player's setup invoke the above script instead of fceu directly.