Skip to content

Commit eb9619e

Browse files
committed
upgrade vendored libgme to latest 0.6.4 release
Reference issue: #680
1 parent 72a7333 commit eb9619e

File tree

7 files changed

+68
-22
lines changed

7 files changed

+68
-22
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
[submodule "external/libgme"]
3838
path = external/libgme
3939
url = https://github.com/libsdl-org/game-music-emu.git
40-
branch = v0.6.3-SDL
40+
branch = v0.6.4-SDL

CMakeLists.txt

+13-7
Original file line numberDiff line numberDiff line change
@@ -690,19 +690,25 @@ set(SDLMIXER_GME_ENABLED FALSE)
690690
if(SDLMIXER_GME)
691691
if(SDLMIXER_VENDORED)
692692
set(SDLMIXER_GME_ENABLED TRUE)
693-
set(BUILD_SHARED_LIBS "${SDLMIXER_GME_SHARED}")
694-
set(ENABLE_UBSAN OFF)
695-
set(BUILD_FRAMEWORK OFF)
693+
set(GME_BUILD_SHARED "${SDLMIXER_GME_SHARED}")
694+
if(SDLMIXER_GME_SHARED)
695+
set(GME_BUILD_STATIC OFF)
696+
set(tgt_gme gme_shared)
697+
else()
698+
set(GME_BUILD_STATIC ON)
699+
set(tgt_gme gme_static)
700+
endif()
701+
set(GME_BUILD_FRAMEWORK OFF)
702+
set(GME_BUILD_TESTING OFF)
703+
set(GME_BUILD_EXAMPLES OFF)
704+
set(GME_ENABLE_UBSAN OFF)
696705
option(GME_ZLIB "Enable GME to support compressed sound formats" OFF)
697706
message(STATUS "Using vendored libgme")
698707
sdl_check_project_in_subfolder(external/libgme libgme SDLMIXER_VENDORED)
699708
enable_language(CXX)
700709
add_subdirectory(external/libgme EXCLUDE_FROM_ALL)
701-
if(NOT TARGET gme::gme)
702-
add_library(gme::gme ALIAS gme)
703-
endif()
704710
if(SDLMIXER_GME_SHARED OR NOT SDLMIXER_BUILD_SHARED_LIBS)
705-
list(APPEND INSTALL_EXTRA_TARGETS gme)
711+
list(APPEND INSTALL_EXTRA_TARGETS ${tgt_gme})
706712
endif()
707713
if(NOT SDLMIXER_GME_SHARED)
708714
list(APPEND PC_LIBS -l$<TARGET_FILE_BASE_NAME:gme>)

VisualC/external/include/gme/gme.h

+37-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/* Game music emulator library C interface (also usable from C++) */
22

3-
/* Game_Music_Emu 0.6.3 */
3+
/* Game_Music_Emu 0.6.4 */
44
#ifndef GME_H
55
#define GME_H
66

77
#ifdef __cplusplus
88
extern "C" {
99
#endif
1010

11-
#define GME_VERSION 0x000603 /* 1 byte major, 1 byte minor, 1 byte patch-level */
11+
#define GME_VERSION 0x000604 /* 1 byte major, 1 byte minor, 1 byte patch-level */
1212

1313
/* Error string returned by library functions, or NULL if no error (success) */
1414
typedef const char* gme_err_t;
@@ -57,6 +57,11 @@ BLARGG_EXPORT void gme_delete( Music_Emu* );
5757
Fade time can be changed while track is playing. */
5858
BLARGG_EXPORT void gme_set_fade( Music_Emu*, int start_msec );
5959

60+
/** See gme_set_fade.
61+
* @since 0.6.4
62+
*/
63+
BLARGG_EXPORT void gme_set_fade_msecs( Music_Emu*, int start_msec, int length_msecs );
64+
6065
/**
6166
* If do_autoload_limit is nonzero, then automatically load track length
6267
* 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 );
6772
*
6873
* By default, playback limits are loaded and applied.
6974
*
70-
* @since 0.6.2
75+
* @since 0.6.3
7176
*/
7277
BLARGG_EXPORT void gme_set_autoload_playback_limit( Music_Emu *, int do_autoload_limit );
7378

7479
/** See gme_set_autoload_playback_limit.
75-
* @since 0.6.2
80+
* (This was actually added in 0.6.3, but wasn't exported because of a typo.)
81+
* @since 0.6.4
7682
*/
7783
BLARGG_EXPORT int gme_autoload_playback_limit( Music_Emu const* );
7884

@@ -123,13 +129,16 @@ struct gme_info_t
123129
int length; /* total length, if file specifies it */
124130
int intro_length; /* length of song up to looping section */
125131
int loop_length; /* length of looping section */
126-
132+
127133
/* Length if available, otherwise intro_length+loop_length*2 if available,
128134
otherwise a default of 150000 (2.5 minutes). */
129135
int play_length;
130-
131-
int i4,i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15; /* reserved */
132-
136+
137+
/* fade length in milliseconds; -1 if unknown */
138+
int fade_length;
139+
140+
int i5,i6,i7,i8,i9,i10,i11,i12,i13,i14,i15; /* reserved */
141+
133142
/* empty string ("") if not available */
134143
const char* system;
135144
const char* game;
@@ -138,7 +147,7 @@ struct gme_info_t
138147
const char* copyright;
139148
const char* comment;
140149
const char* dumper;
141-
150+
142151
const char *s7,*s8,*s9,*s10,*s11,*s12,*s13,*s14,*s15; /* reserved */
143152
};
144153

@@ -170,13 +179,17 @@ BLARGG_EXPORT void gme_mute_voice( Music_Emu*, int index, int mute );
170179
voices, 0 unmutes them all, 0x01 mutes just the first voice, etc. */
171180
BLARGG_EXPORT void gme_mute_voices( Music_Emu*, int muting_mask );
172181

182+
/* Disable/Enable echo effect for SPC files */
183+
/* Available since 0.6.4 */
184+
BLARGG_EXPORT void gme_disable_echo( Music_Emu*, int disable );
185+
173186
/* Frequency equalizer parameters (see gme.txt) */
174187
/* Implementers: If modified, also adjust Music_Emu::make_equalizer as needed */
175188
typedef struct gme_equalizer_t
176189
{
177190
double treble; /* -50.0 = muffled, 0 = flat, +5.0 = extra-crisp */
178191
double bass; /* 1 = full bass, 90 = average, 16000 = almost no bass */
179-
192+
180193
double d2,d3,d4,d5,d6,d7,d8,d9; /* reserved */
181194
} gme_equalizer_t;
182195

@@ -224,7 +237,7 @@ BLARGG_EXPORT int gme_type_multitrack( gme_type_t );
224237

225238
/* whether the pcm output retrieved by gme_play() will have all 8 voices rendered to their
226239
* individual stereo channel or (if false) these voices get mixed into one single stereo channel
227-
* @since 0.6.2 */
240+
* @since 0.6.3 */
228241
BLARGG_EXPORT int gme_multi_channel( Music_Emu const* );
229242

230243
/******** Advanced file loading ********/
@@ -248,7 +261,7 @@ BLARGG_EXPORT gme_type_t gme_identify_extension( const char path_or_extension []
248261
* Get typical file extension for a given music type. This is not a replacement
249262
* for a file content identification library (but see gme_identify_header).
250263
*
251-
* @since 0.6.2
264+
* @since 0.6.3
252265
*/
253266
BLARGG_EXPORT const char* gme_type_extension( gme_type_t music_type );
254267

@@ -263,7 +276,7 @@ BLARGG_EXPORT Music_Emu* gme_new_emu( gme_type_t, int sample_rate );
263276
/* Create new multichannel emulator and set sample rate. Returns NULL if out of memory.
264277
* If you only need track information, pass gme_info_only for sample_rate.
265278
* (see gme_multi_channel for more information on multichannel support)
266-
* @since 0.6.2
279+
* @since 0.6.3
267280
*/
268281
BLARGG_EXPORT Music_Emu* gme_new_emu_multi_channel( gme_type_t, int sample_rate );
269282

@@ -273,6 +286,17 @@ BLARGG_EXPORT gme_err_t gme_load_file( Music_Emu*, const char path [] );
273286
/* Load music file from memory into emulator. Makes a copy of data passed. */
274287
BLARGG_EXPORT gme_err_t gme_load_data( Music_Emu*, void const* data, long size );
275288

289+
/* Load multiple single-track music files from memory into emulator.
290+
* @since 0.6.4
291+
*/
292+
BLARGG_EXPORT gme_err_t gme_load_tracks( Music_Emu* me,
293+
void const* data, long* sizes, int count );
294+
295+
/* Return the fixed track count of an emu file type
296+
* @since 0.6.4
297+
*/
298+
BLARGG_EXPORT int gme_fixed_track_count( gme_type_t );
299+
276300
/* Load music file using custom data reader function that will be called to
277301
read file data. Most emulators load the entire file in one read call. */
278302
typedef gme_err_t (*gme_reader_t)( void* your_data, void* out, int count );
35.5 KB
Binary file not shown.
34 KB
Binary file not shown.

Xcode/gme/gme.xcodeproj/project.pbxproj

+16
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
F307A2DC2B54329C0012534B /* Spc_Dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F307A2AD2B54329C0012534B /* Spc_Dsp.cpp */; };
7373
F307A2DD2B54329C0012534B /* gme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F307A2AE2B54329C0012534B /* gme.cpp */; };
7474
F307A2DF2B5434FF0012534B /* Vgm_Emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F307A2DE2B5434FF0012534B /* Vgm_Emu.cpp */; };
75+
6314974C2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6314974B2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp */; };
76+
6314974E2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6314974D2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp */; };
77+
631497502D8D4AEA00EEC879 /* emu2413.c in Sources */ = {isa = PBXBuildFile; fileRef = 6314974F2D8D4AEA00EEC879 /* emu2413.c */; };
78+
631497522D8D4B0500EEC879 /* panning.c in Sources */ = {isa = PBXBuildFile; fileRef = 631497512D8D4B0500EEC879 /* panning.c */; };
7579
F307A2E12B54358D0012534B /* gme.h in Headers */ = {isa = PBXBuildFile; fileRef = F307A2E02B54358D0012534B /* gme.h */; settings = {ATTRIBUTES = (Public, ); }; };
7680
/* End PBXBuildFile section */
7781

@@ -127,6 +131,10 @@
127131
F307A2AD2B54329C0012534B /* Spc_Dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Spc_Dsp.cpp; path = ../../external/libgme/gme/Spc_Dsp.cpp; sourceTree = "<group>"; };
128132
F307A2AE2B54329C0012534B /* gme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gme.cpp; path = ../../external/libgme/gme/gme.cpp; sourceTree = "<group>"; };
129133
F307A2DE2B5434FF0012534B /* Vgm_Emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Vgm_Emu.cpp; path = ../../external/libgme/gme/Vgm_Emu.cpp; sourceTree = "<group>"; };
134+
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 = "<group>"; };
135+
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 = "<group>"; };
136+
6314974F2D8D4AEA00EEC879 /* emu2413.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = emu2413.c; path = ../../external/libgme/gme/ext/emu2413.c; sourceTree = "<group>"; };
137+
631497512D8D4B0500EEC879 /* panning.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = panning.c; path = ../../external/libgme/gme/ext/panning.c; sourceTree = "<group>"; };
130138
F307A2E02B54358D0012534B /* gme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gme.h; path = ../../external/libgme/gme/gme.h; sourceTree = "<group>"; };
131139
F3F70EDA281F61B4005AA27D /* gme.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = gme.framework; sourceTree = BUILT_PRODUCTS_DIR; };
132140
/* End PBXFileReference section */
@@ -178,6 +186,8 @@
178186
F307A2932B54329C0012534B /* Gbs_Emu.cpp */,
179187
F307A2982B54329C0012534B /* Gme_File.cpp */,
180188
F307A2AE2B54329C0012534B /* gme.cpp */,
189+
6314974F2D8D4AEA00EEC879 /* emu2413.c */,
190+
631497512D8D4B0500EEC879 /* panning.c */,
181191
F307A2A82B54329C0012534B /* Gym_Emu.cpp */,
182192
F307A2A02B54329C0012534B /* Hes_Apu.cpp */,
183193
F307A29C2B54329C0012534B /* Hes_Cpu.cpp */,
@@ -194,6 +204,8 @@
194204
F307A2852B54329C0012534B /* Nes_Namco_Apu.cpp */,
195205
F307A29E2B54329C0012534B /* Nes_Oscs.cpp */,
196206
F307A2812B54329C0012534B /* Nes_Vrc6_Apu.cpp */,
207+
6314974B2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp */,
208+
6314974D2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp */,
197209
F307A29F2B54329C0012534B /* Nsf_Emu.cpp */,
198210
F307A2992B54329C0012534B /* Nsfe_Emu.cpp */,
199211
F307A2902B54329C0012534B /* Sap_Apu.cpp */,
@@ -388,6 +400,10 @@
388400
F307A2BF2B54329C0012534B /* Sap_Apu.cpp in Sources */,
389401
F307A2DC2B54329C0012534B /* Spc_Dsp.cpp in Sources */,
390402
F307A2C82B54329C0012534B /* Nsfe_Emu.cpp in Sources */,
403+
6314974C2D8D4A3600EEC879 /* Nes_Fds_Apu.cpp in Sources */,
404+
6314974E2D8D4A9200EEC879 /* Nes_Vrc7_Apu.cpp in Sources */,
405+
631497502D8D4AEA00EEC879 /* emu2413.c in Sources */,
406+
631497522D8D4B0500EEC879 /* panning.c in Sources */,
391407
);
392408
runOnlyForDeploymentPostprocessing = 0;
393409
};

external/libgme

Submodule libgme updated 140 files

0 commit comments

Comments
 (0)