diff --git a/.gitmodules b/.gitmodules index 80be35e3e..4a00e1104 100644 --- a/.gitmodules +++ b/.gitmodules @@ -37,4 +37,4 @@ [submodule "external/libgme"] path = external/libgme url = https://github.com/libsdl-org/game-music-emu.git - branch = v0.6.3-SDL + branch = v0.6.4-SDL diff --git a/CMakeLists.txt b/CMakeLists.txt index 4009ae8c2..e6bd23fe1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -690,19 +690,25 @@ set(SDLMIXER_GME_ENABLED FALSE) if(SDLMIXER_GME) if(SDLMIXER_VENDORED) set(SDLMIXER_GME_ENABLED TRUE) - set(BUILD_SHARED_LIBS "${SDLMIXER_GME_SHARED}") - set(ENABLE_UBSAN OFF) - set(BUILD_FRAMEWORK OFF) + set(GME_BUILD_SHARED "${SDLMIXER_GME_SHARED}") + if(SDLMIXER_GME_SHARED) + set(GME_BUILD_STATIC OFF) + set(tgt_gme gme_shared) + else() + set(GME_BUILD_STATIC ON) + set(tgt_gme gme_static) + endif() + set(GME_BUILD_FRAMEWORK OFF) + set(GME_BUILD_TESTING OFF) + set(GME_BUILD_EXAMPLES OFF) + set(GME_ENABLE_UBSAN OFF) option(GME_ZLIB "Enable GME to support compressed sound formats" OFF) message(STATUS "Using vendored libgme") sdl_check_project_in_subfolder(external/libgme libgme SDLMIXER_VENDORED) enable_language(CXX) add_subdirectory(external/libgme EXCLUDE_FROM_ALL) - if(NOT TARGET gme::gme) - add_library(gme::gme ALIAS gme) - endif() if(SDLMIXER_GME_SHARED OR NOT SDLMIXER_BUILD_SHARED_LIBS) - list(APPEND INSTALL_EXTRA_TARGETS gme) + list(APPEND INSTALL_EXTRA_TARGETS ${tgt_gme}) endif() if(NOT SDLMIXER_GME_SHARED) list(APPEND PC_LIBS -l$) diff --git a/VisualC/external/include/gme/gme.h b/VisualC/external/include/gme/gme.h index 145f04a33..b3eb54ca7 100644 --- a/VisualC/external/include/gme/gme.h +++ b/VisualC/external/include/gme/gme.h @@ -1,6 +1,6 @@ /* Game music emulator library C interface (also usable from C++) */ -/* Game_Music_Emu 0.6.3 */ +/* Game_Music_Emu 0.6.4 */ #ifndef GME_H #define GME_H @@ -8,7 +8,7 @@ extern "C" { #endif -#define GME_VERSION 0x000603 /* 1 byte major, 1 byte minor, 1 byte patch-level */ +#define GME_VERSION 0x000604 /* 1 byte major, 1 byte minor, 1 byte patch-level */ /* Error string returned by library functions, or NULL if no error (success) */ typedef const char* gme_err_t; @@ -57,6 +57,11 @@ BLARGG_EXPORT void gme_delete( Music_Emu* ); Fade time can be changed while track is playing. */ BLARGG_EXPORT void gme_set_fade( Music_Emu*, int start_msec ); +/** See gme_set_fade. + * @since 0.6.4 + */ +BLARGG_EXPORT void gme_set_fade_msecs( Music_Emu*, int start_msec, int length_msecs ); + /** * If do_autoload_limit is nonzero, then automatically load track length * metadata (if present) and terminate playback once the track length has been @@ -67,12 +72,13 @@ BLARGG_EXPORT void gme_set_fade( Music_Emu*, int start_msec ); * * By default, playback limits are loaded and applied. * - * @since 0.6.2 + * @since 0.6.3 */ BLARGG_EXPORT void gme_set_autoload_playback_limit( Music_Emu *, int do_autoload_limit ); /** See gme_set_autoload_playback_limit. - * @since 0.6.2 + * (This was actually added in 0.6.3, but wasn't exported because of a typo.) + * @since 0.6.4 */ BLARGG_EXPORT int gme_autoload_playback_limit( Music_Emu const* ); @@ -123,13 +129,16 @@ struct gme_info_t int length; /* total length, if file specifies it */ int intro_length; /* length of song up to looping section */ int loop_length; /* length of looping section */ - + /* Length if available, otherwise intro_length+loop_length*2 if available, otherwise a default of 150000 (2.5 minutes). */ int play_length; - - int i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15; /* reserved */ - + + /* fade length in milliseconds; -1 if unknown */ + int fade_length; + + int i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15; /* reserved */ + /* empty string ("") if not available */ const char* system; const char* game; @@ -138,7 +147,7 @@ struct gme_info_t const char* copyright; const char* comment; const char* dumper; - + const char *s7,*s8,*s9,*s10,*s11,*s12,*s13,*s14,*s15; /* reserved */ }; @@ -170,13 +179,17 @@ BLARGG_EXPORT void gme_mute_voice( Music_Emu*, int index, int mute ); voices, 0 unmutes them all, 0x01 mutes just the first voice, etc. */ BLARGG_EXPORT void gme_mute_voices( Music_Emu*, int muting_mask ); +/* Disable/Enable echo effect for SPC files */ +/* Available since 0.6.4 */ +BLARGG_EXPORT void gme_disable_echo( Music_Emu*, int disable ); + /* Frequency equalizer parameters (see gme.txt) */ /* Implementers: If modified, also adjust Music_Emu::make_equalizer as needed */ typedef struct gme_equalizer_t { double treble; /* -50.0 = muffled, 0 = flat, +5.0 = extra-crisp */ double bass; /* 1 = full bass, 90 = average, 16000 = almost no bass */ - + double d2,d3,d4,d5,d6,d7,d8,d9; /* reserved */ } gme_equalizer_t; @@ -224,7 +237,7 @@ BLARGG_EXPORT int gme_type_multitrack( gme_type_t ); /* whether the pcm output retrieved by gme_play() will have all 8 voices rendered to their * individual stereo channel or (if false) these voices get mixed into one single stereo channel - * @since 0.6.2 */ + * @since 0.6.3 */ BLARGG_EXPORT int gme_multi_channel( Music_Emu const* ); /******** Advanced file loading ********/ @@ -248,7 +261,7 @@ BLARGG_EXPORT gme_type_t gme_identify_extension( const char path_or_extension [] * Get typical file extension for a given music type. This is not a replacement * for a file content identification library (but see gme_identify_header). * - * @since 0.6.2 + * @since 0.6.3 */ BLARGG_EXPORT const char* gme_type_extension( gme_type_t music_type ); @@ -263,7 +276,7 @@ BLARGG_EXPORT Music_Emu* gme_new_emu( gme_type_t, int sample_rate ); /* Create new multichannel emulator and set sample rate. Returns NULL if out of memory. * If you only need track information, pass gme_info_only for sample_rate. * (see gme_multi_channel for more information on multichannel support) - * @since 0.6.2 + * @since 0.6.3 */ BLARGG_EXPORT Music_Emu* gme_new_emu_multi_channel( gme_type_t, int sample_rate ); @@ -273,6 +286,17 @@ BLARGG_EXPORT gme_err_t gme_load_file( Music_Emu*, const char path [] ); /* Load music file from memory into emulator. Makes a copy of data passed. */ BLARGG_EXPORT gme_err_t gme_load_data( Music_Emu*, void const* data, long size ); +/* Load multiple single-track music files from memory into emulator. + * @since 0.6.4 + */ +BLARGG_EXPORT gme_err_t gme_load_tracks( Music_Emu* me, + void const* data, long* sizes, int count ); + +/* Return the fixed track count of an emu file type + * @since 0.6.4 + */ +BLARGG_EXPORT int gme_fixed_track_count( gme_type_t ); + /* Load music file using custom data reader function that will be called to read file data. Most emulators load the entire file in one read call. */ typedef gme_err_t (*gme_reader_t)( void* your_data, void* out, int count ); diff --git a/VisualC/external/optional/x64/libgme.dll b/VisualC/external/optional/x64/libgme.dll index 5a827ffac..5585a1f38 100644 Binary files a/VisualC/external/optional/x64/libgme.dll and b/VisualC/external/optional/x64/libgme.dll differ diff --git a/VisualC/external/optional/x86/libgme.dll b/VisualC/external/optional/x86/libgme.dll index 87d8d4df4..374537449 100644 Binary files a/VisualC/external/optional/x86/libgme.dll and b/VisualC/external/optional/x86/libgme.dll differ diff --git a/Xcode/gme/gme.xcodeproj/project.pbxproj b/Xcode/gme/gme.xcodeproj/project.pbxproj index 0c2cc3ece..c8fd1c478 100644 --- a/Xcode/gme/gme.xcodeproj/project.pbxproj +++ b/Xcode/gme/gme.xcodeproj/project.pbxproj @@ -72,6 +72,10 @@ F307A2DC2B54329C0012534B /* Spc_Dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F307A2AD2B54329C0012534B /* Spc_Dsp.cpp */; }; F307A2DD2B54329C0012534B /* gme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F307A2AE2B54329C0012534B /* gme.cpp */; }; F307A2DF2B5434FF0012534B /* Vgm_Emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F307A2DE2B5434FF0012534B /* Vgm_Emu.cpp */; }; + 6314974C2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6314974B2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp */; }; + 6314974E2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6314974D2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp */; }; + 631497502D8D4AEA00EEC879 /* emu2413.c in Sources */ = {isa = PBXBuildFile; fileRef = 6314974F2D8D4AEA00EEC879 /* emu2413.c */; }; + 631497522D8D4B0500EEC879 /* panning.c in Sources */ = {isa = PBXBuildFile; fileRef = 631497512D8D4B0500EEC879 /* panning.c */; }; F307A2E12B54358D0012534B /* gme.h in Headers */ = {isa = PBXBuildFile; fileRef = F307A2E02B54358D0012534B /* gme.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ @@ -127,6 +131,10 @@ F307A2AD2B54329C0012534B /* Spc_Dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Spc_Dsp.cpp; path = ../../external/libgme/gme/Spc_Dsp.cpp; sourceTree = ""; }; F307A2AE2B54329C0012534B /* gme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gme.cpp; path = ../../external/libgme/gme/gme.cpp; sourceTree = ""; }; F307A2DE2B5434FF0012534B /* Vgm_Emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vgm_Emu.cpp; path = ../../external/libgme/gme/Vgm_Emu.cpp; sourceTree = ""; }; + 6314974B2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Nes_Fds_Apu.cpp; path = ../../external/libgme/gme/Nes_Fds_Apu.cpp; sourceTree = ""; }; + 6314974D2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Nes_Vrc7_Apu.cpp; path = ../../external/libgme/gme/Nes_Vrc7_Apu.cpp; sourceTree = ""; }; + 6314974F2D8D4AEA00EEC879 /* emu2413.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = emu2413.c; path = ../../external/libgme/gme/ext/emu2413.c; sourceTree = ""; }; + 631497512D8D4B0500EEC879 /* panning.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = panning.c; path = ../../external/libgme/gme/ext/panning.c; sourceTree = ""; }; F307A2E02B54358D0012534B /* gme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gme.h; path = ../../external/libgme/gme/gme.h; sourceTree = ""; }; F3F70EDA281F61B4005AA27D /* gme.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = gme.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -178,6 +186,8 @@ F307A2932B54329C0012534B /* Gbs_Emu.cpp */, F307A2982B54329C0012534B /* Gme_File.cpp */, F307A2AE2B54329C0012534B /* gme.cpp */, + 6314974F2D8D4AEA00EEC879 /* emu2413.c */, + 631497512D8D4B0500EEC879 /* panning.c */, F307A2A82B54329C0012534B /* Gym_Emu.cpp */, F307A2A02B54329C0012534B /* Hes_Apu.cpp */, F307A29C2B54329C0012534B /* Hes_Cpu.cpp */, @@ -194,6 +204,8 @@ F307A2852B54329C0012534B /* Nes_Namco_Apu.cpp */, F307A29E2B54329C0012534B /* Nes_Oscs.cpp */, F307A2812B54329C0012534B /* Nes_Vrc6_Apu.cpp */, + 6314974B2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp */, + 6314974D2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp */, F307A29F2B54329C0012534B /* Nsf_Emu.cpp */, F307A2992B54329C0012534B /* Nsfe_Emu.cpp */, F307A2902B54329C0012534B /* Sap_Apu.cpp */, @@ -388,6 +400,10 @@ F307A2BF2B54329C0012534B /* Sap_Apu.cpp in Sources */, F307A2DC2B54329C0012534B /* Spc_Dsp.cpp in Sources */, F307A2C82B54329C0012534B /* Nsfe_Emu.cpp in Sources */, + 6314974C2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp in Sources */, + 6314974E2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp in Sources */, + 631497502D8D4AEA00EEC879 /* emu2413.c in Sources */, + 631497522D8D4B0500EEC879 /* panning.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/external/libgme b/external/libgme index 51ce3da09..f7216c15b 160000 --- a/external/libgme +++ b/external/libgme @@ -1 +1 @@ -Subproject commit 51ce3da09af1e27a203381bb4071604bddfd05a9 +Subproject commit f7216c15bda1dccdaecab56d47810802b6f0e218