diff options
-rw-r--r-- | base/main.cpp | 56 | ||||
-rw-r--r-- | sound/mididrv.cpp | 51 |
2 files changed, 56 insertions, 51 deletions
diff --git a/base/main.cpp b/base/main.cpp index a276ec786c..4f5d125e62 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -39,6 +39,7 @@ #include "gui/newgui.h" #include "gui/launcher.h" #include "gui/message.h" +#include "sound/mididrv.h" #ifdef _WIN32_WCE #include "backends/wince/CELauncherDialog.h" @@ -437,3 +438,58 @@ void free_check(void *ptr) { } #endif */ + + +// WORKAROUND bug # 1083058: We put this here and not in sound/mididrv.cpp +// where it belongs to avoid the annoying behavior of some unix linkers (which +// leads to linker errors due to too much code being stripped from the binary. +MidiDriver *MidiDriver::createMidi(int midiDriver) { + switch(midiDriver) { + case MD_NULL: return MidiDriver_NULL_create(); + + // In the case of Adlib, we won't specify anything. + // IMuse is designed to set up its own Adlib driver + // if need be, and we only have to specify a native + // driver. + case MD_ADLIB: return NULL; + +#ifdef USE_MT32EMU + case MD_MT32: return MidiDriver_MT32_create(g_engine->_mixer); +#endif + + case MD_TOWNS: return MidiDriver_YM2612_create(g_engine->_mixer); + + // Right now PC Speaker and PCjr are handled + // outside the MidiDriver architecture, so + // don't create anything for now. + case MD_PCSPK: + case MD_PCJR: return NULL; +#if defined(__PALM_OS__) + case MD_YPA1: return MidiDriver_YamahaPa1_create(); +#ifndef DISABLE_TAPWAVE + case MD_ZODIAC: return MidiDriver_Zodiac_create(); +#endif +#endif +#if defined(WIN32) && !defined(_WIN32_WCE) + case MD_WINDOWS: return MidiDriver_WIN_create(); +#endif +#if defined(__MORPHOS__) + case MD_ETUDE: return MidiDriver_ETUDE_create(); +#endif +#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) + case MD_SEQ: return MidiDriver_SEQ_create(); +#endif +#if (defined(MACOSX) || defined(macintosh)) && !defined(__PALM_OS__) + case MD_QTMUSIC: return MidiDriver_QT_create(); +#endif +#if defined(MACOSX) + case MD_COREAUDIO: return MidiDriver_CORE_create(); +#endif +#if defined(UNIX) && defined(USE_ALSA) + case MD_ALSA: return MidiDriver_ALSA_create(); +#endif + } + + error("Invalid midi driver selected"); + return NULL; +} diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 11fa0d3b15..9872cf65d0 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -137,54 +137,3 @@ int MidiDriver::detectMusicDriver(int midiFlags) { return musicDriver; } - -MidiDriver *MidiDriver::createMidi(int midiDriver) { - switch(midiDriver) { - case MD_NULL: return MidiDriver_NULL_create(); - - // In the case of Adlib, we won't specify anything. - // IMuse is designed to set up its own Adlib driver - // if need be, and we only have to specify a native - // driver. - case MD_ADLIB: return NULL; - -#ifdef USE_MT32EMU - case MD_MT32: return MidiDriver_MT32_create(g_engine->_mixer); -#endif - - case MD_TOWNS: return MidiDriver_YM2612_create(g_engine->_mixer); - - // Right now PC Speaker and PCjr are handled - // outside the MidiDriver architecture, so - // don't create anything for now. - case MD_PCSPK: - case MD_PCJR: return NULL; -#if defined(__PALM_OS__) - case MD_YPA1: return MidiDriver_YamahaPa1_create(); -#ifndef DISABLE_TAPWAVE - case MD_ZODIAC: return MidiDriver_Zodiac_create(); -#endif -#endif -#if defined(WIN32) && !defined(_WIN32_WCE) - case MD_WINDOWS: return MidiDriver_WIN_create(); -#endif -#if defined(__MORPHOS__) - case MD_ETUDE: return MidiDriver_ETUDE_create(); -#endif -#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) - case MD_SEQ: return MidiDriver_SEQ_create(); -#endif -#if (defined(MACOSX) || defined(macintosh)) && !defined(__PALM_OS__) - case MD_QTMUSIC: return MidiDriver_QT_create(); -#endif -#if defined(MACOSX) - case MD_COREAUDIO: return MidiDriver_CORE_create(); -#endif -#if defined(UNIX) && defined(USE_ALSA) - case MD_ALSA: return MidiDriver_ALSA_create(); -#endif - } - - error("Invalid midi driver selected"); - return NULL; -} |