Clone wiki

game-music-emu / Home

game-music-emu has moved!

game-music-emu moved to Bitbucket in 2015 since the old Google Code repository was closed down. Blargg (the original author) no longer has time to maintain the code, so it's being kept on life support by Michael Pyne.

The latest release is version 0.6.1 to address some security vulnerabilities noted by Chris Evans that could result in arbitrary code execution in the fact of malicious SPC audio. Note that 0.6.1 also includes other changes since the previous release, though none are major.

Source

The last released tarball (for version 0.6.1) is available from the Downloads page.

  • Michael Pyne, 2016-12-14

Building game-music-emu

You'll need at least CMake version 2.6.

Then you'll need to do something like this: (note these are Linux/UNIX instructions. Although CMake should work on Mac OS X and Windows I don't have those systems available to test, and you can always still build it yourself like you could before :P):

$ tar xjvf game-music-emu-0.6.1.tar.bz2
$ cd game-music-emu-0.6.1
$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local # See below for more options
$ make && sudo make install

  • The cmake ../ part is to run CMake, passing the parent directory (../) as the source directory.
  • -D for CMake begins a definition, so -DCMAKE_INSTALL_PREFIX=/usr/local sets the CMAKE_INSTALL_PREFIX (where CMake installs to) to /usr/local. You can change this to be anywhere you'd like to install game-music-emu.
  • Compiling in only certain game music emulators is supported. By default, all available types are compiled in. You can remove a type by passing -DUSE_GME_type=FALSE on the command line when running CMake. Make sure to pass more than one if you have more than one type to remove. The valid options are listed below:

Emulator types

Emulator type CMake option
Spectrum ZX -DUSE_GME_AY=0
Game Boy -DUSE_GME_GBS=0
Sega Genesis -DUSE_GME_GYM=0
NEC PC Engine / TurboGrafx-16 -DUSE_GME_HES=0
MSX / Other Z80 -DUSE_GME_KSS=0
NES -DUSE_GME_NSF=0
NES Extended support -DUSE_GME_NSFE=0
Atari SAP -DUSE_GME_SAP=0
SNES -DUSE_GME_SPC=0
Sega VGM/VGZ -DUSE_GME_VGM=0

Note that some emulator code is shared. For instance the audio processing code used by Spectrum ZX happened to also be used by PC Engine, so if you select PC Engine and disable Spectrum ZX, you may notice a bit of code still being used, but this is not an error.

Detecting conditionally compiled emulators

If you're a developer using libgme the only public API is the one defined in gme/gme.h

This API includes a gme_type_list() function, which you must call at runtime. It returns a NULL-terminated list of available types (alternately, you can simply try to play a file and allow libgme to fail if it doesn't support it).

Testing

To test the library, you can use the included (and very simple) GUI player application (which requires libSDL) in the player/ directory. It is not built by default, but you can cd to the game-music-emu/build/player directory and run make from there after you've already run CMake.

From there just run ./player /path/to/file on any supported file type.

Contact

If you have issues building you can contact Michael Pyne at mpyne at kde org. I know a bit about emulation but absolutely nothing about the actual internals of how any of the emulator cores operate, so you'll still need to ask blargg or someone else if you have troubles with the actual operation of the emulators. But fair warning, no one else seems to still be around.

Updated