summaryrefslogtreecommitdiff
path: root/gme
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-16 20:42:17 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-16 20:51:54 +0200
commit1e7c5ae1fa743a73fbc0c1831201271691c6ae95 (patch)
treefa24c03544ba4066d57f288d91b6e3df9d80c4fd /gme
parent36df76395c9e7af90bfe5bfb8c717de7a552847a (diff)
fixed gme source distribution
Diffstat (limited to 'gme')
-rw-r--r--gme/Game_Music_Emu-0.5.2/changes.txt218
-rw-r--r--gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.cpp182
-rw-r--r--gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.h73
-rw-r--r--gme/Game_Music_Emu-0.5.2/demo/basics.c57
-rw-r--r--gme/Game_Music_Emu-0.5.2/demo/cpp_basics.cpp67
-rw-r--r--gme/Game_Music_Emu-0.5.2/demo/features.c149
-rw-r--r--gme/Game_Music_Emu-0.5.2/design.txt194
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme.txt464
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ay_Apu.cpp (renamed from gme/Ay_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ay_Apu.h (renamed from gme/Ay_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ay_Cpu.cpp (renamed from gme/Ay_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ay_Cpu.h (renamed from gme/Ay_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ay_Emu.cpp (renamed from gme/Ay_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ay_Emu.h (renamed from gme/Ay_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Blip_Buffer.cpp (renamed from gme/Blip_Buffer.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Blip_Buffer.h (renamed from gme/Blip_Buffer.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Classic_Emu.cpp (renamed from gme/Classic_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Classic_Emu.h (renamed from gme/Classic_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Data_Reader.cpp (renamed from gme/Data_Reader.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Data_Reader.h (renamed from gme/Data_Reader.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Dual_Resampler.cpp (renamed from gme/Dual_Resampler.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Dual_Resampler.h (renamed from gme/Dual_Resampler.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Effects_Buffer.cpp (renamed from gme/Effects_Buffer.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Effects_Buffer.h (renamed from gme/Effects_Buffer.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Fir_Resampler.cpp (renamed from gme/Fir_Resampler.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Fir_Resampler.h (renamed from gme/Fir_Resampler.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gb_Apu.cpp (renamed from gme/Gb_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gb_Apu.h (renamed from gme/Gb_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gb_Cpu.cpp (renamed from gme/Gb_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gb_Cpu.h (renamed from gme/Gb_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gb_Oscs.cpp (renamed from gme/Gb_Oscs.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gb_Oscs.h (renamed from gme/Gb_Oscs.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gbs_Emu.cpp (renamed from gme/Gbs_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gbs_Emu.h (renamed from gme/Gbs_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gme_File.cpp (renamed from gme/Gme_File.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gme_File.h (renamed from gme/Gme_File.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gym_Emu.cpp (renamed from gme/Gym_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Gym_Emu.h (renamed from gme/Gym_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Hes_Apu.cpp (renamed from gme/Hes_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Hes_Apu.h (renamed from gme/Hes_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Hes_Cpu.cpp (renamed from gme/Hes_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Hes_Cpu.h (renamed from gme/Hes_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Hes_Emu.cpp (renamed from gme/Hes_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Hes_Emu.h (renamed from gme/Hes_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Jamfile (renamed from gme/Jamfile)2
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Kss_Cpu.cpp (renamed from gme/Kss_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Kss_Cpu.h (renamed from gme/Kss_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Kss_Emu.cpp (renamed from gme/Kss_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Kss_Emu.h (renamed from gme/Kss_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Kss_Scc_Apu.cpp (renamed from gme/Kss_Scc_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Kss_Scc_Apu.h (renamed from gme/Kss_Scc_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/M3u_Playlist.cpp (renamed from gme/M3u_Playlist.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/M3u_Playlist.h (renamed from gme/M3u_Playlist.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Multi_Buffer.cpp (renamed from gme/Multi_Buffer.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Multi_Buffer.h (renamed from gme/Multi_Buffer.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Music_Emu.cpp (renamed from gme/Music_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Music_Emu.h (renamed from gme/Music_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Apu.cpp (renamed from gme/Nes_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Apu.h (renamed from gme/Nes_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Cpu.cpp (renamed from gme/Nes_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Cpu.h (renamed from gme/Nes_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Fme7_Apu.cpp (renamed from gme/Nes_Fme7_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Fme7_Apu.h (renamed from gme/Nes_Fme7_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Namco_Apu.cpp (renamed from gme/Nes_Namco_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Namco_Apu.h (renamed from gme/Nes_Namco_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Oscs.cpp (renamed from gme/Nes_Oscs.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Oscs.h (renamed from gme/Nes_Oscs.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Vrc6_Apu.cpp (renamed from gme/Nes_Vrc6_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nes_Vrc6_Apu.h (renamed from gme/Nes_Vrc6_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nsf_Emu.cpp (renamed from gme/Nsf_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nsf_Emu.h (renamed from gme/Nsf_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nsfe_Emu.cpp (renamed from gme/Nsfe_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Nsfe_Emu.h (renamed from gme/Nsfe_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sap_Apu.cpp (renamed from gme/Sap_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sap_Apu.h (renamed from gme/Sap_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sap_Cpu.cpp (renamed from gme/Sap_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sap_Cpu.h (renamed from gme/Sap_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sap_Emu.cpp (renamed from gme/Sap_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sap_Emu.h (renamed from gme/Sap_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sms_Apu.cpp (renamed from gme/Sms_Apu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sms_Apu.h (renamed from gme/Sms_Apu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Sms_Oscs.h (renamed from gme/Sms_Oscs.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Snes_Spc.cpp (renamed from gme/Snes_Spc.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Snes_Spc.h (renamed from gme/Snes_Spc.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Spc_Cpu.cpp (renamed from gme/Spc_Cpu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Spc_Cpu.h (renamed from gme/Spc_Cpu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Spc_Dsp.cpp (renamed from gme/Spc_Dsp.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Spc_Dsp.h (renamed from gme/Spc_Dsp.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Spc_Emu.cpp (renamed from gme/Spc_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Spc_Emu.h (renamed from gme/Spc_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu.cpp (renamed from gme/Vgm_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu.h (renamed from gme/Vgm_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu_Impl.cpp (renamed from gme/Vgm_Emu_Impl.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu_Impl.h (renamed from gme/Vgm_Emu_Impl.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ym2413_Emu.cpp (renamed from gme/Ym2413_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ym2413_Emu.h (renamed from gme/Ym2413_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ym2612_Emu.cpp (renamed from gme/Ym2612_Emu.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/Ym2612_Emu.h (renamed from gme/Ym2612_Emu.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/blargg_common.h (renamed from gme/blargg_common.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/blargg_config.h (renamed from gme/blargg_config.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/blargg_endian.h (renamed from gme/blargg_endian.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/blargg_source.h (renamed from gme/blargg_source.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/gb_cpu_io.h (renamed from gme/gb_cpu_io.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/gme.cpp (renamed from gme/gme.cpp)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/gme.h (renamed from gme/gme.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/hes_cpu_io.h (renamed from gme/hes_cpu_io.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/nes_cpu_io.h (renamed from gme/nes_cpu_io.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/gme/sap_cpu_io.h (renamed from gme/sap_cpu_io.h)0
-rw-r--r--gme/Game_Music_Emu-0.5.2/license.txt504
-rw-r--r--gme/Game_Music_Emu-0.5.2/player/Audio_Scope.cpp198
-rw-r--r--gme/Game_Music_Emu-0.5.2/player/Audio_Scope.h36
-rw-r--r--gme/Game_Music_Emu-0.5.2/player/Music_Player.cpp231
-rw-r--r--gme/Game_Music_Emu-0.5.2/player/Music_Player.h69
-rw-r--r--gme/Game_Music_Emu-0.5.2/player/player.cpp213
-rw-r--r--gme/Game_Music_Emu-0.5.2/readme.txt205
-rw-r--r--gme/Game_Music_Emu-0.5.2/test.m3u2
-rw-r--r--gme/Game_Music_Emu-0.5.2/test.nsfbin0 -> 749 bytes
117 files changed, 2863 insertions, 1 deletions
diff --git a/gme/Game_Music_Emu-0.5.2/changes.txt b/gme/Game_Music_Emu-0.5.2/changes.txt
new file mode 100644
index 00000000..0405b590
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/changes.txt
@@ -0,0 +1,218 @@
+Game_Music_Emu Change Log
+-------------------------
+
+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/gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.cpp b/gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.cpp
new file mode 100644
index 00000000..ec40959d
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.cpp
@@ -0,0 +1,182 @@
+// Game_Music_Emu 0.5.2. http://www.slack.net/~ant/
+
+#include "Wave_Writer.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+/* Copyright (C) 2003-2006 by Shay Green. Permission is hereby granted, free
+of charge, to any person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+to permit persons to whom the Software is furnished to do so, subject to the
+following conditions: The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software. THE
+SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+const int header_size = 0x2C;
+
+static void exit_with_error( const char* str )
+{
+ printf( "Error: %s\n", str ); getchar();
+ exit( EXIT_FAILURE );
+}
+
+Wave_Writer::Wave_Writer( long sample_rate, const char* filename )
+{
+ sample_count_ = 0;
+ rate = sample_rate;
+ buf_pos = header_size;
+ chan_count = 1;
+
+ buf = (unsigned char*) malloc( buf_size * sizeof *buf );
+ if ( !buf )
+ exit_with_error( "Out of memory" );
+
+ file = fopen( filename, "wb" );
+ if ( !file )
+ exit_with_error( "Couldn't open WAVE file for writing" );
+
+ setvbuf( file, 0, _IOFBF, 32 * 1024L );
+}
+
+void Wave_Writer::flush()
+{
+ if ( buf_pos && !fwrite( buf, buf_pos, 1, file ) )
+ exit_with_error( "Couldn't write WAVE data" );
+ buf_pos = 0;
+}
+
+void Wave_Writer::write( const sample_t* in, long remain, int skip )
+{
+ sample_count_ += remain;
+ while ( remain )
+ {
+ if ( buf_pos >= buf_size )
+ flush();
+
+ long n = (buf_size - buf_pos) / sizeof (sample_t);
+ if ( n > remain )
+ n = remain;
+ remain -= n;
+
+ // convert to lsb first format
+ unsigned char* p = &buf [buf_pos];
+ while ( n-- )
+ {
+ int s = *in;
+ in += skip;
+ *p++ = (unsigned char) s;
+ *p++ = (unsigned char) (s >> 8);
+ }
+
+ buf_pos = p - buf;
+ assert( buf_pos <= buf_size );
+ }
+}
+
+
+void Wave_Writer::write( const float* in, long remain, int skip )
+{
+ sample_count_ += remain;
+ while ( remain )
+ {
+ if ( buf_pos >= buf_size )
+ flush();
+
+ long n = (buf_size - buf_pos) / sizeof (sample_t);
+ if ( n > remain )
+ n = remain;
+ remain -= n;
+
+ // convert to lsb first format
+ unsigned char* p = &buf [buf_pos];
+ while ( n-- )
+ {
+ long s = (long) (*in * 0x7FFF);
+ in += skip;
+ if ( (short) s != s )
+ s = 0x7FFF - (s >> 24); // clamp to 16 bits
+ *p++ = (unsigned char) s;
+ *p++ = (unsigned char) (s >> 8);
+ }
+
+ buf_pos = p - buf;
+ assert( buf_pos <= buf_size );
+ }
+}
+
+void Wave_Writer::close()
+{
+ if ( file )
+ {
+ flush();
+
+ // generate header
+ long ds = sample_count_ * sizeof (sample_t);
+ long rs = header_size - 8 + ds;
+ int frame_size = chan_count * sizeof (sample_t);
+ long bps = rate * frame_size;
+ unsigned char header [header_size] =
+ {
+ 'R','I','F','F',
+ rs,rs>>8, // length of rest of file
+ rs>>16,rs>>24,
+ 'W','A','V','E',
+ 'f','m','t',' ',
+ 0x10,0,0,0, // size of fmt chunk
+ 1,0, // uncompressed format
+ chan_count,0, // channel count
+ rate,rate >> 8, // sample rate
+ rate>>16,rate>>24,
+ bps,bps>>8, // bytes per second
+ bps>>16,bps>>24,
+ frame_size,0, // bytes per sample frame
+ 16,0, // bits per sample
+ 'd','a','t','a',
+ ds,ds>>8,ds>>16,ds>>24// size of sample data
+ // ... // sample data
+ };
+
+ // write header
+ fseek( file, 0, SEEK_SET );
+ fwrite( header, sizeof header, 1, file );
+
+ fclose( file );
+ file = 0;
+ free( buf );
+ }
+}
+
+Wave_Writer::~Wave_Writer()
+{
+ close();
+}
+
+// C interface
+
+static Wave_Writer* ww;
+
+void wave_open( long sample_rate, const char* filename )
+{
+ ww = new Wave_Writer( sample_rate, filename );
+ assert( ww );
+}
+
+void wave_enable_stereo() { ww->enable_stereo(); }
+
+long wave_sample_count() { return ww->sample_count(); }
+
+void wave_write( const short* buf, long count ) { ww->write( buf, count ); }
+
+void wave_close()
+{
+ delete ww;
+ ww = 0;
+}
diff --git a/gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.h b/gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.h
new file mode 100644
index 00000000..da08cc2a
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/demo/Wave_Writer.h
@@ -0,0 +1,73 @@
+/* WAVE sound file writer for recording 16-bit output during program development */
+
+#ifndef WAVE_WRITER_H
+#define WAVE_WRITER_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* C interface */
+void wave_open( long sample_rate, const char* filename );
+void wave_enable_stereo( void );
+void wave_write( const short* buf, long count );
+long wave_sample_count( void );
+void wave_close( void );
+
+#ifdef __cplusplus
+ }
+#endif
+
+#ifdef __cplusplus
+#include <stddef.h>
+#include <stdio.h>
+
+/* C++ interface */
+class Wave_Writer {
+public:
+ typedef short sample_t;
+
+ // Create sound file with given sample rate (in Hz) and filename.
+ // Exits program if there's an error.
+ Wave_Writer( long sample_rate, char const* filename = "out.wav" );
+
+ // Enable stereo output
+ void enable_stereo();
+
+ // Append 'count' samples to file. Use every 'skip'th source sample; allows
+ // one channel of stereo sample pairs to be written by specifying a skip of 2.
+ void write( const sample_t*, long count, int skip = 1 );
+
+ // Append 'count' floating-point samples to file. Use every 'skip'th source sample;
+ // allows one channel of stereo sample pairs to be written by specifying a skip of 2.
+ void write( const float*, long count, int skip = 1 );
+
+ // Number of samples written so far
+ long sample_count() const;
+
+ // Finish writing sound file and close it
+ void close();
+
+ ~Wave_Writer();
+public:
+ // Deprecated
+ void stereo( bool b ) { chan_count = b ? 2 : 1; }
+private:
+ enum { buf_size = 32768 * 2 };
+ unsigned char* buf;
+ FILE* file;
+ long sample_count_;
+ long rate;
+ long buf_pos;
+ int chan_count;
+
+ void flush();
+};
+
+inline void Wave_Writer::enable_stereo() { chan_count = 2; }
+
+inline long Wave_Writer::sample_count() const { return sample_count_; }
+
+#endif
+
+#endif
diff --git a/gme/Game_Music_Emu-0.5.2/demo/basics.c b/gme/Game_Music_Emu-0.5.2/demo/basics.c
new file mode 100644
index 00000000..55178251
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/demo/basics.c
@@ -0,0 +1,57 @@
+/* C example that opens a game music file and records 10 seconds to "out.wav" */
+
+static char filename [] = "test.nsf"; /* opens this file (can be any music type) */
+
+#include "gme/gme.h"
+
+#include "Wave_Writer.h" /* wave_ functions for writing sound file */
+#include <stdlib.h>
+#include <stdio.h>
+
+void handle_error( const char* str );
+
+int main()
+{
+ long sample_rate = 44100; /* number of samples per second */
+ int track = 0; /* index of track to play (0 = first) */
+
+ /* Open music file in new emulator */
+ Music_Emu* emu;
+ handle_error( gme_open_file( filename, &emu, sample_rate ) );
+
+ /* Start track */
+ handle_error( gme_start_track( emu, track ) );
+
+ /* Begin writing to wave file */
+ wave_open( sample_rate, "out.wav" );
+ wave_enable_stereo();
+
+ /* Record 10 seconds of track */
+ while ( gme_tell( emu ) < 10 * 1000L )
+ {
+ /* Sample buffer */
+ #define buf_size 1024 /* can be any multiple of 2 */
+ short buf [buf_size];
+
+ /* Fill sample buffer */
+ handle_error( gme_play( emu, buf_size, buf ) );
+
+ /* Write samples to wave file */
+ wave_write( buf, buf_size );
+ }
+
+ /* Cleanup */
+ gme_delete( emu );
+ wave_close();
+
+ return 0;
+}
+
+void handle_error( const char* str )
+{
+ if ( str )
+ {
+ printf( "Error: %s\n", str ); getchar();
+ exit( EXIT_FAILURE );
+ }
+}
diff --git a/gme/Game_Music_Emu-0.5.2/demo/cpp_basics.cpp b/gme/Game_Music_Emu-0.5.2/demo/cpp_basics.cpp
new file mode 100644
index 00000000..53fab418
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/demo/cpp_basics.cpp
@@ -0,0 +1,67 @@
+// C++ example that opens a game music file and records 10 seconds to "out.wav"
+
+static char filename [] = "test.nsf"; /* opens this file (can be any music type) */
+
+#include "gme/Music_Emu.h"
+
+#include "Wave_Writer.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+void handle_error( const char* str );
+
+int main()
+{
+ long sample_rate = 44100; // number of samples per second
+ int track = 0; // index of track to play (0 = first)
+
+ // Determine file type
+ gme_type_t file_type;
+ handle_error( gme_identify_file( filename, &file_type ) );
+ if ( !file_type )
+ handle_error( "Unsupported music type" );
+
+ // Create emulator and set sample rate
+ Music_Emu* emu = file_type->new_emu();
+ if ( !emu )
+ handle_error( "Out of memory" );
+ handle_error( emu->set_sample_rate( sample_rate ) );
+
+ // Load music file into emulator
+ handle_error( emu->load_file( filename ) );
+
+ // Start track
+ handle_error( emu->start_track( track ) );
+
+ // Begin writing to wave file
+ Wave_Writer wave( sample_rate, "out.wav" );
+ wave.enable_stereo();
+
+ // Record 10 seconds of track
+ while ( emu->tell() < 10 * 1000L )
+ {
+ // Sample buffer
+ const long size = 1024; // can be any multiple of 2
+ short buf [size];
+
+ // Fill buffer
+ handle_error( emu->play( size, buf ) );
+
+ // Write samples to wave file
+ wave.write( buf, size );
+ }
+
+ // Cleanup
+ delete emu;
+
+ return 0;
+}
+
+void handle_error( const char* str )
+{
+ if ( str )
+ {
+ printf( "Error: %s\n", str ); getchar();
+ exit( EXIT_FAILURE );
+ }
+}
diff --git a/gme/Game_Music_Emu-0.5.2/demo/features.c b/gme/Game_Music_Emu-0.5.2/demo/features.c
new file mode 100644
index 00000000..96a9a8a9
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/demo/features.c
@@ -0,0 +1,149 @@
+/* C example that opens any music file type, opens an m3u playlist if present,
+prints its info and voice names, customizes the sound, and fades a track out.
+Records to "out.wav". */
+
+static char filename [] = "test.nsf"; /* opens this file (can be any music type) */
+static char playlist [] = "test.m3u"; /* uses this playlist, if present*/
+
+#include "gme/gme.h"
+
+#include "Wave_Writer.h" /* wave_ functions for writing sound file */
+#include <stdlib.h>
+#include <stdio.h>
+
+void handle_error( const char* );
+
+/* Example of loading from memory, which would be useful if using a zip file or
+other custom format. In this example it's silly because we could just use
+gme_load( &emu, sample_rate, path, 0 ). */
+Music_Emu* load_file( const char* path, long sample_rate )
+{
+ Music_Emu* emu;
+ char* data;
+ long size;
+
+ /* Read file data into memory. You might read the data from a zip file or
+ other compressed format. */
+ FILE* in = fopen( path, "rb" );
+ if ( !in )
+ handle_error( "Couldn't open file" );
+ fseek( in, 0, SEEK_END );
+ size = ftell( in );
+ rewind( in );
+
+ data = malloc( size );
+ if ( !data )
+ handle_error( "Out of memory" );
+ if ( fread( data, size, 1, in ) <= 0 )
+ handle_error( "Read error" );
+ fclose( in );
+
+ handle_error( gme_open_data( data, size, &emu, sample_rate ) );
+ free( data ); /* a copy is made of the data */
+ return emu;
+}
+
+/* Print any warning for most recent emulator action (load, start_track, play) */
+void print_warning( Music_Emu* emu )
+{
+ const char* warning = gme_warning( emu );
+ if ( warning )
+ printf( "**** Warning: %s\n\n", warning );
+}
+
+static char my_data [] = "Our cleanup function was called";
+
+/* Example cleanup function automatically called when emulator is deleted. */
+static void my_cleanup( void* my_data )
+{
+ printf( "\n%s\n", (char*) my_data );
+}
+
+int main()
+{
+ long sample_rate = 44100;
+ int track = 0; /* index of track to play (0 = first) */
+ int i;
+
+ /* Load file into emulator */
+ Music_Emu* emu = load_file( filename, sample_rate );
+ print_warning( emu );
+
+ /* Register cleanup function and confirmation string as data */
+ gme_set_user_data( emu, my_data );
+ gme_set_user_cleanup( emu, my_cleanup );
+
+ /* Load .m3u playlist file. All tracks are assumed to use current file.
+ We ignore error here in case there is no m3u file present. */
+ gme_load_m3u( emu, playlist );
+ print_warning( emu );
+
+ /* Get and print main info for track */
+ {
+ track_info_t info;
+ handle_error( gme_track_info( emu, &info, track ) );
+ printf( "System : %s\n", info.system );
+ printf( "Game : %s\n", info.game );
+ printf( "Author : %s\n", info.author );
+ printf( "Copyright: %s\n", info.copyright );
+ printf( "Comment : %s\n", info.comment );
+ printf( "Dumper : %s\n", info.dumper );
+ printf( "Tracks : %d\n", (int) info.track_count );
+ printf( "\n" );
+ printf( "Track : %d\n", (int) track + 1 );
+ printf( "Name : %s\n", info.song );
+ printf( "Length : %ld:%02ld",
+ (long) info.length / 1000 / 60, (long) info.length / 1000 % 60 );
+ if ( info.loop_length != 0 )
+ printf( " (endless)" );
+ printf( "\n\n" );
+ }
+
+ /* Print voice names */
+ for ( i = 0; i < gme_voice_count( emu ); i++ )
+ printf( "Voice %d: %s\n", i, gme_voice_names( emu ) [i] );
+
+ /* Add some stereo enhancement */
+ gme_set_stereo_depth( emu, 0.20 );
+
+ /* Adjust equalizer for crisp, bassy sound */
+ {
+ gme_equalizer_t eq;
+ eq.treble = 0.0;
+ eq.bass = 20;
+ gme_set_equalizer( emu, &eq );
+ }
+
+ /* Start track and begin fade at 10 seconds */
+ handle_error( gme_start_track( emu, track ) );
+ print_warning( emu );
+ gme_set_fade( emu, 10 * 1000L );
+
+ /* Record track until it ends */
+ wave_open( sample_rate, "out.wav" );
+ wave_enable_stereo();
+ while ( !gme_track_ended( emu ) )
+ {
+ #define buf_size 1024
+ short buf [buf_size];
+ handle_error( gme_play( emu, buf_size, buf ) );
+ print_warning( emu );
+ wave_write( buf, buf_size );
+ }
+
+ /* Cleanup */
+ gme_delete( emu );
+ wave_close();
+
+ getchar();
+ return 0;
+}
+
+void handle_error( const char* str )
+{
+ if ( str )
+ {
+ printf( "Error: %s\n", str ); getchar();
+ exit( EXIT_FAILURE );
+ }
+}
diff --git a/gme/Game_Music_Emu-0.5.2/design.txt b/gme/Game_Music_Emu-0.5.2/design.txt
new file mode 100644
index 00000000..8c8c65b1
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/design.txt
@@ -0,0 +1,194 @@
+Game_Music_Emu 0.5.2 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/gme/Game_Music_Emu-0.5.2/gme.txt b/gme/Game_Music_Emu-0.5.2/gme.txt
new file mode 100644
index 00000000..2c963d8e
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/gme.txt
@@ -0,0 +1,464 @@
+Game_Music_Emu 0.5.2
+--------------------
+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
+* C and C++ interfaces
+* Function reference
+* 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
+* Deprecated features
+* 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.
+
+
+C and C++ interfaces
+--------------------
+While the library is written in C++, an extensive C interface is
+provided in gme.h. This C interface will be referred to throughout this
+documentation unless a feature is only available in the full C++
+interface. All C interface functions and other names have the gme_
+prefix, so you can recognize a C++-only feature by the lack of gme_ in
+the names used (contact me if you'd like a feature added to the C
+interface). If you're building a shared library, I highly recommend
+sticking to the C interface only, because it will be more stable between
+releases of the library than the C++ interface. Finally, the C and C++
+interfaces can be freely mixed without problems. Compare demo/basics.c
+with demo/cpp_basics.cpp to see how the C and C++ interfaces translate
+between each other.
+
+
+Function reference
+------------------
+Read the following header files for a complete reference to functions
+and features. The second group of header files can only be used in C++.
+
+blargg_config.h Library configuration
+gme.h C interface (also usable from C++)
+
+Gme_File.h File loading and track information
+Music_Emu.h Track playback and adjustments
+Data_Reader.h Custom data readers
+Effects_Buffer.h Sound buffer with adjustable stereo echo and panning
+M3u_Playlist.h M3U playlist support
+Gbs_Emu.h GBS equalizer settings
+Nsf_Emu.h NSF equalizer settings
+Spc_Emu.h SPC surround disable
+Vgm_Emu.h VGM oversampling disable and custom buffer query
+
+
+Error handling
+--------------
+Functions which can fail have a return type of gme_err_t (blargg_err_t
+in the C++ interfaces), 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.
+
+To improve usability for C programmers, C++ programmers unfamiliar with
+exceptions, and compatibility with older C++ compilers, the library does
+*not* throw any C++ exceptions and uses malloc() instead of the standard
+operator new. This means that you *must* check for NULL when creating a
+library object with the new operator.
+
+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 );
+
+* If you must load the file data into memory yourself, you can have the
+library use your data directly *without* making a copy. If you do this,
+you must not free the data until you're done playing the file.
+
+ error = emu->load_mem( pointer, size );
+
+* If you've already read the first bytes of a file (perhaps to determine
+the file type) and want to avoid seeking back to the beginning for
+performance reasons, use Remaining_Reader:
+
+ Std_File_Reader in;
+ error = in.open( file_path );
+
+ char header [4];
+ error = in.read( &header, sizeof header );
+ ...
+
+ Remaining_Reader rem( &header, sizeof header, &in );
+ error = emu->load( rem );
+
+If you merely need access to a file's header after loading, use the
+emulator-specific header() functions, after casting the Music_Emu
+pointer to the specific emulator's type. This example examines the
+chip_flags field of the header if it's an NSF file:
+
+ if ( music_emu->type() == gme_nsf_type )
+ {
+ Nsf_Emu* nsf_emu = (Nsf_Emu*) music_emu;
+ if ( nsf_emu->header().chip_flags & 0x01 )
+ ...
+ }
+
+Contact me if you want more information about loading files.
+
+
+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.
+
+
+Deprecated features
+-------------------
+The following functions and other features have been deprecated and will
+be removed in a future release of the library. Alternatives to the
+deprecated features are listed to the right.
+
+Music_Emu::error_count() warning()
+load( header, reader ) see "Loading file data" above
+Spc_Emu::trailer() track_info()
+Spc_Emu::trailer_size()
+Gym_Emu::track_length() track_info()
+Vgm_Emu::gd3_data() track_info()
+Nsfe_Emu::disable_playlist() clear_playlist()
+
+
+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.
diff --git a/gme/Ay_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Ay_Apu.cpp
index 9dc5bb28..9dc5bb28 100644
--- a/gme/Ay_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ay_Apu.cpp
diff --git a/gme/Ay_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Ay_Apu.h
index 31956939..31956939 100644
--- a/gme/Ay_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ay_Apu.h
diff --git a/gme/Ay_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Ay_Cpu.cpp
index 6ff7156b..6ff7156b 100644
--- a/gme/Ay_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ay_Cpu.cpp
diff --git a/gme/Ay_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Ay_Cpu.h
index 07241d5e..07241d5e 100644
--- a/gme/Ay_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ay_Cpu.h
diff --git a/gme/Ay_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Ay_Emu.cpp
index bdc82e9e..bdc82e9e 100644
--- a/gme/Ay_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ay_Emu.cpp
diff --git a/gme/Ay_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Ay_Emu.h
index ba8445d3..ba8445d3 100644
--- a/gme/Ay_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ay_Emu.h
diff --git a/gme/Blip_Buffer.cpp b/gme/Game_Music_Emu-0.5.2/gme/Blip_Buffer.cpp
index fd014e4b..fd014e4b 100644
--- a/gme/Blip_Buffer.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Blip_Buffer.cpp
diff --git a/gme/Blip_Buffer.h b/gme/Game_Music_Emu-0.5.2/gme/Blip_Buffer.h
index 9467584f..9467584f 100644
--- a/gme/Blip_Buffer.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Blip_Buffer.h
diff --git a/gme/Classic_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Classic_Emu.cpp
index 063444fe..063444fe 100644
--- a/gme/Classic_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Classic_Emu.cpp
diff --git a/gme/Classic_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Classic_Emu.h
index 8cd822ca..8cd822ca 100644
--- a/gme/Classic_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Classic_Emu.h
diff --git a/gme/Data_Reader.cpp b/gme/Game_Music_Emu-0.5.2/gme/Data_Reader.cpp
index 5bbfbf55..5bbfbf55 100644
--- a/gme/Data_Reader.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Data_Reader.cpp
diff --git a/gme/Data_Reader.h b/gme/Game_Music_Emu-0.5.2/gme/Data_Reader.h
index 00b53b9e..00b53b9e 100644
--- a/gme/Data_Reader.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Data_Reader.h
diff --git a/gme/Dual_Resampler.cpp b/gme/Game_Music_Emu-0.5.2/gme/Dual_Resampler.cpp
index 8644517c..8644517c 100644
--- a/gme/Dual_Resampler.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Dual_Resampler.cpp
diff --git a/gme/Dual_Resampler.h b/gme/Game_Music_Emu-0.5.2/gme/Dual_Resampler.h
index 61beb8a0..61beb8a0 100644
--- a/gme/Dual_Resampler.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Dual_Resampler.h
diff --git a/gme/Effects_Buffer.cpp b/gme/Game_Music_Emu-0.5.2/gme/Effects_Buffer.cpp
index 730f8e94..730f8e94 100644
--- a/gme/Effects_Buffer.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Effects_Buffer.cpp
diff --git a/gme/Effects_Buffer.h b/gme/Game_Music_Emu-0.5.2/gme/Effects_Buffer.h
index eb0aa67a..eb0aa67a 100644
--- a/gme/Effects_Buffer.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Effects_Buffer.h
diff --git a/gme/Fir_Resampler.cpp b/gme/Game_Music_Emu-0.5.2/gme/Fir_Resampler.cpp
index 4e0a4631..4e0a4631 100644
--- a/gme/Fir_Resampler.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Fir_Resampler.cpp
diff --git a/gme/Fir_Resampler.h b/gme/Game_Music_Emu-0.5.2/gme/Fir_Resampler.h
index 339dfce3..339dfce3 100644
--- a/gme/Fir_Resampler.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Fir_Resampler.h
diff --git a/gme/Gb_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Gb_Apu.cpp
index 932ebb83..932ebb83 100644
--- a/gme/Gb_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gb_Apu.cpp
diff --git a/gme/Gb_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Gb_Apu.h
index e74ebc55..e74ebc55 100644
--- a/gme/Gb_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gb_Apu.h
diff --git a/gme/Gb_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Gb_Cpu.cpp
index b1f22bd9..b1f22bd9 100644
--- a/gme/Gb_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gb_Cpu.cpp
diff --git a/gme/Gb_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Gb_Cpu.h
index 953fbaf5..953fbaf5 100644
--- a/gme/Gb_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gb_Cpu.h
diff --git a/gme/Gb_Oscs.cpp b/gme/Game_Music_Emu-0.5.2/gme/Gb_Oscs.cpp
index 735653fa..735653fa 100644
--- a/gme/Gb_Oscs.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gb_Oscs.cpp
diff --git a/gme/Gb_Oscs.h b/gme/Game_Music_Emu-0.5.2/gme/Gb_Oscs.h
index d7f88ea1..d7f88ea1 100644
--- a/gme/Gb_Oscs.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gb_Oscs.h
diff --git a/gme/Gbs_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Gbs_Emu.cpp
index 30a147e5..30a147e5 100644
--- a/gme/Gbs_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gbs_Emu.cpp
diff --git a/gme/Gbs_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Gbs_Emu.h
index 93fe691e..93fe691e 100644
--- a/gme/Gbs_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gbs_Emu.h
diff --git a/gme/Gme_File.cpp b/gme/Game_Music_Emu-0.5.2/gme/Gme_File.cpp
index 6821c3a5..6821c3a5 100644
--- a/gme/Gme_File.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gme_File.cpp
diff --git a/gme/Gme_File.h b/gme/Game_Music_Emu-0.5.2/gme/Gme_File.h
index a535633b..a535633b 100644
--- a/gme/Gme_File.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gme_File.h
diff --git a/gme/Gym_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Gym_Emu.cpp
index 499a9ca2..499a9ca2 100644
--- a/gme/Gym_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gym_Emu.cpp
diff --git a/gme/Gym_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Gym_Emu.h
index 05419ea2..05419ea2 100644
--- a/gme/Gym_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Gym_Emu.h
diff --git a/gme/Hes_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Hes_Apu.cpp
index 22389121..22389121 100644
--- a/gme/Hes_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Hes_Apu.cpp
diff --git a/gme/Hes_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Hes_Apu.h
index ca0c932f..ca0c932f 100644
--- a/gme/Hes_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Hes_Apu.h
diff --git a/gme/Hes_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Hes_Cpu.cpp
index 2615a0bb..2615a0bb 100644
--- a/gme/Hes_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Hes_Cpu.cpp
diff --git a/gme/Hes_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Hes_Cpu.h
index 437d0908..437d0908 100644
--- a/gme/Hes_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Hes_Cpu.h
diff --git a/gme/Hes_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Hes_Emu.cpp
index fafb2666..fafb2666 100644
--- a/gme/Hes_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Hes_Emu.cpp
diff --git a/gme/Hes_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Hes_Emu.h
index 9951eb6a..9951eb6a 100644
--- a/gme/Hes_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Hes_Emu.h
diff --git a/gme/Jamfile b/gme/Game_Music_Emu-0.5.2/gme/Jamfile
index 69d69ace..d2de6620 100644
--- a/gme/Jamfile
+++ b/gme/Game_Music_Emu-0.5.2/gme/Jamfile
@@ -1,4 +1,4 @@
-SubDir ROOT gme ;
+SubDir ROOT gme Game_Music_Emu-0.5.2 gme ;
C++FLAGS += -DHAVE_STDINT_H ;
Library libgme : Ay_Apu.cpp Gb_Apu.cpp Hes_Emu.cpp Nes_Fme7_Apu.cpp Sms_Apu.cpp
diff --git a/gme/Kss_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Kss_Cpu.cpp
index 37c4a724..37c4a724 100644
--- a/gme/Kss_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Kss_Cpu.cpp
diff --git a/gme/Kss_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Kss_Cpu.h
index 6297d100..6297d100 100644
--- a/gme/Kss_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Kss_Cpu.h
diff --git a/gme/Kss_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Kss_Emu.cpp
index 1b26ef0b..1b26ef0b 100644
--- a/gme/Kss_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Kss_Emu.cpp
diff --git a/gme/Kss_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Kss_Emu.h
index 4d8463ab..4d8463ab 100644
--- a/gme/Kss_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Kss_Emu.h
diff --git a/gme/Kss_Scc_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Kss_Scc_Apu.cpp
index 1660ac3d..1660ac3d 100644
--- a/gme/Kss_Scc_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Kss_Scc_Apu.cpp
diff --git a/gme/Kss_Scc_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Kss_Scc_Apu.h
index 03a6a108..03a6a108 100644
--- a/gme/Kss_Scc_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Kss_Scc_Apu.h
diff --git a/gme/M3u_Playlist.cpp b/gme/Game_Music_Emu-0.5.2/gme/M3u_Playlist.cpp
index 0a1475db..0a1475db 100644
--- a/gme/M3u_Playlist.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/M3u_Playlist.cpp
diff --git a/gme/M3u_Playlist.h b/gme/Game_Music_Emu-0.5.2/gme/M3u_Playlist.h
index eda0dc89..eda0dc89 100644
--- a/gme/M3u_Playlist.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/M3u_Playlist.h
diff --git a/gme/Multi_Buffer.cpp b/gme/Game_Music_Emu-0.5.2/gme/Multi_Buffer.cpp
index ecd8f8ad..ecd8f8ad 100644
--- a/gme/Multi_Buffer.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Multi_Buffer.cpp
diff --git a/gme/Multi_Buffer.h b/gme/Game_Music_Emu-0.5.2/gme/Multi_Buffer.h
index a39cca1a..a39cca1a 100644
--- a/gme/Multi_Buffer.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Multi_Buffer.h
diff --git a/gme/Music_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Music_Emu.cpp
index 31c7233c..31c7233c 100644
--- a/gme/Music_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Music_Emu.cpp
diff --git a/gme/Music_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Music_Emu.h
index 573403ce..573403ce 100644
--- a/gme/Music_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Music_Emu.h
diff --git a/gme/Nes_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nes_Apu.cpp
index 8daf5d0e..8daf5d0e 100644
--- a/gme/Nes_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Apu.cpp
diff --git a/gme/Nes_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Nes_Apu.h
index dbd8484c..dbd8484c 100644
--- a/gme/Nes_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Apu.h
diff --git a/gme/Nes_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nes_Cpu.cpp
index 480b4aa4..480b4aa4 100644
--- a/gme/Nes_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Cpu.cpp
diff --git a/gme/Nes_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Nes_Cpu.h
index d303b57c..d303b57c 100644
--- a/gme/Nes_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Cpu.h
diff --git a/gme/Nes_Fme7_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nes_Fme7_Apu.cpp
index c058f6b1..c058f6b1 100644
--- a/gme/Nes_Fme7_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Fme7_Apu.cpp
diff --git a/gme/Nes_Fme7_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Nes_Fme7_Apu.h
index eb60af03..eb60af03 100644
--- a/gme/Nes_Fme7_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Fme7_Apu.h
diff --git a/gme/Nes_Namco_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nes_Namco_Apu.cpp
index f3235b38..f3235b38 100644
--- a/gme/Nes_Namco_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Namco_Apu.cpp
diff --git a/gme/Nes_Namco_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Nes_Namco_Apu.h
index db5fea4b..db5fea4b 100644
--- a/gme/Nes_Namco_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Namco_Apu.h
diff --git a/gme/Nes_Oscs.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nes_Oscs.cpp
index 1ad3f59c..1ad3f59c 100644
--- a/gme/Nes_Oscs.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Oscs.cpp
diff --git a/gme/Nes_Oscs.h b/gme/Game_Music_Emu-0.5.2/gme/Nes_Oscs.h
index b675bfb4..b675bfb4 100644
--- a/gme/Nes_Oscs.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Oscs.h
diff --git a/gme/Nes_Vrc6_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nes_Vrc6_Apu.cpp
index d178407c..d178407c 100644
--- a/gme/Nes_Vrc6_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Vrc6_Apu.cpp
diff --git a/gme/Nes_Vrc6_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Nes_Vrc6_Apu.h
index 18722233..18722233 100644
--- a/gme/Nes_Vrc6_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nes_Vrc6_Apu.h
diff --git a/gme/Nsf_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nsf_Emu.cpp
index 678bddb2..678bddb2 100644
--- a/gme/Nsf_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nsf_Emu.cpp
diff --git a/gme/Nsf_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Nsf_Emu.h
index e06b9172..e06b9172 100644
--- a/gme/Nsf_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nsf_Emu.h
diff --git a/gme/Nsfe_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Nsfe_Emu.cpp
index 0a785e60..0a785e60 100644
--- a/gme/Nsfe_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nsfe_Emu.cpp
diff --git a/gme/Nsfe_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Nsfe_Emu.h
index 561c3be0..561c3be0 100644
--- a/gme/Nsfe_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Nsfe_Emu.h
diff --git a/gme/Sap_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Sap_Apu.cpp
index 23fa9072..23fa9072 100644
--- a/gme/Sap_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sap_Apu.cpp
diff --git a/gme/Sap_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Sap_Apu.h
index c71ce31e..c71ce31e 100644
--- a/gme/Sap_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sap_Apu.h
diff --git a/gme/Sap_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Sap_Cpu.cpp
index 10dc6061..10dc6061 100644
--- a/gme/Sap_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sap_Cpu.cpp
diff --git a/gme/Sap_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Sap_Cpu.h
index 712f63cd..712f63cd 100644
--- a/gme/Sap_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sap_Cpu.h
diff --git a/gme/Sap_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Sap_Emu.cpp
index 8314fd6e..8314fd6e 100644
--- a/gme/Sap_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sap_Emu.cpp
diff --git a/gme/Sap_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Sap_Emu.h
index 4878faa6..4878faa6 100644
--- a/gme/Sap_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sap_Emu.h
diff --git a/gme/Sms_Apu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Sms_Apu.cpp
index b41fdec4..b41fdec4 100644
--- a/gme/Sms_Apu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sms_Apu.cpp
diff --git a/gme/Sms_Apu.h b/gme/Game_Music_Emu-0.5.2/gme/Sms_Apu.h
index 3c11a9c3..3c11a9c3 100644
--- a/gme/Sms_Apu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sms_Apu.h
diff --git a/gme/Sms_Oscs.h b/gme/Game_Music_Emu-0.5.2/gme/Sms_Oscs.h
index 2a896fef..2a896fef 100644
--- a/gme/Sms_Oscs.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Sms_Oscs.h
diff --git a/gme/Snes_Spc.cpp b/gme/Game_Music_Emu-0.5.2/gme/Snes_Spc.cpp
index e909ea18..e909ea18 100644
--- a/gme/Snes_Spc.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Snes_Spc.cpp
diff --git a/gme/Snes_Spc.h b/gme/Game_Music_Emu-0.5.2/gme/Snes_Spc.h
index b558fb71..b558fb71 100644
--- a/gme/Snes_Spc.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Snes_Spc.h
diff --git a/gme/Spc_Cpu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Spc_Cpu.cpp
index fb9983b8..fb9983b8 100644
--- a/gme/Spc_Cpu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Spc_Cpu.cpp
diff --git a/gme/Spc_Cpu.h b/gme/Game_Music_Emu-0.5.2/gme/Spc_Cpu.h
index 2252663b..2252663b 100644
--- a/gme/Spc_Cpu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Spc_Cpu.h
diff --git a/gme/Spc_Dsp.cpp b/gme/Game_Music_Emu-0.5.2/gme/Spc_Dsp.cpp
index 3d934f63..3d934f63 100644
--- a/gme/Spc_Dsp.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Spc_Dsp.cpp
diff --git a/gme/Spc_Dsp.h b/gme/Game_Music_Emu-0.5.2/gme/Spc_Dsp.h
index 36492275..36492275 100644
--- a/gme/Spc_Dsp.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Spc_Dsp.h
diff --git a/gme/Spc_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Spc_Emu.cpp
index 22be9e2a..22be9e2a 100644
--- a/gme/Spc_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Spc_Emu.cpp
diff --git a/gme/Spc_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Spc_Emu.h
index 44b54c30..44b54c30 100644
--- a/gme/Spc_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Spc_Emu.h
diff --git a/gme/Vgm_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu.cpp
index 0fef6bd9..0fef6bd9 100644
--- a/gme/Vgm_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu.cpp
diff --git a/gme/Vgm_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu.h
index bcb784d5..bcb784d5 100644
--- a/gme/Vgm_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu.h
diff --git a/gme/Vgm_Emu_Impl.cpp b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu_Impl.cpp
index a2d7c93e..a2d7c93e 100644
--- a/gme/Vgm_Emu_Impl.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu_Impl.cpp
diff --git a/gme/Vgm_Emu_Impl.h b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu_Impl.h
index 4d387d09..4d387d09 100644
--- a/gme/Vgm_Emu_Impl.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Vgm_Emu_Impl.h
diff --git a/gme/Ym2413_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Ym2413_Emu.cpp
index ede67304..ede67304 100644
--- a/gme/Ym2413_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ym2413_Emu.cpp
diff --git a/gme/Ym2413_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Ym2413_Emu.h
index 98a2a48e..98a2a48e 100644
--- a/gme/Ym2413_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ym2413_Emu.h
diff --git a/gme/Ym2612_Emu.cpp b/gme/Game_Music_Emu-0.5.2/gme/Ym2612_Emu.cpp
index 41ebb093..41ebb093 100644
--- a/gme/Ym2612_Emu.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ym2612_Emu.cpp
diff --git a/gme/Ym2612_Emu.h b/gme/Game_Music_Emu-0.5.2/gme/Ym2612_Emu.h
index 383ac72d..383ac72d 100644
--- a/gme/Ym2612_Emu.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/Ym2612_Emu.h
diff --git a/gme/blargg_common.h b/gme/Game_Music_Emu-0.5.2/gme/blargg_common.h
index 493c231a..493c231a 100644
--- a/gme/blargg_common.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/blargg_common.h
diff --git a/gme/blargg_config.h b/gme/Game_Music_Emu-0.5.2/gme/blargg_config.h
index 9e9c751d..9e9c751d 100644
--- a/gme/blargg_config.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/blargg_config.h
diff --git a/gme/blargg_endian.h b/gme/Game_Music_Emu-0.5.2/gme/blargg_endian.h
index 67165565..67165565 100644
--- a/gme/blargg_endian.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/blargg_endian.h
diff --git a/gme/blargg_source.h b/gme/Game_Music_Emu-0.5.2/gme/blargg_source.h
index 945bf349..945bf349 100644
--- a/gme/blargg_source.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/blargg_source.h
diff --git a/gme/gb_cpu_io.h b/gme/Game_Music_Emu-0.5.2/gme/gb_cpu_io.h
index ada99ead..ada99ead 100644
--- a/gme/gb_cpu_io.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/gb_cpu_io.h
diff --git a/gme/gme.cpp b/gme/Game_Music_Emu-0.5.2/gme/gme.cpp
index d6cebfa8..d6cebfa8 100644
--- a/gme/gme.cpp
+++ b/gme/Game_Music_Emu-0.5.2/gme/gme.cpp
diff --git a/gme/gme.h b/gme/Game_Music_Emu-0.5.2/gme/gme.h
index 469c901c..469c901c 100644
--- a/gme/gme.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/gme.h
diff --git a/gme/hes_cpu_io.h b/gme/Game_Music_Emu-0.5.2/gme/hes_cpu_io.h
index b3d71dad..b3d71dad 100644
--- a/gme/hes_cpu_io.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/hes_cpu_io.h
diff --git a/gme/nes_cpu_io.h b/gme/Game_Music_Emu-0.5.2/gme/nes_cpu_io.h
index 4bae3793..4bae3793 100644
--- a/gme/nes_cpu_io.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/nes_cpu_io.h
diff --git a/gme/sap_cpu_io.h b/gme/Game_Music_Emu-0.5.2/gme/sap_cpu_io.h
index 8c2f6dd0..8c2f6dd0 100644
--- a/gme/sap_cpu_io.h
+++ b/gme/Game_Music_Emu-0.5.2/gme/sap_cpu_io.h
diff --git a/gme/Game_Music_Emu-0.5.2/license.txt b/gme/Game_Music_Emu-0.5.2/license.txt
new file mode 100644
index 00000000..5faba9d4
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/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/gme/Game_Music_Emu-0.5.2/player/Audio_Scope.cpp b/gme/Game_Music_Emu-0.5.2/player/Audio_Scope.cpp
new file mode 100644
index 00000000..74cb2c32
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/player/Audio_Scope.cpp
@@ -0,0 +1,198 @@
+// Game_Music_Emu 0.5.2. http://www.slack.net/~ant/
+
+#include "Audio_Scope.h"
+
+#include <assert.h>
+#include <stdlib.h>
+
+/* Copyright (C) 2005-2006 by Shay Green. Permission is hereby granted, free of
+charge, to any person obtaining a copy of this software module and associated
+documentation files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+to permit persons to whom the Software is furnished to do so, subject to the
+following conditions: The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software. THE
+SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+int const step_bits = 8;
+int const step_unit = 1 << step_bits;
+int const erase_color = 1;
+int const draw_color = 2;
+
+Audio_Scope::Audio_Scope()
+{
+ surface = 0;
+ buf = 0;
+}
+
+Audio_Scope::~Audio_Scope()
+{
+ free( buf );
+
+ if ( surface )
+ SDL_FreeSurface( surface );
+}
+
+const char* Audio_Scope::init( int width, int height )
+{
+ assert( height <= 256 );
+ assert( !buf ); // can only call init() once
+
+ buf = (byte*) calloc( width * sizeof *buf, 1 );
+ if ( !buf )
+ return "Out of memory";
+
+ low_y = 0;
+ high_y = height;
+ buf_size = width;
+
+ for ( sample_shift = 6; sample_shift < 14; )
+ if ( ((0x7FFFL * 2) >> sample_shift++) < height )
+ break;
+
+ v_offset = height / 2 - (0x10000 >> sample_shift);
+
+ screen = SDL_SetVideoMode( width, height, 0, 0 );
+ if ( !screen )
+ return "Couldn't set video mode";
+
+ surface = SDL_CreateRGBSurface( SDL_SWSURFACE, width, height, 8, 0, 0, 0, 0 );
+ if ( !screen )
+ return "Couldn't create surface";
+
+ static SDL_Color palette [2] = { {0, 0, 0}, {0, 255, 0} };
+ SDL_SetColors( surface, palette, 1, 2 );
+
+ return 0; // success
+}
+
+const char* Audio_Scope::draw( const short* in, long count, double step )
+{
+ int low = low_y;
+ int high = high_y;
+
+ if ( count >= buf_size )
+ {
+ count = buf_size;
+ low_y = 0x7FFF;
+ high_y = 0;
+ }
+
+ if ( SDL_LockSurface( surface ) < 0 )
+ return "Couldn't lock surface";
+ render( in, count, (long) (step * step_unit) );
+ SDL_UnlockSurface( surface );
+
+ if ( low > low_y )
+ low = low_y;
+
+ if ( high < high_y )
+ high = high_y;
+
+ SDL_Rect r;
+ r.x = 0;
+ r.w = buf_size;
+ r.y = low + v_offset;
+ r.h = high - low + 1;
+
+ if ( SDL_BlitSurface( surface, &r, screen, &r ) < 0 )
+ return "Blit to screen failed";
+
+ if ( SDL_Flip( screen ) < 0 )
+ return "Couldn't flip screen";
+
+ return 0; // success
+}
+
+void Audio_Scope::render( short const* in, long count, long step )
+{
+ byte* old_pos = buf;
+ long surface_pitch = surface->pitch;
+ byte* out = (byte*) surface->pixels + v_offset * surface_pitch;
+ int old_erase = *old_pos;
+ int old_draw = 0;
+ long in_pos = 0;
+
+ int low_y = this->low_y;
+ int high_y = this->high_y;
+ int half_step = (step + step_unit / 2) >> (step_bits + 1);
+
+ while ( count-- )
+ {
+ // Line drawing/erasing starts at previous sample and ends one short of
+ // current sample, except when previous and current are the same.
+
+ // Extra read on the last iteration of line loops will always be at the
+ // height of the next sample, and thus within the gworld bounds.
+
+ // Erase old line
+ {
+ int delta = *old_pos - old_erase;
+ int offset = old_erase * surface_pitch;
+ old_erase += delta;
+
+ int next_line = surface_pitch;
+ if ( delta < 0 )
+ {
+ delta = -delta;
+ next_line = -surface_pitch;
+ }
+
+ do
+ {
+ out [offset] = erase_color;
+ offset += next_line;
+ }
+ while ( delta-- > 1 );
+ }
+
+ // Draw new line and put in old_buf
+ {
+
+ int in_whole = in_pos >> step_bits;
+ int sample = (0x7FFF * 2 - in [in_whole] - in [in_whole + half_step]) >> sample_shift;
+ if ( !in_pos )
+ old_draw = sample;
+ in_pos += step;
+
+ int delta = sample - old_draw;
+ int offset = old_draw * surface_pitch;
+ old_draw += delta;
+
+ int next_line = surface_pitch;
+ if ( delta < 0 )
+ {
+ delta = -delta;
+ next_line = -surface_pitch;
+ }
+
+ *old_pos++ = sample;
+
+ // min/max updating can be interleved anywhere
+
+ if ( low_y > sample )
+ low_y = sample;
+
+ do
+ {
+ out [offset] = draw_color;
+ offset += next_line;
+ }
+ while ( delta-- > 1 );
+
+ if ( high_y < sample )
+ high_y = sample;
+ }
+
+ out++;
+ }
+
+ this->low_y = low_y;
+ this->high_y = high_y;
+}
diff --git a/gme/Game_Music_Emu-0.5.2/player/Audio_Scope.h b/gme/Game_Music_Emu-0.5.2/player/Audio_Scope.h
new file mode 100644
index 00000000..75334676
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/player/Audio_Scope.h
@@ -0,0 +1,36 @@
+// Simple audio waveform scope in a window, using SDL multimedia library
+
+#ifndef AUDIO_SCOPE_H
+#define AUDIO_SCOPE_H
+
+#include "SDL.h"
+
+class Audio_Scope {
+public:
+ typedef const char* error_t;
+
+ // Initialize scope window of specified size. Height must be 256 or less.
+ error_t init( int width, int height );
+
+ // Draw at most 'count' samples from 'in', skipping 'step' samples after
+ // each sample drawn. Step can be less than 1.0.
+ error_t draw( const short* in, long count, double step = 1.0 );
+
+ Audio_Scope();
+ ~Audio_Scope();
+
+private:
+ typedef unsigned char byte;
+ SDL_Surface* screen;
+ SDL_Surface* surface;
+ byte* buf;
+ int buf_size;
+ int sample_shift;
+ int low_y;
+ int high_y;
+ int v_offset;
+
+ void render( short const* in, long count, long step );
+};
+
+#endif
diff --git a/gme/Game_Music_Emu-0.5.2/player/Music_Player.cpp b/gme/Game_Music_Emu-0.5.2/player/Music_Player.cpp
new file mode 100644
index 00000000..a39819f1
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/player/Music_Player.cpp
@@ -0,0 +1,231 @@
+// Game_Music_Emu 0.5.2. http://www.slack.net/~ant/
+
+#include "Music_Player.h"
+
+#include "gme/Music_Emu.h"
+
+#include <string.h>
+#include <ctype.h>
+
+/* Copyright (C) 2005-2006 by Shay Green. Permission is hereby granted, free of
+charge, to any person obtaining a copy of this software module and associated
+documentation files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use, copy, modify,
+merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+to permit persons to whom the Software is furnished to do so, subject to the
+following conditions: The above copyright notice and this permission notice
+shall be included in all copies or substantial portions of the Software. THE
+SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#include "blargg_source.h"
+
+// Number of audio buffers per second. Adjust if you encounter audio skipping.
+const int fill_rate = 45;
+
+// Simple sound driver using SDL
+typedef void (*sound_callback_t)( void* data, short* out, int count );
+static const char* sound_init( long sample_rate, int buf_size, sound_callback_t, void* data );
+static void sound_start();
+static void sound_stop();
+static void sound_cleanup();
+
+Music_Player::Music_Player()
+{
+ emu_ = 0;
+ scope_buf = 0;
+ paused = false;
+}
+
+blargg_err_t Music_Player::init( long rate )
+{
+ sample_rate = rate;
+
+ int min_size = sample_rate * 2 / fill_rate;
+ int buf_size = 512;
+ while ( buf_size < min_size )
+ buf_size *= 2;
+
+ return sound_init( sample_rate, buf_size, fill_buffer, this );
+}
+
+void Music_Player::stop()
+{
+ sound_stop();
+ delete emu_;
+ emu_ = 0;
+}
+
+Music_Player::~Music_Player()
+{
+ stop();
+ sound_cleanup();
+}
+
+blargg_err_t Music_Player::load_file( const char* path )
+{
+ stop();
+
+ RETURN_ERR( gme_open_file( path, &emu_, sample_rate ) );
+
+ char m3u_path [256 + 5];
+ strncpy( m3u_path, path, 256 );
+ m3u_path [256] = 0;
+ char* p = strrchr( m3u_path, '.' );
+ if ( !p )
+ p = m3u_path + strlen( m3u_path );
+ strcpy( p, ".m3u" );
+ if ( emu_->load_m3u( m3u_path ) ) { } // ignore error
+
+ return 0;
+}
+
+int Music_Player::track_count() const
+{
+ return emu_ ? emu_->track_count() : false;
+}
+
+blargg_err_t Music_Player::start_track( int track )
+{
+ if ( emu_ )
+ {
+ // Sound must not be running when operating on emulator
+ sound_stop();
+ RETURN_ERR( emu_->start_track( track ) );
+
+ // Calculate track length
+ if ( !emu_->track_info( &track_info_ ) )
+ {
+ if ( track_info_.length <= 0 )
+ track_info_.length = track_info_.intro_length +
+ track_info_.loop_length * 2;
+ }
+ if ( track_info_.length <= 0 )
+ track_info_.length = (long) (2.5 * 60 * 1000);
+ emu_->set_fade( track_info_.length );
+
+ paused = false;
+ sound_start();
+ }
+ return 0;
+}
+
+void Music_Player::pause( int b )
+{
+ paused = b;
+ if ( b )
+ sound_stop();
+ else
+ sound_start();
+}
+
+void Music_Player::suspend()
+{
+ if ( !paused )
+ sound_stop();
+}
+
+void Music_Player::resume()
+{
+ if ( !paused )
+ sound_start();
+}
+
+bool Music_Player::track_ended() const
+{
+ return emu_ ? emu_->track_ended() : false;
+}
+
+void Music_Player::set_stereo_depth( double tempo )
+{
+ suspend();
+ gme_set_stereo_depth( emu_, tempo );
+ resume();
+}
+
+void Music_Player::set_tempo( double tempo )
+{
+ suspend();
+ emu_->set_tempo( tempo );
+ resume();
+}
+
+void Music_Player::mute_voices( int mask )
+{
+ suspend();
+ emu_->mute_voices( mask );
+ emu_->ignore_silence( mask != 0 );
+ resume();
+}
+
+void Music_Player::fill_buffer( void* data, sample_t* out, int count )
+{
+ Music_Player* self = (Music_Player*) data;
+ if ( self->emu_ )
+ {
+ if ( self->emu_->play( count, out ) ) { } // ignore error
+
+ if ( self->scope_buf )
+ memcpy( self->scope_buf, out, self->scope_buf_size * sizeof *self->scope_buf );
+ }
+}
+
+// Sound output driver using SDL
+
+#include "SDL.h"
+
+static sound_callback_t sound_callback;
+static void* sound_callback_data;
+
+static void sdl_callback( void* data, Uint8* out, int count )
+{
+ if ( sound_callback )
+ sound_callback( sound_callback_data, (short*) out, count / 2 );
+}
+
+static const char* sound_init( long sample_rate, int buf_size,
+ sound_callback_t cb, void* data )
+{
+ sound_callback = cb;
+ sound_callback_data = data;
+
+ static SDL_AudioSpec as; // making static clears all fields to 0
+ as.freq = sample_rate;
+ as.format = AUDIO_S16SYS;
+ as.channels = 2;
+ as.callback = sdl_callback;
+ as.samples = buf_size;
+ if ( SDL_OpenAudio( &as, 0 ) < 0 )
+ {
+ const char* err = SDL_GetError();
+ if ( !err )
+ err = "Couldn't open SDL audio";
+ return err;
+ }
+
+ return 0;
+}
+
+static void sound_start()
+{
+ SDL_PauseAudio( false );
+}
+
+static void sound_stop()
+{
+ SDL_PauseAudio( true );
+
+ // be sure audio thread is not active
+ SDL_LockAudio();
+ SDL_UnlockAudio();
+}
+
+static void sound_cleanup()
+{
+ sound_stop();
+ SDL_CloseAudio();
+}
diff --git a/gme/Game_Music_Emu-0.5.2/player/Music_Player.h b/gme/Game_Music_Emu-0.5.2/player/Music_Player.h
new file mode 100644
index 00000000..7a573c45
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/player/Music_Player.h
@@ -0,0 +1,69 @@
+// Simple game music file player
+
+// Game_Music_Emu 0.5.2
+#ifndef MUSIC_PLAYER_H
+#define MUSIC_PLAYER_H
+
+#include "gme/Music_Emu.h"
+
+class Music_Player {
+public:
+ // Initialize player and set sample rate
+ blargg_err_t init( long sample_rate = 44100 );
+
+ // Load game music file. NULL on success, otherwise error string.
+ blargg_err_t load_file( const char* path );
+
+ // (Re)start playing track. Tracks are numbered from 0 to track_count() - 1.
+ blargg_err_t start_track( int track );
+
+ // Stop playing current file
+ void stop();
+
+// Optional functions
+
+ // Number of tracks in current file, or 0 if no file loaded.
+ int track_count() const;
+
+ // Info for current track
+ track_info_t const& track_info() const { return track_info_; }
+
+ // Pause/resume playing current track.
+ void pause( int );
+
+ // True if track ended
+ bool track_ended() const;
+
+ // Pointer to emulator
+ Music_Emu* emu() const { return emu_; }
+
+ // Set stereo depth, where 0.0 = none and 1.0 = maximum
+ void set_stereo_depth( double );
+
+ // Set tempo, where 0.5 = half speed, 1.0 = normal, 2.0 = double speed
+ void set_tempo( double );
+
+ // Set voice muting bitmask
+ void mute_voices( int );
+
+ // Set buffer to copy samples from each buffer into, or NULL to disable
+ typedef short sample_t;
+ void set_scope_buffer( sample_t* buf, int size ) { scope_buf = buf; scope_buf_size = size; }
+
+public:
+ Music_Player();
+ ~Music_Player();
+private:
+ Music_Emu* emu_;
+ sample_t* scope_buf;
+ long sample_rate;
+ int scope_buf_size;
+ bool paused;
+ track_info_t track_info_;
+
+ void suspend();
+ void resume();
+ static void fill_buffer( void*, sample_t*, int );
+};
+
+#endif
diff --git a/gme/Game_Music_Emu-0.5.2/player/player.cpp b/gme/Game_Music_Emu-0.5.2/player/player.cpp
new file mode 100644
index 00000000..a0685997
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/player/player.cpp
@@ -0,0 +1,213 @@
+/* How to play game music files with Music_Player (requires SDL library)
+
+Run program with path to a game music file.
+
+Left/Right Change track
+Space Pause/unpause
+E Normal/slight stereo echo/more stereo echo
+-/= Adjust tempo
+1-9 Toggle channel on/off
+0 Reset tempo and turn channels back on */
+
+int const scope_width = 512;
+
+#include "Music_Player.h"
+#include "Audio_Scope.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "SDL.h"
+
+void handle_error( const char* );
+
+static bool paused;
+static Audio_Scope* scope;
+static Music_Player* player;
+static short scope_buf [scope_width * 2];
+
+static void init()
+{
+ // Start SDL
+ if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO ) < 0 )
+ exit( EXIT_FAILURE );
+ atexit( SDL_Quit );
+ SDL_EnableKeyRepeat( 500, 80 );
+
+ // Init scope
+ scope = new Audio_Scope;
+ if ( !scope )
+ handle_error( "Out of memory" );
+ if ( scope->init( scope_width, 256 ) )
+ handle_error( "Couldn't initialize scope" );
+ memset( scope_buf, 0, sizeof scope_buf );
+
+ // Create player
+ player = new Music_Player;
+ if ( !player )
+ handle_error( "Out of memory" );
+ handle_error( player->init() );
+ player->set_scope_buffer( scope_buf, scope_width * 2 );
+}
+
+static void start_track( int track, const char* path )
+{
+ paused = false;
+ handle_error( player->start_track( track - 1 ) );
+
+ // update window title with track info
+
+ long seconds = player->track_info().length / 1000;
+ const char* game = player->track_info().game;
+ if ( !*game )
+ {
+ // extract filename
+ game = strrchr( path, '\\' ); // DOS
+ if ( !game )
+ game = strrchr( path, '/' ); // UNIX
+ if ( !game )
+ game = path;
+ else
+ game++; // skip path separator
+ }
+
+ char title [512];
+ sprintf( title, "%s: %d/%d %s (%ld:%02ld)",
+ game, track, player->track_count(), player->track_info().song,
+ seconds / 60, seconds % 60 );
+ SDL_WM_SetCaption( title, title );
+}
+
+int main( int argc, char** argv )
+{
+ init();
+
+ // Load file
+ const char* path = (argc > 1 ? argv [argc - 1] : "test.nsf");
+ handle_error( player->load_file( path ) );
+ start_track( 1, path );
+
+ // Main loop
+ int track = 1;
+ double tempo = 1.0;
+ bool running = true;
+ double stereo_depth = 0.0;
+ int muting_mask = 0;
+ while ( running )
+ {
+ SDL_Delay( 1000 / 100 );
+
+ // Update scope
+ scope->draw( scope_buf, scope_width, 2 );
+
+ // Automatically go to next track when current one ends
+ if ( player->track_ended() )
+ {
+ if ( track < player->track_count() )
+ start_track( ++track, path );
+ else
+ player->pause( paused = true );
+ }
+
+ // Handle keyboard input
+ SDL_Event e;
+ while ( SDL_PollEvent( &e ) )
+ {
+ switch ( e.type )
+ {
+ case SDL_QUIT:
+ running = false;
+ break;
+
+ case SDL_KEYDOWN:
+ int key = e.key.keysym.sym;
+ switch ( key )
+ {
+ case SDLK_q:
+ case SDLK_ESCAPE: // quit
+ running = false;
+ break;
+
+ case SDLK_LEFT: // prev track
+ if ( !paused && !--track )
+ track = 1;
+ start_track( track, path );
+ break;
+
+ case SDLK_RIGHT: // next track
+ if ( track < player->track_count() )
+ start_track( ++track, path );
+ break;
+
+ case SDLK_MINUS: // reduce tempo
+ tempo -= 0.1;
+ if ( tempo < 0.1 )
+ tempo = 0.1;
+ player->set_tempo( tempo );
+ break;
+
+ case SDLK_EQUALS: // increase tempo
+ tempo += 0.1;
+ if ( tempo > 2.0 )
+ tempo = 2.0;
+ player->set_tempo( tempo );
+ break;
+
+ case SDLK_SPACE: // toggle pause
+ paused = !paused;
+ player->pause( paused );
+ break;
+
+ case SDLK_e: // toggle echo
+ stereo_depth += 0.2;
+ if ( stereo_depth > 0.5 )
+ stereo_depth = 0;
+ player->set_stereo_depth( stereo_depth );
+ break;
+
+ case SDLK_0: // reset tempo and muting
+ tempo = 1.0;
+ muting_mask = 0;
+ player->set_tempo( tempo );
+ player->mute_voices( muting_mask );
+ break;
+
+ default:
+ if ( SDLK_1 <= key && key <= SDLK_9 ) // toggle muting
+ {
+ muting_mask ^= 1 << (key - SDLK_1);
+ player->mute_voices( muting_mask );
+ }
+ }
+ }
+ }
+ }
+
+ // Cleanup
+ delete player;
+ delete scope;
+
+ return 0;
+}
+
+void handle_error( const char* error )
+{
+ if ( error )
+ {
+ // put error in window title
+ char str [256];
+ sprintf( str, "Error: %s", error );
+ fprintf( stderr, str );
+ SDL_WM_SetCaption( str, str );
+
+ // wait for keyboard or mouse activity
+ SDL_Event e;
+ do
+ {
+ while ( !SDL_PollEvent( &e ) ) { }
+ }
+ while ( e.type != SDL_QUIT && e.type != SDL_KEYDOWN && e.type != SDL_MOUSEBUTTONDOWN );
+
+ exit( EXIT_FAILURE );
+ }
+}
diff --git a/gme/Game_Music_Emu-0.5.2/readme.txt b/gme/Game_Music_Emu-0.5.2/readme.txt
new file mode 100644
index 00000000..e3470bfa
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/readme.txt
@@ -0,0 +1,205 @@
+Game_Music_Emu 0.5.2: 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:
+* Can be used in C and C++ code
+* 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/. Be sure "test.nsf" is in the same directory.
+Running the program should generate the recording "out.wav".
+
+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
+
+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
+ cpp_basics.cpp C++ version of basics.c
+ features.c Demonstrates many additional features
+ Wave_Writer.h WAVE sound file writer used for demo output
+ Wave_Writer.cpp
+
+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
+
+gme/
+ blargg_config.h Library configuration (modify this file as needed)
+
+ gme.h C interface (also usable in C++, and simpler too)
+ gme.cpp
+
+ Gme_File.h File loading and track information
+ Music_Emu.h Track playback and adjustments
+ Data_Reader.h Custom data readers
+
+ Effects_Buffer.h Sound buffer with stereo echo and panning
+ Effects_Buffer.cpp
+
+ M3u_Playlist.h M3U playlist support
+ M3u_Playlist.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
+
+ blargg_common.h Common files needed by all emulators
+ blargg_endian.h
+ blargg_source.h
+ Blip_Buffer.cpp
+ Blip_Buffer.h
+ Gme_File.cpp
+ Music_Emu.cpp
+ Classic_Emu.h
+ Classic_Emu.cpp
+ Multi_Buffer.h
+ Multi_Buffer.cpp
+ Data_Reader.cpp
+
+
+Legal
+-----
+Game_Music_Emu library copyright (C) 2003-2006 Shay Green.
+SNES SPC DSP emulator based on OpenSPC, copyright (C) 2002 Brad Martin.
+Sega Genesis YM2612 emulator copyright (C) 2002 Stephane Dallongeville.
+
+--
+Shay Green <gblargg@gmail.com>
diff --git a/gme/Game_Music_Emu-0.5.2/test.m3u b/gme/Game_Music_Emu-0.5.2/test.m3u
new file mode 100644
index 00000000..fd46bfe1
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/test.m3u
@@ -0,0 +1,2 @@
+# filename,track number,track name,track time
+test.nsf,$00,BGM C,1:16
diff --git a/gme/Game_Music_Emu-0.5.2/test.nsf b/gme/Game_Music_Emu-0.5.2/test.nsf
new file mode 100644
index 00000000..da5fcedd
--- /dev/null
+++ b/gme/Game_Music_Emu-0.5.2/test.nsf
Binary files differ