summaryrefslogtreecommitdiff
path: root/plugins/gme/game-music-emu-0.6pre
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-05-19 22:29:12 +0200
committerGravatar waker <wakeroid@gmail.com>2012-05-19 22:29:12 +0200
commitc0f09dd6f3aac5dafba18b854458b641db11d17e (patch)
tree629c7acb2458cd655768987bedb523416f415b80 /plugins/gme/game-music-emu-0.6pre
parent104d77c4fe79cd327b1ef439142f1363cf82531b (diff)
tarball fixes
Diffstat (limited to 'plugins/gme/game-music-emu-0.6pre')
-rw-r--r--plugins/gme/game-music-emu-0.6pre/CMakeLists.txt91
-rw-r--r--plugins/gme/game-music-emu-0.6pre/changes.txt239
-rw-r--r--plugins/gme/game-music-emu-0.6pre/design.txt194
-rw-r--r--plugins/gme/game-music-emu-0.6pre/gme.txt375
-rw-r--r--plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.cpp2
-rw-r--r--plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.h53
-rw-r--r--plugins/gme/game-music-emu-0.6pre/license.txt504
-rw-r--r--plugins/gme/game-music-emu-0.6pre/readme.txt216
8 files changed, 1620 insertions, 54 deletions
diff --git a/plugins/gme/game-music-emu-0.6pre/CMakeLists.txt b/plugins/gme/game-music-emu-0.6pre/CMakeLists.txt
new file mode 100644
index 00000000..c76bbe19
--- /dev/null
+++ b/plugins/gme/game-music-emu-0.6pre/CMakeLists.txt
@@ -0,0 +1,91 @@
+# CMake project definition file.
+project(libgme)
+
+include (CheckCXXCompilerFlag)
+
+set(GME_VERSION 0.6.0 CACHE INTERNAL "libgme Version")
+
+# 2.6+ always assumes FATAL_ERROR, but 2.4 and below don't.
+# Of course, 2.4 might work, in which case you're welcome to drop
+# down the requirement, but I can't test that.
+cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
+
+# Default emulators to build (all of them! ;)
+if (NOT DEFINED USE_GME_AY)
+ SET(USE_GME_AY 1 CACHE BOOL "Enable support for Spectrum ZX music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_GBS)
+ SET(USE_GME_GBS 1 CACHE BOOL "Enable support for Game Boy music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_GYM)
+ SET(USE_GME_GYM 1 CACHE BOOL "Enable Sega MegaDrive/Genesis music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_HES)
+ SET(USE_GME_HES 1 CACHE BOOL "Enable PC Engine/TurboGrafx-16 music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_KSS)
+ SET(USE_GME_KSS 1 CACHE BOOL "Enable MSX or other Z80 systems music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_NSF)
+ SET(USE_GME_NSF 1 CACHE BOOL "Enable NES NSF music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_NSFE)
+ SET(USE_GME_NSFE 1 CACHE BOOL "Enable NES NSFE and NSF music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_SAP)
+ SET(USE_GME_SAP 1 CACHE BOOL "Enable Atari SAP music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_SPC)
+ SET(USE_GME_SPC 1 CACHE BOOL "Enable SNES SPC music emulation")
+endif()
+
+if (NOT DEFINED USE_GME_VGM)
+ SET(USE_GME_VGM 1 CACHE BOOL "Enable Sega VGM/VGZ music emulation")
+endif()
+
+if (USE_GME_NSFE AND NOT USE_GME_NSF)
+ MESSAGE(" -- NSFE support requires NSF, enabling NSF support. --")
+ SET(USE_GME_NSF 1 CACHE BOOL "Enable NES NSF music emulation" FORCE)
+endif()
+
+# Check for GCC "visibility" support.
+if (CMAKE_COMPILER_IS_GNUCXX)
+ check_cxx_compiler_flag (-fvisibility=hidden __LIBGME_TEST_VISIBILITY)
+ set (ENABLE_VISIBILITY OFF)
+ if (__LIBGME_TEST_VISIBILITY)
+ # get the gcc version
+ exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
+ string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
+
+ # gcc <4.1 had poor support for symbol visibility
+ if ((${_gcc_version} VERSION_GREATER "4.1") OR (${_gcc_version} VERSION_EQUAL "4.1"))
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+ set (ENABLE_VISIBILITY ON)
+ add_definitions (-DLIBGME_VISIBILITY)
+
+ # GCC >= 4.2 also correctly supports making inline members have hidden
+ # visibility by default.
+ if ((${_gcc_version} VERSION_GREATER "4.2") OR (${_gcc_version} VERSION_EQUAL "4.2"))
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
+ endif()
+ endif()
+ endif() # test visibility
+endif (CMAKE_COMPILER_IS_GNUCXX)
+
+# Cache this result
+set( LIBGME_HAVE_GCC_VISIBILITY ${ENABLE_VISIBILITY} CACHE BOOL "GCC support for hidden visibility")
+
+# Shared library defined here
+add_subdirectory(gme)
+
+# EXCLUDE_FROM_ALL adds build rules but keeps it out of default build
+add_subdirectory(player EXCLUDE_FROM_ALL)
+add_subdirectory(demo EXCLUDE_FROM_ALL)
diff --git a/plugins/gme/game-music-emu-0.6pre/changes.txt b/plugins/gme/game-music-emu-0.6pre/changes.txt
new file mode 100644
index 00000000..c0afecff
--- /dev/null
+++ b/plugins/gme/game-music-emu-0.6pre/changes.txt
@@ -0,0 +1,239 @@
+Game_Music_Emu Change Log
+-------------------------
+
+Game_Music_Emu 0.5.6
+--------------------
+- Switched to newer snes_spc 0.9.0 for SPC emulation. Uses fast DSP.
+
+- Fixed a couple of GBS bugs, one involving access of memory after realloc.
+
+- Removed documentation of C++ interface, as the C interface in gme.h is
+the only supported one.
+
+- Added gme_enable_accuracy() for enabling more accurate sound emulation
+options (currently affects SPC only).
+
+
+Game_Music_Emu 0.5.5
+--------------------
+- CMake build support has been added. You can build Game_Music_Emu as
+a shared library and install it so that you do not have to include your
+own copy if you know libgme will be present on your target system.
+Requires CMake 2.6 or higher.
+
+
+Game_Music_Emu 0.5.2
+--------------------
+- *TONS* of changes and improvements. You should re-read the new header
+files and documentation as the changes will allow you to simplify your
+code a lot (it might even be simpler to just rewrite it). Existing code
+should continue to work without changes in most cases (see Deprecated
+features in gme.txt).
+
+- New file formats: AY, HES, KSS, SAP, NSFE
+
+- All-new comprehensive C interface (also usable from C++). Simplifies
+many things, especially file loading, and brings everything together in
+one header file (gme.h).
+
+- Information tags and track names and times can be accessed for all
+game music formats
+
+- New features supported by all emulators: end of track fading,
+automatic silence detection, adjustable song tempo, seek to new time in
+track
+
+- Updated mini player example to support track names and times, echo,
+tempo, and channel muting, and added visual waveform display
+
+- Improved configuration to use blargg_config.h, which you can modify
+and keep when you update to a newer libary version. Includes flag for
+library to automatically handle gzipped files using zlib (so you don't
+need to use Gzip_File_Reader anymore).
+
+- GBS: Fixed wave channel to not reset waveform when APU is powered off
+(affected Garfield). Also improved invalid bank selection (affected Game
+& Watch and others).
+
+- VGM: Added support for alternate noise shifter register
+configurations, used by other systems like the BBC Micro.
+
+- SPC: Removed IPL ROM dump from emulator, as none of the SPC files I
+scanned needed it, and an SPC file can include a copy if necessary. Also
+re-enabled supposed clamping in gaussian interpolation between the third
+and fourth lookups, though I don't know whether it matters
+
+- Added Music_Emu::load_mem() to use music data already in memory
+(without copying it)
+
+- Added Music_Emu::warning(), which reports minor problems when loading
+and playing a music file
+
+- Added Music_Emu::set_gain() for uniform adjustment of gain. Can only
+be set during initialization, so not useful as a general volume control.
+
+- Added custom operator new to ensure that no exceptions are thrown in
+the library (I'd use std::nothrow if it were part of pre-ISO (ARM) C++)
+
+- Added BLIP_BUFFER_FAST flag to blargg_config.h to use a lower quality
+bandlimited synthesis in "classic" emulators, which might help
+performance on ancient processors (measure first!). Don't use this
+unless absolutely necessary, as quality suffers.
+
+- Improved performance a bit for x86 platforms
+
+- Text files now in DOS newline format so they will open in Notepad
+properly
+
+- Removed requirement that file header structures not have any padding
+added to the end
+
+- Fixed common bug in all CPU emulators where negative program counter
+could crash emulator (occurred during a negative branch from the
+beginning of memory). Also fixed related bug in Z80 emulator for
+IX/IY+displacement mode.
+
+- Eliminated all warnings when compiling on gcc 4.0. The following
+generates no diagnostics:
+
+ gcc -S gme/*.cpp -o /dev/null -ansi -fno-gnu-keywords
+ -fno-nonansi-builtins -pedantic -W -Wabi -Wall -Wcast-align
+ -Wcast-qual -Wchar-subscripts -Wdisabled-optimization -Werror
+ -Winline -Wlong-long -Wmultichar -Winvalid-offsetof
+ -Wnon-virtual-dtor -Woverloaded-virtual -Wparentheses
+ -Wpointer-arith -Wredundant-decls -Wreorder -Wsign-compare
+ -Wsign-promo -Wunknown-pragmas -Wwrite-strings
+
+
+Game_Music_Emu 0.3.0
+--------------------
+- Added more demos, including music player using the SDL multimedia
+library for sound, and improved documentation
+
+- All: Improved interface to emulators to allow simpler setup and
+loading. Instead of various init() functions, all now support
+set_sample_rate( long rate ) and load( const char* file_path ).
+
+- All: Removed error return from start_track() and play(), and added
+error_count() to get the total number of emulation errors since the
+track was last started. See demos for examples of new usage.
+
+- All: Fixed mute_voices() muting to be preserved after loading files
+and starting tracks, instead of being cleared as it was whenever a track
+was started
+
+- VGM: Rewrote Vgm_Emu to support Sega Genesis/Mega Drive FM sound at
+any sample rate with optional FM oversampling, support for alternate
+YM2612 sound cores, and support for optional YM2413
+
+- VGM: Added tempo control, useful for slowing 60Hz NTSC Sega Genesis
+music to 50Hz PAL
+
+- VGM: Removed Vgm_Emu::track_data(), since I realized that this
+information is already present in the VGM header (oops!)
+
+- GYM: Changed Gym_Emu::track_length() operation (see Gym_Emu.h)
+
+- NSF: Added support for Sunsoft FME-7 sound chip used by Gimmick
+soundtrack
+
+- NSF: Fixed Namco 106 problems with Final Lap and others
+
+- Moved library sources to gme/ directory to reduce clutter, and merged
+boost/ functionality into blargg_common.h
+
+- Added Gzip_File_Reader for transparently using gzipped files
+
+
+Game_Music_Emu 0.2.4
+--------------------
+- Created a discussion forum for problems and feedback:
+http://groups-beta.google.com/group/blargg-sound-libs
+
+- Changed error return value of Blip_Buffer::sample_rate() (also for
+Stereo_Buffer, Effects_Buffer, etc.) to blargg_err_t (defined in
+blargg_common.h), to make error reporting consistent with other
+functions. This means the "no error" return value is the opposite of
+what it was before, which will break current code which checks the error
+return value:
+
+ // current code (broken)
+ if ( !buf.sample_rate( samples_per_sec ) )
+ out_of_memory();
+
+ // quick-and-dirty fix (just remove the ! operation)
+ if ( buf.sample_rate( samples_per_sec ) )
+ out_of_memory();
+
+ // proper fix
+ blargg_err_t error = buf.sample_rate( samples_per_sec );
+ if ( error )
+ report_error( error );
+
+- Implemented workaround for MSVC++ 6 compiler limitations, allowing it
+to work on that compiler again
+
+- Added sample clamping to avoid wrap-around at high volumes, allowing
+higher volume with little distortion
+
+- Added to-do list and design notes
+
+- Added Music_Emu::skip( long sample_count ) to skip ahead in current
+track
+
+- Added Gym_Emu::track_length() and Vgm_Emu::track_length() for
+determining the length of non-looped GYM and VGM files
+
+- Partially implemented DMC non-linearity when its value is directly set
+using $4011, which reduces previously over-emphasized "popping" of
+percussion on some games (TMNT II in particular)
+
+- Fixed Fir_Resampler, used for SPC and GYM playback (was incorrectly
+using abs() instead of fabs()...argh)
+
+- Fixed SPC emulation bugs: eliminated clicks in Plok! soundtrack and
+now stops sample slightly earlier than the end, as the SNES does. Fixed
+a totally broken CPU addressing mode.
+
+- Fixed Konami VRC6 saw wave (was very broken before). Now VRC6 music
+sounds decent
+
+- Fixed a minor GBS emulation bug
+
+- Fixed GYM loop point bug when track was restarted before loop point
+had been reached
+
+- Made default GBS frequency equalization less muffled
+
+- Added pseudo-surround effect removal for SPC files
+
+- Added Music_Emu::voice_names() which returns names for each voice.
+
+- Added BLARGG_SOURCE_BEGIN which allows custom compiler options to be
+easily set for library sources
+
+- Changed assignment of expansion sound chips in Nsf_Emu to be spread
+more evenly when using Effects_Buffer
+
+- Changed 'size_t' values in Blip_Buffer interface to 'long'
+
+- Changed demo to generate a WAVE sound file rather than an AIFF file
+
+
+Game_Music_Emu 0.2.0
+--------------------
+- Redid framework and rewrote/cleaned up emulators
+
+- Changed licensing to GNU Lesser General Public License (LGPL)
+
+- Added Sega Genesis GYM and Super Nintendo SPC emulators
+
+- Added Namco-106 and Konami VRC6 sound chip support to NSF emulator
+
+- Eliminated use of static mutable data in emulators, allowing
+multi-instance safety
+
+
+Game_Music_Emu 0.1.0
+--------------------
+- First release
diff --git a/plugins/gme/game-music-emu-0.6pre/design.txt b/plugins/gme/game-music-emu-0.6pre/design.txt
new file mode 100644
index 00000000..33e185a3
--- /dev/null
+++ b/plugins/gme/game-music-emu-0.6pre/design.txt
@@ -0,0 +1,194 @@
+Game_Music_Emu 0.5.6 Design
+---------------------------
+This might be slightly out-of-date at times, but will be a big help in
+understanding the library implementation.
+
+
+Architecture
+------------
+The library is essentially a bunch of independent game music file
+emulators unified with a common interface.
+
+Gme_File and Music_Emu provide a common interface to the emulators. The
+virtual functions are protected rather than public to allow pre- and
+post-processing of arguments and data in one place. This allows the
+emulator classes to assume that everything is set up properly when
+starting a track and playing samples.
+
+All file input is done with the Data_Reader interface. Many derived
+classes are present, for the usual disk-based file and block of memory,
+to specialized adaptors for things like reading a subset of data or
+combining a block of memory with a Data_Reader to the remaining data.
+This makes the library much more flexible with regard to the source of
+game music file data. I still added a specialized load_mem() function to
+have the emulator keep a pointer to data already read in memory, for
+those formats whose files can be absolutely huge (GYM, some VGMs). This
+is important if for some reason the caller must load the data ahead of
+time, but doesn't want the emulator needlessly making a copy.
+
+Since silence checking and fading are relatively complex, they are kept
+separate from basic file loading and track information, which are
+handled in the base class Gme_File. My original intent was to use
+Gme_File as the common base class for full emulators and track
+information-only readers, but implementing the C interface was much
+simpler if both derived from Music_Emu. User C++ code can still benefit
+from static checking by using Gme_File where only track information will
+be accessed.
+
+Each emulator generally has three components: main emulator, CPU
+emulator, and sound chip emulator(s). Each component has minimal
+coupling, so use in a full emulator or stand alone is fairly easy. This
+modularity really helps reduce complexity. Blip_Buffer helps a lot with
+simplifying the APU interfaces and implementation.
+
+The "classic" emulators derive from Classic_Emu, which handles
+Blip_Buffer filling and multiple channels. It uses Multi_Buffer for
+output, allowing you to derive a custom buffer that could output each
+voice to a separate sound channel and do different processing on each.
+At some point I'm going to implement a better Effects_Buffer that allows
+individual control of every channel.
+
+In implementing the C interface, I wanted a way to specify an emulator
+type that didn't require linking in all the emulators. For each emulator
+type there is a global object with pointers to functions to create the
+emulator or a track information reader. The emulator type is thus a
+pointer to this, which conveniently allows for a NULL value. The user
+referencing this emulator type object is what ultimately links the
+emulator in (unless new Foo_Emu is used in C++, of course). This type
+also serves as a useful substitute for RTTI on older C++ compilers.
+
+Addendum: I have since added gme_type_list(), which causes all listed
+emulators to be linked in. To avoid this, I make the list itself
+editable in blargg_config.h. Having a built-in list allows
+gme_load_file() to take a path and give back an emulator with the file
+loaded, which is extremely useful for new users.
+
+
+Interface conventions
+----------------------
+If a function retains a pointer to or replaces the value of an object
+passed, it takes a pointer so that it will be clear in the caller's
+source code that care is required.
+
+Multi-word names have an underscore '_' separator between individual
+words.
+
+Functions are named with lowercase words. Functions which perform an
+action with side-effects are named with a verb phrase (i.e. load, move,
+run). Functions which return the value of a piece of state are named
+using a noun phrase (i.e. loaded, moved, running).
+
+Classes are named with capitalized words. Only the first letter of an
+acronym is capitalized. Class names are nouns, sometimes suggestive of
+what they do (i.e. File_Scanner).
+
+Structure, enumeration, and typedefs to these and built-in types are
+named using lowercase words with a _t suffix.
+
+Macros are named with all-uppercase words.
+
+Internal names which can't be hidden due to technical reasons have an
+underscore '_' suffix.
+
+
+Managing Complexity
+-------------------
+Complexity has been a factor in most library decisions. Many features
+have been passed by due to the complexity they would add. Once
+complexity goes past a certain level, it mentally grasping the library
+in its entirety, at which point more defects will occur and be hard to
+find.
+
+I chose 16-bit signed samples because it seems to be the most common
+format. Supporting multiple formats would add too much complexity to be
+worth it. Other formats can be obtained via conversion.
+
+I've kept interfaces fairly lean, leaving many possible features
+untapped but easy to add if necessary. For example the classic emulators
+could have volume and frequency equalization adjusted separately for
+each channel, since they each have an associated Blip_Synth.
+
+Source files of 400 lines or less seem to be the best size to limit
+complexity. In a few cases there is no reasonable way to split longer
+files, or there is benefit from having the source together in one file.
+
+
+Preventing Bugs
+---------------
+I've done many things to reduce the opportunity for defects. A general
+principle is to write code so that defects will be as visible as
+possible. I've used several techniques to achieve this.
+
+I put assertions at key points where defects seem likely or where
+corruption due to a defect is likely to be visible. I've also put
+assertions where violations of the interface are likely. In emulators
+where I am unsure of exact hardware operation in a particular case, I
+output a debug-only message noting that this has occurred; many times I
+haven't implemented a hardware feature because nothing uses it. I've
+made code brittle where there is no clear reason flexibility; code
+written to handle every possibility sacrifices quality and reliability
+to handle vaguely defined situations.
+
+
+Flexibility through indirection
+-------------------------------
+I've tried to allow the most flexibility of modules by using indirection
+to allow extension by the user. This keeps each module simpler and more
+focused on its unique task.
+
+The classic emulators use Multi_Buffer, which potentially allows a
+separate Blip_Buffer for each channel. This keeps emulators free of
+typical code to allow output in mono, stereo, panning, etc.
+
+All emulators use a reader object to access file data, allowing it to be
+stored in a regular file, compressed archive, memory, or generated
+on-the-fly. Again, the library can be kept free of the particulars of
+file access and changes required to support new formats.
+
+
+Emulators in general
+--------------------
+When I wrote the first NES sound emulator, I stored most of the state in
+an emulator-specific format, with significant redundancy. In the
+register write function I decoded everything into named variables. I
+became tired of the verbosity and wanted to more closely model the
+hardware, so I moved to a style of storing the last written value to
+each register, along with as little other state as possible, mostly the
+internal hardware registers. While this involves slightly more
+recalculation, in most cases the emulation code is of comparable size.
+It also makes state save/restore (for use in a full emulator) much
+simpler. Finally, it makes debugging easier since the hardware registers
+used in emulation are obvious.
+
+
+CPU Cores
+---------
+I've spent lots of time coming up with techniques to optimize the CPU
+cores. Some of the most important: execute multiple instructions during
+an emulation call, keep state in local variables to allow register
+assignment, optimize state representation for most common instructions,
+defer status flag calculation until actually needed, read program code
+directly without a call to the memory read function, always pre-fetch
+the operand byte before decoding instruction, and emulate instructions
+using common blocks of code.
+
+I've successfully used Nes_Cpu in a fairly complete NES emulator, and
+I'd like to make all the CPU emulators suitable for use in emulators. It
+seems a waste for them to be used only for the small amount of emulation
+necessary for game music files.
+
+I debugged the CPU cores by writing a test shell that ran them in
+parallel with other CPU cores and compared all memory accesses and
+processor states at each step. This provided good value at little cost.
+
+The CPU mapping page size is adjustable to allow the best tradeoff
+between memory/cache usage and handler granularity. The interface allows
+code to be somewhat independent of the page size.
+
+I optimize program memory accesses to direct reads rather than calls to
+the memory read function. My assumption is that it would be difficult to
+get useful code out of hardware I/O addresses, so no software will
+intentionally execute out of I/O space. Since the page size can be
+changed easily, most program memory mapping schemes can be accommodated.
+This greatly reduces memory access function calls.
+
diff --git a/plugins/gme/game-music-emu-0.6pre/gme.txt b/plugins/gme/game-music-emu-0.6pre/gme.txt
new file mode 100644
index 00000000..2985786b
--- /dev/null
+++ b/plugins/gme/game-music-emu-0.6pre/gme.txt
@@ -0,0 +1,375 @@
+Game_Music_Emu 0.5.5
+--------------------
+Author : Shay Green <gblargg@gmail.com>
+Website: http://www.slack.net/~ant/libs/
+Forum : http://groups.google.com/group/blargg-sound-libs
+License: GNU Lesser General Public License (LGPL)
+
+Contents
+--------
+* Overview
+* Error handling
+* Emulator types
+* M3U playlist support
+* Information fields
+* Track length
+* Loading file data
+* Sound parameters
+* VGM/GYM YM2413 & YM2612 FM sound
+* Modular construction
+* Obscure features
+* Solving problems
+* Thanks
+
+
+Overview
+--------
+This library can open game music files, play tracks, and read game and
+track information tags. To play a game music file, do the following:
+
+* Open the file with gme_open_file()
+* Start a track with gme_start_track();
+* Generate samples as needed with gme_play()
+* Play samples through speaker using your operating system
+* Delete emulator when done with gme_delete()
+
+Your code must arrange for the generated samples to be played through
+the computer's speaker using whatever method your operating system
+requires.
+
+There are many additional features available; you can:
+
+* Determine of the type of a music file without opening it with
+gme_identify_*()
+* Load just the file's information tags with gme_info_only
+* Load from a block of memory rather than a file with gme_load_data()
+* Arrange for a fade-out at a particular time with gme_set_fade
+* Find when a track has ended with gme_track_ended()
+* Seek to a new time in the track with gme_seek()
+* Load an extended m3u playlist with gme_load_m3u()
+* Get a list of the voices (channels) and mute them individually with
+gme_voice_names() and gme_mute_voice()
+* Change the playback tempo without affecting pitch with gme_set_tempo()
+* Adjust treble/bass equalization with gme_set_equalizer()
+* Associate your own data with an emulator and later get it back with
+gme_set_user_data()
+* Register a function of yours to be called back when the emulator is
+deleted with gme_set_user_cleanup()
+
+Refer to gme.h for a comprehensive summary of features.
+
+
+Error handling
+--------------
+Functions which can fail have a return type of gme_err_t, which is a
+pointer to an error string (const char*). If a function is successful it
+returns NULL. Errors that you can easily avoid are checked with debug
+assertions; gme_err_t return values are only used for genuine run-time
+errors that can't be easily predicted in advance (out of memory, I/O
+errors, incompatible file data). Your code should check all error
+values.
+
+When loading a music file in the wrong emulator or trying to load a
+non-music file, gme_wrong_file_type is returned. You can check for this
+error in C++ like this:
+
+ gme_err_t err = gme_open_file( path, &emu );
+ if ( err == gme_wrong_file_type )
+ ...
+
+To check for minor problems, call gme_warning() to get a string
+describing the last warning. Your player should allow the user some way
+of knowing when this is the case, since these minor errors could affect
+playback. Without this information the user can't solve problems as
+well. When playing a track, gme_warning() returns minor playback-related
+problems (major playback problems end the track immediately and set the
+warning string).
+
+
+Emulator types
+--------------
+The library includes several game music emulators that each support a
+different file type. Each is identified by a gme_type_t constant defined
+in gme.h, for example gme_nsf_emu is for the NSF emulator. If you use
+gme_open_file() or gme_open_data(), the library does the work of
+determining the file type and creating an appropriate emulator. If you
+want more control over this process, read on.
+
+There are two basic ways to identify a game music file's type: look at
+its file extension, or read the header data. The library includes
+functions to help with both methods. The first is preferable because it
+is fast and the most common way to identify files. Sometimes the
+extension is lost or wrong, so the header must be read.
+
+Use gme_identify_extension() to find the correct game music type based
+on a filename. To identify a file based on its extension and header
+contents, use gme_identify_file(). If you read the header data yourself,
+use gme_identify_header().
+
+If you want to remove support for some music types to reduce your
+executable size, edit GME_TYPE_LIST in blargg_config.h. For example, to
+support just NSF and GBS, use this:
+
+ #define GME_TYPE_LIST \
+ gme_nsf_type,\
+ gme_gbs_type
+
+
+M3U playlist support
+--------------------
+The library supports playlists in an extended m3u format with
+gme_load_m3u() to give track names and times to multi-song formats: AY,
+GBS, HES, KSS, NSF, NSFE, and SAP. Some aspects of the file format
+itself is not well-defined so some m3u files won't work properly
+(particularly those provided with KSS files). Only m3u files referencing
+a single file are supported; your code must handle m3u files covering
+more than one game music file, though it can use the built-in m3u
+parsing provided by the library.
+
+
+Information fields
+------------------
+Support is provided for the various text fields and length information
+in a file with gme_track_info(). If you just need track information for
+a file (for example, building a playlist), use gme_new_info() in place
+of gme_new_emu(), load the file normally, then you can access the track
+count and info, but nothing else.
+
+ M3U VGM GYM SPC SAP NSFE NSF AY GBS HES KSS
+ -------------------------------------------------------
+Track Count | * * * * * * * * *
+ |
+System | * * * * * * * * * *
+ |
+Game | * * * * * * *
+ |
+Song | * * * * * * *
+ |
+Author | * * * * * * * *
+ |
+Copyright | * * * * * * * *
+ |
+Comment | * * * *
+ |
+Dumper | * * * *
+ |
+Length | * * * * * *
+ |
+Intro Length| * * *
+ |
+Loop Length | * * *
+
+As listed above, the HES and KSS file formats don't include a track
+count, and tracks are often scattered over the 0-255 range, so an m3u
+playlist for these is a must.
+
+Unavailable text fields are set to an empty string and times to -1. Your
+code should be prepared for any combination of available and unavailable
+fields, as a particular music file might not use all of the supported
+fields listed above.
+
+Currently text fields are truncated to 255 characters. Obscure fields of
+some formats are not currently decoded; contact me if you want one
+added.
+
+
+Track length
+------------
+The library leaves it up to you as to when to stop playing a track. You
+can ask for available length information and then tell the library what
+time it should start fading the track with gme_set_fade(). By default it
+also continually checks for 6 or more seconds of silence to mark the end
+of a track. Here is a reasonable algorithm you can use to decide how
+long to play a track:
+
+* If the track length is > 0, use it
+* If the loop length > 0, play for intro + loop * 2
+* Otherwise, default to 2.5 minutes (150000 msec)
+
+If you want to play a track longer than normal, be sure the loop length
+isn't zero. See Music_Player.cpp around line 145 for example code.
+
+By default, the library skips silence at the beginning of a track. It
+also continually checks for the end of a non-looping track by watching
+for 6 seconds of unbroken silence. When doing this is scans *ahead* by
+several seconds so it can report the end of the track after only one
+second of silence has actually played. This feature can be disabled with
+gme_ignore_silence().
+
+
+Loading file data
+-----------------
+The library allows file data to be loaded in many different ways. All
+load functions return an error which you should check. The following
+examples assume these variables:
+
+ Music_Emu* emu;
+ gme_err_t error;
+
+If you're letting the library determine a file's type, you can use
+either gme_open_file() or gme_open_data():
+
+ error = gme_open_file( pathname, &emu );
+ error = gme_open_data( pointer, size, &emu );
+
+If you're manually determining file type and using used gme_new_emu() to
+create an emulator, you can use the following methods of loading:
+
+* From a block of memory:
+
+ error = gme_load_data( emu, pointer, size );
+
+* Have library call your function to read data:
+
+ gme_err_t my_read( void* my_data, void* out, long count )
+ {
+ // code that reads 'count' bytes into 'out' buffer
+ // and return 0 if no error
+ }
+
+ error = gme_load_custom( emu, my_read, file_size, my_data );
+
+
+Sound parameters
+----------------
+All emulators support an arbitrary output sampling rate. A rate of 44100
+Hz should work well on most systems. Since band-limited synthesis is
+used, a sampling rate above 48000 Hz is not necessary and will actually
+reduce sound quality and performance.
+
+All emulators also support adjustable gain, mainly for the purpose of
+getting consistent volume between different music formats and avoiding
+excessive modulation. The gain can only be set *before* setting the
+emulator's sampling rate, so it's not useful as a general volume
+control. The default gains of emulators are set so that they give
+generally similar volumes, though some soundtracks are significantly
+louder or quieter than normal.
+
+Some emulators support adjustable treble and bass frequency equalization
+(AY, GBS, HES, KSS, NSF, NSFE, SAP, VGM) using set_equalizer().
+Parameters are specified using gme_equalizer_t eq = { treble_dB,
+bass_freq }. Treble_dB sets the treble level (in dB), where 0.0 dB gives
+normal treble; -200.0 dB is quite muffled, and 5.0 dB emphasizes treble
+for an extra crisp sound. Bass_freq sets the frequency where bass
+response starts to diminish; 15 Hz is normal, 0 Hz gives maximum bass,
+and 15000 Hz removes all bass. For example, the following makes the
+sound extra-crisp but lacking bass:
+
+ gme_equalizer_t eq = { 5.0, 1000 };
+ gme_set_equalizer( music_emu, &eq );
+
+Each emulator's equalization defaults to approximate the particular
+console's sound quality; this default can be determined by calling
+equalizer() just after creating the emulator. The Music_Emu::tv_eq
+profile gives sound as if coming from a TV speaker, and some emulators
+include other profiles for different versions of the system. For
+example, to use Famicom sound equalization with the NSF emulator, do the
+following:
+
+ music_emu->set_equalizer( Nsf_Emu::famicom_eq );
+
+
+VGM/GYM YM2413 & YM2612 FM sound
+--------------------------------
+The library plays Sega Genesis/Mega Drive music using a YM2612 FM sound
+chip emulator based on the Gens project. Because this has some
+inaccuracies, other YM2612 emulators can be used in its place by
+re-implementing the interface in YM2612_Emu.h. Available on my website
+is a modified version of MAME's YM2612 emulator, which sounds better in
+some ways and whose author is still making improvements.
+
+VGM music files using the YM2413 FM sound chip are also supported, but a
+YM2413 emulator isn't included with the library due to technical
+reasons. I have put one of the available YM2413 emulators on my website
+that can be used directly.
+
+
+Modular construction
+--------------------
+The library is made of many fairly independent modules. If you're using
+only one music file emulator, you can eliminate many of the library
+sources from your program. Refer to the files list in readme.txt to get
+a general idea of what can be removed, and be sure to edit GME_TYPE_LIST
+(see "Emulator types" above). Post to the forum if you'd like me to put
+together a smaller version for a particular use, as this only takes me a
+few minutes to do.
+
+If you want to use one of the individual sound chip emulators (or CPU
+cores) in your own console emulator, first check the libraries page on
+my website since I have released several of them as stand alone
+libraries with included documentation and examples on their use. If you
+don't find it as a standalone library, contact me and I'll consider
+separating it.
+
+The "classic" sound chips use my Blip_Buffer library, which greatly
+simplifies their implementation and efficiently handles band-limited
+synthesis. It is also available as a stand alone library with
+documentation and many examples.
+
+
+Obscure features
+----------------
+The library's flexibility allows many possibilities. Contact me if you
+want help implementing ideas or removing limitations.
+
+* Uses no global/static variables, allowing multiple instances of any
+emulator. This is useful in a music player if you want to allow
+simultaneous recording or scanning of other tracks while one is already
+playing. This will also be useful if your platform disallows global
+data.
+
+* Emulators that support a custom sound buffer can have *every* voice
+routed to a different Blip_Buffer, allowing custom processing on each
+voice. For example you could record a Game Boy track as a 4-channel
+sound file.
+
+* Defining BLIP_BUFFER_FAST uses lower quality, less-multiply-intensive
+synthesis on "classic" emulators, which might help on some really old
+processors. This significantly lowers sound quality and prevents treble
+equalization. Try this if your platform's processor isn't fast enough
+for normal quality. Even on my ten-year-old 400 MHz Mac, this reduces
+processor usage at most by about 0.6% (from 4% to 3.4%), hardly worth
+the quality loss.
+
+
+Solving problems
+----------------
+If you're having problems, try the following:
+
+* If you're getting garbled sound, try this simple siren generator in
+place of your call to play(). This will quickly tell whether the problem
+is in the library or in your code.
+
+ static void play_siren( long count, short* out )
+ {
+ static double a, a2;
+ while ( count-- )
+ *out++ = 0x2000 * sin( a += .1 + .05*sin( a2+=.00005 ) );
+ }
+
+* Enable debugging support in your environment. This enables assertions
+and other run-time checks.
+
+* Turn the compiler's optimizer is off. Sometimes an optimizer generates
+bad code.
+
+* If multiple threads are being used, ensure that only one at a time is
+accessing a given set of objects from the library. This library is not
+in general thread-safe, though independent objects can be used in
+separate threads.
+
+* If all else fails, see if the demos work.
+
+
+Thanks
+------
+Big thanks to Chris Moeller (kode54) for help with library testing and
+feedback, for maintaining the Foobar2000 plugin foo_gep based on it, and
+for original work on openspc++ that was used when developing Spc_Emu.
+Brad Martin's excellent OpenSPC SNES DSP emulator worked well from the
+start. Also thanks to Richard Bannister, Mahendra Tallur, Shazz,
+nenolod, theHobbit, Johan Samuelsson, and nes6502 for testing, using,
+and giving feedback for the library in their respective game music
+players. More recently, Lucas Paul and Michael Pyne have helped nudge the
+library into a public repository and get its interface more stable for use
+in shared libraries.
diff --git a/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.cpp b/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.cpp
index 5d7f9421..4e5d8f60 100644
--- a/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.cpp
+++ b/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.cpp
@@ -1,6 +1,6 @@
// snes_spc 0.9.0. http://www.slack.net/~ant/
-#include "SPC_Filter.h"
+#include "Spc_Filter.h"
/* Copyright (C) 2007 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser
diff --git a/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.h b/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.h
deleted file mode 100644
index 0068817b..00000000
--- a/plugins/gme/game-music-emu-0.6pre/gme/SPC_Filter.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Simple low-pass and high-pass filter to better match sound output of a SNES
-
-// snes_spc 0.9.0
-#ifndef SPC_FILTER_H
-#define SPC_FILTER_H
-
-#include "blargg_common.h"
-
-struct SPC_Filter {
-public:
-
- // Filters count samples of stereo sound in place. Count must be a multiple of 2.
- typedef short sample_t;
- void run( sample_t io [], int count );
-
-// Optional features
-
- // Clears filter to silence
- void clear();
-
- // Sets gain (volume), where gain_unit is normal. Gains greater than gain_unit
- // are fine, since output is clamped to 16-bit sample range.
- enum { gain_unit = 0x100 };
- void set_gain( int gain );
-
- // Enables/disables filtering (when disabled, gain is still applied)
- void enable( bool b );
-
- // Sets amount of bass (logarithmic scale)
- enum { bass_none = 0 };
- enum { bass_norm = 8 }; // normal amount
- enum { bass_max = 31 };
- void set_bass( int bass );
-
-public:
- SPC_Filter();
- BLARGG_DISABLE_NOTHROW
-private:
- enum { gain_bits = 8 };
- int gain;
- int bass;
- bool enabled;
- struct chan_t { int p1, pp1, sum; };
- chan_t ch [2];
-};
-
-inline void SPC_Filter::enable( bool b ) { enabled = b; }
-
-inline void SPC_Filter::set_gain( int g ) { gain = g; }
-
-inline void SPC_Filter::set_bass( int b ) { bass = b; }
-
-#endif
diff --git a/plugins/gme/game-music-emu-0.6pre/license.txt b/plugins/gme/game-music-emu-0.6pre/license.txt
new file mode 100644
index 00000000..5faba9d4
--- /dev/null
+++ b/plugins/gme/game-music-emu-0.6pre/license.txt
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/plugins/gme/game-music-emu-0.6pre/readme.txt b/plugins/gme/game-music-emu-0.6pre/readme.txt
new file mode 100644
index 00000000..add10941
--- /dev/null
+++ b/plugins/gme/game-music-emu-0.6pre/readme.txt
@@ -0,0 +1,216 @@
+Game_Music_Emu 0.5.5: Game Music Emulators
+------------------------------------------
+Game_Music_Emu is a collection of video game music file emulators that
+support the following formats and systems:
+
+AY ZX Spectrum/Amstrad CPC
+GBS Nintendo Game Boy
+GYM Sega Genesis/Mega Drive
+HES NEC TurboGrafx-16/PC Engine
+KSS MSX Home Computer/other Z80 systems (doesn't support FM sound)
+NSF/NSFE Nintendo NES/Famicom (with VRC 6, Namco 106, and FME-7 sound)
+SAP Atari systems using POKEY sound chip
+SPC Super Nintendo/Super Famicom
+VGM/VGZ Sega Master System/Mark III, Sega Genesis/Mega Drive,BBC Micro
+
+Features:
+* C interface for use in C, C++, and other compatible languages
+* High emphasis has been placed on making the library very easy to use
+* One set of common functions work with all emulators the same way
+* Several code examples, including music player using SDL
+* Portable code for use on any system with modern or older C++ compilers
+* Adjustable output sample rate using quality band-limited resampling
+* Uniform access to text information fields and track timing information
+* End-of-track fading and automatic look ahead silence detection
+* Treble/bass and stereo echo for AY/GBS/HES/KSS/NSF/NSFE/SAP/VGM
+* Tempo can be adjusted and individual voices can be muted while playing
+* Can read music data from file, memory, or custom reader function/class
+* Can access track information without having to load into full emulator
+* M3U track listing support for multi-track formats
+* Modular design allows elimination of unneeded emulators/features
+
+This library has been used in game music players for Windows, Linux on
+several architectures, Mac OS, MorphOS, Xbox, PlayStation Portable,
+GP2X, and Nintendo DS.
+
+Author : Shay Green <gblargg@gmail.com>
+Website: http://www.slack.net/~ant/
+Forum : http://groups.google.com/group/blargg-sound-libs
+License: GNU Lesser General Public License (LGPL)
+
+
+Getting Started
+---------------
+Build a program consisting of demo/basics.c, demo/Wave_Writer.cpp, and
+all source files in gme/. If you have CMake 2.6 or later, execute
+
+ run cmake
+ cd demo
+ run make
+
+Be sure "test.nsf" is in the same directory as the program. Running it
+should generate the recording "out.wav".
+
+A slightly more extensive demo application is available in the player/
+directory. It requires SDL to build.
+
+Read gme.txt for more information. Post to the discussion forum for
+assistance.
+
+
+Files
+-----
+gme.txt General notes about the library
+changes.txt Changes made since previous releases
+design.txt Library design notes
+license.txt GNU Lesser General Public License
+CMakeLists.txt CMake build rules
+
+test.nsf Test file for NSF emulator
+test.m3u Test m3u playlist for features.c demo
+
+demo/
+ basics.c Records NSF file to wave sound file
+ features.c Demonstrates many additional features
+ Wave_Writer.h WAVE sound file writer used for demo output
+ Wave_Writer.cpp
+ CMakeLists.txt CMake build rules
+
+player/ Player using the SDL multimedia library
+ player.cpp Simple music player with waveform display
+ Music_Player.cpp Stand alone player for background music
+ Music_Player.h
+ Audio_Scope.cpp Audio waveform scope
+ Audio_Scope.h
+ CMakeLists.txt CMake build rules
+
+gme/
+ blargg_config.h Library configuration (modify this file as needed)
+
+ gme.h Library interface header file
+ gme.cpp
+
+ Ay_Emu.h ZX Spectrum AY emulator
+ Ay_Emu.cpp
+ Ay_Apu.cpp
+ Ay_Apu.h
+ Ay_Cpu.cpp
+ Ay_Cpu.h
+
+ Gbs_Emu.h Nintendo Game Boy GBS emulator
+ Gbs_Emu.cpp
+ Gb_Apu.cpp
+ Gb_Apu.h
+ Gb_Cpu.cpp
+ Gb_Cpu.h
+ gb_cpu_io.h
+ Gb_Oscs.cpp
+ Gb_Oscs.h
+
+ Hes_Emu.h TurboGrafx-16/PC Engine HES emulator
+ Hes_Apu.cpp
+ Hes_Apu.h
+ Hes_Cpu.cpp
+ Hes_Cpu.h
+ hes_cpu_io.h
+ Hes_Emu.cpp
+
+ Kss_Emu.h MSX Home Computer/other Z80 systems KSS emulator
+ Kss_Emu.cpp
+ Kss_Cpu.cpp
+ Kss_Cpu.h
+ Kss_Scc_Apu.cpp
+ Kss_Scc_Apu.h
+ Ay_Apu.h
+ Ay_Apu.cpp
+ Sms_Apu.h
+ Sms_Apu.cpp
+ Sms_Oscs.h
+
+ Nsf_Emu.h Nintendo NES NSF/NSFE emulator
+ Nsf_Emu.cpp
+ Nes_Apu.cpp
+ Nes_Apu.h
+ Nes_Cpu.cpp
+ Nes_Cpu.h
+ nes_cpu_io.h
+ Nes_Oscs.cpp
+ Nes_Oscs.h
+ Nes_Fme7_Apu.cpp
+ Nes_Fme7_Apu.h
+ Nes_Namco_Apu.cpp
+ Nes_Namco_Apu.h
+ Nes_Vrc6_Apu.cpp
+ Nes_Vrc6_Apu.h
+ Nsfe_Emu.h NSFE support
+ Nsfe_Emu.cpp
+
+ Spc_Emu.h Super Nintendo SPC emulator
+ Spc_Emu.cpp
+ Snes_Spc.cpp
+ Snes_Spc.h
+ Spc_Cpu.cpp
+ Spc_Cpu.h
+ Spc_Dsp.cpp
+ Spc_Dsp.h
+ Fir_Resampler.cpp
+ Fir_Resampler.h
+
+ Sap_Emu.h Atari SAP emulator
+ Sap_Emu.cpp
+ Sap_Apu.cpp
+ Sap_Apu.h
+ Sap_Cpu.cpp
+ Sap_Cpu.h
+ sap_cpu_io.h
+
+ Vgm_Emu.h Sega VGM emulator
+ Vgm_Emu_Impl.cpp
+ Vgm_Emu_Impl.h
+ Vgm_Emu.cpp
+ Ym2413_Emu.cpp
+ Ym2413_Emu.h
+ Gym_Emu.h Sega Genesis GYM emulator
+ Gym_Emu.cpp
+ Sms_Apu.cpp Common Sega emulator files
+ Sms_Apu.h
+ Sms_Oscs.h
+ Ym2612_Emu.cpp
+ Ym2612_Emu.h
+ Dual_Resampler.cpp
+ Dual_Resampler.h
+ Fir_Resampler.cpp
+ Fir_Resampler.h
+
+ M3u_Playlist.h M3U playlist support
+ M3u_Playlist.cpp
+
+ Effects_Buffer.h Sound buffer with stereo echo and panning
+ Effects_Buffer.cpp
+
+ blargg_common.h Common files needed by all emulators
+ blargg_endian.h
+ blargg_source.h
+ Blip_Buffer.cpp
+ Blip_Buffer.h
+ Gme_File.h
+ Gme_File.cpp
+ Music_Emu.h
+ Music_Emu.cpp
+ Classic_Emu.h
+ Classic_Emu.cpp
+ Multi_Buffer.h
+ Multi_Buffer.cpp
+ Data_Reader.h
+ Data_Reader.cpp
+
+ CMakeLists.txt CMake build rules
+
+
+Legal
+-----
+Game_Music_Emu library copyright (C) 2003-2009 Shay Green.
+Sega Genesis YM2612 emulator copyright (C) 2002 Stephane Dallongeville.
+
+--
+Shay Green <gblargg@gmail.com>